summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <igor@olga.mysql.com>2007-03-22 00:05:36 -0700
committerunknown <igor@olga.mysql.com>2007-03-22 00:05:36 -0700
commit3e950bbaab951dda753a0731e41fff7f90e1c52f (patch)
tree83387eaca0f378205dc55a088f16b88e348c5b41 /mysql-test
parentaca0c2277df2a53a707ea3ab2ff8dc578ad75000 (diff)
downloadmariadb-git-3e950bbaab951dda753a0731e41fff7f90e1c52f.tar.gz
Fixed bug #27362: crash at evaluation of IN predicate when one
of its argument happened to be a decimal expression returning the NULL value. The crash was due to the fact the function in_decimal::set did not take into account that val_decimal() could return 0 if the decimal expression had been evaluated to NULL. mysql-test/r/func_in.result: Added a test case for bug #27362. mysql-test/t/func_in.test: Added a test case for bug #27362.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/func_in.result5
-rw-r--r--mysql-test/t/func_in.test11
2 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result
index fad9a7157e1..87855091699 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -470,4 +470,9 @@ a
Warnings:
Warning 1292 Incorrect date value: '19772-07-29' for column 'a' at row 1
DROP TABLE t1,t2,t3,t4;
+CREATE TABLE t1 (id int not null);
+INSERT INTO t1 VALUES (1),(2);
+SELECT id FROM t1 WHERE id IN(4564, (SELECT IF(1=0,1,1/0)) );
+id
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test
index f9749662ec1..77592d015eb 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -360,4 +360,15 @@ SELECT * FROM t4 WHERE a IN ('1972-02-06','19772-07-29');
DROP TABLE t1,t2,t3,t4;
+#
+# BUG#27362: IN with a decimal expression that may return NULL
+#
+
+CREATE TABLE t1 (id int not null);
+INSERT INTO t1 VALUES (1),(2);
+
+SELECT id FROM t1 WHERE id IN(4564, (SELECT IF(1=0,1,1/0)) );
+
+DROP TABLE t1;
+
--echo End of 5.0 tests