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:44:42 +0000 (20:44 +0900)
commit2c739758bc6473fd22cf9fd6753106e08377be93
tree5f136ae812a098745ee731898383921ec8217e03
parent09bf8f7b62fa4918de109988ed85139dcb9cfbf6
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