summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Vondra2017-04-22 22:21:20 +0000
committerTomas Vondra2017-04-22 22:21:20 +0000
commitb383b07c941c22ae0bbe9ae28bd1e84e114d821a (patch)
tree53564675fba25336910a5385e17a2caf05307b55 /src
parent0e071bd0938a3118ec7deaddeb7170ddb43baa8b (diff)
Resolve failures in create_am and amutils regression suites.
The problem was that CREATE ACCESS METHOD was not properly pushed to data nodes, causing failures in subsequent commands refering to the access method. The plan changes in create_am seem trivial, generally just adding "Remote Subquery" to the single-node plan.
Diffstat (limited to 'src')
-rw-r--r--src/backend/tcop/utility.c4
-rw-r--r--src/test/regress/expected/create_am.out43
2 files changed, 28 insertions, 19 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index a7c0543201..0f42512466 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -2473,6 +2473,10 @@ ProcessUtilitySlow(Node *parsetree,
case T_CreateAmStmt:
address = CreateAccessMethod((CreateAmStmt *) parsetree);
+#ifdef PGXC
+ if (IS_PGXC_LOCAL_COORDINATOR)
+ ExecUtilityStmtOnNodes(queryString, NULL, sentToRemote, false, EXEC_ON_ALL_NODES, false);
+#endif
break;
default:
diff --git a/src/test/regress/expected/create_am.out b/src/test/regress/expected/create_am.out
index 1b464aae2d..2e5d1154f3 100644
--- a/src/test/regress/expected/create_am.out
+++ b/src/test/regress/expected/create_am.out
@@ -45,13 +45,14 @@ EXPLAIN (COSTS OFF)
SELECT * FROM fast_emp4000
WHERE home_base @ '(200,200),(2000,1000)'::box
ORDER BY (home_base[0])[0];
- QUERY PLAN
-----------------------------------------------------------------
- Sort
- Sort Key: ((home_base[0])[0])
- -> Index Only Scan using grect2ind2 on fast_emp4000
- Index Cond: (home_base @ '(2000,1000),(200,200)'::box)
-(4 rows)
+ QUERY PLAN
+----------------------------------------------------------------------
+ Remote Subquery Scan on all (datanode_1,datanode_2)
+ -> Sort
+ Sort Key: ((home_base[0])[0])
+ -> Index Only Scan using grect2ind2 on fast_emp4000
+ Index Cond: (home_base @ '(2000,1000),(200,200)'::box)
+(5 rows)
SELECT * FROM fast_emp4000
WHERE home_base @ '(200,200),(2000,1000)'::box
@@ -64,12 +65,14 @@ SELECT * FROM fast_emp4000
EXPLAIN (COSTS OFF)
SELECT count(*) FROM fast_emp4000 WHERE home_base && '(1000,1000,0,0)'::box;
- QUERY PLAN
--------------------------------------------------------------
- Aggregate
- -> Index Only Scan using grect2ind2 on fast_emp4000
- Index Cond: (home_base && '(1000,1000),(0,0)'::box)
-(3 rows)
+ QUERY PLAN
+-------------------------------------------------------------------------
+ Finalize Aggregate
+ -> Remote Subquery Scan on all (datanode_1,datanode_2)
+ -> Partial Aggregate
+ -> Index Only Scan using grect2ind2 on fast_emp4000
+ Index Cond: (home_base && '(1000,1000),(0,0)'::box)
+(5 rows)
SELECT count(*) FROM fast_emp4000 WHERE home_base && '(1000,1000,0,0)'::box;
count
@@ -79,12 +82,14 @@ SELECT count(*) FROM fast_emp4000 WHERE home_base && '(1000,1000,0,0)'::box;
EXPLAIN (COSTS OFF)
SELECT count(*) FROM fast_emp4000 WHERE home_base IS NULL;
- QUERY PLAN
---------------------------------------------------------
- Aggregate
- -> Index Only Scan using grect2ind2 on fast_emp4000
- Index Cond: (home_base IS NULL)
-(3 rows)
+ QUERY PLAN
+--------------------------------------------------------------------
+ Finalize Aggregate
+ -> Remote Subquery Scan on all (datanode_1,datanode_2)
+ -> Partial Aggregate
+ -> Index Only Scan using grect2ind2 on fast_emp4000
+ Index Cond: (home_base IS NULL)
+(5 rows)
SELECT count(*) FROM fast_emp4000 WHERE home_base IS NULL;
count