- Notifications
You must be signed in to change notification settings - Fork5
Commita298a1e
committed
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 thefact that there might be non-NULL "b" values associated with later valuesof "a". This happens because _bt_mark_scankey_required() marks thesubsidiary scankey for "b" as required, which is just wrong: it's fora column after the one with the first inequality key (namely "a"), andthus can't be considered a required match.This bit of brain fade dates back to the very beginnings of our supportfor indexed ROW() comparisons, in 2006. Kind of astonishing that no onecame 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, evidentlybecause the fix for bug #6278 (i.e., stopping at nulls in either scandirection) is required to make it fail. I'm sure I could devise a casethat fails in 9.1 as well, perhaps with something involving making a cursorback up; but it doesn't seem worth the trouble.1 parentbe060cb commita298a1e
File tree
3 files changed
+46
-23
lines changed- src
- backend/access/nbtree
- test/regress
- expected
- sql
3 files changed
+46
-23
lines changedLines changed: 8 additions & 23 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1285 | 1285 |
| |
1286 | 1286 |
| |
1287 | 1287 |
| |
1288 |
| - | |
1289 |
| - | |
1290 |
| - | |
1291 |
| - | |
1292 |
| - | |
1293 |
| - | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
1294 | 1291 |
| |
1295 | 1292 |
| |
1296 | 1293 |
| |
| |||
1328 | 1325 |
| |
1329 | 1326 |
| |
1330 | 1327 |
| |
1331 |
| - | |
1332 | 1328 |
| |
1333 |
| - | |
1334 |
| - | |
1335 |
| - | |
1336 |
| - | |
1337 |
| - | |
1338 |
| - | |
1339 |
| - | |
1340 |
| - | |
1341 |
| - | |
1342 |
| - | |
1343 |
| - | |
1344 |
| - | |
1345 |
| - | |
1346 |
| - | |
1347 |
| - | |
1348 |
| - | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
1349 | 1334 |
| |
1350 | 1335 |
| |
1351 | 1336 |
| |
|
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
278 | 278 |
| |
279 | 279 |
| |
280 | 280 |
| |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
281 | 304 |
| |
282 | 305 |
| |
283 | 306 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
116 | 116 |
| |
117 | 117 |
| |
118 | 118 |
| |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
119 | 134 |
| |
120 | 135 |
| |
121 | 136 |
| |
|
0 commit comments
Comments
(0)