summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_if.test
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2015-09-03 18:00:43 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2015-09-04 15:56:58 +0200
commit102a85f9f30cdf8c3baa3893c68932617240bfa6 (patch)
treeed606863e8c698f8039ebc6f19fa6a4b53eaabb9 /mysql-test/t/func_if.test
parentfa51f70dc68fe2f3afe943e2c81fcbdb34f16cad (diff)
downloadmariadb-git-102a85f9f30cdf8c3baa3893c68932617240bfa6.tar.gz
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.
Diffstat (limited to 'mysql-test/t/func_if.test')
-rw-r--r--mysql-test/t/func_if.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test
index 2b89a618aa6..8fdba77db9b 100644
--- a/mysql-test/t/func_if.test
+++ b/mysql-test/t/func_if.test
@@ -206,6 +206,20 @@ SELECT if(1, NULL, (SELECT min('hello')));
--echo End of 5.2 tests
+--echo #
+--echo # MDEV-8663: IF Statement returns multiple values erroneously
+--echo # (or Assertion `!null_value' failed in Item::send(Protocol*, String*)
+--echo #
+CREATE TABLE `t1` (
+`datas` VARCHAR(25) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+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`;
+
+drop table t1;
+
--disable_query_log
# Restore timezone to default
set time_zone= @@global.time_zone;