summaryrefslogtreecommitdiff
path: root/mysql-test/include
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@sun.com>2010-06-06 13:19:29 +0200
committerJon Olav Hauglid <jon.hauglid@sun.com>2010-06-06 13:19:29 +0200
commit142a162c665704ce5b4d5b671d05a068661c088a (patch)
treedef1ebab09889a8f09a9fcd074c8a672689376af /mysql-test/include
parentcbf4019a1b3ec82bdcd9a65db114908a920fb01c (diff)
parent60a9d9bbb94ac03159bcc2d75b649abb1c9dc956 (diff)
downloadmariadb-git-142a162c665704ce5b4d5b671d05a068661c088a.tar.gz
manual merge from mysql-trunk-bugfixing
Conflicts: Text conflict in mysql-test/r/archive.result Contents conflict in mysql-test/r/innodb_bug38231.result Text conflict in mysql-test/r/mdl_sync.result Text conflict in mysql-test/suite/binlog/t/disabled.def Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result Text conflict in mysql-test/t/archive.test Contents conflict in mysql-test/t/innodb_bug38231.test Text conflict in mysql-test/t/mdl_sync.test Text conflict in sql/sp_head.cc Text conflict in sql/sql_show.cc Text conflict in sql/table.cc Text conflict in sql/table.h
Diffstat (limited to 'mysql-test/include')
-rw-r--r--mysql-test/include/innodb-index.inc26
-rw-r--r--mysql-test/include/mysqlhotcopy.inc121
-rw-r--r--mysql-test/include/not_var_link.inc7
-rw-r--r--mysql-test/include/show_slave_status.inc2
-rw-r--r--mysql-test/include/show_slave_status2.inc2
-rw-r--r--mysql-test/include/test_fieldsize.inc2
6 files changed, 156 insertions, 4 deletions
diff --git a/mysql-test/include/innodb-index.inc b/mysql-test/include/innodb-index.inc
new file mode 100644
index 00000000000..37de3162abe
--- /dev/null
+++ b/mysql-test/include/innodb-index.inc
@@ -0,0 +1,26 @@
+--eval create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb default charset=$charset
+insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe');
+commit;
+--error ER_DUP_ENTRY
+alter table t1 add unique index (b);
+insert into t1 values(8,9,'fff','fff');
+select * from t1;
+show create table t1;
+alter table t1 add index (b);
+insert into t1 values(10,10,'kkk','iii');
+select * from t1;
+select * from t1 force index(b) order by b;
+explain select * from t1 force index(b) order by b;
+show create table t1;
+alter table t1 add unique index (c), add index (d);
+insert into t1 values(11,11,'aaa','mmm');
+select * from t1;
+select * from t1 force index(b) order by b;
+select * from t1 force index(c) order by c;
+select * from t1 force index(d) order by d;
+explain select * from t1 force index(b) order by b;
+explain select * from t1 force index(c) order by c;
+explain select * from t1 force index(d) order by d;
+show create table t1;
+check table t1;
+drop table t1;
diff --git a/mysql-test/include/mysqlhotcopy.inc b/mysql-test/include/mysqlhotcopy.inc
new file mode 100644
index 00000000000..b3fd5e47179
--- /dev/null
+++ b/mysql-test/include/mysqlhotcopy.inc
@@ -0,0 +1,121 @@
+# Test of mysqlhotcopy (perl script)
+# Author: Horst Hunger
+# Created: 2010-05-10
+
+--source include/not_windows.inc
+--source include/not_embedded.inc
+
+if ($MYSQLHOTCOPY)
+{
+ die due to missing mysqlhotcopy tool;
+}
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+--disable_warnings
+DROP DATABASE IF EXISTS hotcopy_test;
+--enable_warnings
+CREATE DATABASE hotcopy_test;
+USE hotcopy_test;
+eval CREATE TABLE t1 (c1 int, c2 varchar(20)) ENGINE=$engine;
+eval CREATE TABLE t2 (c1 int, c2 varchar(20)) ENGINE=$engine;
+eval CREATE TABLE t3 (c1 int, c2 varchar(20)) ENGINE=$engine;
+
+INSERT INTO t1 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb');
+INSERT INTO t2 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb');
+INSERT INTO t3 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb');
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_test
+
+# backup into another database in the same directory
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_save
+
+USE hotcopy_save;
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+
+# restore data into the original database with mysqlhotcopy
+if(`SELECT engine= 'MyISAM' FROM information_schema.tables WHERE table_name='t1'`)
+{
+USE hotcopy_test;
+DELETE FROM t1;
+SELECT * FROM t1;
+
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet --addtodest -S $MASTER_MYSOCK -u root hotcopy_save hotcopy_test
+
+USE hotcopy_save;
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+}
+
+USE hotcopy_test;
+DROP TABLE t2;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_test
+
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet --addtodest -S $MASTER_MYSOCK -u root hotcopy_save hotcopy_test
+
+FLUSH TABLES;
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+
+# backup of db into a directory
+USE hotcopy_test;
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test $MYSQLTEST_VARDIR/tmp
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--list_files $MYSQLTEST_VARDIR/tmp/hotcopy_test
+#--exec rm -rf $MYSQLTEST_VARDIR/tmp/hotcopy_test
+--remove_files_wildcard $MYSQLTEST_VARDIR/tmp/hotcopy_test *
+--rmdir $MYSQLTEST_VARDIR/tmp/hotcopy_test
+
+# backup without full index files
+# reproduction of bug#53556, "--list_files" shows MYI files, which is wrong.
+DROP DATABASE hotcopy_save;
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet --noindices -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_save
+
+# test of option "allowold"
+DROP DATABASE hotcopy_save;
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_save
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--error 9,2304
+--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet --allowold -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_save
+
+# test of option "keepold"
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet --keepold -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_save_old
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_save
+
+# test of option "suffix"
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet --suffix=_cpy -S $MASTER_MYSOCK -u root hotcopy_test
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_test_cpy
+DROP DATABASE hotcopy_test_cpy;
+
+DROP DATABASE hotcopy_test;
+DROP DATABASE hotcopy_save;
+DROP DATABASE hotcopy_save_old;
+
diff --git a/mysql-test/include/not_var_link.inc b/mysql-test/include/not_var_link.inc
index 96db4f1dfd5..e1eb1dff2d7 100644
--- a/mysql-test/include/not_var_link.inc
+++ b/mysql-test/include/not_var_link.inc
@@ -1,6 +1,11 @@
+# Test if MYSQLTEST_VARDIR is a soft link
+# If we run in parallel, we have a suffix "/$child_num", so chop off that.
+
perl;
+ my $path= $ENV{'MYSQLTEST_VARDIR'};
+ $path=~ s|/\d+$||;
open (ISLINK, ">" . $ENV{'MYSQL_TMP_DIR'} . "/mtr_var_link");
- my $mvr= -l $ENV{'MYSQLTEST_VARDIR'} ? 1 : 0;
+ my $mvr= -l $path ? 1 : 0;
print ISLINK "let \$mtr_var_link= $mvr;\n";
close ISLINK;
EOF
diff --git a/mysql-test/include/show_slave_status.inc b/mysql-test/include/show_slave_status.inc
index 9f51b8bcea1..b315b9e45ca 100644
--- a/mysql-test/include/show_slave_status.inc
+++ b/mysql-test/include/show_slave_status.inc
@@ -2,5 +2,5 @@
# that varies depending on where the test is executed.
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # 41 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
query_vertical SHOW SLAVE STATUS;
diff --git a/mysql-test/include/show_slave_status2.inc b/mysql-test/include/show_slave_status2.inc
index e078b19be12..7e970b31d8e 100644
--- a/mysql-test/include/show_slave_status2.inc
+++ b/mysql-test/include/show_slave_status2.inc
@@ -4,5 +4,5 @@
# masked out log positions
--replace_result $MASTER_MYPORT MASTER_PORT $DEFAULT_MASTER_PORT 3306
---replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # 41 #
+--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
query_vertical SHOW SLAVE STATUS;
diff --git a/mysql-test/include/test_fieldsize.inc b/mysql-test/include/test_fieldsize.inc
index ec7b705396d..606bc63779d 100644
--- a/mysql-test/include/test_fieldsize.inc
+++ b/mysql-test/include/test_fieldsize.inc
@@ -24,7 +24,7 @@ connection slave;
START SLAVE;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # 41 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
# The following should be 0