forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit11086f2
committed
Repair planner bug introduced in 8.2 by ability to rearrange outer joins:
in cases where a sub-SELECT inserts a WHERE clause between two outer joins,that clause may prevent us from re-ordering the two outer joins. The codewas considering only the joins' own ON-conditions in determining reorderingsafety, which is not good enough. Add a "delay_upper_joins" flag toOuterJoinInfo to flag that we have detected such a clause and higher-levelouter joins shouldn't be permitted to commute with this one. (This mightseem overly coarse, but given the current rules for OJ reordering, it'ssufficient AFAICT.)The failure case is actually pretty narrow: it needs a WHERE clause withinthe RHS of a left join that checks the RHS of a lower left join, but is notstrict for that RHS (else we'd have simplified the lower join to a plainjoin). Even then no failure will be manifest unless the planner chooses torearrange the join order.Per bug report from Adam Terrey.1 parent0f6e2d0 commit11086f2
File tree
8 files changed
+138
-13
lines changed- src
- backend
- nodes
- optimizer/plan
- include/nodes
- test/regress
- expected
- sql
8 files changed
+138
-13
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 |
| - | |
| 18 | + | |
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| |||
1425 | 1425 |
| |
1426 | 1426 |
| |
1427 | 1427 |
| |
| 1428 | + | |
1428 | 1429 |
| |
1429 | 1430 |
| |
1430 | 1431 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
21 |
| - | |
| 21 | + | |
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
| |||
680 | 680 |
| |
681 | 681 |
| |
682 | 682 |
| |
| 683 | + | |
683 | 684 |
| |
684 | 685 |
| |
685 | 686 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
1453 | 1453 |
| |
1454 | 1454 |
| |
1455 | 1455 |
| |
| 1456 | + | |
1456 | 1457 |
| |
1457 | 1458 |
| |
1458 | 1459 |
| |
|
Lines changed: 45 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
51 |
| - | |
| 51 | + | |
| 52 | + | |
52 | 53 |
| |
53 | 54 |
| |
54 | 55 |
| |
| |||
492 | 493 |
| |
493 | 494 |
| |
494 | 495 |
| |
| 496 | + | |
| 497 | + | |
| 498 | + | |
495 | 499 |
| |
496 | 500 |
| |
497 | 501 |
| |
| |||
561 | 565 |
| |
562 | 566 |
| |
563 | 567 |
| |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
564 | 579 |
| |
565 | 580 |
| |
566 | 581 |
| |
567 |
| - | |
| 582 | + | |
568 | 583 |
| |
569 | 584 |
| |
570 | 585 |
| |
| |||
749 | 764 |
| |
750 | 765 |
| |
751 | 766 |
| |
752 |
| - | |
| 767 | + | |
753 | 768 |
| |
754 | 769 |
| |
755 | 770 |
| |
| |||
776 | 791 |
| |
777 | 792 |
| |
778 | 793 |
| |
779 |
| - | |
| 794 | + | |
780 | 795 |
| |
781 | 796 |
| |
782 | 797 |
| |
| |||
918 | 933 |
| |
919 | 934 |
| |
920 | 935 |
| |
921 |
| - | |
| 936 | + | |
| 937 | + | |
922 | 938 |
| |
923 |
| - | |
924 |
| - | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
925 | 943 |
| |
926 | 944 |
| |
927 | 945 |
| |
| |||
946 | 964 |
| |
947 | 965 |
| |
948 | 966 |
| |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
949 | 980 |
| |
950 | 981 |
| |
951 |
| - | |
| 982 | + | |
| 983 | + | |
952 | 984 |
| |
953 | 985 |
| |
954 | 986 |
| |
| |||
979 | 1011 |
| |
980 | 1012 |
| |
981 | 1013 |
| |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
982 | 1018 |
| |
983 | 1019 |
| |
984 | 1020 |
| |
|
Lines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
1042 | 1042 |
| |
1043 | 1043 |
| |
1044 | 1044 |
| |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
1045 | 1051 |
| |
1046 | 1052 |
| |
1047 | 1053 |
| |
| |||
1055 | 1061 |
| |
1056 | 1062 |
| |
1057 | 1063 |
| |
| 1064 | + | |
1058 | 1065 |
| |
1059 | 1066 |
| |
1060 | 1067 |
| |
|
Lines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2223 | 2223 |
| |
2224 | 2224 |
| |
2225 | 2225 |
| |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + |
Lines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2223 | 2223 |
| |
2224 | 2224 |
| |
2225 | 2225 |
| |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + |
Lines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
399 | 399 |
| |
400 | 400 |
| |
401 | 401 |
| |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + |
0 commit comments
Comments
(0)