Commit be4a1c2e authored by unknown's avatar unknown
Browse files

Test case updates and new test cases added to CRBR


BitKeeper/deleted/.del-rpl_row_multi_update3.test~fcf9a2234bd0f1b:
  Delete: mysql-test/t/rpl_row_multi_update3.test
BitKeeper/deleted/.del-rpl_row_multi_update3.test~b366698f8379f38f:
  Delete: mysql-test/extra/rpl_tests/rpl_row_multi_update3.test
BitKeeper/deleted/.del-rpl_row_multi_update3.result~1a3a8438eaaf11f2:
  Delete: mysql-test/r/rpl_row_multi_update3.result
mysql-test/t/rpl_ndb_commit_afterflush.test:
  added comments
mysql-test/r/rpl_ndb_commit_afterflush.result:
  New results file
mysql-test/t/rpl_ddl.test:
  Added to skip default ndb engine
mysql-test/t/rpl_ndb_ddl.test:
  new wrapper for ndb
mysql-test/r/rpl_ndb_ddl.result:
  new wrapper for ndb
mysql-test/t/rpl_insert_ignore.test:
  Added to skip ndb if default engine
mysql-test/t/rpl_ndb_insert_ignore.test:
  New wrapper for ndb
mysql-test/r/rpl_ndb_insert_ignore.result:
  New Results file
mysql-test/t/rpl_multi_update2.test:
  Updated to skip ndb default engine + added comments
mysql-test/t/rpl_ndb_multi_update2.test:
  New ndb wrapper for test case
mysql-test/t/rpl_ndb_multi_update2-slave.opt:
  New slave option file to go with new NDB test wrapper
mysql-test/r/rpl_ndb_multi_update2.result:
  New results file
mysql-test/t/rpl_multi_update3.test:
  Updated to skip ndb default engine + added comments
mysql-test/t/rpl_ndb_multi_update3.test:
  New ndb wrapper for test case
mysql-test/r/rpl_ndb_multi_update3.result:
  New results file
mysql-test/t/rpl_relayrotate.test:
  added comments and ability to sjip when ndb is default engine
mysql-test/t/rpl_ndb_relayrotate.test:
  New wrapper for ndb
mysql-test/t/rpl_ndb_relayrotate-slave.opt:
  New option file for ndb slave
mysql-test/r/rpl_ndb_relayrotate.result:
  New results file
mysql-test/t/rpl_loaddata.test:
  Updated
mysql-test/t/rpl_multi_update.test:
  Updated
mysql-test/t/rpl_relay_space_myisam.test:
  Updated
mysql-test/t/rpl_row_001.test:
  Updated
mysql-test/t/rpl_row_blob_myisam.test:
  Updated
mysql-test/t/rpl_row_charset.test:
  Updated
mysql-test/t/rpl_row_delayed_ins.test:
  Updated
mysql-test/t/rpl_row_log.test:
  Updated
mysql-test/t/rpl_row_UUID.test:
  Updated
mysql-test/t/rpl_auto_increment.test:
  Updated
mysql-test/t/rpl_commit_after_flush.test:
  Updated
mysql-test/t/rpl_deadlock_innodb.test:
  Updated
mysql-test/t/rpl_failed_optimize.test:
  Updated
mysql-test/t/rpl_foreign_key_innodb.test:
  Updated
mysql-test/t/rpl_insert_id_pk.test:
  Updated
mysql-test/t/rpl_insert_id.test:
  Updated
mysql-test/t/rpl_relay_space_innodb.test:
  Updated
mysql-test/t/rpl_row_blob_innodb.test:
  Updated
mysql-test/t/rpl_row_func003.test:
  Updated
mysql-test/t/rpl_row_log_innodb.test:
  Updated
mysql-test/t/rpl_row_sp002_innodb.test:
  Updated
mysql-test/t/rpl_row_sp003.test:
  Updated
mysql-test/t/rpl_row_sp006_InnoDB.test:
  Updated
mysql-test/t/rpl_row_sp007_innodb.test:
  Updated
mysql-test/t/rpl_ndb_row_001.test:
  New wrapper for ndb
mysql-test/r/rpl_ndb_row_001.result:
  New results file
mysql-test/t/rpl_ndb_UUID.test:
  New wrapper for ndb
