mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
fix for bug #12841
(Server crash on DO IFNULL(NULL,NULL) (fixes also "SELECT CAST(IFNULL(NULL,NULL) as DECIMAL)" unreported crash) (new revampled fix with suggestions from Igor) mysql-test/r/select.result: result of test for bug 12841 mysql-test/t/select.test: test for bug #12841 (Server crash on DO IFNULL(NULL,NULL) sql/item_func.cc: don't use the return value of ::str_op() without checking it whether checking it for NULL. (fixes bug #12841 as well as another not reported bug, but existing one - test case added). All other places where ::str_op() is used are safe.
This commit is contained in:
@ -2875,6 +2875,16 @@ b a t1_val t2_val
|
||||
1 1 1 1
|
||||
1 2 2 1
|
||||
drop table t1, t2, t3;
|
||||
DO IFNULL(NULL, NULL);
|
||||
SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL);
|
||||
CAST(IFNULL(NULL, NULL) AS DECIMAL)
|
||||
NULL
|
||||
SELECT ABS(IFNULL(NULL, NULL));
|
||||
ABS(IFNULL(NULL, NULL))
|
||||
NULL
|
||||
SELECT IFNULL(NULL, NULL);
|
||||
IFNULL(NULL, NULL)
|
||||
NULL
|
||||
create table t1 (a char(1));
|
||||
create table t2 (a char(1));
|
||||
insert into t1 values ('a'),('b'),('c');
|
||||
|
@ -2445,6 +2445,15 @@ select * from t1 natural join t3 natural join t2;
|
||||
drop table t1, t2, t3;
|
||||
|
||||
|
||||
#
|
||||
# Bug #12841: Server crash on DO IFNULL(NULL,NULL)
|
||||
#
|
||||
# (testing returning of int, decimal, real, string)
|
||||
DO IFNULL(NULL, NULL);
|
||||
SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL);
|
||||
SELECT ABS(IFNULL(NULL, NULL));
|
||||
SELECT IFNULL(NULL, NULL);
|
||||
|
||||
#
|
||||
# Bug #6495 Illogical requirement for column qualification in NATURAL join
|
||||
#
|
||||
|
Reference in New Issue
Block a user