summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2011-01-18 23:55:39 +0100
committerMattias Jonsson <mattias.jonsson@oracle.com>2011-01-18 23:55:39 +0100
commit28604b18a6b873ec054f84226804d20f93afe5c3 (patch)
tree01a378502502166da8beb1131415a6ae2e0b2c23 /mysql-test/suite
parente55b6e576708317987a20e2ba6aed61b2ff785df (diff)
downloadmariadb-git-28604b18a6b873ec054f84226804d20f93afe5c3.tar.gz
Bug#59418: parts suite have several failures with --embedded-server
The test were using external tools not available for embedded. Fixed by rewriting the test to not rely on external tools like the mysql-client Also fixed some non portable --exec commands and replaced #p# to #P# to pass on windows.
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/parts/inc/partition_check_drop.inc4
-rw-r--r--mysql-test/suite/parts/inc/partition_layout_check1.inc13
-rw-r--r--mysql-test/suite/parts/inc/partition_layout_check2.inc7
-rw-r--r--mysql-test/suite/parts/r/partition_recover_myisam.result2
-rw-r--r--mysql-test/suite/parts/t/partition_debug_sync_innodb.test2
-rw-r--r--mysql-test/suite/parts/t/partition_recover_myisam.test6
-rw-r--r--mysql-test/suite/parts/t/partition_special_innodb.test4
7 files changed, 20 insertions, 18 deletions
diff --git a/mysql-test/suite/parts/inc/partition_check_drop.inc b/mysql-test/suite/parts/inc/partition_check_drop.inc
index daaa5e541c7..137de4165a0 100644
--- a/mysql-test/suite/parts/inc/partition_check_drop.inc
+++ b/mysql-test/suite/parts/inc/partition_check_drop.inc
@@ -66,10 +66,10 @@ if ($found_garbage)
}
# Do a manual cleanup, because the following tests should not suffer from
# remaining files
- --exec rm -f $MYSQLD_DATADIR/test/t1* || true
+ --remove_files_wildcard $MYSQLD_DATADIR/test t1*
if ($with_directories)
{
- --exec rm -f $MYSQLTEST_VARDIR/tmp/t1* || true
+ --remove_files_wildcard $MYSQLTEST_VARDIR/tmp t1*
}
}
--enable_query_log
diff --git a/mysql-test/suite/parts/inc/partition_layout_check1.inc b/mysql-test/suite/parts/inc/partition_layout_check1.inc
index bca41b6f9c7..66a93d5d8d7 100644
--- a/mysql-test/suite/parts/inc/partition_layout_check1.inc
+++ b/mysql-test/suite/parts/inc/partition_layout_check1.inc
@@ -29,14 +29,10 @@ DELETE FROM t0_definition;
let $MYSQLD_DATADIR= `select LEFT(@@datadir, LENGTH(@@datadir)-1)`;
#echo MYSQLD_DATADIR: $MYSQLD_DATADIR;
-# Dump the current definition of the table t1 to tmp1
-# This complicated method - let another mysqltest collect the output - is used
-# because of two reasons
+# Save the current definition of the table t1
# - SHOW CREATE TABLE t1 is at least currently most probably more reliable than
# the corresponding SELECT on the INFORMATION_SCHEMA
-# - SHOW CREATE TABLE .. cannot write its out put into a file like SELECT
-let $show_file= $MYSQLD_DATADIR/test/tmp1;
---exec echo "SHOW CREATE TABLE t1; exit; " | $MYSQL_TEST > $show_file 2>&1
+let $show_create= `SHOW CREATE TABLE t1`;
if ($do_file_tests)
{
# List the files belonging to the table t1
@@ -57,12 +53,13 @@ if (!$do_file_tests)
# Insert the current definition of the table t1 into t0_definition
eval INSERT INTO t0_definition SET state = 'old',
- create_command = load_file('$show_file'),
+ create_command = "$show_create",
file_list = @aux;
# Print the create table statement into the protocol
+# Added the concat to avoid changing the result files
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR '\r' ''
-SELECT create_command FROM t0_definition WHERE state = 'old';
+SELECT concat('SHOW CREATE TABLE t1;\nTable\tCreate Table\n',create_command,'\n') as `create_command` FROM t0_definition WHERE state = 'old';
if ($do_file_tests)
{
# We stored the list of files, therefore printing the content makes sense
diff --git a/mysql-test/suite/parts/inc/partition_layout_check2.inc b/mysql-test/suite/parts/inc/partition_layout_check2.inc
index 7ff871a4c45..2f74455a811 100644
--- a/mysql-test/suite/parts/inc/partition_layout_check2.inc
+++ b/mysql-test/suite/parts/inc/partition_layout_check2.inc
@@ -28,9 +28,8 @@ DELETE FROM t0_definition WHERE state = 'new';
let $MYSQLD_DATADIR= `select LEFT(@@datadir, LENGTH(@@datadir)-1)`;
#echo MYSQLD_DATADIR: $MYSQLD_DATADIR;
-# Dump the current definition of the table t1 to tmp1
-let $show_file= $MYSQLD_DATADIR/test/tmp1;
---exec echo "SHOW CREATE TABLE t1; exit; " | $MYSQL_TEST > $show_file 2>&1
+# Save the current definition of the table t1
+let $show_create= `SHOW CREATE TABLE t1`;
if ($do_file_tests)
{
@@ -52,7 +51,7 @@ if (!$do_file_tests)
# Insert the current definition of the table t1 into t0_definition
eval INSERT INTO t0_definition SET state = 'new',
- create_command = load_file('$show_file'),
+ create_command = "$show_create",
file_list = @aux;
# Print the old and new table layout, if they differ
diff --git a/mysql-test/suite/parts/r/partition_recover_myisam.result b/mysql-test/suite/parts/r/partition_recover_myisam.result
index 49775ee498e..cf3ccaa73b3 100644
--- a/mysql-test/suite/parts/r/partition_recover_myisam.result
+++ b/mysql-test/suite/parts/r/partition_recover_myisam.result
@@ -1,4 +1,4 @@
-call mtr.add_suppression("./test/t1_will_crash");
+call mtr.add_suppression("t1_will_crash");
call mtr.add_suppression("Got an error from unknown thread, ha_myisam.cc");
CREATE TABLE t1_will_crash (a INT, KEY (a)) ENGINE=MyISAM;
INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test
index 79ef3d537bf..e9abe134d84 100644
--- a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test
+++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test
@@ -14,6 +14,7 @@ partition by range (a)
insert into t1 values (1), (11), (21), (33);
SELECT * FROM t1;
SHOW CREATE TABLE t1;
+--replace_result #p# #P#
--list_files $MYSQLD_DATADIR/test
SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open';
@@ -36,6 +37,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
disconnect con1;
connection default;
--reap
+--replace_result #p# #P#
--list_files $MYSQLD_DATADIR/test
SHOW CREATE TABLE t1;
SELECT * FROM t1;
diff --git a/mysql-test/suite/parts/t/partition_recover_myisam.test b/mysql-test/suite/parts/t/partition_recover_myisam.test
index 64bc821ac37..043ec16a9f4 100644
--- a/mysql-test/suite/parts/t/partition_recover_myisam.test
+++ b/mysql-test/suite/parts/t/partition_recover_myisam.test
@@ -1,6 +1,6 @@
# test the auto-recover (--myisam-recover) of partitioned myisam tables
-call mtr.add_suppression("./test/t1_will_crash");
+call mtr.add_suppression("t1_will_crash");
call mtr.add_suppression("Got an error from unknown thread, ha_myisam.cc");
--source include/have_partition.inc
@@ -20,6 +20,8 @@ FLUSH TABLES;
let $MYSQLD_DATADIR= `select @@datadir`;
--remove_file $MYSQLD_DATADIR/test/t1_will_crash.MYI
--copy_file std_data/corrupt_t1.MYI $MYSQLD_DATADIR/test/t1_will_crash.MYI
+--replace_result \\ /
+--replace_regex /Table '.*data/Table './
SELECT * FROM t1_will_crash;
DROP TABLE t1_will_crash;
CREATE TABLE t1_will_crash (a INT, KEY (a))
@@ -33,5 +35,7 @@ FLUSH TABLES;
--echo # head -c1024 t1#P#p1.MYI > corrupt_t1#P#p1.MYI
--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI
--copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI
+--replace_result \\ /
+--replace_regex /Table '.*data/Table './
SELECT * FROM t1_will_crash;
DROP TABLE t1_will_crash;
diff --git a/mysql-test/suite/parts/t/partition_special_innodb.test b/mysql-test/suite/parts/t/partition_special_innodb.test
index eac19f6d588..f237b02f331 100644
--- a/mysql-test/suite/parts/t/partition_special_innodb.test
+++ b/mysql-test/suite/parts/t/partition_special_innodb.test
@@ -58,8 +58,8 @@ ENGINE = InnoDB
PARTITION BY HASH (a)
PARTITIONS 2;
-connect (con1,127.0.0.1,root,,test,$MASTER_MYPORT,);
-connect (con2,127.0.0.1,root,,test,$MASTER_MYPORT,);
+connect (con1, localhost, root,,);
+connect (con2, localhost, root,,);
--connection con1
SET autocommit=OFF;