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

Tatsuo Ishii ishii at sraoss.co.jp
Thu Jul 13 11:34:26 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
------
master

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

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