From 407d0e30f5af22fb3e7a751fe7a701bf49e52e4a Mon Sep 17 00:00:00 2001 From: Onder Kalaci Date: Thu, 21 Feb 2019 18:21:41 +0300 Subject: [PATCH] Fix selectForUpdate bug --- .../distributed/planner/fast_path_router_planner.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/backend/distributed/planner/fast_path_router_planner.c b/src/backend/distributed/planner/fast_path_router_planner.c index f795ef480..efb1488ce 100644 --- a/src/backend/distributed/planner/fast_path_router_planner.c +++ b/src/backend/distributed/planner/fast_path_router_planner.c @@ -213,14 +213,10 @@ FastPathRouterQuery(Query *query) * hasForUpdate is tricky because Citus does support only when * replication = 1 or reference tables. */ - if (query->hasForUpdate) + if (query->hasForUpdate && + !(cacheEntry->partitionMethod == DISTRIBUTE_BY_NONE || + SingleReplicatedTable(distributedTableId))) { - if (cacheEntry->partitionMethod == DISTRIBUTE_BY_NONE || - SingleReplicatedTable(distributedTableId)) - { - return true; - } - return false; }