OSDN Git Service

Don't reset plpgsql nest level at every command end
authorKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Tue, 4 Dec 2018 01:33:55 +0000 (10:33 +0900)
committerKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Wed, 5 Dec 2018 08:31:20 +0000 (17:31 +0900)
commitb6ebe309a92328110bc66786476b29879ee1272f
tree9ae67d3e1671e825520a702fe1aba95d6fba4005
parentd5d67194c94901572984995454ce650dfc98ac30
Don't reset plpgsql nest level at every command end

Clean up code for global exit is forgetting about loops that run
hinted commands multiple times. This leads to pg_hint_plan's failure
to affect after the first execution of the inner commands.
The hint below worked only for the first time.

FOR outer IN EXECUTE 'outer-command' LOOP
  FOR inner IN EXECUTE '/*+ hint */ inner-command' LOOP
    <something>
  END LOOP;
END LOOP;
expected/pg_hint_plan.out
pg_hint_plan.c
sql/pg_hint_plan.sql