From 386ceb4916dac1585f6ac304e47f73ce3594dee2 Mon Sep 17 00:00:00 2001 From: Matthias Leich Date: Tue, 28 Apr 2009 20:12:18 +0200 Subject: [PATCH] Fix for Bug#43546 Several 5.0 tests do not pass MTR's --check option (moved from Bug 42308) Details: - insert_update Add DROP TABLE which was missing, error numbers -> names - varbinary Add DROP TABLE which was missing - sp_trans_log Add missing DROP function, improved formatting --- mysql-test/r/insert_update.result | 1 + mysql-test/r/sp_trans_log.result | 5 ++++- mysql-test/r/varbinary.result | 1 + mysql-test/t/insert_update.test | 19 ++++++++++--------- mysql-test/t/sp_trans_log.test | 19 ++++++++++++++----- mysql-test/t/varbinary.test | 1 + 6 files changed, 31 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index 20cde86101e..b648531b455 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -393,6 +393,7 @@ id c1 cnt 1 0 3 2 2 1 DROP TABLE t1; +DROP TABLE t2; create table t1(f1 int primary key, f2 timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP); insert into t1(f1) values(1); diff --git a/mysql-test/r/sp_trans_log.result b/mysql-test/r/sp_trans_log.result index eb0770cb0a1..cce5a28fa2e 100644 --- a/mysql-test/r/sp_trans_log.result +++ b/mysql-test/r/sp_trans_log.result @@ -1,3 +1,5 @@ +drop function if exists bug23333| +drop table if exists t1,t2| CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM| CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB| insert into t2 values (1,1)| @@ -20,4 +22,5 @@ master-bin.000001 # Query 1 # # select count(*),@a from t1 /* must be 1,1 */| count(*) @a 1 1 -drop table t1, t2| +drop table t1,t2; +drop function if exists bug23333; diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result index f584c22f98a..01af6979ca3 100644 --- a/mysql-test/r/varbinary.result +++ b/mysql-test/r/varbinary.result @@ -78,6 +78,7 @@ alter table t1 modify a varchar(255); select length(a) from t1; length(a) 6 +drop table t1; select 0b01000001; 0b01000001 A diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index 67108744ec6..de38ae0b0d3 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -12,7 +12,7 @@ INSERT t1 VALUES (8,4,50) ON DUPLICATE KEY UPDATE c=c+1000; SELECT * FROM t1; INSERT t1 VALUES (1,4,60) ON DUPLICATE KEY UPDATE c=c+10000; SELECT * FROM t1; --- error 1062 +-- error ER_DUP_ENTRY INSERT t1 VALUES (1,9,70) ON DUPLICATE KEY UPDATE c=c+100000, b=4; SELECT * FROM t1; TRUNCATE TABLE t1; @@ -63,7 +63,7 @@ INSERT t1 SELECT 8,4,50 FROM DUAL ON DUPLICATE KEY UPDATE c=c+1000; SELECT * FROM t1; INSERT t1 SELECT 1,4,60 FROM DUAL ON DUPLICATE KEY UPDATE c=c+10000; SELECT * FROM t1; --- error 1062 +-- error ER_DUP_ENTRY INSERT t1 SELECT 1,9,70 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100000, b=4; SELECT * FROM t1; TRUNCATE TABLE t1; @@ -76,7 +76,7 @@ INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=t1.c+100; SELECT * FROM t1; INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0; SELECT * FROM t1; ---error 1052 +--error ER_NON_UNIQ_ERROR INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a); INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=t1.c+VALUES(t1.a); SELECT *, VALUES(a) FROM t1; @@ -95,9 +95,9 @@ insert ignore into t1 select a from t1 as t2 on duplicate key update a=t1.a+1 ; select * from t1; insert into t1 select 1 on duplicate key update a=2; select * from t1; ---error 1052 +--error ER_NON_UNIQ_ERROR insert into t1 select a from t1 on duplicate key update a=a+1 ; ---error 1052 +--error ER_NON_UNIQ_ERROR insert ignore into t1 select a from t1 on duplicate key update a=t1.a+1 ; drop table t1; @@ -171,13 +171,13 @@ SET SQL_MODE = 'TRADITIONAL'; CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL); ---error 1364 +--error ER_NO_DEFAULT_FOR_FIELD INSERT INTO t1 (a) VALUES (1); ---error 1364 +--error ER_NO_DEFAULT_FOR_FIELD INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE a = b; ---error 1364 +--error ER_NO_DEFAULT_FOR_FIELD INSERT INTO t1 (a) VALUES (1) ON DUPLICATE KEY UPDATE b = b; SELECT * FROM t1; @@ -278,7 +278,7 @@ INSERT INTO t1 (id,c1) VALUES (1,10); SELECT * FROM t1; CREATE TABLE t2 (id INT, c1 INT); INSERT INTO t2 VALUES (1,NULL), (2,2); ---error 1048 +--error ER_BAD_NULL_ERROR INSERT INTO t1 (id,c1) SELECT 1,NULL ON DUPLICATE KEY UPDATE c1=NULL; SELECT * FROM t1; @@ -290,6 +290,7 @@ INSERT IGNORE INTO t1 (id,c1) SELECT * FROM t2 SELECT * FROM t1; DROP TABLE t1; +DROP TABLE t2; # # Bug#28904: INSERT .. ON DUPLICATE was silently updating rows when it diff --git a/mysql-test/t/sp_trans_log.test b/mysql-test/t/sp_trans_log.test index 93605722f6b..effa3ca80cf 100644 --- a/mysql-test/t/sp_trans_log.test +++ b/mysql-test/t/sp_trans_log.test @@ -4,11 +4,15 @@ delimiter |; # -# Bug #13270 INSERT,UPDATE,etc that calls func with side-effect does not binlog -# Bug #23333 stored function + non-transac table + transac table = -# breaks stmt-based binlog -# Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF() +# Bug#13270 INSERT,UPDATE,etc that calls func with side-effect does not binlog +# Bug#23333 stored function + non-transac table + transac table = +# breaks stmt-based binlog +# Bug#27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF() # +--disable_warnings +drop function if exists bug23333| +drop table if exists t1,t2| +--enable_warnings CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM| CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB| @@ -29,5 +33,10 @@ insert into t2 values (bug23333(),1)| --replace_column 2 # 5 # 6 # show binlog events from 98 /* with fixes for #23333 will show there are 2 queries */| select count(*),@a from t1 /* must be 1,1 */| -drop table t1, t2| +delimiter ;| + +# clean-up + +drop table t1,t2; +drop function if exists bug23333; diff --git a/mysql-test/t/varbinary.test b/mysql-test/t/varbinary.test index 427c1a6b84a..a53a3b8d5b4 100644 --- a/mysql-test/t/varbinary.test +++ b/mysql-test/t/varbinary.test @@ -83,6 +83,7 @@ insert into t1 values("aaa "); select length(a) from t1; alter table t1 modify a varchar(255); select length(a) from t1; +drop table t1; # # Bug#35658 (An empty binary value leads to mysqld crash)