[pgpool-committers: 9478] pgpool: Fix PREPARE in multi-statement case.

Tatsuo Ishii ishii at sraoss.co.jp
Thu Jul 13 11:34:17 JST 2023


Fix PREPARE in multi-statement case.

If multi-statement query includes PREPARE in the second or latter
position, and subsequent bind message uses the prepared statement, it
fails with "unable to bind" error because the prepared statement is not
saved in sent messages.

To fix this if such a case found after parsing the statement, create a
query context for the named statement and add it to the sent message
list.
Discussion: https://www.pgpool.net/pipermail/pgpool-general/2023-July/008931.html

For this new regression test 079..multi_prepare is added.

Branch
------
V4_3_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=9a61345254270c1016f4f83430382194d7903d5f

Modified Files
--------------
src/protocol/pool_proto_modules.c                  | 59 ++++++++++++++++++++++
.../tests/079.multi_prepare/expected.txt           | 23 +++++++++
.../tests/079.multi_prepare/pgproto.data           | 16 ++++++
.../regression/tests/079.multi_prepare/test.sh     | 39 ++++++++++++++
4 files changed, 137 insertions(+)



More information about the pgpool-committers mailing list