mirror of https://github.com/citusdata/citus.git
parent
033fda9183
commit
7e46f41c12
|
@ -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
|
static bool
|
||||||
SkipCitusProcessingForUtility(Node *parsetree)
|
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
|
static bool
|
||||||
IsCitusExtensionStmt(Node *parsetree)
|
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 *
|
static char *
|
||||||
ExtractNewExtensionVersion(Node *parsetree)
|
ExtractNewExtensionVersion(Node *parsetree)
|
||||||
{
|
{
|
||||||
|
@ -1394,8 +1410,7 @@ ExtractNewExtensionVersion(Node *parsetree)
|
||||||
foreach(optionsCell, optionsList)
|
foreach(optionsCell, optionsList)
|
||||||
{
|
{
|
||||||
DefElem *defElement = (DefElem *) lfirst(optionsCell);
|
DefElem *defElement = (DefElem *) lfirst(optionsCell);
|
||||||
|
if (strncmp(defElement->defname, "new_version", NAMEDATALEN) == 0)
|
||||||
if (strcmp(defElement->defname, "new_version") == 0)
|
|
||||||
{
|
{
|
||||||
newVersion = strVal(defElement->arg);
|
newVersion = strVal(defElement->arg);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -615,7 +615,7 @@ RegisterCitusConfigVariables(void)
|
||||||
|
|
||||||
DefineCustomStringVariable(
|
DefineCustomStringVariable(
|
||||||
"citus.version",
|
"citus.version",
|
||||||
gettext_noop("Shows the running Citus version"),
|
gettext_noop("Shows the Citus library version"),
|
||||||
NULL,
|
NULL,
|
||||||
&CitusVersion,
|
&CitusVersion,
|
||||||
CITUS_VERSION,
|
CITUS_VERSION,
|
||||||
|
@ -625,7 +625,7 @@ RegisterCitusConfigVariables(void)
|
||||||
|
|
||||||
DefineCustomBoolVariable(
|
DefineCustomBoolVariable(
|
||||||
"citus.enable_version_checks",
|
"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,
|
NULL,
|
||||||
&EnableVersionChecks,
|
&EnableVersionChecks,
|
||||||
true,
|
true,
|
||||||
|
|
Loading…
Reference in New Issue