mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-16421 Make system tables crash safe
Make all system tables in mysql directory of type engine=Aria Privilege tables are using transactional=1 Statistical tables are using transactional=0, to allow them to be quickly updated with low overhead. Help tables are also using transactional=0 as these are only updated at init time. Other changes: - Aria store engine is now a required engine - Update comment for Aria tables to reflect their new usage - Fixed that _ma_reset_trn_for_table() removes unlocked table from transaction table list. This was needed to allow one to lock and unlock system tables separately from other tables, for example when reading a procedure from mysql.proc - Don't give a warning when using transactional=1 for engines that is using transactions. This is both logical and also to avoid warnings/errors when doing an alter of a privilege table to InnoDB. - Don't abort on warnings from ALTER TABLE for changes that would be accepted by CREATE TABLE. - New created Aria transactional tables are marked as not movable (as they include create_rename_lsn). - bootstrap.test was changed to kill orignal server, as one can't anymore have two servers started at same time on same data directory and data files. - Disable maria.small_blocksize as one can't anymore change aria block size after system tables are created. - Speed up creation of help tables by using lock tables. - wsrep_sst_resync now also copies Aria redo logs.
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
--source include/not_embedded.inc
|
||||
#
|
||||
# test mysqld in bootstrap mode
|
||||
#
|
||||
@ -15,7 +16,9 @@ let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR --def
|
||||
use test;
|
||||
CREATE TABLE t1(a int);
|
||||
EOF
|
||||
--source include/kill_mysqld.inc
|
||||
--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
|
||||
--source include/start_mysqld.inc
|
||||
drop table t1;
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql;
|
||||
#
|
||||
@ -25,9 +28,11 @@ remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql;
|
||||
use test;
|
||||
CREATE TABLE t1;
|
||||
EOF
|
||||
--source include/kill_mysqld.inc
|
||||
--error 1
|
||||
--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
|
||||
# Table t1 should not exists
|
||||
--source include/start_mysqld.inc
|
||||
--error 1051
|
||||
drop table t1;
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql;
|
||||
@ -35,17 +40,15 @@ remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql;
|
||||
#
|
||||
# Bootstrap with a query larger than 2*thd->net.max_packet
|
||||
#
|
||||
set @my_max_allowed_packet= @@max_allowed_packet;
|
||||
set global max_allowed_packet=64*@@max_allowed_packet;
|
||||
--disable_query_log
|
||||
create table t1 select 2 as a, concat(repeat('MySQL', @@max_allowed_packet/10), ';') as b;
|
||||
eval select * into outfile '$MYSQLTEST_VARDIR/tmp/long_query.sql' from t1;
|
||||
--enable_query_log
|
||||
--source include/kill_mysqld.inc
|
||||
--error 1
|
||||
--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/long_query.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/long_query.sql;
|
||||
|
||||
set global max_allowed_packet=@my_max_allowed_packet;
|
||||
--source include/start_mysqld.inc
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
@ -62,8 +65,10 @@ SELECT 'bug' as '' FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'
|
||||
#
|
||||
# MDEV-13063 Server crashes in intern_plugin_lock or assertion `plugin_ptr->ref_count == 1' fails in plugin_init
|
||||
#
|
||||
--source include/kill_mysqld.inc
|
||||
--error 1
|
||||
--exec $MYSQLD_BOOTSTRAP_CMD --myisam_recover_options=NONE
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
--echo End of 5.5 tests
|
||||
|
||||
@ -73,6 +78,7 @@ SELECT 'bug' as '' FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'
|
||||
# Check that --bootstrap can install and uninstall plugins
|
||||
#
|
||||
let $PLUGIN_DIR=`select @@plugin_dir`;
|
||||
--source include/kill_mysqld.inc
|
||||
--write_file $MYSQLTEST_VARDIR/tmp/install_plugin.sql
|
||||
install soname 'ha_example';
|
||||
uninstall plugin unusable;
|
||||
@ -90,6 +96,7 @@ create table t1(a int) engine=example charset=latin1;
|
||||
EOF
|
||||
--exec $MYSQLD_BOOTSTRAP_CMD --plugin-dir=$PLUGIN_DIR < $MYSQLTEST_VARDIR/tmp/bootstrap_plugins.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_plugins.sql
|
||||
--source include/start_mysqld.inc
|
||||
flush tables;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
@ -104,5 +111,7 @@ truncate table mysql.plugin;
|
||||
--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql
|
||||
use test;
|
||||
EOF
|
||||
--source include/kill_mysqld.inc
|
||||
--exec $MYSQLD_BOOTSTRAP_CMD --ignore-db-dirs='some_dir' --ignore-db-dirs='some_dir' < $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql
|
||||
--source include/start_mysqld.inc
|
||||
|
Reference in New Issue
Block a user