summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2001-05-28 19:18:23 -0600
committerunknown <sasha@mysql.sashanet.com>2001-05-28 19:18:23 -0600
commit704becf22801bfa00f866124eb7f4898e3003d03 (patch)
tree555928735ac48778eab810466107750e6e6131a1 /mysql-test
parent403b38ee5091e74df8adb6ee0c644903a82ffcad (diff)
downloadmariadb-git-704becf22801bfa00f866124eb7f4898e3003d03.tar.gz
updates for LOAD DATA FROM MASTER + some cleanup of replication code
include/mysqld_error.h: new errors mysql-test/r/rpl000009.result: test load data from master mysql-test/t/rpl000009.test: test load data from master sql/mini_client.cc: extra functionality needed for load data from master and other things sql/mini_client.h: addition to API sql/mysql_priv.h: mysql_create_db()/mysql_rm_db() now return a value sql/share/english/errmsg.txt: more error messages sql/slave.cc: cleanup of fetch_nx_table() sql/slave.h: cleanup of fetch_nx_table() sql/sql_base.cc: remove unused code originally written for retrieving a non-existent table in slave thread sql/sql_class.cc: remove unused replication variables sql/sql_class.h: remove unused replication variabled sql/sql_db.cc: make mysql_create_db()/mysql_rm_db() work with thd == 0 (do not write messages to the net) and instead return success/error sql/sql_lex.h: added SQLCOM_LOAD_MASTER_DATA sql/sql_parse.cc: LOAD MASTER DATA, cleanup of LOAD TABLE FROM MASTER sql/sql_repl.cc: LOAD DATA FROM MASTER sql/sql_repl.h: LOAD DATA FROM MASTER sql/sql_yacc.yy: LOAD DATA FROM MASTER
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/rpl000009.result30
-rw-r--r--mysql-test/t/rpl000009.test53
2 files changed, 83 insertions, 0 deletions
diff --git a/mysql-test/r/rpl000009.result b/mysql-test/r/rpl000009.result
index d5b4cdf3bee..74452473d0c 100644
--- a/mysql-test/r/rpl000009.result
+++ b/mysql-test/r/rpl000009.result
@@ -1,2 +1,32 @@
n m
4 15
+Database
+bar
+foo
+mysql
+test
+Database
+mysql
+test
+Database
+bar
+foo
+mysql
+test
+Tables_in_foo
+Tables_in_bar
+t1
+t2
+n s
+1 one bar
+2 two bar
+3 three bar
+n s
+11 eleven bar
+12 twelve bar
+13 thirteen bar
+n s
+1 one bar
+2 two bar
+3 three bar
+4 four bar
diff --git a/mysql-test/t/rpl000009.test b/mysql-test/t/rpl000009.test
index 768c6c151b4..208e6f0b037 100644
--- a/mysql-test/t/rpl000009.test
+++ b/mysql-test/t/rpl000009.test
@@ -31,3 +31,56 @@ connection slave;
sync_with_master;
drop database if exists bar;
drop database if exists foo;
+
+#now let's test load data from master
+
+#first create some databases and tables on the master
+connection master;
+set sql_log_bin = 0;
+create database foo;
+create database bar;
+show databases;
+create table foo.t1(n int, s char(20));
+create table foo.t2(n int, s text);
+insert into foo.t1 values (1, 'one'), (2, 'two'), (3, 'three');
+insert into foo.t2 values (11, 'eleven'), (12, 'twelve'), (13, 'thirteen');
+
+create table bar.t1(n int, s char(20));
+create table bar.t2(n int, s text);
+insert into bar.t1 values (1, 'one bar'), (2, 'two bar'), (3, 'three bar');
+insert into bar.t2 values (11, 'eleven bar'), (12, 'twelve bar'),
+ (13, 'thirteen bar');
+set sql_log_bin = 1;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+#this should show that the slave is empty at this point
+show databases;
+load data from master;
+
+#now let's check if we have the right tables and the right data in them
+show databases;
+use foo;
+show tables;
+use bar;
+show tables;
+select * from bar.t1;
+select * from bar.t2;
+
+#now let's see if replication works
+connection master;
+insert into bar.t1 values (4, 'four bar');
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from bar.t1;
+
+#now time for cleanup
+connection master;
+drop database bar;
+drop database foo;
+save_master_pos;
+connection slave;
+sync_with_master;
+