Commit 7683d57
Bug#36593235: MySQL server 8.3.0 crashes at
Item_rollup_sum_switcher::current_arg
Backport to 5.7.49.
Problem is seen when a subquery containing a aggregate
function with rollup is part of a row value comparator
and if there were no rows returned from the subquery.
cmp_item_row::store_value() evaluates the subquery and
goes ahead to store the values of the expressions in
the comparator without checking if the result was assigned
for the subquery. This leads to evaluation of a rollup
expression when it is marked as not to be evaluated as
aggregation was completed earlier. For the failing
query, AggregateIterator() does evaluate the expressions.
However HAVING clause does not qualify the rows. So the
result of the aggregation is never cached.
If a subquery returns empty result, bring_value()
would set the "null_value" to true.
cmp_item_row::store_value() now stores the value of
the underlying comparator objects only when the
result is not null. Else the result is set
to null.
Change-Id: I7bb17e621f1e5b439f6284c279ce69b80dace2371 parent c865736 commit 7683d57
2 files changed
+37
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
4929 | 4929 | | |
4930 | 4930 | | |
4931 | 4931 | | |
4932 | | - | |
4933 | 4932 | | |
4934 | | - | |
| 4933 | + | |
| 4934 | + | |
4935 | 4935 | | |
4936 | | - | |
4937 | | - | |
| 4936 | + | |
| 4937 | + | |
| 4938 | + | |
| 4939 | + | |
| 4940 | + | |
| 4941 | + | |
| 4942 | + | |
| 4943 | + | |
| 4944 | + | |
| 4945 | + | |
4938 | 4946 | | |
4939 | 4947 | | |
4940 | 4948 | | |
| |||
4952 | 4960 | | |
4953 | 4961 | | |
4954 | 4962 | | |
4955 | | - | |
4956 | 4963 | | |
4957 | | - | |
| 4964 | + | |
| 4965 | + | |
4958 | 4966 | | |
4959 | | - | |
4960 | | - | |
4961 | | - | |
4962 | | - | |
4963 | | - | |
| 4967 | + | |
| 4968 | + | |
| 4969 | + | |
| 4970 | + | |
| 4971 | + | |
| 4972 | + | |
| 4973 | + | |
| 4974 | + | |
| 4975 | + | |
| 4976 | + | |
| 4977 | + | |
| 4978 | + | |
| 4979 | + | |
4964 | 4980 | | |
4965 | 4981 | | |
4966 | 4982 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
1419 | 1419 | | |
1420 | 1420 | | |
1421 | 1421 | | |
| 1422 | + | |
1422 | 1423 | | |
1423 | 1424 | | |
1424 | 1425 | | |
| |||
1768 | 1769 | | |
1769 | 1770 | | |
1770 | 1771 | | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
1771 | 1779 | | |
1772 | 1780 | | |
1773 | 1781 | | |
| |||
0 commit comments