Commit afd4b25d authored by Mattias Jonsson's avatar Mattias Jonsson

Bug#56659: Mismatch of CAPITAL vs small letters in "unified filelist" partitioning output

Bug#56657: Test still uses "--exec rm -f ..." which is non-portable
Bug#56601: Test uses Unix path for temporary file, fails, and writes misleading message

Several tests that was written in a non portable way (failed on windows)

Fixed by
1) backporting the fix for replace_result to also apply to list_files
(mysqltest from mysql-trunk)
2) replacing all #p#/#sp#/#tmp# to #P#/#SP#/#TMP#/
(innodb always converts filenames to lower case in windows).
3) replacing '--exec rm -f' with '--remove_files_wildcard'
4) replacing a perl snippet with '--write_file'

client/mysqltest.cc:
  backport from mysql-trunk to allow replace_result to apply
  also on list_files
mysql-test/suite/parts/inc/partition_check_drop.inc:
  Compensate for differences between innodb on windows vs unix.
  Using mysqltest command, instead of unix command to remove files.
mysql-test/suite/parts/inc/partition_crash.inc:
  compensate for differences between innodb on windows vs unix
mysql-test/suite/parts/inc/partition_fail.inc:
  compensate for differences between innodb on windows vs unix
mysql-test/suite/parts/inc/partition_layout.inc:
  compensate for differences between innodb on windows vs unix
mysql-test/suite/parts/inc/partition_layout_check1.inc:
  compensate for differences between innodb on windows vs unix
mysql-test/suite/parts/inc/partition_layout_check2.inc:
  compensate for differences between innodb on windows vs unix
mysql-test/suite/parts/r/partition_recover_myisam.result:
  updated result
mysql-test/suite/parts/r/partition_special_myisam.result:
  updated result
mysql-test/suite/parts/t/part_supported_sql_func_innodb.test:
  Test takes very long time, require --big flag
mysql-test/suite/parts/t/partition_alter1_1_2_innodb.test:
  Test takes very long time, require --big flag
mysql-test/suite/parts/t/partition_alter1_2_innodb.test:
  Test takes very long time, require --big flag
mysql-test/suite/parts/t/partition_alter2_1_1_innodb.test:
  Test takes very long time, require --big flag
mysql-test/suite/parts/t/partition_alter2_1_2_innodb.test:
  Test takes very long time, require --big flag
mysql-test/suite/parts/t/partition_alter2_2_2_innodb.test:
  Test takes very long time, require --big flag
mysql-test/suite/parts/t/partition_alter4_innodb.test:
  Test takes very long time, require --big flag
mysql-test/suite/parts/t/partition_debug_sync_innodb.test:
  compensate for differences between innodb on windows vs unix
mysql-test/suite/parts/t/partition_recover_myisam.test:
  more generic suppression (failed in windows)
mysql-test/suite/parts/t/partition_special_myisam.test:
  Using portable mysqltest command 'write_file' instead of perl snippet.
