From: Pavan Deolasee Date: Thu, 18 May 2017 11:13:38 +0000 (+0530) Subject: Do not reset global_session on RESET ALL X-Git-Tag: XL_10_R1BETA1~293 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=b494491ab1021b0e13d43b04aca2c42b99f68360;p=postgres-xl.git Do not reset global_session on RESET ALL This avoids resetting global session information when DISCARD/RESET ALL is executed. This can have bad effects, especially as seen from the 'guc' test case where we fail to handle temp tables correctly. So we mark global_session GUC with GUC_NO_RESET_ALL flag and instead issue an explicit RESET global_session when connection is cleaned up. --- diff --git a/src/backend/pgxc/pool/execRemote.c b/src/backend/pgxc/pool/execRemote.c index f4b2c7fe2a..21f155f5f7 100644 --- a/src/backend/pgxc/pool/execRemote.c +++ b/src/backend/pgxc/pool/execRemote.c @@ -1942,8 +1942,10 @@ pgxc_node_remote_cleanup_all(void) PGXCNodeHandle *new_connections[handles->co_conn_count + handles->dn_conn_count]; int new_conn_count = 0; int i; - char *resetcmd = "RESET ALL;RESET SESSION AUTHORIZATION;" - "RESET transaction_isolation;"; + char *resetcmd = "RESET ALL;" + "RESET SESSION AUTHORIZATION;" + "RESET transaction_isolation;" + "RESET global_session"; elog(DEBUG5, "pgxc_node_remote_cleanup_all - handles->co_conn_count %d," "handles->dn_conn_count %d", handles->co_conn_count, diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 3d4493fcdd..cf1a41fa71 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -3586,7 +3586,7 @@ static struct config_string ConfigureNamesString[] = {"global_session", PGC_USERSET, UNGROUPED, gettext_noop("Sets the global session identifier."), NULL, - GUC_IS_NAME | GUC_REPORT | GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE | GUC_NOT_WHILE_SEC_REST + GUC_IS_NAME | GUC_REPORT | GUC_NO_RESET_ALL | GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE | GUC_NOT_WHILE_SEC_REST }, &global_session_string, "none",