pgsql: Re-enable error for "SELECT ... OFFSET -1".

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Re-enable error for "SELECT ... OFFSET -1".
Date: 2014-07-22 17:30:32
Message-ID: E1X9dtY-00087W-2j@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Re-enable error for "SELECT ... OFFSET -1".

The executor has thrown errors for negative OFFSET values since 8.4 (see
commit bfce56eea45b1369b7bb2150a150d1ac109f5073), but in a moment of brain
fade I taught the planner that OFFSET with a constant negative value was a
no-op (commit 1a1832eb085e5bca198735e5d0e766a3cb61b8fc). Reinstate the
former behavior by only discarding OFFSET with a value of exactly 0. In
passing, adjust a planner comment that referenced the ancient behavior.

Back-patch to 9.3 where the mistake was introduced.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/30d6a9858cd8389e59d652d9919761dc095326c5

Modified Files
--------------
src/backend/optimizer/plan/planner.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-07-23 00:26:27 Re: [COMMITTERS] pgsql: Diagnose incompatible OpenLDAP versions during build and test.
Previous Message Tom Lane 2014-07-22 15:51:18 Re: [COMMITTERS] pgsql: Diagnose incompatible OpenLDAP versions during build and test.