diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2021-02-26 20:38:20 +0530 |
---|---|---|
committer | Varun Gupta <varun.gupta@mariadb.com> | 2021-03-12 10:13:05 +0530 |
commit | 390de205ccbc0dc9b3e0dc81ad36d6686c3c06a5 (patch) | |
tree | 382940170b56b413e33ca363ab676ff302a10162 /sql/item_cmpfunc.cc | |
parent | 1f3f90318f6431551472d239ee01cec5f80074d9 (diff) | |
download | mariadb-git-390de205ccbc0dc9b3e0dc81ad36d6686c3c06a5.tar.gz |
MDEV-24519: Server crashes in Charset::set_charset upon SELECT
The query causing the issue here has implicit grouping for we
have to produce one row with special values for the aggregates
(depending on each aggregate function), and NULL values for all
non-aggregate fields.
The subselect item where implicit grouping was being done,
null_value for the subselect item was not being set for
the case when the implicit grouping produces NULL values
for the items in the select list of the subquery.
This which was leading to the crash.
The fix would be to set the null_value when all the values
for the row column have NULL values.
Further changes are
1) etting null_value for Item_singlerow_subselect only
after val_* functions have been called.
2) Introduced a parameter null_value_inside to Item_cache that
would store be set to TRUE if any of the arguments of the
Item_cache are null.
Reviewed And co-authored by Monty
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index d5b89f13f04..7b7604053e3 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1598,7 +1598,7 @@ longlong Item_in_optimizer::val_int() DBUG_RETURN(res); } - if (cache->null_value) + if (cache->null_value_inside) { DBUG_PRINT("info", ("Left NULL...")); /* |