forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite33ae53
committed
Fix handling of bare boolean expressions in mcv_get_match_bitmap.
Since v14, the extended stats machinery will try to estimate forotherwise-unsupported boolean expressions if they match an expressionavailable from an extended stats object. mcv.c did not get the memoabout this, and would spit up with "unknown clause type". Fortunatelythe case is easy to handle, since we can expect the expression yieldsboolean.While here, replace some not-terribly-on-point assertions withsimpler runtime tests for lookup failure. That seems appropriateso that we get an elog not a crash if we somehow get to the newit-should-be-a-bool-expression code with a subexpression thatdoesn't match any stats column.Per report from Danny Shemesh. Thanks to Justin Pryzby forpreliminary investigation.Discussion:https://postgr.es/m/CAFZC=QqD6=27wQPOW1pbRa98KPyuyn+7cL_Ay_Ck-roZV84vHg@mail.gmail.com1 parent94da732 commite33ae53
File tree
3 files changed
+60
-27
lines changed- src
- backend/statistics
- test/regress
- expected
- sql
3 files changed
+60
-27
lines changedLines changed: 34 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1532 | 1532 |
| |
1533 | 1533 |
| |
1534 | 1534 |
| |
1535 |
| - | |
1536 |
| - | |
| 1535 | + | |
| 1536 | + | |
1537 | 1537 |
| |
1538 | 1538 |
| |
1539 | 1539 |
| |
1540 | 1540 |
| |
1541 |
| - | |
| 1541 | + | |
1542 | 1542 |
| |
1543 | 1543 |
| |
1544 | 1544 |
| |
| |||
1550 | 1550 |
| |
1551 | 1551 |
| |
1552 | 1552 |
| |
1553 |
| - | |
1554 |
| - | |
| 1553 | + | |
| 1554 | + | |
1555 | 1555 |
| |
1556 | 1556 |
| |
1557 | 1557 |
| |
| 1558 | + | |
1558 | 1559 |
| |
1559 | 1560 |
| |
1560 |
| - | |
1561 |
| - | |
1562 |
| - | |
1563 | 1561 |
| |
1564 | 1562 |
| |
1565 | 1563 |
| |
1566 |
| - | |
| 1564 | + | |
| 1565 | + | |
1567 | 1566 |
| |
1568 | 1567 |
| |
1569 | 1568 |
| |
| |||
1574 | 1573 |
| |
1575 | 1574 |
| |
1576 | 1575 |
| |
1577 |
| - | |
1578 |
| - | |
1579 |
| - | |
| 1576 | + | |
| 1577 | + | |
1580 | 1578 |
| |
1581 | 1579 |
| |
1582 |
| - | |
1583 |
| - | |
1584 | 1580 |
| |
1585 | 1581 |
| |
1586 | 1582 |
| |
| |||
1659 | 1655 |
| |
1660 | 1656 |
| |
1661 | 1657 |
| |
1662 |
| - | |
1663 |
| - | |
1664 | 1658 |
| |
1665 | 1659 |
| |
1666 | 1660 |
| |
| |||
1944 | 1938 |
| |
1945 | 1939 |
| |
1946 | 1940 |
| |
1947 |
| - | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
1948 | 1965 |
| |
1949 | 1966 |
| |
1950 | 1967 |
| |
|
Lines changed: 14 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
271 | 271 |
| |
272 | 272 |
| |
273 | 273 |
| |
| 274 | + | |
| 275 | + | |
| 276 | + | |
274 | 277 |
| |
275 | 278 |
| |
276 |
| - | |
277 |
| - | |
278 |
| - | |
279 |
| - | |
280 |
| - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
281 | 283 |
| |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
282 | 291 |
| |
283 | 292 |
| |
284 | 293 |
| |
|
Lines changed: 12 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
165 | 165 |
| |
166 | 166 |
| |
167 | 167 |
| |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
168 | 172 |
| |
169 | 173 |
| |
170 |
| - | |
171 |
| - | |
172 |
| - | |
173 |
| - | |
174 |
| - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
175 | 178 |
| |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
176 | 183 |
| |
177 | 184 |
| |
178 | 185 |
| |
|
0 commit comments
Comments
(0)