summaryrefslogtreecommitdiff
path: root/mysql-test/t/null.test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-02-26 12:07:07 +0100
committerSergei Golubchik <serg@mariadb.org>2016-03-05 16:25:29 +0100
commit5a3a79ce5f20a862abdde505a683df1148e0dc37 (patch)
tree97663bc2283b5368d1830ad750ab4b410072cef9 /mysql-test/t/null.test
parentc689e93500589fd653c15166f64d12038594855e (diff)
downloadmariadb-git-5a3a79ce5f20a862abdde505a683df1148e0dc37.tar.gz
MDEV-9637 select nullif(count(col1),0) gives wrong result if in a view
don't do special SUM_FUNC_ITEM treatment in NULLIF for views (as before), but do it for derived tables (when context_analysis_only == CONTEXT_ANALYSIS_ONLY_DERIVED)
Diffstat (limited to 'mysql-test/t/null.test')
-rw-r--r--mysql-test/t/null.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test
index 8857195d0e1..0302ce17bce 100644
--- a/mysql-test/t/null.test
+++ b/mysql-test/t/null.test
@@ -958,6 +958,17 @@ show create view v1;
drop view v1;
drop table t1;
+#
+# MDEV-9637 select nullif(count(col1),0) gives wrong result if in a view
+#
+create table t1 (col1 varchar(50) default null);
+insert into t1 (col1) values ('hello'), ('hello'), ('hello');
+create view v1 as select nullif(count(col1),0) from t1;
+select * from v1;
+select nullif(count(col1),0) from t1;
+drop view v1;
+drop table t1;
+
--echo #
--echo # End of 10.1 tests
--echo #