- Notifications
You must be signed in to change notification settings - Fork5
Commit71e58dc
committed
Make equal() ignore CoercionForm fields for better planning with casts.
This change ensures that the planner will see implicit and explicit castsas equivalent for all purposes, except in the minority of cases wherethere's actually a semantic difference (as reflected by having a 3-argumentcast function). In particular, this fixes cases where the EquivalenceClassmachinery failed to consider two references to a varchar column asequivalent if one was implicitly cast to text but the other was explicitlycast to text, as seen in bug #7598 from Vaclav Juza. We have had similarbugs before in other parts of the planner, so I think it's time to fix thisproblem at the core instead of continuing to band-aid around it.Remove set_coercionform_dontcare(), which represents the band-aidpreviously in use for allowing matching of index and constraint expressionswith inconsistent cast labeling. (We can probably get rid ofCOERCE_DONTCARE altogether, but I don't think removing that enum value inback branches would be wise; it's possible there's third party codereferring to it.)Back-patch to 9.2. We could go back further, and might want to once thishas been tested more; but for the moment I won't risk destabilizing planchoices in long-since-stable branches.1 parente583ffe commit71e58dc
File tree
6 files changed
+17
-132
lines changed- src
- backend
- nodes
- optimizer/util
- utils/cache
- include
- nodes
- optimizer
6 files changed
+17
-132
lines changedLines changed: 11 additions & 70 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
83 | 83 |
| |
84 | 84 |
| |
85 | 85 |
| |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
86 | 90 |
| |
87 | 91 |
| |
88 | 92 |
| |
| |||
235 | 239 |
| |
236 | 240 |
| |
237 | 241 |
| |
238 |
| - | |
239 |
| - | |
240 |
| - | |
241 |
| - | |
242 |
| - | |
243 |
| - | |
244 |
| - | |
245 |
| - | |
246 |
| - | |
247 |
| - | |
| 242 | + | |
248 | 243 |
| |
249 | 244 |
| |
250 | 245 |
| |
| |||
448 | 443 |
| |
449 | 444 |
| |
450 | 445 |
| |
451 |
| - | |
452 |
| - | |
453 |
| - | |
454 |
| - | |
455 |
| - | |
456 |
| - | |
457 |
| - | |
458 |
| - | |
459 |
| - | |
460 |
| - | |
| 446 | + | |
461 | 447 |
| |
462 | 448 |
| |
463 | 449 |
| |
| |||
469 | 455 |
| |
470 | 456 |
| |
471 | 457 |
| |
472 |
| - | |
473 |
| - | |
474 |
| - | |
475 |
| - | |
476 |
| - | |
477 |
| - | |
478 |
| - | |
479 |
| - | |
480 |
| - | |
481 |
| - | |
| 458 | + | |
482 | 459 |
| |
483 | 460 |
| |
484 | 461 |
| |
| |||
493 | 470 |
| |
494 | 471 |
| |
495 | 472 |
| |
496 |
| - | |
497 |
| - | |
498 |
| - | |
499 |
| - | |
500 |
| - | |
501 |
| - | |
502 |
| - | |
503 |
| - | |
504 |
| - | |
505 |
| - | |
| 473 | + | |
506 | 474 |
| |
507 | 475 |
| |
508 | 476 |
| |
| |||
513 | 481 |
| |
514 | 482 |
| |
515 | 483 |
| |
516 |
| - | |
517 |
| - | |
518 |
| - | |
519 |
| - | |
520 |
| - | |
521 |
| - | |
522 |
| - | |
523 |
| - | |
524 |
| - | |
525 |
| - | |
| 484 | + | |
526 | 485 |
| |
527 | 486 |
| |
528 | 487 |
| |
| |||
589 | 548 |
| |
590 | 549 |
| |
591 | 550 |
| |
592 |
| - | |
593 |
| - | |
594 |
| - | |
595 |
| - | |
596 |
| - | |
597 |
| - | |
598 |
| - | |
599 |
| - | |
600 |
| - | |
601 |
| - | |
| 551 | + | |
602 | 552 |
| |
603 | 553 |
| |
604 | 554 |
| |
| |||
684 | 634 |
| |
685 | 635 |
| |
686 | 636 |
| |
687 |
| - | |
688 |
| - | |
689 |
| - | |
690 |
| - | |
691 |
| - | |
692 |
| - | |
693 |
| - | |
694 |
| - | |
695 |
| - | |
696 |
| - | |
| 637 | + | |
697 | 638 |
| |
698 | 639 |
| |
699 | 640 |
| |
|
Lines changed: 0 additions & 42 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
101 |
| - | |
102 | 101 |
| |
103 | 102 |
| |
104 | 103 |
| |
| |||
2114 | 2113 |
| |
2115 | 2114 |
| |
2116 | 2115 |
| |
2117 |
| - | |
2118 |
| - | |
2119 |
| - | |
2120 |
| - | |
2121 |
| - | |
2122 |
| - | |
2123 |
| - | |
2124 |
| - | |
2125 |
| - | |
2126 |
| - | |
2127 |
| - | |
2128 |
| - | |
2129 |
| - | |
2130 |
| - | |
2131 |
| - | |
2132 |
| - | |
2133 |
| - | |
2134 |
| - | |
2135 |
| - | |
2136 |
| - | |
2137 |
| - | |
2138 |
| - | |
2139 |
| - | |
2140 |
| - | |
2141 |
| - | |
2142 |
| - | |
2143 |
| - | |
2144 |
| - | |
2145 |
| - | |
2146 |
| - | |
2147 |
| - | |
2148 |
| - | |
2149 |
| - | |
2150 |
| - | |
2151 |
| - | |
2152 |
| - | |
2153 |
| - | |
2154 |
| - | |
2155 |
| - | |
2156 |
| - | |
2157 |
| - | |
2158 | 2116 |
| |
2159 | 2117 |
| |
2160 | 2118 |
| |
|
Lines changed: 0 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
665 | 665 |
| |
666 | 666 |
| |
667 | 667 |
| |
668 |
| - | |
669 |
| - | |
670 |
| - | |
671 |
| - | |
672 |
| - | |
673 |
| - | |
674 | 668 |
| |
675 | 669 |
| |
676 | 670 |
| |
|
Lines changed: 0 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3549 | 3549 |
| |
3550 | 3550 |
| |
3551 | 3551 |
| |
3552 |
| - | |
3553 |
| - | |
3554 |
| - | |
3555 |
| - | |
3556 |
| - | |
3557 |
| - | |
3558 | 3552 |
| |
3559 | 3553 |
| |
3560 | 3554 |
| |
| |||
3621 | 3615 |
| |
3622 | 3616 |
| |
3623 | 3617 |
| |
3624 |
| - | |
3625 |
| - | |
3626 |
| - | |
3627 |
| - | |
3628 |
| - | |
3629 |
| - | |
3630 | 3618 |
| |
3631 | 3619 |
| |
3632 | 3620 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
317 | 317 |
| |
318 | 318 |
| |
319 | 319 |
| |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
320 | 326 |
| |
321 | 327 |
| |
322 | 328 |
| |
|
Lines changed: 0 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
79 | 79 |
| |
80 | 80 |
| |
81 | 81 |
| |
82 |
| - | |
83 |
| - | |
84 | 82 |
| |
85 | 83 |
| |
86 | 84 |
| |
|
0 commit comments
Comments
(0)