summaryrefslogtreecommitdiff
path: root/mysql-test/t/null.test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-03-03 18:44:10 +0100
committerSergei Golubchik <serg@mariadb.org>2016-03-05 16:25:29 +0100
commitff93b77fd62bdb708e2b2b34f4e2202c12e727c4 (patch)
tree47b0e1bac37b65480da19faabd2fb85e3a947a58 /mysql-test/t/null.test
parent5a3a79ce5f20a862abdde505a683df1148e0dc37 (diff)
downloadmariadb-git-ff93b77fd62bdb708e2b2b34f4e2202c12e727c4.tar.gz
MDEV-9641 MDEV-9644 NULLIF assertions
* only copy args[0] to args[2] after fix_fields (when all item substitutions have already happened) * change QT_ITEM_FUNC_NULLIF_TO_CASE (that allows to print NULLIF as CASE) to QT_ITEM_ORIGINAL_FUNC_NULLIF (that prohibits it). So that NULLIF-to-CASE is allowed by default and only disabled explicitly for SHOW VIEW|FUNCTION|PROCEDURE and mysql_make_view. By default it is allowed (in particular in error messages and debug output, that can happen anytime before or after optimizer).
Diffstat (limited to 'mysql-test/t/null.test')
-rw-r--r--mysql-test/t/null.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test
index 0302ce17bce..85c7131c33b 100644
--- a/mysql-test/t/null.test
+++ b/mysql-test/t/null.test
@@ -969,6 +969,25 @@ select nullif(count(col1),0) from t1;
drop view v1;
drop table t1;
+#
+# MDEV-9644 Assertion `args[0] == args[2] || thd->stmt_arena->is_stmt_execute()' failed in Item_func_nullif::fix_length_and_dec()
+#
+select nullif((select 1), (select 2));
+create table t1 (f int);
+insert into t1 values (1),(2);
+select nullif( not f, 1 ) from t1;
+drop table t1;
+
+#
+# MDEV-9641 Assertion `args[0] == args[2] || _current_thd()->lex->context_analysis_only' failed in Item_func_nullif::print(String*, enum_query_type)
+#
+set names utf8;
+create table t1 (f1 varchar(10));
+insert into t1 values ('2015-12-31');
+--error ER_DATA_OUT_OF_RANGE
+select power( timestamp( nullif( '2002-09-08', f1 ) ), 24 ) from t1;
+drop table t1;
+
--echo #
--echo # End of 10.1 tests
--echo #