diff options
author | Pavan Deolasee | 2017-06-15 05:25:34 +0000 |
---|---|---|
committer | Pavan Deolasee | 2017-06-15 05:25:34 +0000 |
commit | 72dd9fdf7a898bddf4cfbf9b4d16bff11521d3da (patch) | |
tree | 05974ce8b196c47391697f2c45cc0f1c6491cff3 | |
parent | 302ab9725906d0268db4fcbc64d787dd0438418c (diff) |
Take into account the fact that pg_parse_query() returns a list of RawStmt
Starting PG 10, pg_parse_query() returns a list of RawStmt unlike a list of
parse trees. The actual parse tree is now available as RawStmt->stmt. So we
must look into the correct place to check if the supplied query is one of the
special statements such as VACUUM, CLUSTER or CREATE INDEX statement, which
needs special handling.
-rw-r--r-- | src/backend/tcop/postgres.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index b10e0e44d9..3cc070a34b 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -1251,11 +1251,11 @@ exec_simple_query(const char *query_string) */ if (IS_PGXC_DATANODE && IsPostmasterEnvironment) { - if (IsA(parsetree, VacuumStmt) || IsA(parsetree, ClusterStmt)) + if (IsA(parsetree->stmt, VacuumStmt) || IsA(parsetree->stmt, ClusterStmt)) SetForceXidFromGTM(true); - else if (IsA(parsetree, ReindexStmt)) + else if (IsA(parsetree->stmt, ReindexStmt)) { - ReindexStmt *stmt = (ReindexStmt *) parsetree; + ReindexStmt *stmt = (ReindexStmt *) parsetree->stmt; if (stmt->kind == REINDEX_OBJECT_SCHEMA || stmt->kind == REINDEX_OBJECT_DATABASE) SetForceXidFromGTM(true); |