forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1e2f96f
committed
Fix assorted fallout from IS [NOT] NULL patch.
Commits4452000 et al established semantics for NullTest.argisrow thatare a bit different from its initial conception: rather than being merelya cache of whether we've determined the input to have composite type,the flag now has the further meaning that we should apply field-by-fieldtesting as per the standard's definition of IS [NOT] NULL. If argisrowis false and yet the input has composite type, the construct instead hasthe semantics of IS [NOT] DISTINCT FROM NULL. Update the comments inprimnodes.h to clarify this, and fix ruleutils.c and deparse.c to printsuch cases correctly. In the case of ruleutils.c, this merely results incosmetic changes in EXPLAIN output, since the case can't currently arisein stored rules. However, it represents a live bug for deparse.c, whichwould formerly have sent a remote query that had semantics differentfrom the local behavior. (From the user's standpoint, this means thattesting a remote nested-composite column for null-ness could have hadunexpected recursive behavior much like that fixed in4452000.)In a related but somewhat independent fix, make plancat.c set argisrowto false in all NullTest expressions constructed to represent "attnotnull"constructs. Since attnotnull is actually enforced as a simple null-valuecheck, this is a more accurate representation of the semantics; we werepreviously overpromising what it meant for composite columns, which mightpossibly lead to incorrect planner optimizations. (It seems that what theSQL spec expects a NOT NULL constraint to mean is an IS NOT NULL test, soarguably we are violating the spec and should fix attnotnull to do theother thing. If we ever do, this part should get reverted.)Back-patch, same as the previous commit.Discussion: <10682.1469566308@sss.pgh.pa.us>1 parent884aec4 commit1e2f96f
File tree
5 files changed
+77
-20
lines changed- contrib/postgres_fdw
- src
- backend
- optimizer/util
- utils/adt
- include/nodes
- test/regress/expected
5 files changed
+77
-20
lines changedLines changed: 20 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1806 | 1806 |
| |
1807 | 1807 |
| |
1808 | 1808 |
| |
1809 |
| - | |
1810 |
| - | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
1811 | 1823 |
| |
1812 |
| - | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
1813 | 1830 |
| |
1814 | 1831 |
| |
1815 | 1832 |
| |
|
Lines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1090 | 1090 |
| |
1091 | 1091 |
| |
1092 | 1092 |
| |
1093 |
| - | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
1094 | 1100 |
| |
1095 | 1101 |
| |
1096 | 1102 |
| |
|
Lines changed: 36 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7890 | 7890 |
| |
7891 | 7891 |
| |
7892 | 7892 |
| |
7893 |
| - | |
| 7893 | + | |
| 7894 | + | |
| 7895 | + | |
| 7896 | + | |
| 7897 | + | |
| 7898 | + | |
| 7899 | + | |
| 7900 | + | |
| 7901 | + | |
7894 | 7902 |
| |
7895 |
| - | |
7896 |
| - | |
7897 |
| - | |
7898 |
| - | |
7899 |
| - | |
7900 |
| - | |
7901 |
| - | |
7902 |
| - | |
7903 |
| - | |
| 7903 | + | |
| 7904 | + | |
| 7905 | + | |
| 7906 | + | |
| 7907 | + | |
| 7908 | + | |
| 7909 | + | |
| 7910 | + | |
| 7911 | + | |
| 7912 | + | |
| 7913 | + | |
| 7914 | + | |
| 7915 | + | |
| 7916 | + | |
| 7917 | + | |
| 7918 | + | |
| 7919 | + | |
| 7920 | + | |
| 7921 | + | |
| 7922 | + | |
| 7923 | + | |
| 7924 | + | |
| 7925 | + | |
| 7926 | + | |
| 7927 | + | |
| 7928 | + | |
| 7929 | + | |
7904 | 7930 |
| |
7905 | 7931 |
| |
7906 | 7932 |
| |
|
Lines changed: 11 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1076 | 1076 |
| |
1077 | 1077 |
| |
1078 | 1078 |
| |
1079 |
| - | |
1080 |
| - | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
1081 | 1089 |
| |
1082 | 1090 |
| |
1083 | 1091 |
| |
| |||
1091 | 1099 |
| |
1092 | 1100 |
| |
1093 | 1101 |
| |
1094 |
| - | |
| 1102 | + | |
1095 | 1103 |
| |
1096 | 1104 |
| |
1097 | 1105 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
664 | 664 |
| |
665 | 665 |
| |
666 | 666 |
| |
667 |
| - | |
668 |
| - | |
| 667 | + | |
| 668 | + | |
669 | 669 |
| |
670 |
| - | |
| 670 | + | |
671 | 671 |
| |
672 | 672 |
| |
673 | 673 |
| |
|
0 commit comments
Comments
(0)