forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4816d2e
committed
Fix cross-type case in partial row matching for hashed subplans.
When hashing a subplan like "WHERE (a, b) NOT IN (SELECT x, y FROM ...)",findPartialMatch() attempted to match rows using the hashtable's internalequality operators, which of course are for x and y's datatypes. What weneed to use are the potentially cross-type operators for a=x, b=y, etc.Failure to do that leads to wrong answers or even crashes. The scope forproblems is limited to cases where we have different types with compatiblehash functions (else we'd not be using a hashed subplan), but for exampleint4 vs int8 can cause the problem.Per bug #7597 from Bo Jensen. This has been wrong since the hashed-subplancode was written, so patch all the way back.1 parent6f60fdd commit4816d2e
File tree
3 files changed
+43
-6
lines changed- src
- backend/executor
- test/regress
- expected
- sql
3 files changed
+43
-6
lines changedLines changed: 11 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
49 |
| - | |
| 49 | + | |
| 50 | + | |
50 | 51 |
| |
51 | 52 |
| |
52 | 53 |
| |
| |||
153 | 154 |
| |
154 | 155 |
| |
155 | 156 |
| |
156 |
| - | |
| 157 | + | |
157 | 158 |
| |
158 | 159 |
| |
159 | 160 |
| |
| |||
186 | 187 |
| |
187 | 188 |
| |
188 | 189 |
| |
189 |
| - | |
| 190 | + | |
190 | 191 |
| |
191 | 192 |
| |
192 | 193 |
| |
193 | 194 |
| |
194 | 195 |
| |
195 | 196 |
| |
196 |
| - | |
| 197 | + | |
197 | 198 |
| |
198 | 199 |
| |
199 | 200 |
| |
| |||
573 | 574 |
| |
574 | 575 |
| |
575 | 576 |
| |
| 577 | + | |
| 578 | + | |
| 579 | + | |
576 | 580 |
| |
577 | 581 |
| |
578 |
| - | |
| 582 | + | |
| 583 | + | |
579 | 584 |
| |
580 | 585 |
| |
581 | 586 |
| |
| |||
588 | 593 |
| |
589 | 594 |
| |
590 | 595 |
| |
591 |
| - | |
| 596 | + | |
592 | 597 |
| |
593 | 598 |
| |
594 | 599 |
| |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
543 | 543 |
| |
544 | 544 |
| |
545 | 545 |
| |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
546 | 563 |
| |
547 | 564 |
| |
548 | 565 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
345 | 345 |
| |
346 | 346 |
| |
347 | 347 |
| |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
348 | 363 |
| |
349 | 364 |
| |
350 | 365 |
| |
|
0 commit comments
Comments
(0)