diff options
author | Pavan Deolasee | 2017-06-15 05:26:04 +0000 |
---|---|---|
committer | Pavan Deolasee | 2017-06-15 05:26:04 +0000 |
commit | 140c2f2cb9a0474f8257fbbf0f306c766090a36e (patch) | |
tree | 3b697450347c2a9b03a4725d51f0bf9709b5d909 | |
parent | 72dd9fdf7a898bddf4cfbf9b4d16bff11521d3da (diff) |
Check for non-utility commands in PlannedStmt
Starting PG 10, even utility statements are wrapped in a PlannedStmt. So we
must ensure that we are dealing with non-utility statements before trying to
look into the planTree because it won't be set for utility statements.
-rw-r--r-- | src/pl/plpgsql/src/pl_exec.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 0d75a99361..73dddec35f 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -5367,6 +5367,7 @@ exec_for_query(PLpgSQL_execstate *estate, PLpgSQL_stmt_forq *stmt, */ #define MAX_REMOTE_QUERY_FETCH 10000 if (IsA(linitial(portal->stmts), PlannedStmt) && + (((PlannedStmt *) linitial(portal->stmts))->commandType != CMD_UTILITY) && IsA(((PlannedStmt *) linitial(portal->stmts))->planTree, RemoteQuery)) count = MAX_REMOTE_QUERY_FETCH; else |