summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorsasha@mysql.sashanet.com <>2000-11-17 23:35:40 -0700
committersasha@mysql.sashanet.com <>2000-11-17 23:35:40 -0700
commit24a7aae0f452f75cdfb09ccf1cec37d38d0f82a9 (patch)
treeccc45fd7f4b333edac1dbea98d87b49f1a6635a5 /mysql-test/t
parentf046a11591b8d2e3230ec1ea9eac1773d359d29e (diff)
downloadmariadb-git-24a7aae0f452f75cdfb09ccf1cec37d38d0f82a9.tar.gz
fixed bugs in delayed insert replication and when slave loses connection after Int_var but before Query
public test suite now tests replication code as well
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/3.23/rpl000001.test15
-rw-r--r--mysql-test/t/3.23/rpl000002.test11
-rw-r--r--mysql-test/t/3.23/rpl000003.test9
-rw-r--r--mysql-test/t/3.23/rpl000004.test18
-rw-r--r--mysql-test/t/3.23/rpl000005.test12
-rw-r--r--mysql-test/t/3.23/rpl000006.test12
-rw-r--r--mysql-test/t/include/master-slave.inc9
7 files changed, 86 insertions, 0 deletions
diff --git a/mysql-test/t/3.23/rpl000001.test b/mysql-test/t/3.23/rpl000001.test
new file mode 100644
index 00000000000..f49a9d2b146
--- /dev/null
+++ b/mysql-test/t/3.23/rpl000001.test
@@ -0,0 +1,15 @@
+source t/include/master-slave.inc;
+connection master;
+use test;
+drop table if exists words;
+create table words (word char(20) not null);
+load data infile '../../std_data/words' into table words;
+drop table if exists foo;
+create table foo(n int);
+insert into foo values(1),(2);
+connection slave;
+sleep 3;
+use test;
+@r/3.23/rpl000001.a.result select * from foo;
+@r/3.23/rpl000001.b.result select sum(length(word)) from words;
+
diff --git a/mysql-test/t/3.23/rpl000002.test b/mysql-test/t/3.23/rpl000002.test
new file mode 100644
index 00000000000..b7df0e3e7ef
--- /dev/null
+++ b/mysql-test/t/3.23/rpl000002.test
@@ -0,0 +1,11 @@
+source t/include/master-slave.inc;
+connection master;
+use test;
+drop table if exists x;
+create table x(n int auto_increment primary key);
+set insert_id = 2000;
+insert into x values (NULL),(NULL),(NULL);
+connection slave;
+use test;
+sleep 1;
+@r/3.23/rpl000002.result select * from x;
diff --git a/mysql-test/t/3.23/rpl000003.test b/mysql-test/t/3.23/rpl000003.test
new file mode 100644
index 00000000000..5f64a743bc1
--- /dev/null
+++ b/mysql-test/t/3.23/rpl000003.test
@@ -0,0 +1,9 @@
+source t/include/master-slave.inc;
+connection master;
+drop table if exists x;
+create table x(n int primary key);
+!insert into x values (1),(2),(2);
+insert into x values (3);
+connection slave;
+sleep 1;
+@r/3.23/rpl000003.result select * from x;
diff --git a/mysql-test/t/3.23/rpl000004.test b/mysql-test/t/3.23/rpl000004.test
new file mode 100644
index 00000000000..795bb0e32a2
--- /dev/null
+++ b/mysql-test/t/3.23/rpl000004.test
@@ -0,0 +1,18 @@
+source t/include/master-slave.inc;
+connection master;
+use test;
+set SQL_LOG_BIN=0;
+drop table if exists words;
+create table words (word char(20) not null, index(word));
+load data infile '../../std_data/words' into table words;
+drop table if exists words1;
+create table words1 (word char(20) not null);
+load data infile '../../std_data/words' into table words1;
+connection slave;
+use test;
+drop table if exists words;
+load table words from master;
+drop table if exists words1;
+load table words1 from master;
+@r/3.23/rpl000004.a.result check table words;
+@r/3.23/rpl000004.b.result select count(*) from words1;
diff --git a/mysql-test/t/3.23/rpl000005.test b/mysql-test/t/3.23/rpl000005.test
new file mode 100644
index 00000000000..403c0efd9bb
--- /dev/null
+++ b/mysql-test/t/3.23/rpl000005.test
@@ -0,0 +1,12 @@
+source t/include/master-slave.inc;
+connection master;
+drop table if exists test;
+CREATE TABLE test (name varchar(64), age smallint(3));
+INSERT INTO test SET name='Andy', age=31;
+INSERT test SET name='Jacob', age=2;
+INSERT into test SET name='Caleb', age=1;
+ALTER TABLE test ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY;
+@r/3.23/rpl000005.result select * from test;
+connection slave;
+sleep 1;
+@r/3.23/rpl000005.result select * from test;
diff --git a/mysql-test/t/3.23/rpl000006.test b/mysql-test/t/3.23/rpl000006.test
new file mode 100644
index 00000000000..8f85b3a7952
--- /dev/null
+++ b/mysql-test/t/3.23/rpl000006.test
@@ -0,0 +1,12 @@
+source t/include/master-slave.inc;
+connection master;
+set SQL_LOG_BIN=0;
+set timestamp=200006;
+drop table if exists foo;
+create table foo(t timestamp not null,a char(1));
+insert into foo ( a) values ('F');
+@r/3.23/rpl000006.result select unix_timestamp(t) from foo;
+connection slave;
+drop table if exists foo;
+load table foo from master;
+@r/3.23/rpl000006.result select unix_timestamp(t) from foo;
diff --git a/mysql-test/t/include/master-slave.inc b/mysql-test/t/include/master-slave.inc
new file mode 100644
index 00000000000..590332bfa85
--- /dev/null
+++ b/mysql-test/t/include/master-slave.inc
@@ -0,0 +1,9 @@
+connect (master,localhost,root,,test,0,var/tmp/mysql.sock);
+connect (slave,localhost,root,,test,0,var/tmp/mysql-slave.sock);
+connection slave;
+!slave stop;
+connection master;
+reset master;
+connection slave;
+reset slave;
+!slave start;