Fix Pgpool-II rewriting query error when the queries include "GROUPS" and "EXCLUDE...
authorBo Peng <pengbo@sraoss.co.jp>
Wed, 10 Jul 2019 07:30:32 +0000 (16:30 +0900)
committerBo Peng <pengbo@sraoss.co.jp>
Wed, 10 Jul 2019 07:30:32 +0000 (16:30 +0900)
This occurs only in native replication mode.

Thanks to Yugo Nagata for the bug reporting.

src/parser/outfuncs.c

index fbef9e5e037756b3fed1e1e42c35f79b4fa85ef4..73b6d073303705a3fa10b26ef6b4e1b9ccb6e04f 100644 (file)
@@ -1976,6 +1976,8 @@ _outWindowDef(String * str, WindowDef *node)
                        string_append_char(str, " RANGE");
                else if (node->frameOptions & FRAMEOPTION_ROWS)
                        string_append_char(str, " ROWS");
+               else if (node->frameOptions & FRAMEOPTION_GROUPS)
+                       string_append_char(str, " GROUPS");
 
                if (node->frameOptions & FRAMEOPTION_BETWEEN)
                        string_append_char(str, " BETWEEN");
@@ -2021,6 +2023,19 @@ _outWindowDef(String * str, WindowDef *node)
                                string_append_char(str, " FOLLOWING");
                        }
                }
+
+               if (node->frameOptions & FRAMEOPTION_EXCLUDE_CURRENT_ROW)
+               {
+                       string_append_char(str, " EXCLUDE CURRENT ROW");
+               }
+               else if (node->frameOptions & FRAMEOPTION_EXCLUDE_GROUP)
+               {
+                       string_append_char(str, " EXCLUDE GROUP");
+               }
+               else if (node->frameOptions & FRAMEOPTION_EXCLUDE_TIES)
+               {
+                       string_append_char(str, " EXCLUDE TIES");
+               }
        }
        string_append_char(str, ")");
 }