From cdbbc489f04a9359c0c7c38f6fc2050b6283b678 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sun, 19 Jul 2020 13:38:27 -0500 Subject: [PATCH 9/9] fix! Base implementation of subscripting mechanism --- src/backend/commands/typecmds.c | 4 ++-- src/backend/parser/parse_node.c | 10 +++++----- src/backend/parser/parse_target.c | 2 +- src/include/catalog/pg_type.h | 2 +- src/include/parser/parse_node.h | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c index 8a1703c871..cd6855643f 100644 --- a/src/backend/commands/typecmds.c +++ b/src/backend/commands/typecmds.c @@ -1915,7 +1915,7 @@ findTypeSubscriptingFunction(List *procname, Oid typeOid, bool parseFunc) if (parseFunc) { /* - * Subscripting function parse always take two INTERNAL argument and + * Subscripting parse functions always take two INTERNAL arguments and * return INTERNAL. */ argList[0] = INTERNALOID; @@ -1924,7 +1924,7 @@ findTypeSubscriptingFunction(List *procname, Oid typeOid, bool parseFunc) else { /* - * Subscripting functions fetch/assign always take one typeOid + * Subscripting fetch/assign functions always take one typeOid * argument, one INTERNAL argument and return typeOid. */ argList[0] = typeOid; diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c index 3710d01aa2..d1c4ea8573 100644 --- a/src/backend/parser/parse_node.c +++ b/src/backend/parser/parse_node.c @@ -184,7 +184,7 @@ pcb_error_callback(void *arg) * transformContainerType() * Identify the types involved in a subscripting operation for container * - * On entry, containerType/containerTypmod are modified if necessary to + * On entry, containerType/containerTypmod are modified if necessary to * identify the actual container type and typmod. */ void @@ -227,13 +227,13 @@ transformContainerType(Oid *containerType, int32 *containerTypmod) * with the source data inserted into the right part of the container. * * For both cases, this function contains only general subscripting logic while - * type-specific logic (e.g. type verifications and coersion) is placen in - * separate procedure indicated by typsubshandler. There is only one exception - * for now about domain-over-container, if the source container is of a + * type-specific logic (e.g. type verifications and coercion) is placed in + * separate procedures indicated by typsubshandler. There is only one exception + * for now about domain-over-container: if the source container is of a * domain-over-container type, the result is of the base container type or its * element type; essentially, we must fold a domain to its base type before * applying subscripting. (Note that int2vector and oidvector are treated as - * domains here.) An error will appear in case if current container type + * domains here.) An error will appear in the case the current container type * doesn't have a subscripting procedure. * * pstate Parse state diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c index 3ca0791500..73a8c88c12 100644 --- a/src/backend/parser/parse_target.c +++ b/src/backend/parser/parse_target.c @@ -949,7 +949,7 @@ transformAssignmentSubscripts(ParseState *pstate, rhs, location); - /* Provide fully prepared subscriptinng information for custom validation */ + /* Provide fully prepared subscripting information for custom validation */ sbsref->refassgnexpr = (Expr *) rhs; sbsroutines->validate(rhs != NULL, sbsref, pstate); diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h index 5dbdc880dc..ea237ec61d 100644 --- a/src/include/catalog/pg_type.h +++ b/src/include/catalog/pg_type.h @@ -222,7 +222,7 @@ CATALOG(pg_type,1247,TypeRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(71,TypeRelati Oid typcollation BKI_DEFAULT(0) BKI_LOOKUP(pg_collation); /* - * Type specific subscripting logic. If typsubshandler is none, it means + * Type specific subscripting logic. If typsubshandler is NULL, it means * that this type doesn't support subscripting. */ regproc typsubshandler BKI_DEFAULT(-) BKI_LOOKUP(pg_proc); diff --git a/src/include/parser/parse_node.h b/src/include/parser/parse_node.h index f0786ac570..b4736206d1 100644 --- a/src/include/parser/parse_node.h +++ b/src/include/parser/parse_node.h @@ -325,7 +325,7 @@ extern SubscriptingRef *transformContainerSubscripts(ParseState *pstate, int32 containerTypMod, List *indirection, Node *assignFrom); -extern SubscriptRoutines* getSubscriptingRoutines(Oid containerType); +extern SubscriptRoutines *getSubscriptingRoutines(Oid containerType); extern Const *make_const(ParseState *pstate, Value *value, int location); #endif /* PARSE_NODE_H */ -- 2.17.0