]> granicus.if.org Git - postgresql/commit
Re-enable error for "SELECT ... OFFSET -1".
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 22 Jul 2014 17:30:01 +0000 (13:30 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 22 Jul 2014 17:30:09 +0000 (13:30 -0400)
commit30d6a9858cd8389e59d652d9919761dc095326c5
treefc276221bd9b7d7a2996a64e142a1c54a7b851cd
parent1ea941450bca70ec9e30c2936e99835f9649f865
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.
src/backend/optimizer/plan/planner.c