1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-8663: IF Statement returns multiple values erroneously (or Assertion `!null_value' failed in Item::send(Protocol*, String*))

Postreview addons by Bar

Fix: keeping contract: NULL value mean NULL pointer in val_str and val_deciman.
This commit is contained in:
Oleksandr Byelkin
2015-09-03 18:00:43 +02:00
parent fa51f70dc6
commit 102a85f9f3
5 changed files with 82 additions and 31 deletions

View File

@ -234,3 +234,20 @@ SELECT if(1, NULL, (SELECT min('hello')));
if(1, NULL, (SELECT min('hello')))
NULL
End of 5.2 tests
#
# MDEV-8663: IF Statement returns multiple values erroneously
# (or Assertion `!null_value' failed in Item::send(Protocol*, String*)
#
CREATE TABLE `t1` (
`datas` VARCHAR(25) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Warnings:
Warning 1286 Unknown storage engine 'InnoDB'
Warning 1266 Using storage engine MyISAM for table 't1'
INSERT INTO `t1` VALUES ('1,2'), ('2,3'), ('3,4');
SELECT IF(FIND_IN_SET('1', `datas`), 1.5, IF(FIND_IN_SET('2', `datas`), 2, NULL)) AS `First`, '1' AS `Second`, '2' AS `Third` FROM `t1`;
First Second Third
1.5 1 2
2.0 1 2
NULL 1 2
drop table t1;