From f00f8ef543116ddf5e815d9ff0fab3a6c81a9a59 Mon Sep 17 00:00:00 2001 From: krzychus Date: Thu, 27 Feb 2020 17:40:23 +0100 Subject: [PATCH 1/2] Minimal set of defines needed for TBase to work. As ./configure does not reset these and compile succeeds but leaves a lot of dead code that is needed to function. --- src/include/pg_config_manual.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h index b53f9d0d..2f8a1508 100644 --- a/src/include/pg_config_manual.h +++ b/src/include/pg_config_manual.h @@ -387,8 +387,8 @@ /* all code written by Tencent Team must be in macro __TBASE__ block*/ -#define __TBASE__ 0 -#define __SUPPORT_DISTRIBUTED_TRANSACTION__ 0 +#define __TBASE__ 1 +#define __SUPPORT_DISTRIBUTED_TRANSACTION__ 1 //#define __PAGE_TIMESTAMP_LOG__ 0 //#define __USE_GLOBAL_SNAPSHOT__ 0 #ifdef __SUPPORT_DISTRIBUTED_TRANSACTION__ @@ -404,11 +404,11 @@ #define _MLS_ 0 #define __AUDIT_FGA__ #define __STORAGE_SCALABLE__ 0 -#define __XLOG__ 0 -#define __COLD_HOT__ 0 +#define __XLOG__ 1 +#define __COLD_HOT__ 1 #define __SUBSCRIPTION__ 0 #define _PUB_SUB_RELIABLE_ 0 -#define __TWO_PHASE_TRANS__ 0 +#define __TWO_PHASE_TRANS__ 1 //#define __TWO_PHASE_TESTS__ 0 /* MAX NODES NUMBER of the cluster */ #define MAX_NODES_NUMBER 4096 From cb2e5a3c8e8769a1809e35268bb51a0442a84a59 Mon Sep 17 00:00:00 2001 From: krzychus Date: Fri, 5 Jun 2020 21:50:15 +0200 Subject: [PATCH 2/2] Let use DML in with subqueries as on normal PG. If we use datanodes with direct SQL we might skip certain cheks that are not valid at cluster-wide planning. Here we bring vanila PG behaviour back. --- src/backend/optimizer/plan/planner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index 67bf565a..8dadc13a 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -593,7 +593,7 @@ subquery_planner(PlannerGlobal *glob, Query *parse, #ifdef XCP /* XL currently does not support DML in subqueries. */ if ((parse->commandType != CMD_SELECT) && - ((parent_root ? parent_root->query_level + 1 : 1) > 1)) + ((parent_root ? parent_root->query_level + 1 : 1) > 1) && !IS_PGXC_DATANODE) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("INSERT/UPDATE/DELETE is not supported in subquery")));