parent 73384c99
...@@ -447,7 +447,7 @@ struct st_command ...@@ -447,7 +447,7 @@ struct st_command
char *query, *query_buf,*first_argument,*last_argument,*end; char *query, *query_buf,*first_argument,*last_argument,*end;
DYNAMIC_STRING content; DYNAMIC_STRING content;
int first_word_len, query_len; int first_word_len, query_len;
my_bool abort_on_error; my_bool abort_on_error, used_replace;
struct st_expected_errors expected_errors; struct st_expected_errors expected_errors;
char require_file[FN_REFLEN]; char require_file[FN_REFLEN];
enum enum_commands type; enum enum_commands type;
...@@ -3414,7 +3414,7 @@ static int get_list_files(DYNAMIC_STRING *ds, const DYNAMIC_STRING *ds_dirname, ...@@ -3414,7 +3414,7 @@ static int get_list_files(DYNAMIC_STRING *ds, const DYNAMIC_STRING *ds_dirname,
if (ds_wild && ds_wild->length && if (ds_wild && ds_wild->length &&
wild_compare(file->name, ds_wild->str, 0)) wild_compare(file->name, ds_wild->str, 0))
continue; continue;
dynstr_append(ds, file->name); replace_dynstr_append(ds, file->name);
dynstr_append(ds, "\n"); dynstr_append(ds, "\n");
} }
set_wild_chars(0); set_wild_chars(0);
...@@ -3444,6 +3444,7 @@ static void do_list_files(struct st_command *command) ...@@ -3444,6 +3444,7 @@ static void do_list_files(struct st_command *command)
{"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"} {"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"}
}; };
DBUG_ENTER("do_list_files"); DBUG_ENTER("do_list_files");
command->used_replace= 1;
check_command_args(command, command->first_argument, check_command_args(command, command->first_argument,
list_files_args, list_files_args,
...@@ -3485,6 +3486,7 @@ static void do_list_files_write_file_command(struct st_command *command, ...@@ -3485,6 +3486,7 @@ static void do_list_files_write_file_command(struct st_command *command,
{"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"} {"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"}
}; };
DBUG_ENTER("do_list_files_write_file"); DBUG_ENTER("do_list_files_write_file");
command->used_replace= 1;
check_command_args(command, command->first_argument, check_command_args(command, command->first_argument,
list_files_args, list_files_args,
...@@ -8473,7 +8475,7 @@ int main(int argc, char **argv) ...@@ -8473,7 +8475,7 @@ int main(int argc, char **argv)
memset(&saved_expected_errors, 0, sizeof(saved_expected_errors)); memset(&saved_expected_errors, 0, sizeof(saved_expected_errors));
} }
if (command_executed != last_command_executed) if (command_executed != last_command_executed || command->used_replace)
{ {
/* /*
As soon as any command has been executed, As soon as any command has been executed,
......
...@@ -26,10 +26,12 @@ if ($do_file_tests) ...@@ -26,10 +26,12 @@ if ($do_file_tests)
{ {
let $ls_file= $MYSQLD_DATADIR/test/tmp2; let $ls_file= $MYSQLD_DATADIR/test/tmp2;
# List the files belonging to the table t1 # List the files belonging to the table t1
--replace_result $MYSQLTEST_VARDIR \$MYSQLTEST_VARDIR #p# #P# #sp# #SP#
--list_files_write_file $ls_file $MYSQLD_DATADIR/test t1* --list_files_write_file $ls_file $MYSQLD_DATADIR/test t1*
--chmod 0644 $ls_file --chmod 0644 $ls_file
if ($with_directories) if ($with_directories)
{ {
--replace_result $MYSQLTEST_VARDIR \$MYSQLTEST_VARDIR #p# #P# #sp# #SP#
--list_files_append_file $ls_file $MYSQLTEST_VARDIR/tmp t1* --list_files_append_file $ls_file $MYSQLTEST_VARDIR/tmp t1*
} }
eval SET @aux = load_file('$ls_file'); eval SET @aux = load_file('$ls_file');
...@@ -60,16 +62,15 @@ if ($found_garbage) ...@@ -60,16 +62,15 @@ if ($found_garbage)
--echo # <alter partitioning> worked incomplete. --echo # <alter partitioning> worked incomplete.
--echo # We found: --echo # We found:
# Print the list of files into the protocol # Print the list of files into the protocol
eval SELECT REPLACE(file_list,'$MYSQLTEST_VARDIR','\$MYSQLTEST_VARDIR') eval SELECT file_list AS "unified filelist"
AS "unified filelist"
FROM t0_definition WHERE state = 'old'; FROM t0_definition WHERE state = 'old';
} }
# Do a manual cleanup, because the following tests should not suffer from # Do a manual cleanup, because the following tests should not suffer from
# remaining files # remaining files
--exec rm -f $MYSQLD_DATADIR/test/t1* || true --remove_files_wildcard $MYSQLD_DATADIR/test t1*
if ($with_directories) if ($with_directories)
{ {
--exec rm -f $MYSQLTEST_VARDIR/tmp/t1* || true --remove_files_wildcard $MYSQLTEST_VARDIR/tmp t1*
} }
} }
--enable_query_log --enable_query_log
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
--eval $create_statement --eval $create_statement
--eval $insert_statement --eval $insert_statement
--echo # State before crash --echo # State before crash
--replace_result #p# #P# --replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test --list_files $DATADIR/test
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
--sorted_result --sorted_result
...@@ -14,13 +14,13 @@ SELECT * FROM t1; ...@@ -14,13 +14,13 @@ SELECT * FROM t1;
--error 2013 --error 2013
--eval $crash_statement --eval $crash_statement
--echo # State after crash (before recovery) --echo # State after crash (before recovery)
--replace_regex /sqlx.*\./sqlx-nnnn_nnnn./ /#p#/#P#/ --replace_regex /sqlx.*\./sqlx-nnnn_nnnn./ /#p#/#P#/ /#sp#/#SP#/ /#tmp#/#TMP#/
--list_files $DATADIR/test --list_files $DATADIR/test
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
--echo # State after crash recovery --echo # State after crash recovery
--replace_result #p# #P# --replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test --list_files $DATADIR/test
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
--sorted_result --sorted_result
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
--eval $create_statement --eval $create_statement
--eval $insert_statement --eval $insert_statement
--echo # State before failure --echo # State before failure
--replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test --list_files $DATADIR/test
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
--sorted_result --sorted_result
...@@ -11,6 +12,7 @@ SELECT * FROM t1; ...@@ -11,6 +12,7 @@ SELECT * FROM t1;
--eval $fail_statement --eval $fail_statement
--enable_abort_on_error --enable_abort_on_error
--echo # State after failure --echo # State after failure
--replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test --list_files $DATADIR/test
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
--sorted_result --sorted_result
......
...@@ -10,6 +10,6 @@ eval SHOW CREATE TABLE t1; ...@@ -10,6 +10,6 @@ eval SHOW CREATE TABLE t1;
if ($ls) if ($ls)
{ {
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR #p# #P# #sp# #SP#
--list_files $MYSQLD_DATADIR/test t1* --list_files $MYSQLD_DATADIR/test t1*
} }
...@@ -69,7 +69,7 @@ if ($do_file_tests) ...@@ -69,7 +69,7 @@ if ($do_file_tests)
if ($ls) if ($ls)
{ {
# Print the list of files into the protocol # Print the list of files into the protocol
replace_result $MYSQLD_DATADIR MYSQLD_DATADIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR; replace_result $MYSQLD_DATADIR MYSQLD_DATADIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR #p# #P# #sp# #SP# part_n part_N;
SELECT file_list AS "unified filelist" SELECT file_list AS "unified filelist"
FROM t0_definition WHERE state = 'old'; FROM t0_definition WHERE state = 'old';
} }
......
...@@ -65,7 +65,7 @@ let $run= `SELECT @aux`; ...@@ -65,7 +65,7 @@ let $run= `SELECT @aux`;
if ($run) if ($run)
{ {
--vertical_results --vertical_results
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR #p# #P# #sp# #SP#
SELECT state, SELECT state,
REPLACE(create_command,'\n',' ') AS "Table definition", REPLACE(create_command,'\n',' ') AS "Table definition",
REPLACE(file_list ,'\n',' ') AS "File list" REPLACE(file_list ,'\n',' ') AS "File list"
......
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"); call mtr.add_suppression("Got an error from unknown thread");
CREATE TABLE t1_will_crash (a INT, KEY (a)) ENGINE=MyISAM; 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); INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
......
...@@ -214,7 +214,7 @@ SET lock_wait_timeout = 2; ...@@ -214,7 +214,7 @@ SET lock_wait_timeout = 2;
ALTER TABLE t1 COALESCE PARTITION 2; ALTER TABLE t1 COALESCE PARTITION 2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction ERROR HY000: Lock wait timeout exceeded; try restarting transaction
# Connection 3 tries to load into the table: # Connection 3 tries to load into the table:
LOAD DATA LOCAL INFILE '/tmp/load.in' INTO TABLE t1 (f); LOAD DATA INFILE 'load.in' INTO TABLE t1 (f);
# Connection 1 commits the transaction # Connection 1 commits the transaction
COMMIT; COMMIT;
# Connection 3... # Connection 3...
......
...@@ -28,6 +28,9 @@ let $do_long_tests= 1; ...@@ -28,6 +28,9 @@ let $do_long_tests= 1;
# The server must support partitioning. # The server must support partitioning.
--source include/have_partition.inc --source include/have_partition.inc
# This test takes long time, so only run it with the --big mtr-flag.
--source include/big_test.inc
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# Engine specific settings and requirements # Engine specific settings and requirements
......
...@@ -46,6 +46,9 @@ let $more_pk_ui_tests= 0; ...@@ -46,6 +46,9 @@ let $more_pk_ui_tests= 0;
# The server must support partitioning. # The server must support partitioning.
--source include/have_partition.inc --source include/have_partition.inc
# This test takes long time, so only run it with the --big mtr-flag.
--source include/big_test.inc
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# Engine specific settings and requirements # Engine specific settings and requirements
......
...@@ -46,6 +46,9 @@ let $more_pk_ui_tests= 0; ...@@ -46,6 +46,9 @@ let $more_pk_ui_tests= 0;
# The server must support partitioning. # The server must support partitioning.
--source include/have_partition.inc --source include/have_partition.inc
# This test takes long time, so only run it with the --big mtr-flag.
--source include/big_test.inc
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# Engine specific settings and requirements # Engine specific settings and requirements
......
...@@ -45,6 +45,9 @@ let $only_part_1= 1; ...@@ -45,6 +45,9 @@ let $only_part_1= 1;
# The server must support partitioning. # The server must support partitioning.
--source include/have_partition.inc --source include/have_partition.inc
# This test takes long time, so only run it with the --big mtr-flag.
--source include/big_test.inc
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# Engine specific settings and requirements # Engine specific settings and requirements
......
...@@ -45,6 +45,9 @@ let $only_part_2= 1; ...@@ -45,6 +45,9 @@ let $only_part_2= 1;
# The server must support partitioning. # The server must support partitioning.
--source include/have_partition.inc --source include/have_partition.inc
# This test takes long time, so only run it with the --big mtr-flag.
--source include/big_test.inc
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# Engine specific settings and requirements # Engine specific settings and requirements
......
...@@ -45,6 +45,9 @@ let $only_part_2= 1; ...@@ -45,6 +45,9 @@ let $only_part_2= 1;
# The server must support partitioning. # The server must support partitioning.
--source include/have_partition.inc --source include/have_partition.inc
# This test takes long time, so only run it with the --big mtr-flag.
--source include/big_test.inc
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# Engine specific settings and requirements # Engine specific settings and requirements
......
...@@ -43,6 +43,9 @@ let $more_pk_ui_tests= 0; ...@@ -43,6 +43,9 @@ let $more_pk_ui_tests= 0;
# The server must support partitioning. # The server must support partitioning.
--source include/have_partition.inc --source include/have_partition.inc
# This test takes long time, so only run it with the --big mtr-flag.
--source include/big_test.inc
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# Engine specific settings and requirements # Engine specific settings and requirements
......
...@@ -56,6 +56,7 @@ partition by range (a) ...@@ -56,6 +56,7 @@ partition by range (a)
insert into t1 values (1), (11), (21), (33); insert into t1 values (1), (11), (21), (33);
SELECT * FROM t1; SELECT * FROM t1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
--replace_result #p# #P# #sp# #SP#
--list_files $MYSQLD_DATADIR/test --list_files $MYSQLD_DATADIR/test
SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open'; SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open';
...@@ -78,6 +79,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p0 INTO ...@@ -78,6 +79,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
disconnect con1; disconnect con1;
connection default; connection default;
--reap --reap
--replace_result #p# #P# #sp# #SP#
--list_files $MYSQLD_DATADIR/test --list_files $MYSQLD_DATADIR/test
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT * FROM t1; SELECT * FROM t1;
......
# test the auto-recover (--myisam-recover) of partitioned myisam tables # 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"); call mtr.add_suppression("Got an error from unknown thread");
--source include/have_partition.inc --source include/have_partition.inc
......
...@@ -62,13 +62,14 @@ ALTER TABLE t1 COALESCE PARTITION 2; ...@@ -62,13 +62,14 @@ ALTER TABLE t1 COALESCE PARTITION 2;
--connect (con3,localhost,root,,) --connect (con3,localhost,root,,)
perl; --let $MYSQLD_DATADIR= `SELECT @@datadir`
open( LD, ">" . "/tmp/load.in" ) || die "Could not open file for writing " . $ENV{'MYSQLTEST_DATADIR'} . "/test/load.in"; --write_file $MYSQLD_DATADIR/test/load.in
print LD "1\n2\n3\n"; 1
close( LD ); 2
3
EOF EOF
--echo # Connection 3 tries to load into the table: --echo # Connection 3 tries to load into the table:
send LOAD DATA LOCAL INFILE '/tmp/load.in' INTO TABLE t1 (f); send LOAD DATA INFILE 'load.in' INTO TABLE t1 (f);
--connection default --connection default
--real_sleep 1 --real_sleep 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment