pgsql: Behave correctly if INSERT ... VALUES is decorated with addition - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Behave correctly if INSERT ... VALUES is decorated with addition
Date
Msg-id E1P2C3B-0006t7-WC@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Behave correctly if INSERT ... VALUES is decorated with additional clauses.

In versions 8.2 and up, the grammar allows attaching ORDER BY, LIMIT,
FOR UPDATE, or WITH to VALUES, and hence to INSERT ... VALUES.  But the
special-case code for VALUES in transformInsertStmt() wasn't expecting any
of those, and just ignored them, leading to unexpected results.  Rather
than complicate the special-case path, just ensure that the presence of any
of those clauses makes us treat the query as if it had a general SELECT.
Per report from Hitoshi Harada.

Branch
------
REL8_2_STABLE

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=d8014f9a7f9ec848890296d7c01dbf7b2d70fc1b

Modified Files
--------------
src/backend/parser/analyze.c |   10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Remove excess argument to open(2).
Next
From: Tom Lane
Date:
Subject: pgsql: Behave correctly if INSERT ... VALUES is decorated with addition