forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0563a3a
committed
Fix a bug in how we generate partition constraints.
Move the code for doing parent attnos to child attnos mapping for Varsin partition constraint expressions to a separate functionmap_partition_varattnos() and call it from the appropriate places.Doing it in get_qual_from_partbound(), as is now, would produce wrongresult in certain multi-level partitioning cases, because it onlyconsiders the current pair of parent-child relations. In certainmulti-level partitioning cases, attnums for the same key attribute(s)might differ between various levels causing the same attribute to benumbered differently in different instances of the Var correspondingto a given attribute.With this commit, in generate_partition_qual(), we first generate thethe whole partition constraint (considering all levels of partitioning)and then do the mapping, so that Vars in the final expression arenumbered according the leaf relation (to which it is supposed to apply).Amit Langote, reviewed by me.1 parent0c2070c commit0563a3a
File tree
5 files changed
+110
-52
lines changed- src
- backend
- catalog
- commands
- include/catalog
- test/regress
- expected
- sql
5 files changed
+110
-52
lines changedLines changed: 49 additions & 50 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
852 | 852 |
| |
853 | 853 |
| |
854 | 854 |
| |
855 |
| - | |
856 |
| - | |
857 |
| - | |
858 |
| - | |
859 | 855 |
| |
860 | 856 |
| |
861 | 857 |
| |
| |||
876 | 872 |
| |
877 | 873 |
| |
878 | 874 |
| |
879 |
| - | |
880 |
| - | |
881 |
| - | |
882 |
| - | |
883 |
| - | |
884 |
| - | |
885 |
| - | |
886 |
| - | |
887 |
| - | |
888 |
| - | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
889 | 898 |
| |
890 |
| - | |
| 899 | + | |
891 | 900 |
| |
892 |
| - | |
| 901 | + | |
893 | 902 |
| |
894 | 903 |
| |
895 | 904 |
| |
896 | 905 |
| |
897 |
| - | |
898 |
| - | |
| 906 | + | |
| 907 | + | |
899 | 908 |
| |
900 | 909 |
| |
901 |
| - | |
902 |
| - | |
903 |
| - | |
904 |
| - | |
905 |
| - | |
906 |
| - | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
907 | 916 |
| |
908 | 917 |
| |
909 | 918 |
| |
910 |
| - | |
| 919 | + | |
911 | 920 |
| |
912 | 921 |
| |
913 | 922 |
| |
| |||
1496 | 1505 |
| |
1497 | 1506 |
| |
1498 | 1507 |
| |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
1499 | 1512 |
| |
1500 | 1513 |
| |
1501 | 1514 |
| |
1502 | 1515 |
| |
1503 |
| - | |
1504 |
| - | |
1505 |
| - | |
1506 |
| - | |
1507 |
| - | |
1508 |
| - | |
1509 |
| - | |
1510 |
| - | |
1511 |
| - | |
1512 |
| - | |
1513 |
| - | |
1514 |
| - | |
1515 |
| - | |
1516 | 1516 |
| |
1517 |
| - | |
1518 |
| - | |
1519 |
| - | |
1520 | 1517 |
| |
1521 | 1518 |
| |
1522 | 1519 |
| |
| |||
1533 | 1530 |
| |
1534 | 1531 |
| |
1535 | 1532 |
| |
1536 |
| - | |
| 1533 | + | |
1537 | 1534 |
| |
1538 |
| - | |
1539 |
| - | |
1540 |
| - | |
1541 |
| - | |
1542 |
| - | |
1543 |
| - | |
| 1535 | + | |
1544 | 1536 |
| |
1545 | 1537 |
| |
1546 | 1538 |
| |
1547 |
| - | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
1548 | 1547 |
| |
1549 |
| - | |
| 1548 | + | |
1550 | 1549 |
| |
1551 | 1550 |
| |
1552 | 1551 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13429 | 13429 |
| |
13430 | 13430 |
| |
13431 | 13431 |
| |
| 13432 | + | |
13432 | 13433 |
| |
13433 | 13434 |
| |
13434 | 13435 |
| |
| |||
13451 | 13452 |
| |
13452 | 13453 |
| |
13453 | 13454 |
| |
13454 |
| - | |
13455 |
| - | |
| 13455 | + | |
| 13456 | + | |
| 13457 | + | |
| 13458 | + | |
13456 | 13459 |
| |
13457 | 13460 |
| |
13458 | 13461 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
77 | 77 |
| |
78 | 78 |
| |
79 | 79 |
| |
| 80 | + | |
80 | 81 |
| |
81 | 82 |
| |
82 | 83 |
| |
|
Lines changed: 30 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3339 | 3339 |
| |
3340 | 3340 |
| |
3341 | 3341 |
| |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + |
Lines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2191 | 2191 |
| |
2192 | 2192 |
| |
2193 | 2193 |
| |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + |
0 commit comments
Comments
(0)