From ec1eb9e95797db8ec0067e95dd04ba49cd8a7b95 Mon Sep 17 00:00:00 2001 From: zhengxue Date: Mon, 28 Dec 2020 11:24:40 +0800 Subject: [PATCH] fix the parameter quote-all-identifiers for gs_dumpall --- src/common/backend/utils/misc/guc.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/backend/utils/misc/guc.cpp b/src/common/backend/utils/misc/guc.cpp index dc14704e2..cbd9b229b 100644 --- a/src/common/backend/utils/misc/guc.cpp +++ b/src/common/backend/utils/misc/guc.cpp @@ -16438,8 +16438,9 @@ void ExecSetVariableStmt(VariableSetStmt* stmt) if (spcname != NULL) { char* tempname = strstr(spcname, SCHEMA_TEMP_NAME); char* catalogname = strstr(spcname, SCHEMA_CATALOG_NAME); - if ((tempname != NULL && JudgeSystemSchema(spcname, SYSTEM_SCHEMA, sizeof(SYSTEM_SCHEMA)) == 0) || - (catalogname != NULL && JudgeSystemSchema(spcname, SYSTEM_SCHEMA, sizeof(SYSTEM_SCHEMA)) == 0)) { + int schema_type_size = sizeof(SYSTEM_SCHEMA) / sizeof(SYSTEM_SCHEMA[0]); + if ((tempname != NULL && JudgeSystemSchema(spcname, SYSTEM_SCHEMA, schema_type_size) == 0) || + (catalogname != NULL && JudgeSystemSchema(spcname, SYSTEM_SCHEMA, schema_type_size) == 0)) { ereport(WARNING, (errmsg("It is invalid to set pg_temp or pg_catalog behind other schemas in search path " "explicitly. The priority order is pg_temp, pg_catalog and other schemas.")));