summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <jani@a193-229-222-105.elisa-laajakaista.fi>2005-09-10 18:41:37 +0300
committerunknown <jani@a193-229-222-105.elisa-laajakaista.fi>2005-09-10 18:41:37 +0300
commit53043f535a1d279d9668cd31e392553caf624d8f (patch)
tree5a2530a8512732934c3fee8004c462259181b62a /mysql-test
parentc1a3b5be0a9a6213edb04f3802850396f291e5f3 (diff)
parent8c129f5012324f385bb892c9045403dd25f4df39 (diff)
downloadmariadb-git-53043f535a1d279d9668cd31e392553caf624d8f.tar.gz
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-4.1
into a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-4.1
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/insert_select.result10
-rw-r--r--mysql-test/t/insert_select.test10
2 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index 2ac73fe7662..d4eb4e8b788 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -668,3 +668,13 @@ ERROR 42S02: Unknown table 't2' in field list
insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b;
ERROR 42S02: Unknown table 't2' in field list
drop table t1,t2,t3;
+create table t1(f1 varchar(5) key);
+insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
+insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
+insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
+select * from t1;
+f1
+2000
+2001
+2002
+drop table t1;
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test
index 14853b38db2..6fcdef6ab03 100644
--- a/mysql-test/t/insert_select.test
+++ b/mysql-test/t/insert_select.test
@@ -204,4 +204,14 @@ insert into t1 select t2.a from t2 on duplicate key update t2.a= a + t2.b;
insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b;
drop table t1,t2,t3;
+#
+# Bug #12695 Item_func_isnull::update_used_tables() did not update
+# const_item_cache
+create table t1(f1 varchar(5) key);
+insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
+insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
+insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
+select * from t1;
+drop table t1;
+
# End of 4.1 tests