Do not use FQS for queries with FOR UPDATE/SHARE clause
authorPavan Deolasee <[email protected]>
Tue, 12 Jan 2016 03:54:46 +0000 (09:24 +0530)
committerPavan Deolasee <[email protected]>
Tue, 12 Jan 2016 03:54:46 +0000 (09:24 +0530)
src/backend/optimizer/util/pgxcship.c

index a19ce71866cc21c2fd8323df736cc020171ab65c..86a71c5249a860ef0a96440ad8b80d0bbbb5245c 100644 (file)
@@ -871,6 +871,11 @@ pgxc_shippability_walker(Node *node, Shippability_context *sc_context)
 
                        if (query->hasRecursive)
                                pgxc_set_shippability_reason(sc_context, SS_UNSUPPORTED_EXPR);
+
+                       /* Queries with FOR UPDATE/SHARE can't be shipped */
+                       if (query->hasForUpdate || query->rowMarks)
+                               pgxc_set_shippability_reason(sc_context, SS_UNSUPPORTED_EXPR);
+
                        /*
                         * If the query needs Coordinator for evaluation or the query can be
                         * completed on Coordinator itself, we don't ship it to the Datanode