From: Bo Peng Date: Thu, 18 Oct 2018 09:12:24 +0000 (+0900) Subject: Fix syntax error in native replication, when queries including now() etc. and "IN... X-Git-Tag: V3_4_20~6 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=103ac89fbb7fcf261008e9b4fa8cc5e934daebf8;p=pgpool2.git Fix syntax error in native replication, when queries including now() etc. and "IN (SELECT ...)" in WHERE clause. In native replication, queries including now() etc. are rewritten to a timestamp constant value. However, Pgpool-II didn't support queries including now() etc. and "IN (SELECT ...)" in WHERE clause. Per bug433. --- diff --git a/src/parser/outfuncs.c b/src/parser/outfuncs.c index 03e2b62c7..92d28023d 100644 --- a/src/parser/outfuncs.c +++ b/src/parser/outfuncs.c @@ -416,6 +416,12 @@ _outSubLink(String *str, SubLink *node) { _outNode(str, node->testexpr); + /* + * If the source was "x IN (select)", convert to "x = ANY (select)". + */ + if (node->subLinkType == ANY_SUBLINK && node->operName == NIL) + node->operName = list_make1(makeString("=")); + if (node->operName != NIL) { Value *v = linitial(node->operName);