forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit94da732
committed
Fix non-bulletproof ScalarArrayOpExpr code for extended statistics.
statext_is_compatible_clause_internal() checked that the argumentsof a ScalarArrayOpExpr are one Var and one Const, but it would allowcases where the Const was on the left. Subsequent uses of the clauseare not expecting that and would suffer assertion failures or coredumps. mcv.c also had not bothered to cope with the case of a NULLarray constant, which seems really unacceptably sloppy of somebody.(Although our tools failed us there too, since AFAIK neither Coveritynor any compiler warned of the obvious use-of-uninitialized-variablecondition.) It seems best to handle that by havingstatext_is_compatible_clause_internal() reject it.Noted while fixing bug #17570. Back-patch to v13 where theextended stats code grew some awareness of ScalarArrayOpExpr.1 parentd7714c1 commit94da732
File tree
4 files changed
+47
-24
lines changed- src
- backend/statistics
- test/regress
- expected
- sql
4 files changed
+47
-24
lines changedLines changed: 9 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1331 | 1331 |
| |
1332 | 1332 |
| |
1333 | 1333 |
| |
1334 |
| - | |
1335 |
| - | |
| 1334 | + | |
| 1335 | + | |
1336 | 1336 |
| |
1337 | 1337 |
| |
1338 | 1338 |
| |
| |||
1452 | 1452 |
| |
1453 | 1453 |
| |
1454 | 1454 |
| |
| 1455 | + | |
| 1456 | + | |
1455 | 1457 |
| |
1456 | 1458 |
| |
1457 | 1459 |
| |
1458 | 1460 |
| |
1459 | 1461 |
| |
1460 | 1462 |
| |
1461 |
| - | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
1462 | 1468 |
| |
1463 | 1469 |
| |
1464 | 1470 |
| |
|
Lines changed: 10 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1746 | 1746 |
| |
1747 | 1747 |
| |
1748 | 1748 |
| |
1749 |
| - | |
1750 |
| - | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
1751 | 1752 |
| |
1752 |
| - | |
1753 |
| - | |
1754 |
| - | |
1755 |
| - | |
1756 |
| - | |
1757 |
| - | |
1758 |
| - | |
1759 |
| - | |
1760 |
| - | |
1761 |
| - | |
1762 |
| - | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
1763 | 1760 |
| |
1764 | 1761 |
| |
1765 | 1762 |
| |
|
Lines changed: 18 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1837 | 1837 |
| |
1838 | 1838 |
| |
1839 | 1839 |
| |
1840 |
| - | |
| 1840 | + | |
| 1841 | + | |
1841 | 1842 |
| |
1842 | 1843 |
| |
1843 | 1844 |
| |
| |||
1907 | 1908 |
| |
1908 | 1909 |
| |
1909 | 1910 |
| |
1910 |
| - | |
1911 |
| - | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
1912 | 1914 |
| |
1913 | 1915 |
| |
1914 | 1916 |
| |
| |||
2048 | 2050 |
| |
2049 | 2051 |
| |
2050 | 2052 |
| |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
2051 | 2059 |
| |
2052 |
| - | |
| 2060 | + | |
2053 | 2061 |
| |
2054 | 2062 |
| |
2055 | 2063 |
| |
| |||
2195 | 2203 |
| |
2196 | 2204 |
| |
2197 | 2205 |
| |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
2198 | 2212 |
| |
2199 | 2213 |
| |
2200 | 2214 |
| |
|
Lines changed: 10 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
909 | 909 |
| |
910 | 910 |
| |
911 | 911 |
| |
912 |
| - | |
| 912 | + | |
| 913 | + | |
913 | 914 |
| |
914 | 915 |
| |
915 | 916 |
| |
| |||
958 | 959 |
| |
959 | 960 |
| |
960 | 961 |
| |
961 |
| - | |
962 |
| - | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
963 | 965 |
| |
964 | 966 |
| |
965 | 967 |
| |
| |||
1009 | 1011 |
| |
1010 | 1012 |
| |
1011 | 1013 |
| |
| 1014 | + | |
| 1015 | + | |
1012 | 1016 |
| |
1013 |
| - | |
| 1017 | + | |
1014 | 1018 |
| |
1015 | 1019 |
| |
1016 | 1020 |
| |
| |||
1062 | 1066 |
| |
1063 | 1067 |
| |
1064 | 1068 |
| |
| 1069 | + | |
| 1070 | + | |
1065 | 1071 |
| |
1066 | 1072 |
| |
1067 | 1073 |
| |
|
0 commit comments
Comments
(0)