mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
7c8983e99e
Fix by explicitly setting timezone for a few more tests that need it. (We avoid setting TZ everywhere by default as this breaks some tests on windows). Also add fix of two other windows failures due to non-portable suppressions, thanks to Alex Budovski. mysql-test/mysql-test-run.pl: Don't let --timezone option from one test stray into the next test (mostly to make results more deterministic rather than depend on whatever test happens to run just before). mysql-test/suite/maria/r/maria-recover.result: Fix suppression pattern to also work with Windows \ path separator. mysql-test/suite/maria/t/maria-recover.test: Fix suppression pattern to also work with Windows \ path separator. mysql-test/suite/parts/inc/partition_timestamp.inc: Set timezone explicitly for test that needs it. mysql-test/suite/parts/r/partition_recover_myisam.result: Fix suppression pattern to also work with Windows \ path separator. mysql-test/suite/parts/t/partition_recover_myisam.test: Fix suppression pattern to also work with Windows \ path separator. mysql-test/t/mysqlbinlog_row-master.opt: Set timezone explicitly for test that needs it. mysql-test/t/mysqlbinlog_row_innodb-master.opt: Set timezone explicitly for test that needs it. mysql-test/t/mysqlbinlog_row_myisam-master.opt: Set timezone explicitly for test that needs it. mysql-test/t/mysqlbinlog_row_trans-master.opt: Set timezone explicitly for test that needs it.
68 lines
2.4 KiB
Text
68 lines
2.4 KiB
Text
# Test of the --maria-recover option.
|
|
|
|
--source include/have_maria.inc
|
|
|
|
--disable_query_log
|
|
# Note: \\. matches a single period. We use '.' as directory separator to
|
|
# account for Unix and Windows variation.
|
|
call mtr.add_suppression("Checking table: '\\..mysqltest.t_corrupted2'");
|
|
call mtr.add_suppression("Recovering table: '\\..mysqltest.t_corrupted2'");
|
|
call mtr.add_suppression("Table '\\..mysqltest.t_corrupted2' is marked as crashed and should be repaired");
|
|
--enable_query_log
|
|
|
|
# Note: we're setting an environment variable (not prefixing it by $),
|
|
# so that the perl code below can access it.
|
|
let MYSQLD_DATADIR= `select @@datadir`;
|
|
|
|
select @@global.maria_recover;
|
|
set global maria_recover=off;
|
|
select @@global.maria_recover;
|
|
set global maria_recover=default;
|
|
select @@global.maria_recover;
|
|
set global maria_recover=normal;
|
|
select @@global.maria_recover;
|
|
|
|
--disable_warnings
|
|
drop database if exists mysqltest;
|
|
--enable_warnings
|
|
create database mysqltest;
|
|
|
|
use mysqltest;
|
|
|
|
create table t1 (a varchar(1000), index(a)) engine=maria;
|
|
insert into t1 values("ThursdayMorningsMarket");
|
|
|
|
flush table t1; # put index page on disk
|
|
insert into t1 select concat(a,'b') from t1 limit 1;
|
|
# now t1 has its open_count>0 and so will t2_corrupted.
|
|
# It is not named t2 because the corruption messages which will be put
|
|
# in the error log need to be detected in mtr_process.pl, and we want
|
|
# a specific name to do specific detection (don't want to ignore
|
|
# any corruption messages of other tests using "t2" as table).
|
|
|
|
copy_file $MYSQLD_DATADIR/mysqltest/t1.frm $MYSQLD_DATADIR/mysqltest/t_corrupted2.frm;
|
|
copy_file $MYSQLD_DATADIR/mysqltest/t1.MAD $MYSQLD_DATADIR/mysqltest/t_corrupted2.MAD;
|
|
copy_file $MYSQLD_DATADIR/mysqltest/t1.MAI $MYSQLD_DATADIR/mysqltest/t_corrupted2.MAI;
|
|
|
|
# Ruin the index file.
|
|
# If maria-block-size is smaller than the default, the corruption
|
|
# messages will differ.
|
|
perl;
|
|
use strict;
|
|
use warnings;
|
|
my $fname= "$ENV{'MYSQLD_DATADIR'}/mysqltest/t_corrupted2.MAI";
|
|
open(FILE, "+<", $fname) or die;
|
|
my $whatever= ("\xAB" x 100);
|
|
sysseek (FILE, 8192, 0) or die;
|
|
syswrite (FILE, $whatever) or die;
|
|
close FILE;
|
|
EOF
|
|
|
|
replace_regex /Table.*t_corrupted2/t_corrupted2/ ;
|
|
--enable_prepare_warnings
|
|
select * from t_corrupted2; # should show corruption and repair messages
|
|
--disable_prepare_warnings
|
|
select * from t_corrupted2; # should show just rows
|
|
|
|
drop database mysqltest;
|
|
set global maria_recover=backup;
|