diff --git a/src/backend/distributed/executor/multi_utility.c b/src/backend/distributed/executor/multi_utility.c index 8986d6a11..fad9cad76 100644 --- a/src/backend/distributed/executor/multi_utility.c +++ b/src/backend/distributed/executor/multi_utility.c @@ -409,6 +409,12 @@ multi_ProcessUtility(Node *parsetree, } +/* + * SkipCitusProcessingForUtility simply returns whether a given utility should + * bypass Citus processing and checks and be handled exclusively by standard + * PostgreSQL utility processing. At present, CREATE/ALTER/DROP EXTENSION, + * ABORT, COMMIT, ROLLBACK, and SET (GUC) statements are exempt from Citus. + */ static bool SkipCitusProcessingForUtility(Node *parsetree) { @@ -460,6 +466,11 @@ SkipCitusProcessingForUtility(Node *parsetree) } +/* + * IsCitusExtensionStmt returns whether a given utility is a CREATE or ALTER + * EXTENSION statement which references the citus extension. This function + * returns false for all other inputs. + */ static bool IsCitusExtensionStmt(Node *parsetree) { @@ -1370,6 +1381,11 @@ ErrorIfUnstableCreateOrAlterExtensionStmt(Node *parsetree) } +/* + * ExtractNewExtensionVersion returns the new extension version specified by + * a CREATE or ALTER EXTENSION statement. Other inputs are not permitted. This + * function returns NULL for statements with no explicit version specified. + */ static char * ExtractNewExtensionVersion(Node *parsetree) { @@ -1394,8 +1410,7 @@ ExtractNewExtensionVersion(Node *parsetree) foreach(optionsCell, optionsList) { DefElem *defElement = (DefElem *) lfirst(optionsCell); - - if (strcmp(defElement->defname, "new_version") == 0) + if (strncmp(defElement->defname, "new_version", NAMEDATALEN) == 0) { newVersion = strVal(defElement->arg); break; diff --git a/src/backend/distributed/shared_library_init.c b/src/backend/distributed/shared_library_init.c index fdd428bb2..c3dcf4e88 100644 --- a/src/backend/distributed/shared_library_init.c +++ b/src/backend/distributed/shared_library_init.c @@ -615,7 +615,7 @@ RegisterCitusConfigVariables(void) DefineCustomStringVariable( "citus.version", - gettext_noop("Shows the running Citus version"), + gettext_noop("Shows the Citus library version"), NULL, &CitusVersion, CITUS_VERSION, @@ -625,7 +625,7 @@ RegisterCitusConfigVariables(void) DefineCustomBoolVariable( "citus.enable_version_checks", - gettext_noop("Enables version checks in CREATE/ALTER extension queries"), + gettext_noop("Enables version checks during CREATE/ALTER EXTENSION commands"), NULL, &EnableVersionChecks, true,