Fix time stamp rewrite bug.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 20 Dec 2022 10:06:22 +0000 (19:06 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 20 Dec 2022 10:06:22 +0000 (19:06 +0900)
commita6c62f6bd82d148cdf45420eae91a0739f93f178
tree7bbcfc54de9b9ce2e0ed4bd30313130d37203ef9
parent8ca4aa132c2909b9910844847174c92ff66085ca
Fix time stamp rewrite bug.

In native replication/snapshot isolation mode, any write query
including timestamp/date/time data are rewritten so that all
PostgreSQL servers accept same timestamp etc. value. From 4.4 outfuncs
module which is used to generate rewritten query was broken for
boolean data. In a parse tree constant data is represented as
"A_Const". 4.4 updated the module by using PostgreSQL 15's outfuncs
module. Starting from PostgreSQL 15 A_Const handles more data type
including boolean. Unfortunately the pgpool's outfuncs module did not
adopt the change. As a result boolean constant was ignored and turned
into empty string in the rewritten query string, which caused syntax
errors.

This commit fixes the issue. Also modify _outA_Const() so that it uses
_out* functions to handle other data types to save a few lines of
code.

Per report from Michiel van Leening.
Discussion: at: https://www.pgpool.net/pipermail/pgpool-general/2022-December/008581.html
Back-patch to: 4.4.
src/parser/outfuncs.c