Commit 386ceb49 authored by Matthias Leich's avatar Matthias Leich

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
parent fa01a4ed
......@@ -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);
......
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;
......@@ -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
......
......@@ -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
......
......@@ -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;
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment