diff options
author | unknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru> | 2007-11-21 20:53:44 +0400 |
---|---|---|
committer | unknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru> | 2007-11-21 20:53:44 +0400 |
commit | 0c2dac2a8bfc41e09b127d7f011dcdd4a22a5b88 (patch) | |
tree | e8504eef52e4d63af3cfb1187125bdccc93653b8 /sql/item_func.h | |
parent | 3f43b07b4ae78728c9bc6e608eb66ba2c35ce9a8 (diff) | |
download | mariadb-git-0c2dac2a8bfc41e09b127d7f011dcdd4a22a5b88.tar.gz |
Fix for bug #32558: group by null-returning expression with rollup causes crash
Problem: setting Item_func_rollup_const::null_value property to argument's null_value
before (without) the argument evaluation may result in a crash due to wrong null_value.
Fix: use is_null() to set Item_func_rollup_const::null_value instead as it evaluates
the argument if necessary and returns a proper value.
mysql-test/r/olap.result:
Fix for bug #32558: group by null-returning expression with rollup causes crash
- test result.
mysql-test/t/olap.test:
Fix for bug #32558: group by null-returning expression with rollup causes crash
- test case.
sql/item_func.h:
Fix for bug #32558: group by null-returning expression with rollup causes crash
- use args[0]->is_null() to obtain Item_func_rollup_const::null_value
instead of args[0]->null_value as it's not set in advance in case of
constant functions.
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index a31294c0395..a5e162f344f 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -782,7 +782,7 @@ public: max_length= args[0]->max_length; decimals=args[0]->decimals; /* The item could be a NULL constant. */ - null_value= args[0]->null_value; + null_value= args[0]->is_null(); } }; |