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

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

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

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