From ad93d6feea1a4d9c992d1fc4d6b65b5e590f503c Mon Sep 17 00:00:00 2001 From: Onder Kalaci Date: Sun, 23 Jun 2019 11:32:58 +0200 Subject: [PATCH] Change the order of placement access added to the list This is to make sure that the error messages related to foreign keys to reference tables shows the exact placement access name instead of SELECT. --- src/backend/distributed/executor/multi_router_executor.c | 2 +- .../regress/expected/foreign_key_restriction_enforcement.out | 2 +- .../regress/expected/foreign_key_restriction_enforcement_0.out | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/distributed/executor/multi_router_executor.c b/src/backend/distributed/executor/multi_router_executor.c index ca9353556..db5078336 100644 --- a/src/backend/distributed/executor/multi_router_executor.c +++ b/src/backend/distributed/executor/multi_router_executor.c @@ -1250,7 +1250,7 @@ GetModifyConnections(Task *task, bool markCritical) /* create placement access for the placement that we're modifying */ placementModification = CreatePlacementAccess(taskPlacement, accessType); - placementAccessList = lappend(placementAccessList, placementModification); + placementAccessList = lcons(placementModification, placementAccessList); /* get an appropriate connection for the DML statement */ multiConnection = GetPlacementListConnection(connectionFlags, placementAccessList, diff --git a/src/test/regress/expected/foreign_key_restriction_enforcement.out b/src/test/regress/expected/foreign_key_restriction_enforcement.out index 62a1e7ef8..cd0902da5 100644 --- a/src/test/regress/expected/foreign_key_restriction_enforcement.out +++ b/src/test/regress/expected/foreign_key_restriction_enforcement.out @@ -538,7 +538,7 @@ ROLLBACK; BEGIN; ALTER TABLE on_update_fkey_table ADD COLUMN X int; UPDATE referece_table SET id = 160 WHERE id = 15; -ERROR: cannot execute SELECT on reference relation "referece_table" because there was a parallel DDL access to distributed relation "on_update_fkey_table" in the same transaction +ERROR: cannot execute DML on reference relation "referece_table" because there was a parallel DDL access to distributed relation "on_update_fkey_table" in the same transaction HINT: Try re-running the transaction with "SET LOCAL citus.multi_shard_modify_mode TO 'sequential';" ROLLBACK; -- case 6:5: Unrelated parallel DDL on distributed table followed by unrelated DDL on ref. table diff --git a/src/test/regress/expected/foreign_key_restriction_enforcement_0.out b/src/test/regress/expected/foreign_key_restriction_enforcement_0.out index 34b99d039..9ec8a3b91 100644 --- a/src/test/regress/expected/foreign_key_restriction_enforcement_0.out +++ b/src/test/regress/expected/foreign_key_restriction_enforcement_0.out @@ -538,7 +538,7 @@ ROLLBACK; BEGIN; ALTER TABLE on_update_fkey_table ADD COLUMN X int; UPDATE referece_table SET id = 160 WHERE id = 15; -ERROR: cannot execute SELECT on reference relation "referece_table" because there was a parallel DDL access to distributed relation "on_update_fkey_table" in the same transaction +ERROR: cannot execute DML on reference relation "referece_table" because there was a parallel DDL access to distributed relation "on_update_fkey_table" in the same transaction HINT: Try re-running the transaction with "SET LOCAL citus.multi_shard_modify_mode TO 'sequential';" ROLLBACK; -- case 6:5: Unrelated parallel DDL on distributed table followed by unrelated DDL on ref. table