summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-10-08 12:01:58 +0300
committerunknown <monty@narttu.mysql.fi>2003-10-08 12:01:58 +0300
commit1ead85e6783e303c2d024aebe4c5a04e0aa6560f (patch)
tree5f3cf2f56cc441edc81b2cf5fc056128ab764b41 /mysql-test/t
parent118d532134a1700bdb7ba29ce41712994f023692 (diff)
downloadmariadb-git-1ead85e6783e303c2d024aebe4c5a04e0aa6560f.tar.gz
Fixes after merge
mysql-test/std_data/trunc_binlog.000001: Rename: mysql-test/std_data/trunc_binlog.001 -> mysql-test/std_data/trunc_binlog.000001 client/mysqltest.c: Fixed merge problem mysql-test/mysql-test-run.sh: Fixed merge problem mysql-test/r/distinct.result: Fix after merge mysql-test/r/drop_temp_table.result: Fix after merge mysql-test/r/join_outer.result: Fix after merge mysql-test/r/mysqldump.result: Fix after merge mysql-test/r/null_key.result: Fix after merge mysql-test/r/order_by.result: Fix after merge mysql-test/r/rpl_alter.result: Fix after merge mysql-test/r/rpl_loaddata.result: Fix after merge mysql-test/r/rpl_loaddata_rule_m.result: Fix after merge mysql-test/r/rpl_trunc_binlog.result: Fix after merge mysql-test/r/select_safe.result: Fix after merge mysql-test/t/insert.test: Fix after merge mysql-test/t/mysqlbinlog.test: Fix after merge mysql-test/t/rpl000009.test: Fix after merge mysql-test/t/rpl_alter.test: Fix after merge mysql-test/t/rpl_loaddata_rule_m.test: Fix after merge mysql-test/t/rpl_trunc_binlog.test: Fix after merge sql-common/client.c: Fix after merge sql/item_subselect.cc: Fix after merge sql/repl_failsafe.cc: Fix after merge sql/slave.cc: Fix after merge sql/sql_insert.cc: Fix after merge
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/insert.test10
-rw-r--r--mysql-test/t/mysqlbinlog.test18
-rw-r--r--mysql-test/t/rpl000009.test80
-rw-r--r--mysql-test/t/rpl_alter.test22
-rw-r--r--mysql-test/t/rpl_loaddata_rule_m.test11
-rw-r--r--mysql-test/t/rpl_trunc_binlog.test12
6 files changed, 87 insertions, 66 deletions
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index ae0a87895e1..62d277bfad5 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -80,10 +80,10 @@ drop table t1,t2;
#
--disable_warnings
-drop database if exists test_$1;
+drop database if exists mysqltest;
--enable_warnings
-create database test_$1;
-use test_$1;
+create database mysqltest;
+use mysqltest;
create table t1 (c int);
-insert into test_$1.t1 set test_$1.t1.c = '1';
-drop database test_$1;
+insert into mysqltest.t1 set mysqltest.t1.c = '1';
+drop database mysqltest;
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index 22b63146652..3a24efd9f39 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -39,28 +39,28 @@ select "--- Local --" as "";
#
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.001
+--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001
# this should not fail but shouldn't produce any working statements
--disable_query_log
select "--- Broken LOAD DATA --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.002
+--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000002
# this should show almost nothing
--disable_query_log
select "--- --database --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --database=nottest $MYSQL_TEST_DIR/var/log/master-bin.001
+--exec $MYSQL_BINLOG --short-form --database=nottest $MYSQL_TEST_DIR/var/log/master-bin.000001
# this test for position option
--disable_query_log
select "--- --position --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --position=27 $MYSQL_TEST_DIR/var/log/master-bin.002
+--exec $MYSQL_BINLOG --short-form --position=27 $MYSQL_TEST_DIR/var/log/master-bin.000002
# These are tests for remote binlog.
# They should return the same as previous test.
@@ -74,30 +74,30 @@ select "--- Remote --" as "";
--enable_query_log
# This is broken now
-# By the way it seems that remote version fetches all events with name >= master-bin.001
+# By the way it seems that remote version fetches all events with name >= master-bin.000001
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.001
+--exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
# This is broken too
--disable_query_log
select "--- Broken LOAD DATA --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.002
+--exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.002
# And this too ! (altough it is documented)
--disable_query_log
select "--- --database --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.001
+--exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.000001
# Strangely but this works
--disable_query_log
select "--- --position --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --position=27 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.002
+--exec $MYSQL_BINLOG --short-form --read-from-remote-server --position=27 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.002
# clean up
drop table t1;
diff --git a/mysql-test/t/rpl000009.test b/mysql-test/t/rpl000009.test
index 4db62540e7b..cd318efa2b6 100644
--- a/mysql-test/t/rpl000009.test
+++ b/mysql-test/t/rpl000009.test
@@ -3,9 +3,15 @@
source include/master-slave.inc;
--disable_warnings
+drop database if exists mysqltest;
drop database if exists mysqltest2;
-create database mysqltest2;
+drop database if exists mysqltest3;
+connection slave;
drop database if exists mysqltest;
+drop database if exists mysqltest2;
+drop database if exists mysqltest3;
+connection master;
+create database mysqltest2;
create database mysqltest;
--enable_warnings
@@ -60,38 +66,42 @@ sync_with_master;
# This should show that the slave is empty at this point
show databases;
-# Create foo and foo2 on slave; we expect that LOAD DATA FROM MASTER will
-# neither touch database foo nor foo2.
-create database foo;
-create table foo.t1(n int, s char(20));
-insert into foo.t1 values (1, 'original foo.t1');
-create table foo.t3(n int, s char(20));
-insert into foo.t3 values (1, 'original foo.t3');
-create database foo2;
-create table foo2.t1(n int, s char(20));
-insert into foo2.t1 values (1, 'original foo2.t1');
-# Create bar, and bar.t1, to check that it gets replaced,
-# and bar.t3 to check that it is not touched (there is no bar.t3 on master)
-create database bar;
-create table bar.t1(n int, s char(20));
-insert into bar.t1 values (1, 'original bar.t1');
-create table bar.t3(n int, s char(20));
-insert into bar.t3 values (1, 'original bar.t3');
+# Create mysqltest2 and mysqltest3 on slave; we expect that LOAD DATA FROM
+# MASTER will neither touch database mysqltest nor mysqltest3
+create database mysqltest2;
+create table mysqltest2.t1(n int, s char(20));
+insert into mysqltest2.t1 values (1, 'original foo.t1');
+create table mysqltest2.t3(n int, s char(20));
+insert into mysqltest2.t3 values (1, 'original foo.t3');
+create database mysqltest3;
+create table mysqltest3.t1(n int, s char(20));
+insert into mysqltest3.t1 values (1, 'original foo2.t1');
+
+# Create mysqltest, and mysqltest.t1, to check that it gets replaced,
+# and mysqltest.t3 to check that it is not touched (there is no
+# mysqltest.t3 on master)
+create database mysqltest;
+create table mysqltest.t1(n int, s char(20));
+insert into mysqltest.t1 values (1, 'original bar.t1');
+create table mysqltest.t3(n int, s char(20));
+insert into mysqltest.t3 values (1, 'original bar.t3');
load data from master;
# Now let's check if we have the right tables and the right data in them
show databases;
use mysqltest2;
-# LOAD DATA FROM MASTER uses only replicate_*_db rules to decide which databases
-# have to be copied. So it thinks "foo" has to be copied. Before 4.0.16 it would
-# first drop "foo", then create "foo". This "drop" is a bug; in that case t3
-# would disappear.
-# So here the effect of this bug (BUG#1248) would be to leave an empty "foo" on
-# the slave.
+
+# LOAD DATA FROM MASTER uses only replicate_*_db rules to decide which
+# databases have to be copied. So it thinks "mysqltest" has to be
+# copied. Before 4.0.16 it would first drop "mysqltest", then create
+# "mysqltest". This "drop" is a bug; in that case t3 would disappear. So
+# here the effect of this bug (BUG#1248) would be to leave an empty
+# "mysqltest" on the slave.
+
show tables; # should be t1 & t3
select * from t1; # should be slave's original
-use foo2;
+use mysqltest3;
show tables; # should be t1
select * from t1; # should be slave's original
use mysqltest;
@@ -111,19 +121,24 @@ select * from mysqltest.t1;
# Check that LOAD DATA FROM MASTER reports the error if it can't drop a
# table to be overwritten.
# DISABLED FOR NOW AS chmod IS NOT PORTABLE ON NON-UNIX
-# insert into bar.t1 values(10, 'should be there');
+# insert into mysqltest.t1 values(10, 'should be there');
# flush tables;
-# system chmod 500 var/slave-data/bar/;
+# system chmod 500 var/slave-data/mysqltest/;
# --error 6
# load data from master; # should fail (errno 13)
-# system chmod 700 var/slave-data/bar/;
-# select * from bar.t1; # should contain the row (10, ...)
+# system chmod 700 var/slave-data/mysqltest/;
+# select * from mysqltest.t1; # should contain the row (10, ...)
# Check that LOAD TABLE FROM MASTER fails if the table exists on slave
--error 1050
-load table bar.t1 from master;
-drop table bar.t1;
+load table mysqltest.t1 from master;
+drop table mysqltest.t1;
+load table mysqltest.t1 from master;
+
+# Check what happens when requestion not existing table
+#
+--error 1188
load table bar.t1 from master;
# as LOAD DATA FROM MASTER failed it did not restart slave threads
@@ -137,5 +152,6 @@ drop database mysqltest2;
save_master_pos;
connection slave;
sync_with_master;
-drop database mysqltest;
+# These has to be droped on slave as they are not replicated
drop database mysqltest2;
+drop database mysqltest3;
diff --git a/mysql-test/t/rpl_alter.test b/mysql-test/t/rpl_alter.test
index 6b8cf773150..a913f01cd81 100644
--- a/mysql-test/t/rpl_alter.test
+++ b/mysql-test/t/rpl_alter.test
@@ -1,22 +1,22 @@
source include/master-slave.inc;
--disable_warnings
-drop database if exists test_$1;
+drop database if exists mysqltest;
--enable_warnings
-create database test_$1;
+create database mysqltest;
-create table test_$1.t1 ( n int);
-alter table test_$1.t1 add m int;
-insert into test_$1.t1 values (1,2);
-create table test_$1.t2 (n int);
-insert into test_$1.t2 values (45);
-rename table test_$1.t2 to test_$1.t3, test_$1.t1 to test_$1.t2;
+create table mysqltest.t1 ( n int);
+alter table mysqltest.t1 add m int;
+insert into mysqltest.t1 values (1,2);
+create table mysqltest.t2 (n int);
+insert into mysqltest.t2 values (45);
+rename table mysqltest.t2 to mysqltest.t3, mysqltest.t1 to mysqltest.t2;
save_master_pos;
connection slave;
sync_with_master;
-select * from test_$1.t2;
-select * from test_$1.t3;
+select * from mysqltest.t2;
+select * from mysqltest.t3;
connection master;
-drop database test_$1;
+drop database mysqltest;
save_master_pos;
connection slave;
sync_with_master;
diff --git a/mysql-test/t/rpl_loaddata_rule_m.test b/mysql-test/t/rpl_loaddata_rule_m.test
index 18f295f8ce2..ec3a9259e32 100644
--- a/mysql-test/t/rpl_loaddata_rule_m.test
+++ b/mysql-test/t/rpl_loaddata_rule_m.test
@@ -3,6 +3,11 @@
# This is for BUG#1100 (LOAD DATA INFILE was half-logged).
source include/master-slave.inc;
+
+--disable_warnings
+drop database if exists mysqltest;
+--enable_warnings
+
connection slave;
reset master;
@@ -10,9 +15,9 @@ reset master;
connection master;
# 'test' is the current database
-create database test2;
+create database mysqltest;
create table t1(a int, b int, unique(b));
-use test2;
+use mysqltest;
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
show binlog events from 79; # should be nothing
-drop database test2;
+drop database mysqltest;
diff --git a/mysql-test/t/rpl_trunc_binlog.test b/mysql-test/t/rpl_trunc_binlog.test
index efdc3012471..1f224423c97 100644
--- a/mysql-test/t/rpl_trunc_binlog.test
+++ b/mysql-test/t/rpl_trunc_binlog.test
@@ -1,7 +1,7 @@
-# We are testing if a binlog which contains BEGIN but not COMMIT (the master did
-# while writing the transaction to the binlog) triggers an error on slave.
-# So we use such a truncated binlog and simulate that the master restarted after
-# this.
+# We are testing if a binlog which contains BEGIN but not COMMIT (the
+# master did while writing the transaction to the binlog) triggers an
+# error on slave. So we use such a truncated binlog and simulate that
+# the master restarted after this.
source include/master-slave.inc;
@@ -9,8 +9,8 @@ connection slave;
stop slave;
connection master;
flush logs;
-system mv -f var/log/master-bin.001 var/log/master-bin.002;
-system cp std_data/trunc_binlog.001 var/log/master-bin.001;
+system mv -f var/log/master-bin.000001 var/log/master-bin.000002;
+system cp std_data/trunc_binlog.000001 var/log/master-bin.000001;
connection slave;
reset slave;
start slave;