pgpool2.git / summary / log / commit / refs
commit 0b059bd5887d8c40aff04a73fd718f4541bd9201
Author: Bo Peng <pengbo@sraoss.co.jp>
Date: Thu Oct 18 09:12:24 2018 +0000
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.
src/parser/outfuncs.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/parser/outfuncs.c b/src/parser/outfuncs.c
index 1d4cd87c8..c1d929841 100644
--- a/src/parser/outfuncs.c
+++ b/src/parser/outfuncs.c
@@ -466,6 +466,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);
[parent: dd043dff7300]