diff options
author | Pavan Deolasee | 2017-05-18 11:13:38 +0000 |
---|---|---|
committer | Pavan Deolasee | 2017-05-18 11:13:38 +0000 |
commit | b494491ab1021b0e13d43b04aca2c42b99f68360 (patch) | |
tree | 302dc8e15d496c16eccc97dc1cd4e83337871a98 | |
parent | 9b12e275cd0b42c2cc4f65b8f6dd771d394bbba7 (diff) |
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.
-rw-r--r-- | src/backend/pgxc/pool/execRemote.c | 6 | ||||
-rw-r--r-- | src/backend/utils/misc/guc.c | 2 |
2 files changed, 5 insertions, 3 deletions
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", |