mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
Fix thinko in SPI_execute_plan() calls
Two call sites were apparently thinking that the last argument of SPI_execute_plan() is the number of query parameters, but it is actually the row limit. Change the calls to 0, since we don't care about the limit there. The previous code didn't break anything, but it was still wrong.
This commit is contained in:
parent
4053189d59
commit
b7212c9726
@ -480,7 +480,7 @@ pg_get_ruledef_worker(Oid ruleoid, int prettyFlags)
|
||||
*/
|
||||
args[0] = ObjectIdGetDatum(ruleoid);
|
||||
nulls[0] = ' ';
|
||||
spirc = SPI_execute_plan(plan_getrulebyoid, args, nulls, true, 1);
|
||||
spirc = SPI_execute_plan(plan_getrulebyoid, args, nulls, true, 0);
|
||||
if (spirc != SPI_OK_SELECT)
|
||||
elog(ERROR, "failed to get pg_rewrite tuple for rule %u", ruleoid);
|
||||
if (SPI_processed != 1)
|
||||
@ -635,7 +635,7 @@ pg_get_viewdef_worker(Oid viewoid, int prettyFlags, int wrapColumn)
|
||||
args[1] = DirectFunctionCall1(namein, CStringGetDatum(ViewSelectRuleName));
|
||||
nulls[0] = ' ';
|
||||
nulls[1] = ' ';
|
||||
spirc = SPI_execute_plan(plan_getviewrule, args, nulls, true, 2);
|
||||
spirc = SPI_execute_plan(plan_getviewrule, args, nulls, true, 0);
|
||||
if (spirc != SPI_OK_SELECT)
|
||||
elog(ERROR, "failed to get pg_rewrite tuple for view %u", viewoid);
|
||||
if (SPI_processed != 1)
|
||||
|
Loading…
Reference in New Issue
Block a user