Do not FQS EXECUTE DIRECT statements.
authorPavan Deolasee <[email protected]>
Tue, 12 Jul 2016 09:07:22 +0000 (14:37 +0530)
committerPavan Deolasee <[email protected]>
Tue, 12 Jul 2016 09:07:22 +0000 (14:37 +0530)
Executor is not prepared to handle that and its not necessary since EXECUTE
DIRECT implies direct execution on the target node anyways

src/backend/optimizer/plan/planner.c
src/backend/pgxc/plan/planner.c

index c5ba9d8deedfa7ddc4a96052e337e1fe1fda209f..783e43acd57e65895013e57ec8a584459ffccacb 100644 (file)
@@ -172,7 +172,7 @@ planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
                 * A Coordinator receiving a query from another Coordinator
                 * is not allowed to go into PGXC planner.
                 */
-               if (IS_PGXC_COORDINATOR && !IsConnFromCoord())
+               if (IS_PGXC_LOCAL_COORDINATOR)
                        result = pgxc_planner(parse, cursorOptions, boundParams);
                else
 #endif
index ff8b774ef20082c8d08cd09d8165c19a2b0e912d..0212c8773673d3961c1de79b3d4e09f09b240ef9 100644 (file)
@@ -278,6 +278,15 @@ pgxc_FQS_planner(Query *query, ParamListInfo boundParams)
        if (query->utilityStmt &&
                IsA(query->utilityStmt, DeclareCursorStmt))
                return NULL;
+
+       /* Do not FQS EXEC DIRECT statements */
+       if (query->utilityStmt && IsA(query->utilityStmt, RemoteQuery))
+       {
+               RemoteQuery *stmt = (RemoteQuery *) query->utilityStmt;
+               if (stmt->exec_direct_type != EXEC_DIRECT_NONE)
+                       return NULL;
+       }
+
        /*
         * If the query can not be or need not be shipped to the Datanodes, don't
         * create any plan here. standard_planner() will take care of it.