mysql-test/r/rpl_ndb_UUID.result:
  New results file
mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test:
  Updated with order by
mysql-test/r/rpl_row_delayed_ins.result:
  Updated results file
mysql-test/t/rpl_ndb_charset.test:
  New wrapper for ndb
mysql-test/r/rpl_ndb_charset.result:
  New results file
mysql-test/t/rpl_row_until.test:
  Updated to skip when ndb is default. ndb bin logs are different size, so test would need to be rewitten for ndb
mysql-test/t/rpl_row_max_relay_size.test:
  Updated
mysql-test/t/rpl_row_sp008.test:
  Removed show binlog as it is not needed for test
mysql-test/r/rpl_row_sp008.result:
  Updated results
mysql-test/t/rpl_row_basic_11bugs.test:
  Removed show binlog as it is not needed for test
mysql-test/r/rpl_row_basic_11bugs.result:
  Updated results
BitKeeper/deleted/.del-rpl_ndb_max_relay_size.test~afa6834a51627676:
  Delete: mysql-test/t/rpl_ndb_max_relay_size.test
BitKeeper/deleted/.del-rpl_ndb_max_relay_size.result~1e944e2782e270d8:
  Delete: mysql-test/r/rpl_ndb_max_relay_size.result
mysql-test/t/disabled.def:
  Updated
parent b634daa3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -9,14 +9,14 @@ let $VERSION=`select version()`;
eval create table t1(a int not null primary key) engine=$engine_type;
insert delayed into t1 values (1),(2),(3);
flush tables;
select * from t1;
SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;

connection master;
--replace_result $VERSION VERSION
show binlog events;
sync_slave_with_master;
select * from t1;
SELECT * FROM t1 ORDER BY a;
connection master;
drop table t1;
sync_slave_with_master;
+0 −159
Original line number Diff line number Diff line
-- source include/master-slave.inc

##############################################################################
#
# Let's verify that multi-update with a subselect does not cause the slave to crash
# (BUG#10442)
#
--disable_query_log
SELECT '-------- Test for BUG#9361 --------' as "";
--enable_query_log

eval CREATE TABLE t1 (
 a int unsigned not null auto_increment primary key,
 b int unsigned
) ENGINE=$engine_type;

eval CREATE TABLE t2 (
 a int unsigned not null auto_increment primary key,
 b int unsigned
) ENGINE=$engine_type;

INSERT INTO t1 VALUES (NULL, 0);
INSERT INTO t1 SELECT NULL, 0 FROM t1;

INSERT INTO t2 VALUES (NULL, 0), (NULL,1);

SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;

UPDATE t2, (SELECT a FROM t1) AS t SET t2.b = t.a+5 ;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;

sync_slave_with_master;
connection slave;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;

connection master;
drop table t1,t2;

##############################################################################
#
#  Test for BUG#9361: 
#  Subselects should work inside multi-updates
#
--disable_query_log
SELECT '-------- Test 1 for BUG#9361 --------' as "";
--enable_query_log

connection master;

--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
--enable_warnings

CREATE TABLE t1 (
  a1  char(30),
  a2  int,
  a3  int,
  a4  char(30),
  a5  char(30)
);

CREATE TABLE t2 (
  b1  int,
  b2  char(30)
);

# Insert one row per table
INSERT INTO t1 VALUES ('Yes', 1, NULL, 'foo', 'bar');
INSERT INTO t2 VALUES (1, 'baz');

# This should update the row in t1
UPDATE t1 a, t2 
  SET    a.a1 = 'No' 
  WHERE  a.a2 = 
    (SELECT  b1 
     FROM    t2 
     WHERE   b2 = 'baz') 
  AND a.a3 IS NULL 
  AND a.a4 = 'foo' 
  AND a.a5 = 'bar';

sync_slave_with_master;
connection slave;
SELECT * FROM t1;
SELECT * FROM t2;

connection master;
DROP TABLE t1, t2;

##############################################################################
#
# Second test for BUG#9361
#

--disable_query_log
SELECT '-------- Test 2 for BUG#9361 --------' as "";
--enable_query_log

connection master;

--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
--enable_warnings

