pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Fix incorrect handling of NULL index entries in indexed ROW() co
6+ messages / 1 participants
[nested] [flat]
* pgsql: Fix incorrect handling of NULL index entries in indexed ROW() co
@ 2016-03-09 19:51 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2016-03-09 19:51 UTC (permalink / raw)
To: pgsql-committers
Fix incorrect handling of NULL index entries in indexed ROW() comparisons.
An index search using a row comparison such as ROW(a, b) > ROW('x', 'y')
would stop upon reaching a NULL entry in the "b" column, ignoring the
fact that there might be non-NULL "b" values associated with later values
of "a". This happens because _bt_mark_scankey_required() marks the
subsidiary scankey for "b" as required, which is just wrong: it's for
a column after the one with the first inequality key (namely "a"), and
thus can't be considered a required match.
This bit of brain fade dates back to the very beginnings of our support
for indexed ROW() comparisons, in 2006. Kind of astonishing that no one
came across it before Glen Takahashi, in bug #14010.
Back-patch to all supported versions.
Note: the given test case doesn't actually fail in unpatched 9.1, evidently
because the fix for bug #6278 (i.e., stopping at nulls in either scan
direction) is required to make it fail. I'm sure I could devise a case
that fails in 9.1 as well, perhaps with something involving making a cursor
back up; but it doesn't seem worth the trouble.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/a298a1e06fb0574c898a07761f9f86c2a323919e
Modified Files
--------------
src/backend/access/nbtree/nbtutils.c | 31 ++++++++-----------------------
src/test/regress/expected/rowtypes.out | 23 +++++++++++++++++++++++
src/test/regress/sql/rowtypes.sql | 15 +++++++++++++++
3 files changed, 46 insertions(+), 23 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix incorrect handling of NULL index entries in indexed ROW() co
@ 2016-03-09 19:51 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2016-03-09 19:51 UTC (permalink / raw)
To: pgsql-committers
Fix incorrect handling of NULL index entries in indexed ROW() comparisons.
An index search using a row comparison such as ROW(a, b) > ROW('x', 'y')
would stop upon reaching a NULL entry in the "b" column, ignoring the
fact that there might be non-NULL "b" values associated with later values
of "a". This happens because _bt_mark_scankey_required() marks the
subsidiary scankey for "b" as required, which is just wrong: it's for
a column after the one with the first inequality key (namely "a"), and
thus can't be considered a required match.
This bit of brain fade dates back to the very beginnings of our support
for indexed ROW() comparisons, in 2006. Kind of astonishing that no one
came across it before Glen Takahashi, in bug #14010.
Back-patch to all supported versions.
Note: the given test case doesn't actually fail in unpatched 9.1, evidently
because the fix for bug #6278 (i.e., stopping at nulls in either scan
direction) is required to make it fail. I'm sure I could devise a case
that fails in 9.1 as well, perhaps with something involving making a cursor
back up; but it doesn't seem worth the trouble.
Branch
------
REL9_5_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/b2ce9485bdf8e67494717b9d21978ef7592f9be1
Modified Files
--------------
src/backend/access/nbtree/nbtutils.c | 31 ++++++++-----------------------
src/test/regress/expected/rowtypes.out | 23 +++++++++++++++++++++++
src/test/regress/sql/rowtypes.sql | 15 +++++++++++++++
3 files changed, 46 insertions(+), 23 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix incorrect handling of NULL index entries in indexed ROW() co
@ 2016-03-09 19:51 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2016-03-09 19:51 UTC (permalink / raw)
To: pgsql-committers
Fix incorrect handling of NULL index entries in indexed ROW() comparisons.
An index search using a row comparison such as ROW(a, b) > ROW('x', 'y')
would stop upon reaching a NULL entry in the "b" column, ignoring the
fact that there might be non-NULL "b" values associated with later values
of "a". This happens because _bt_mark_scankey_required() marks the
subsidiary scankey for "b" as required, which is just wrong: it's for
a column after the one with the first inequality key (namely "a"), and
thus can't be considered a required match.
This bit of brain fade dates back to the very beginnings of our support
for indexed ROW() comparisons, in 2006. Kind of astonishing that no one
came across it before Glen Takahashi, in bug #14010.
Back-patch to all supported versions.
Note: the given test case doesn't actually fail in unpatched 9.1, evidently
because the fix for bug #6278 (i.e., stopping at nulls in either scan
direction) is required to make it fail. I'm sure I could devise a case
that fails in 9.1 as well, perhaps with something involving making a cursor
back up; but it doesn't seem worth the trouble.
Branch
------
REL9_4_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/da936200dbd92509768376b8ca198cfcbeec738b
Modified Files
--------------
src/backend/access/nbtree/nbtutils.c | 31 ++++++++-----------------------
src/test/regress/expected/rowtypes.out | 23 +++++++++++++++++++++++
src/test/regress/sql/rowtypes.sql | 15 +++++++++++++++
3 files changed, 46 insertions(+), 23 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix incorrect handling of NULL index entries in indexed ROW() co
@ 2016-03-09 19:51 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2016-03-09 19:51 UTC (permalink / raw)
To: pgsql-committers
Fix incorrect handling of NULL index entries in indexed ROW() comparisons.
An index search using a row comparison such as ROW(a, b) > ROW('x', 'y')
would stop upon reaching a NULL entry in the "b" column, ignoring the
fact that there might be non-NULL "b" values associated with later values
of "a". This happens because _bt_mark_scankey_required() marks the
subsidiary scankey for "b" as required, which is just wrong: it's for
a column after the one with the first inequality key (namely "a"), and
thus can't be considered a required match.
This bit of brain fade dates back to the very beginnings of our support
for indexed ROW() comparisons, in 2006. Kind of astonishing that no one
came across it before Glen Takahashi, in bug #14010.
Back-patch to all supported versions.
Note: the given test case doesn't actually fail in unpatched 9.1, evidently
because the fix for bug #6278 (i.e., stopping at nulls in either scan
direction) is required to make it fail. I'm sure I could devise a case
that fails in 9.1 as well, perhaps with something involving making a cursor
back up; but it doesn't seem worth the trouble.
Branch
------
REL9_3_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/1ab7a160f9d983ba738022c0b4dc62a67848b932
Modified Files
--------------
src/backend/access/nbtree/nbtutils.c | 31 ++++++++-----------------------
src/test/regress/expected/rowtypes.out | 23 +++++++++++++++++++++++
src/test/regress/sql/rowtypes.sql | 15 +++++++++++++++
3 files changed, 46 insertions(+), 23 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix incorrect handling of NULL index entries in indexed ROW() co
@ 2016-03-09 19:51 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2016-03-09 19:51 UTC (permalink / raw)
To: pgsql-committers
Fix incorrect handling of NULL index entries in indexed ROW() comparisons.
An index search using a row comparison such as ROW(a, b) > ROW('x', 'y')
would stop upon reaching a NULL entry in the "b" column, ignoring the
fact that there might be non-NULL "b" values associated with later values
of "a". This happens because _bt_mark_scankey_required() marks the
subsidiary scankey for "b" as required, which is just wrong: it's for
a column after the one with the first inequality key (namely "a"), and
thus can't be considered a required match.
This bit of brain fade dates back to the very beginnings of our support
for indexed ROW() comparisons, in 2006. Kind of astonishing that no one
came across it before Glen Takahashi, in bug #14010.
Back-patch to all supported versions.
Note: the given test case doesn't actually fail in unpatched 9.1, evidently
because the fix for bug #6278 (i.e., stopping at nulls in either scan
direction) is required to make it fail. I'm sure I could devise a case
that fails in 9.1 as well, perhaps with something involving making a cursor
back up; but it doesn't seem worth the trouble.
Branch
------
REL9_2_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/c8e059724f35b32e4c54d24349a2e3675067e38c
Modified Files
--------------
src/backend/access/nbtree/nbtutils.c | 31 ++++++++-----------------------
src/test/regress/expected/rowtypes.out | 23 +++++++++++++++++++++++
src/test/regress/sql/rowtypes.sql | 15 +++++++++++++++
3 files changed, 46 insertions(+), 23 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix incorrect handling of NULL index entries in indexed ROW() co
@ 2016-03-09 19:51 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2016-03-09 19:51 UTC (permalink / raw)
To: pgsql-committers
Fix incorrect handling of NULL index entries in indexed ROW() comparisons.
An index search using a row comparison such as ROW(a, b) > ROW('x', 'y')
would stop upon reaching a NULL entry in the "b" column, ignoring the
fact that there might be non-NULL "b" values associated with later values
of "a". This happens because _bt_mark_scankey_required() marks the
subsidiary scankey for "b" as required, which is just wrong: it's for
a column after the one with the first inequality key (namely "a"), and
thus can't be considered a required match.
This bit of brain fade dates back to the very beginnings of our support
for indexed ROW() comparisons, in 2006. Kind of astonishing that no one
came across it before Glen Takahashi, in bug #14010.
Back-patch to all supported versions.
Note: the given test case doesn't actually fail in unpatched 9.1, evidently
because the fix for bug #6278 (i.e., stopping at nulls in either scan
direction) is required to make it fail. I'm sure I could devise a case
that fails in 9.1 as well, perhaps with something involving making a cursor
back up; but it doesn't seem worth the trouble.
Branch
------
REL9_1_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/d485d9581dd3b85181aa39e18f130809bc129d5f
Modified Files
--------------
src/backend/access/nbtree/nbtutils.c | 31 ++++++++-----------------------
src/test/regress/expected/rowtypes.out | 23 +++++++++++++++++++++++
src/test/regress/sql/rowtypes.sql | 15 +++++++++++++++
3 files changed, 46 insertions(+), 23 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2016-03-09 19:51 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-03-09 19:51 pgsql: Fix incorrect handling of NULL index entries in indexed ROW() co Tom Lane <tgl@sss.pgh.pa.us>
2016-03-09 19:51 pgsql: Fix incorrect handling of NULL index entries in indexed ROW() co Tom Lane <tgl@sss.pgh.pa.us>
2016-03-09 19:51 pgsql: Fix incorrect handling of NULL index entries in indexed ROW() co Tom Lane <tgl@sss.pgh.pa.us>
2016-03-09 19:51 pgsql: Fix incorrect handling of NULL index entries in indexed ROW() co Tom Lane <tgl@sss.pgh.pa.us>
2016-03-09 19:51 pgsql: Fix incorrect handling of NULL index entries in indexed ROW() co Tom Lane <tgl@sss.pgh.pa.us>
2016-03-09 19:51 pgsql: Fix incorrect handling of NULL index entries in indexed ROW() co Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox