From ac994724a754139ced21b645e7b1485f787f224e Mon Sep 17 00:00:00 2001 From: Dipesh Dhameliya Date: Wed, 4 Oct 2023 13:05:41 +0530 Subject: [PATCH] Fixed "database "" does not exist" error in parallel worker (#1872) (#1882) Error "database "" does not exist" is being throw from Parallel worker during initialisation of GUC space. As matter of fact, we should not care to restore the value of babelfishpg_tsql.identity_insert because value of the same would not be used in parallel worker execution. Hence, this commit avoids assigning babelfishpg_tsql.identity_insert inside parallel worker. Note on test: Given JDBC test cases are sufficient but currently parallel worker is running into other crashes or issues so we can not really show tests here. Have tested this changes locally. Task: BABEL-4420 Signed-off-by: Dipesh Dhameliya --- contrib/babelfishpg_tsql/src/pl_handler.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/babelfishpg_tsql/src/pl_handler.c b/contrib/babelfishpg_tsql/src/pl_handler.c index eb9c669970..84746b5a35 100644 --- a/contrib/babelfishpg_tsql/src/pl_handler.c +++ b/contrib/babelfishpg_tsql/src/pl_handler.c @@ -17,6 +17,7 @@ #include "access/attnum.h" #include "access/htup_details.h" +#include "access/parallel.h" #include "access/table.h" #include "catalog/heap.h" #include "catalog/indexing.h" @@ -259,6 +260,9 @@ set_procid(Oid oid) static void assign_identity_insert(const char *newval, void *extra) { + if (IsParallelWorker()) + return; + if (strcmp(newval, "") != 0) { List *elemlist;