OSDN Git Service

Fixed a bug related to SQL statements in PL/pgSQL functions.
authorKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Mon, 22 Dec 2014 08:34:15 +0000 (17:34 +0900)
committerKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Mon, 22 Dec 2014 11:46:04 +0000 (20:46 +0900)
commitb715e7a19a83f6ecb7d6b7e7aeedec6393525011
tree49d11f7ca8e9103d4cf0bd53a4a6617ddd5eb441
parentab11909d11c42f386fda0661c223c26e7082ac1b
Fixed a bug related to SQL statements in PL/pgSQL functions.

At least since 9.1, true query strings of SQL statements executed in
PL/pgSQL functions were found that were not obtained correctly by the
previous implement, it is because that PLpgSQL_stmt variable did not
have proper query string to be read for hints. Instead, it is changed
to read them from the top of error_context_stack in
pg_hint_plan_planner(). This change made a slight difference in
behavior which doesn't affect its work so a part of the regtest was
also changed. And added some regression tests for it.
expected/pg_hint_plan.out
expected/ut-A.out
pg_hint_plan.c
sql/pg_hint_plan.sql