CREATE TABLE t1 (
  i   INT,
  j   INT,
  x   INT,
  y   INT,
  z   INT
);

CREATE TABLE t2 (
  i   INT,
  k   INT,
  x   INT,
  y   INT,
  z   INT
);

CREATE TABLE t3 (
  j   INT,
  k   INT,
  x   INT,
  y   INT,
  z   INT
);

INSERT INTO t1 VALUES ( 1, 2,13,14,15);
INSERT INTO t2 VALUES ( 1, 3,23,24,25);
INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36);

UPDATE      t1 AS a  
INNER JOIN  t2 AS b 
              ON a.i = b.i
INNER JOIN  t3 AS c 
              ON a.j = c.j  AND  b.k = c.k
SET         a.x = b.x, 
            a.y = b.y, 
            a.z = (
              SELECT  sum(z) 
              FROM    t3
              WHERE   y = 34 
            ) 
WHERE       b.x = 23;

sync_slave_with_master;
connection slave;

SELECT * FROM t1;

connection master;
DROP TABLE t1, t2, t3;
+40 −0
Original line number Diff line number Diff line
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, vchar_column VARCHAR(100), PRIMARY KEY(a)) engine=NDB;
INSERT INTO test.t1  VALUES(1,UUID(),UUID());
create procedure test.p1()
begin
INSERT INTO test.t1  VALUES(2,UUID(),UUID());
INSERT INTO test.t1  VALUES(3,UUID(),UUID());
end|
CALL test.p1();
create function test.fn1(x int)
returns int
begin
insert into t1 values (4+x,UUID(),UUID());
insert into t1 values (5+x,UUID(),UUID());
return 0;
end|
select fn1(0);
fn1(0)
0
create table t2 (a int);
insert into t2 values(fn1(2));
SHOW CREATE TABLE test.t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` int(11) NOT NULL default '0',
  `blob_column` longblob,
  `vchar_column` varchar(100) default NULL,
  PRIMARY KEY  (`a`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () 
DROP PROCEDURE test.p1;
DROP FUNCTION test.fn1;
DROP TABLE test.t1;
DROP TABLE test.t2;
+201 −0
Original line number Diff line number Diff line
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set timestamp=1000000000;
drop database if exists mysqltest2;
drop database if exists mysqltest3;
create database mysqltest2 character set latin2;
set @@character_set_server=latin5;
create database mysqltest3;

--- --master--
show create database mysqltest2;
Database	Create Database
mysqltest2	CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
show create database mysqltest3;
Database	Create Database
mysqltest3	CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */

--- --slave--
show create database mysqltest2;
Database	Create Database
mysqltest2	CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
show create database mysqltest3;
Database	Create Database
mysqltest3	CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
set @@collation_server=armscii8_bin;
drop database mysqltest3;
create database mysqltest3;

--- --master--
show create database mysqltest3;
Database	Create Database
mysqltest3	CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */

--- --slave--
show create database mysqltest3;
Database	Create Database
mysqltest3	CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
use mysqltest2;
create table t1 (a int auto_increment primary key, b varchar(100));
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
insert into t1 (b) values(@@character_set_server);
insert into t1 (b) values(@@collation_server);
insert into t1 (b) values(@@character_set_client);
insert into t1 (b) values(@@character_set_connection);
insert into t1 (b) values(@@collation_connection);

--- --master--
select * from t1 order by a;
a	b
1	armscii8
2	armscii8_bin
3	cp850
4	latin2
5	latin2_croatian_ci

--- --slave--
select * from mysqltest2.t1 order by a;
a	b
1	armscii8
2	armscii8_bin
3	cp850
4	latin2
5	latin2_croatian_ci
select "--- --muller--" as "";

--- --muller--
set character_set_client=latin1, collation_connection=latin1_german1_ci;
truncate table t1;
insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Mller","Muffler"));
set collation_connection=latin1_german2_ci;
insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Mller","Muffler"));

--- --master--
select * from t1 order by a;
a	b
1	latin1_german1_ci
2	Muffler
3	latin1_german2_ci
4	Mller

--- --slave--
select * from mysqltest2.t1 order by a;
a	b
1	latin1_german1_ci
2	Muffler
3	latin1_german2_ci
4	Mller
select "--- --INSERT--" as "";

--- --INSERT--
set @a= _cp850 'Mller' collate cp850_general_ci;
truncate table t1;
insert into t1 (b) values(collation(@a));

--- --master--
select * from t1 order by a;
a	b
1	cp850_general_ci

--- --slave--
select * from mysqltest2.t1 order by a;
a	b
1	cp850_general_ci
drop database mysqltest2;
drop database mysqltest3;
show binlog events from 102;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	#	Query	1	#	drop database if exists mysqltest2
master-bin.000001	#	Query	1	#	drop database if exists mysqltest3
master-bin.000001	#	Query	1	#	create database mysqltest2 character set latin2
master-bin.000001	#	Query	1	#	create database mysqltest3
master-bin.000001	#	Query	1	#	drop database mysqltest3
master-bin.000001	#	Query	1	#	create database mysqltest3
master-bin.000001	#	Query	1	#	use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))
master-bin.000001	#	Table_map	1	#	mysqltest2.t1
master-bin.000001	#	Write_rows	1	#	
master-bin.000001	#	Table_map	1	#	mysqltest2.t1
master-bin.000001	#	Write_rows	1	#	
master-bin.000001	#	Table_map	1	#	mysqltest2.t1
master-bin.000001	#	Write_rows	1	#	
master-bin.000001	#	Table_map	1	#	mysqltest2.t1
master-bin.000001	#	Write_rows	1	#	
master-bin.000001	#	Table_map	1	#	mysqltest2.t1
master-bin.000001	#	Write_rows	1	#	
master-bin.000001	#	Query	1	#	use `mysqltest2`; truncate table t1
master-bin.000001	#	Table_map	1	#	mysqltest2.t1
master-bin.000001	#	Write_rows	1	#	
master-bin.000001	#	Table_map	1	#	mysqltest2.t1
master-bin.000001	#	Write_rows	1	#	
master-bin.000001	#	Table_map	1	#	mysqltest2.t1
master-bin.000001	#	Write_rows	1	#	
master-bin.000001	#	Table_map	1	#	mysqltest2.t1
master-bin.000001	#	Write_rows	1	#	
master-bin.000001	#	Query	1	#	use `mysqltest2`; truncate table t1
master-bin.000001	#	Table_map	1	#	mysqltest2.t1
master-bin.000001	#	Write_rows	1	#	
master-bin.000001	#	Query	1	#	drop database mysqltest2
master-bin.000001	#	Query	1	#	drop database mysqltest3
select "--- --global--" as "";

--- --global--
set global character_set_server=latin2;
set global character_set_server=latin1;
set global character_set_server=latin2;
set global character_set_server=latin1;
select "--- --oneshot--" as "";

--- --oneshot--
set one_shot @@character_set_server=latin5;
set @@max_join_size=1000;
select @@character_set_server;
@@character_set_server
latin5
select @@character_set_server;
@@character_set_server
latin1
set @@character_set_server=latin5;
select @@character_set_server;
@@character_set_server
latin5
select @@character_set_server;
@@character_set_server
latin5
set one_shot max_join_size=10;
ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
set character_set_client=9999999;
ERROR 42000: Unknown character set: '9999999'
set collation_server=9999998;
ERROR HY000: Unknown collation: '9999998'
select "--- --3943--" as "";

--- --3943--
use test;
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
SET CHARACTER_SET_CLIENT=koi8r,
CHARACTER_SET_CONNECTION=cp1251, 
CHARACTER_SET_RESULTS=koi8r;
INSERT INTO t1 (c1, c2) VALUES (',  ',',  ');
select hex(c1), hex(c2) from t1;
hex(c1)	hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3	CDF32C20E7E020F0FBE1E0EBEAF3
select hex(c1), hex(c2) from t1;
hex(c1)	hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3	CDF32C20E7E020F0FBE1E0EBEAF3
drop table t1;
select "--- --6676--" as "";

--- --6676--
create table `t1` (
`pk` varchar(10) not null default '', 
primary key (`pk`)
) engine=NDB default charset=latin1;
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
+13 −0
Original line number Diff line number Diff line
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 (a INT) ENGINE=NDB;
begin;
insert into t1 values(1);
flush tables with read lock;
commit;
unlock tables;
drop table t1;
Loading