From fa13c29b2e36d33fdda46777390aca6df2b0faeb Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 10 Sep 2005 02:30:26 +0400 Subject: [PATCH 1/2] insert_select.result, insert_select.test: Customer's test case for bug#12695 Item_func_isnull::update_used_tables() did not update const_item_cache. mysql-test/t/insert_select.test: Customer's test case for bug#12695 Item_func_isnull::update_used_tables() did not update const_item_cache. mysql-test/r/insert_select.result: Customer's test case for bug#12695 Item_func_isnull::update_used_tables() did not update const_item_cache. --- mysql-test/r/insert_select.result | 10 ++++++++++ mysql-test/t/insert_select.test | 10 ++++++++++ 2 files changed, 20 insertions(+) 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 From e6560c0da090d4355b761c07ae500aacd7f6b0db Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 11 Sep 2005 00:57:31 +0200 Subject: [PATCH 2/2] Removed redundant reset_one_shot_variables calls sql/sql_parse.cc: Optimization, this reset is executed below anyway --- sql/sql_parse.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 76d4c5c27dc..131fe3d691d 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3327,7 +3327,6 @@ purposes internal to the MySQL server", MYF(0)); !db_ok_with_wild_table(lex->name))) { my_error(ER_SLAVE_IGNORED_TABLE, MYF(0)); - reset_one_shot_variables(thd); break; } #endif @@ -3363,7 +3362,6 @@ purposes internal to the MySQL server", MYF(0)); !db_ok_with_wild_table(lex->name))) { my_error(ER_SLAVE_IGNORED_TABLE, MYF(0)); - reset_one_shot_variables(thd); break; } #endif @@ -3404,7 +3402,6 @@ purposes internal to the MySQL server", MYF(0)); !db_ok_with_wild_table(db))) { my_error(ER_SLAVE_IGNORED_TABLE, MYF(0)); - reset_one_shot_variables(thd); break; } #endif