Skip to content
Browse files

Fix nodeToString() bug. example test case:

If nodeToString() is given the parse tree of "insert into r1
values(1,2), (3,4)", it returns "insert into r1 values(1,2),
values(3,4)", which is apparently wrong.
Patch provided by Akio Ishida.
  • Loading branch information...
1 parent 3dbf5b4 commit ecb990c5dd03f8994a6744278f69a3c1396a4002 t-ishii committed
Showing with 2,539 additions and 1,474 deletions.
  1. +2,528 −1,472 ChangeLog
  2. +5 −1 TODO
  3. +2 −1 parser/outfuncs.c
  4. +1 −0 test/parser/expected/insert.out
  5. +1 −0 test/parser/expected/select.out
  6. +1 −0 test/parser/input/insert.sql
  7. +1 −0 test/parser/input/select.sql
View
4,000 ChangeLog
2,528 additions, 1,472 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
6 TODO
@@ -1,7 +1,11 @@
-$Header: /cvsroot/pgpool/pgpool-II/TODO,v 1.18 2009/02/28 04:45:23 t-ishii Exp $
+$Header: /cvsroot/pgpool/pgpool-II/TODO,v 1.19 2009/11/05 03:43:27 t-ishii Exp $
* General
+- Add backend id to statement log
+
+- Show PostgreSQL backend process ids in process status
+
- Prepare for changing postgresql.conf directives which produce 'S'
message. Othewise we get:
View
3 parser/outfuncs.c
@@ -836,6 +836,7 @@ _outSelectStmt(String *str, SelectStmt *node)
ListCell *lc;
int comma = 0;
+ string_append_char(str, " VALUES");
foreach (lc, node->valuesLists)
{
if (comma == 0)
@@ -843,7 +844,7 @@ _outSelectStmt(String *str, SelectStmt *node)
else
string_append_char(str, ",");
- string_append_char(str, " VALUES (");
+ string_append_char(str, " (");
_outNode(str, lfirst(lc));
string_append_char(str, ")");
}
View
1 test/parser/expected/insert.out
@@ -10,3 +10,4 @@ INSERT INTO "t"("a", "b", "c") VALUES (2,DEFAULT,'''\\')
INSERT INTO "foo"("a", "b") VALUES (1,2) RETURNING *
INSERT INTO "foo"("a", "b") VALUES (1,2) RETURNING "a"
INSERT INTO "foo"("a", "b") VALUES (1,2) RETURNING "a","b"
+INSERT INTO "foo"("a", "b") VALUES (1,2), (3,4), (5,6)
View
1 test/parser/expected/select.out
@@ -86,3 +86,4 @@ CREATE TABLE "x" AS SELECT * FROM "t"
SELECT '1 year'::interval DAY TO SECOND
SELECT '1 year'::interval HOUR TO MINUTE
SELECT '1 year'::interval HOUR TO SECOND
+ VALUES (1,2), (3,4), (5,6)
View
1 test/parser/input/insert.sql
@@ -10,3 +10,4 @@ INSERT INTO t(a,b,c) VALUES (2,DEFAULT,'\'\\');
INSERT INTO foo(a,b) VALUES (1, 2) RETURNING *;
INSERT INTO foo(a,b) VALUES (1, 2) RETURNING a;
INSERT INTO foo(a,b) VALUES (1, 2) RETURNING a,b;
+INSERT INTO foo(a,b) VALUES (1, 2), (3, 4), (5, 6);
View
1 test/parser/input/select.sql
@@ -86,3 +86,4 @@ SELECT interval '1 year' DAY TO MINUTE
SELECT interval '1 year' DAY TO SECOND
SELECT interval '1 year' HOUR TO MINUTE
SELECT interval '1 year' HOUR TO SECOND
+VALUES (1, 2), (3, 4), (5, 6);

0 comments on commit ecb990c

Please sign in to comment.
Something went wrong with that request. Please try again.