forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit76a3df6
committed
Code review focused on new node types added by partitioning support.
Fix failure to check that we got a plain Const from const-simplification ofa coercion request. This is the cause of bug #14666 from Tian Bing: thereis an int4 to money cast, but it's only stable not immutable (because ofdependence on lc_monetary), resulting in a FuncExpr that the code wasmiserably unequipped to deal with, or indeed even to notice that it wasfailing to deal with. Add test cases around this coercion behavior.In view of the above, sprinkle the code liberally with castNode() macros,in hope of catching the next such bug a bit sooner. Also, change somefunctions that were randomly declared to take Node* to take more specificpointer types. And change some struct fields that were declared Node*but could be given more specific types, allowing removal of assortedexplicit casts.Place PARTITION_MAX_KEYS check a bit closer to the code it's protecting.Likewise check only-one-key-for-list-partitioning restriction in a lessrandom place.Avoid not-per-project-style usages like !strcmp(...).Fix assorted failures to avoid scribbling on the input of parsetransformation. I'm not sure how necessary this is, but it's entirelysilly for these functions to be expending cycles to avoid that and notgetting it right.Add guards against partitioning on system columns.Put backend/nodes/ support code into an order that matches handlingof these node types elsewhere.Annotate the fact that somebody added location fields to PartitionBoundSpecand PartitionRangeDatum but forgot to handle them inoutfuncs.c/readfuncs.c. This is fairly harmless for production purposes(since readfuncs.c would just substitute -1 anyway) but it's still bogus.It's not worth forcing a post-beta1 initdb just to fix this, but if wehave another reason to force initdb before 10.0, we should go back andclean this up.Contrariwise, somebody added location fields to PartitionElem andPartitionSpec but forgot to teach exprLocation() about them.Consolidate duplicative code in transformPartitionBound().Improve a couple of error messages.Improve assorted commentary.Re-pgindent the files touched by this patch; this affects a few commentblocks that must have been added quite recently.Report:https://postgr.es/m/20170524024550.29935.14396@wrigleys.postgresql.org1 parent54bb322 commit76a3df6
File tree
18 files changed
+361
-270
lines changed- src
- backend
- catalog
- commands
- nodes
- parser
- utils/adt
- include
- catalog
- nodes
- parser
- test/regress
- expected
- sql
18 files changed
+361
-270
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3219 | 3219 |
| |
3220 | 3220 |
| |
3221 | 3221 |
| |
3222 |
| - | |
| 3222 | + | |
3223 | 3223 |
| |
3224 | 3224 |
| |
3225 | 3225 |
| |
|
Lines changed: 34 additions & 30 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
247 | 247 |
| |
248 | 248 |
| |
249 | 249 |
| |
| 250 | + | |
| 251 | + | |
250 | 252 |
| |
251 |
| - | |
252 | 253 |
| |
253 | 254 |
| |
254 | 255 |
| |
255 | 256 |
| |
256 | 257 |
| |
257 | 258 |
| |
258 |
| - | |
| 259 | + | |
259 | 260 |
| |
260 | 261 |
| |
261 | 262 |
| |
| |||
327 | 328 |
| |
328 | 329 |
| |
329 | 330 |
| |
330 |
| - | |
| 331 | + | |
| 332 | + | |
331 | 333 |
| |
332 | 334 |
| |
333 | 335 |
| |
| |||
665 | 667 |
| |
666 | 668 |
| |
667 | 669 |
| |
668 |
| - | |
| 670 | + | |
| 671 | + | |
669 | 672 |
| |
670 |
| - | |
671 | 673 |
| |
672 | 674 |
| |
673 | 675 |
| |
| |||
692 | 694 |
| |
693 | 695 |
| |
694 | 696 |
| |
695 |
| - | |
| 697 | + | |
696 | 698 |
| |
697 | 699 |
| |
698 | 700 |
| |
| |||
889 | 891 |
| |
890 | 892 |
| |
891 | 893 |
| |
892 |
| - | |
| 894 | + | |
| 895 | + | |
893 | 896 |
| |
894 |
| - | |
895 | 897 |
| |
896 | 898 |
| |
897 | 899 |
| |
| |||
1328 | 1330 |
| |
1329 | 1331 |
| |
1330 | 1332 |
| |
1331 |
| - | |
| 1333 | + | |
1332 | 1334 |
| |
1333 | 1335 |
| |
1334 | 1336 |
| |
| |||
1427 | 1429 |
| |
1428 | 1430 |
| |
1429 | 1431 |
| |
1430 |
| - | |
| 1432 | + | |
1431 | 1433 |
| |
1432 | 1434 |
| |
1433 | 1435 |
| |
1434 | 1436 |
| |
1435 |
| - | |
| 1437 | + | |
1436 | 1438 |
| |
1437 | 1439 |
| |
1438 | 1440 |
| |
| |||
1448 | 1450 |
| |
1449 | 1451 |
| |
1450 | 1452 |
| |
1451 |
| - | |
| 1453 | + | |
1452 | 1454 |
| |
1453 | 1455 |
| |
1454 | 1456 |
| |
| |||
1458 | 1460 |
| |
1459 | 1461 |
| |
1460 | 1462 |
| |
1461 |
| - | |
| 1463 | + | |
1462 | 1464 |
| |
1463 | 1465 |
| |
1464 | 1466 |
| |
| |||
1512 | 1514 |
| |
1513 | 1515 |
| |
1514 | 1516 |
| |
1515 |
| - | |
1516 |
| - | |
| 1517 | + | |
| 1518 | + | |
1517 | 1519 |
| |
1518 | 1520 |
| |
1519 | 1521 |
| |
| |||
1565 | 1567 |
| |
1566 | 1568 |
| |
1567 | 1569 |
| |
1568 |
| - | |
1569 |
| - | |
| 1570 | + | |
| 1571 | + | |
1570 | 1572 |
| |
1571 | 1573 |
| |
1572 | 1574 |
| |
| |||
1644 | 1646 |
| |
1645 | 1647 |
| |
1646 | 1648 |
| |
1647 |
| - | |
| 1649 | + | |
1648 | 1650 |
| |
1649 |
| - | |
1650 |
| - | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
1651 | 1654 |
| |
1652 |
| - | |
| 1655 | + | |
| 1656 | + | |
1653 | 1657 |
| |
1654 | 1658 |
| |
1655 | 1659 |
| |
| |||
1779 | 1783 |
| |
1780 | 1784 |
| |
1781 | 1785 |
| |
1782 |
| - | |
| 1786 | + | |
1783 | 1787 |
| |
1784 | 1788 |
| |
1785 | 1789 |
| |
| |||
1807 | 1811 |
| |
1808 | 1812 |
| |
1809 | 1813 |
| |
1810 |
| - | |
| 1814 | + | |
| 1815 | + | |
1811 | 1816 |
| |
1812 | 1817 |
| |
1813 | 1818 |
| |
| |||
1971 | 1976 |
| |
1972 | 1977 |
| |
1973 | 1978 |
| |
1974 |
| - | |
1975 |
| - | |
1976 |
| - | |
| 1979 | + | |
| 1980 | + | |
1977 | 1981 |
| |
1978 | 1982 |
| |
1979 | 1983 |
| |
| |||
2080 | 2084 |
| |
2081 | 2085 |
| |
2082 | 2086 |
| |
2083 |
| - | |
| 2087 | + | |
2084 | 2088 |
| |
2085 | 2089 |
| |
2086 | 2090 |
| |
| |||
2091 | 2095 |
| |
2092 | 2096 |
| |
2093 | 2097 |
| |
2094 |
| - | |
| 2098 | + | |
2095 | 2099 |
| |
2096 |
| - | |
| 2100 | + | |
2097 | 2101 |
| |
2098 | 2102 |
| |
2099 | 2103 |
| |
| |||
2103 | 2107 |
| |
2104 | 2108 |
| |
2105 | 2109 |
| |
2106 |
| - | |
| 2110 | + | |
2107 | 2111 |
| |
2108 | 2112 |
| |
2109 | 2113 |
| |
|
0 commit comments
Comments
(0)