Commit 9a5cb8d9 authored by unknown's avatar unknown

Updated test cases


mysql-test/include/not_ndb_default.inc:
  New include file to skip certain tests with default engine = ndb
mysql-test/t/rpl_optimize.test:
  Updated to skip test when NDB is default engine
mysql-test/extra/rpl_tests/rpl_auto_increment.test:
  Updated to skip test when NDB is default engine
BitKeeper/deleted/.del-rpl_ndb_auto_inc-master.opt~e38255d94debc2c8:
  Delete: mysql-test/t/rpl_ndb_auto_inc-master.opt
mysql-test/t/rpl_ndb_auto_inc.test:
  updated to use with ndb
mysql-test/r/rpl_ndb_auto_inc.result:
  New results
mysql-test/t/disabled.def:
  Updated to remove rpl_ndb_auto_inc.test
mysql-test/extra/rpl_tests/rpl_row_blob.test:
  updated to remove check table, not needed and not supported by ndb engine
mysql-test/t/rpl_ndb_blob2.test:
  new ndb wrapper
mysql-test/r/rpl_ndb_blob2.result:
  new results
parent 9373a8d3
#
# Test of auto_increment with offset
#
#####################################
# By: JBM
# Date: 2006-02-10
# Change: NDB does not support auto inc
# in this usage. Currently there is no
# plan to implment. Skipping test when
# NDB is default engine.
#####################################
-- source include/not_ndb_default.inc
-- source include/master-slave.inc
eval create table t1 (a int not null auto_increment,b int, primary key (a)) engine=$engine_type2 auto_increment=3;
......
......@@ -30,7 +30,6 @@ data LONGBLOB, PRIMARY KEY(c1))ENGINE=$engine_type;
INSERT INTO test.t1 VALUES (NULL, NULL);
INSERT INTO test.t1 VALUES (NULL, repeat('a',1*1024));
INSERT INTO test.t1 VALUES (NULL, repeat('b',16*1024));
CHECK TABLE test.t1;
--echo
--echo **** Data Insert Validation Master Section test.t1 ****
......@@ -60,6 +59,9 @@ UPDATE t1 set data=repeat('c',17*1024) where c1 = 2;
--echo
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
# Sleep is needed for NDB to allow time for
# Injector thread to populate the bin log.
sleep 10;
save_master_pos;
connection slave;
sync_with_master;
......@@ -155,6 +157,9 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=1;
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
# Sleep is needed for NDB to allow time for
# Injector thread to populate the bin log.
sleep 15;
save_master_pos;
connection slave;
sync_with_master;
......
--require r/true.require
disable_query_log;
select convert(@@table_type using latin1) NOT IN ("ndbcluster","NDBCLUSTER") as "TRUE";
enable_query_log;
......@@ -4,116 +4,94 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=myisam auto_increment=3;
***************** Test 1 ************************
CREATE TABLE t1 (a INT NOT NULL auto_increment,b INT, PRIMARY KEY (a)) ENGINE=NDB auto_increment=3;
insert into t1 values (NULL,1),(NULL,2),(NULL,3);
select * from t1;
******* Select from Master *************
select * from t1 ORDER BY a;
a b
12 1
22 2
32 3
select * from t1;
3 1
4 2
5 3
******* Select from Slave *************
select * from t1 ORDER BY a;
a b
12 1
22 2
32 3
3 1
4 2
5 3
drop table t1;
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=myisam;
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=NDB;
insert into t1 values (1,1),(NULL,2),(3,3),(NULL,4);
delete from t1 where b=4;
insert into t1 values (NULL,5),(NULL,6);
select * from t1;
******* Select from Master *************
select * from t1 ORDER BY a;
a b
1 1
2 2
3 3
22 5
32 6
select * from t1;
5 5
6 6
******* Select from Slave *************
select * from t1 ORDER BY a;
a b
1 1
2 2
3 3
22 5
32 6
5 5
6 6
drop table t1;
set @@session.auto_increment_increment=100, @@session.auto_increment_offset=10;
show variables like "%auto_inc%";
Variable_name Value
auto_increment_increment 100
auto_increment_offset 10
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
insert into t1 values (NULL),(5),(NULL);
insert into t1 values (250),(NULL);
select * from t1;
a
5
10
110
250
310
insert into t1 values (1000);
set @@insert_id=400;
insert into t1 values(NULL),(NULL);
select * from t1;
a
5
10
110
250
310
400
410
1000
select * from t1;
a
5
10
110
250
310
400
410
1000
drop table t1;
create table t1 (a int not null auto_increment, primary key (a)) engine=innodb;
insert into t1 values (NULL),(5),(NULL);
insert into t1 values (250),(NULL);
select * from t1;
******* Select from Master *************
select * from t1 ORDER BY a;
a
1
5
10
110
6
250
310
251
insert into t1 values (1000);
set @@insert_id=400;
insert into t1 values(NULL),(NULL);
select * from t1;
******* Select from Master *************
select * from t1 ORDER BY a;
a
1
5
10
110
6
250
310
251
400
410
1000
select * from t1;
1001
******* Select from Slave *************
select * from t1 ORDER BY a;
a
1
5
10
110
6
250
310
251
400
410
1000
1001
drop table t1;
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
insert into t1 values (NULL),(5),(NULL),(NULL);
insert into t1 values (500),(NULL),(502),(NULL),(NULL);
select * from t1;
insert into t1 values (500),(NULL),(502),(NULL),(600);
******* Select from Master *************
select * from t1 ORDER BY a;
a
1
5
......@@ -123,13 +101,15 @@ a
501
502
503
504
600
set @@insert_id=600;
insert into t1 values(600),(NULL),(NULL);
ERROR 23000: Duplicate entry '600' for key 1
ERROR 23000: Can't write; duplicate key in table 't1'
set @@insert_id=600;
insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
select * from t1;
******* Select from Master *************
select * from t1 ORDER BY a;
a
1
5
......@@ -139,11 +119,14 @@ a
501
502
503
504
600
603
604
610
611
select * from t1;
******* Select from Slave *************
select * from t1 ORDER BY a;
a
1
5
......@@ -153,33 +136,39 @@ a
501
502
503
504
600
603
604
610
611
drop table t1;
set @@session.auto_increment_increment=10, @@session.auto_increment_offset=1;
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
insert into t1 values(2),(12),(22),(32),(42);
insert into t1 values (NULL),(NULL);
insert into t1 values (3),(NULL),(NULL);
select * from t1;
******* Select from Master *************
select * from t1 ORDER BY a;
a
1
2
3
11
21
31
select * from t1;
4
5
******* Select from Slave *************
** Slave should have 2, 12, 22, 32, 42 **
** Master will have 2 but not 12, 22, 32, 42 **
select * from t1 ORDER BY a;
a
1
2
3
11
4
5
12
21
22
31
32
42
drop table t1;
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 TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
***** Table Create Section ****
CREATE TABLE test.t1 (c1 int not null auto_increment,
data LONGBLOB, PRIMARY KEY(c1))ENGINE=#;
**** Data Insert Section test.t1 *****
INSERT INTO test.t1 VALUES (NULL, NULL);
INSERT INTO test.t1 VALUES (NULL, repeat('a',1*1024));
INSERT INTO test.t1 VALUES (NULL, repeat('b',16*1024));
**** Data Insert Validation Master Section test.t1 ****
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
LENGTH(data)
NULL
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
LENGTH(data)
1024
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
LENGTH(data)
16384
**** Data Insert Validation Slave Section test.t1 ****
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
LENGTH(data)
NULL
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
LENGTH(data)
1024
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
LENGTH(data)
16384
**** Data Update Section test.t1 ****
UPDATE test.t1 set data=repeat('a',18*1024) where c1 = 1;
UPDATE t1 set data=repeat('c',17*1024) where c1 = 2;
**** Data Update Validation Master Section test.t1 ****
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
LENGTH(data)
18432
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
LENGTH(data)
17408
**** Data Update Validation Slave Section test.t1 ****
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
LENGTH(data)
18432
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
LENGTH(data)
17408
**** End Test Section test.t1 ****
**** Create Table test.t2 ****
CREATE TABLE test.t2 (
c1 INT NOT NULL PRIMARY KEY,
c2 TEXT,
c3 INT,
c4 LONGBLOB,
KEY(c3))ENGINE=#;
*** Setup Values For test.t2 ***
set @x0 = '01234567012345670123456701234567';
set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0);
set @b1 = 'b1';
set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
set @b1 = concat(@b1,@x0);
set @d1 = 'dd1';
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
set @b2 = 'b2';
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
set @d2 = 'dd2';
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
**** Data Insert Section test.t2 *****
INSERT INTO test.t2 VALUES(1,@b1,111,@d1);
INSERT INTO test.t2 VALUES(2,@b2,222,@d2);
**** Data Insert Validation Master Section test.t2 ****
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=1;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
1 2256 b1 3000 dd1
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 20000 b2 30000 dd2
**** Data Insert Validation Slave Section test.t2 ****
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=1;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
1 2256 b1 3000 dd1
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 20000 b2 30000 dd2
**** Data Update Section test.t2 ****
UPDATE test.t2 SET c2=@b2, c4=@d2 WHERE c1=1;
UPDATE test.t2 SET c2=@b1, c4=@d1 WHERE c1=2;
**** Data Update Validation Master Section test.t2 ****
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=1;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
1 20000 b2 30000 dd2
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 2256 b1 3000 dd1
**** Data Update Validation Slave Section test.t2 ****
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=1;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
1 20000 b2 30000 dd2
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 2256 b1 3000 dd1
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
......@@ -29,7 +29,6 @@ ndb_autodiscover : Needs to be fixed w.r.t binlog
ndb_autodiscover2 : Needs to be fixed w.r.t binlog
ndb_alter_table_row : sometimes wrong error 1015!=1046
ndb_gis : garbled msgs from corrupt THD*
rpl_ndb_auto_inc : Bug #17086
rpl_ndb_relay_space : Bug #16993
ndb_binlog_ddl_multi : Bug #17038
rpl_ndb_log : Bug #17158
......
--auto-increment-increment=10 --auto-increment-offset=2
#
# Test of auto_increment in CRBR
#
#####################################
# Wrapper for rpl_auto_increment.test#
# By: JBM
# Date: 2006-02-10
# Change: Augmented test to use with cluster
#####################################
-- source include/have_innodb.inc
let $engine_type=NDB;
let $engine_type2=myisam;
-- source extra/rpl_tests/rpl_auto_increment.test
-- source include/master-slave.inc
--echo ***************** Test 1 ************************
--echo
CREATE TABLE t1 (a INT NOT NULL auto_increment,b INT, PRIMARY KEY (a)) ENGINE=NDB auto_increment=3;
insert into t1 values (NULL,1),(NULL,2),(NULL,3);
--echo ******* Select from Master *************
--echo
select * from t1 ORDER BY a;
sync_slave_with_master;
--echo ******* Select from Slave *************
--echo
select * from t1 ORDER BY a;
connection master;
drop table t1;
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=NDB;
insert into t1 values (1,1),(NULL,2),(3,3),(NULL,4);
delete from t1 where b=4;
insert into t1 values (NULL,5),(NULL,6);
--echo ******* Select from Master *************
--echo
select * from t1 ORDER BY a;
sync_slave_with_master;
--echo ******* Select from Slave *************
--echo
select * from t1 ORDER BY a;
connection master;
drop table t1;
create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
# Insert with 2 insert statements to get better testing of logging
insert into t1 values (NULL),(5),(NULL);
insert into t1 values (250),(NULL);
--echo ******* Select from Master *************
--echo
select * from t1 ORDER BY a;
insert into t1 values (1000);
set @@insert_id=400;
insert into t1 values(NULL),(NULL);
--echo ******* Select from Master *************
--echo
select * from t1 ORDER BY a;
sync_slave_with_master;
--echo ******* Select from Slave *************
--echo
select * from t1 ORDER BY a;
connection master;
drop table t1;
create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
# Insert with 2 insert statements to get better testing of logging
insert into t1 values (NULL),(5),(NULL),(NULL);
insert into t1 values (500),(NULL),(502),(NULL),(600);
--echo ******* Select from Master *************
--echo
select * from t1 ORDER BY a;
set @@insert_id=600;
# We expect a duplicate key error that we will ignore below
--error 1022
insert into t1 values(600),(NULL),(NULL);
set @@insert_id=600;
insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
--echo ******* Select from Master *************
--echo
select * from t1 ORDER BY a;
sync_slave_with_master;
--echo ******* Select from Slave *************
--echo
select * from t1 ORDER BY a;
connection master;
drop table t1;
#
# Test that auto-increment works when slave has rows in the table
#
create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
sync_slave_with_master;
insert into t1 values(2),(12),(22),(32),(42);
connection master;
insert into t1 values (NULL),(NULL);
insert into t1 values (3),(NULL),(NULL);
--echo ******* Select from Master *************
--echo
select * from t1 ORDER BY a;
sync_slave_with_master;
--echo ******* Select from Slave *************
--echo
--echo ** Slave should have 2, 12, 22, 32, 42 **
--echo ** Master will have 2 but not 12, 22, 32, 42 **
--echo
select * from t1 ORDER BY a;
connection master;
drop table t1;
# End cleanup
sync_slave_with_master;
#################################
# Wrapper for rpl_row_blob.test #
# Using wrapper to share test #
# code between engine tests #
#################################
-- source include/have_ndb.inc
let $engine_type=NDBCLUSTER;
-- source extra/rpl_tests/rpl_row_blob.test
......@@ -3,9 +3,14 @@
# You can replace OPTIMIZE by REPAIR.
#####################################
# Change Author: JBM
# Change Date: 2006-01-17
# Change:
# Change Date: 2006-02-09
# Change: NDB does not and will not support
# OPTIMIZE for memory tables. If and when
# it does support for Disk Data, a new
# version of this test will be need.
# Skipping this test if default engine = ndb
#####################################
-- source include/not_ndb_default.inc
-- source include/master-slave.inc
create table t1 (a int not null auto_increment primary key, b int, key(b));
......
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