mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 22:12:30 +01:00
e702b70d67
The --enable_prepare_warnings allows to not discard warnings from autorepair of crashed table in --ps-protocol mode. Use this to properly fix the parts.partition_recover_myisam and maria.maria-recover tests. Add a test case for the new feature. This also adds missing test coverage for the case where the same warning is thrown in both prepare and execute phase. client/mysqltest.cc: Implement new commands --enable-prepare_warnings and --disable_prepare_warnings. mysql-test/r/mysqltest_ps.result: Add test case for new --enable_prepare_warning mysqltest command. mysql-test/suite/maria/t/maria-recover.test: Better fix of test case using new --enable_prepare_warnings command. mysql-test/suite/parts/t/partition_recover_myisam.test: Fix test failure in --ps-protocol mode. mysql-test/t/mysqltest_ps.test: Add test case for new --enable_prepare_warning mysqltest command.
41 lines
1.7 KiB
Text
41 lines
1.7 KiB
Text
# test the auto-recover (--myisam-recover) of partitioned myisam tables
|
|
--source include/have_partition.inc
|
|
--disable_warnings
|
|
--disable_query_log
|
|
drop table if exists t1_will_crash;
|
|
--enable_query_log
|
|
--enable_warnings
|
|
|
|
|
|
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);
|
|
FLUSH TABLES;
|
|
|
|
--echo # replacing t1.MYI with a corrupt + unclosed one created by doing:
|
|
--echo # 'create table t1 (a int key(a))' head -c1024 t1.MYI > corrupt_t1.MYI
|
|
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
|
|
# Embedded server doesn't chdir to data directory
|
|
--replace_regex /Table '.*\/data\/test\/t1_will_crash/Table '.\/test\/t1_will_crash/
|
|
--enable_prepare_warnings
|
|
SELECT * FROM t1_will_crash;
|
|
--disable_prepare_warnings
|
|
DROP TABLE t1_will_crash;
|
|
CREATE TABLE t1_will_crash (a INT, KEY (a))
|
|
ENGINE=MyISAM
|
|
PARTITION BY HASH(a)
|
|
PARTITIONS 3;
|
|
INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
|
|
FLUSH TABLES;
|
|
--echo # replacing t1#P#p1.MYI with a corrupt + unclosed one created by doing:
|
|
--echo # 'create table t1 (a int key(a)) partition by hash (a) partitions 3'
|
|
--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
|
|
# Embedded server doesn't chdir to data directory
|
|
--replace_regex /Table '.*\/data\/test\/t1_will_crash/Table '.\/test\/t1_will_crash/
|
|
--enable_prepare_warnings
|
|
SELECT * FROM t1_will_crash;
|
|
--disable_prepare_warnings
|
|
DROP TABLE t1_will_crash;
|