mariadb/mysql-test/suite/rpl/r/rpl_mdev12179.result
Michael Widenius d6d63f4844 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.
2018-08-14 12:18:38 +03:00

277 lines
6.4 KiB
Text

include/rpl_init.inc [topology=1->2]
connection server_2;
call mtr.add_suppression("The automatically created table.*name may not be entirely in lowercase");
SET GLOBAL gtid_pos_auto_engines="innodb";
ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=slave_pos;
SELECT @@gtid_pos_auto_engines;
@@gtid_pos_auto_engines
SELECT @@SESSION.gtid_pos_auto_engines;
ERROR HY000: Variable 'gtid_pos_auto_engines' is a GLOBAL variable
SET GLOBAL gtid_pos_auto_engines= NULL;
ERROR 42000: Variable 'gtid_pos_auto_engines' can't be set to the value of 'NULL'
SET GLOBAL gtid_pos_auto_engines="innodb";
SELECT @@gtid_pos_auto_engines;
@@gtid_pos_auto_engines
InnoDB
SET GLOBAL gtid_pos_auto_engines="myisam,innodb";
SELECT @@gtid_pos_auto_engines;
@@gtid_pos_auto_engines
MyISAM,InnoDB
SET GLOBAL gtid_pos_auto_engines="innodb,myisam";
SELECT @@gtid_pos_auto_engines;
@@gtid_pos_auto_engines
InnoDB,MyISAM
SET GLOBAL gtid_pos_auto_engines="innodb,innodb,myisam,innodb,myisam,myisam,innodb";
SELECT @@gtid_pos_auto_engines;
@@gtid_pos_auto_engines
InnoDB,MyISAM
SET GLOBAL gtid_pos_auto_engines=DEFAULT;
SELECT @@gtid_pos_auto_engines;
@@gtid_pos_auto_engines
SET GLOBAL gtid_pos_auto_engines="";
SELECT @@gtid_pos_auto_engines;
@@gtid_pos_auto_engines
include/start_slave.inc
connection server_1;
CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1);
SELECT * FROM t1 ORDER BY a;
a
1
connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
include/stop_slave.inc
SET sql_log_bin=0;
ALTER TABLE mysql.gtid_slave_pos ENGINE=Aria;
CREATE TABLE mysql.gtid_slave_pos_innodb LIKE mysql.gtid_slave_pos;
ALTER TABLE mysql.gtid_slave_pos_innodb ENGINE=InnoDB;
INSERT INTO mysql.gtid_slave_pos_innodb SELECT * FROM mysql.gtid_slave_pos;
TRUNCATE mysql.gtid_slave_pos;
SET sql_log_bin=1;
connection server_1;
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
SELECT * FROM t1 ORDER BY a;
a
1
2
3
include/save_master_gtid.inc
*** Restart server with --gtid-pos-auto-engines=innodb,myisam ***
connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a
1
2
3
*** Verify no new gtid_slave_pos* tables are created ***
SELECT table_name, engine FROM information_schema.tables
WHERE table_schema='mysql' AND table_name LIKE 'gtid_slave_pos%'
ORDER BY table_name;
table_name engine
gtid_slave_pos Aria
gtid_slave_pos_innodb InnoDB
SELECT @@gtid_pos_auto_engines;
@@gtid_pos_auto_engines
InnoDB,MyISAM
include/stop_slave.inc
SET sql_log_bin=0;
INSERT INTO mysql.gtid_slave_pos_innodb SELECT * FROM mysql.gtid_slave_pos;
DROP TABLE mysql.gtid_slave_pos;
RENAME TABLE mysql.gtid_slave_pos_innodb TO mysql.gtid_slave_pos;
SET sql_log_bin=1;
connection server_1;
CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (4);
INSERT INTO t2 VALUES (1);
SELECT * FROM t1 ORDER BY a;
a
1
2
3
4
SELECT * FROM t2 ORDER BY a;
a
1
include/save_master_gtid.inc
*** Restart server with --gtid-pos-auto-engines=myisam,innodb ***
connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a
1
2
3
4
SELECT * FROM t2 ORDER BY a;
a
1
*** Verify that no new gtid_slave_pos* tables are auto-created ***
SELECT table_name, engine FROM information_schema.tables
WHERE table_schema='mysql' AND table_name LIKE 'gtid_slave_pos%'
ORDER BY table_name;
table_name engine
gtid_slave_pos InnoDB
include/stop_slave.inc
SET sql_log_bin=0;
ALTER TABLE mysql.gtid_slave_pos ENGINE=Aria;
SET sql_log_bin=1;
connection server_1;
INSERT INTO t1 VALUES (5);
INSERT INTO t2 VALUES (2);
SELECT * FROM t1 ORDER BY a;
a
1
2
3
4
5
SELECT * FROM t2 ORDER BY a;
a
1
2
include/save_master_gtid.inc
connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a
1
2
3
4
5
SELECT * FROM t2 ORDER BY a;
a
1
2
*** Verify that mysql.gtid_slave_pos_InnoDB is auto-created ***
SELECT lower(table_name), engine FROM information_schema.tables
WHERE table_schema='mysql' AND table_name LIKE 'gtid_slave_pos%'
ORDER BY table_name;
lower(table_name) engine
gtid_slave_pos Aria
gtid_slave_pos_innodb InnoDB
include/stop_slave.inc
SET sql_log_bin=0;
INSERT INTO mysql.gtid_slave_pos SELECT * FROM mysql.gtid_slave_pos_InnoDB;
DROP TABLE mysql.gtid_slave_pos_InnoDB;
SET sql_log_bin=1;
connection server_1;
INSERT INTO t1 VALUES (6);
INSERT INTO t2 VALUES (3);
SELECT * FROM t1 ORDER BY a;
a
1
2
3
4
5
6
SELECT * FROM t2 ORDER BY a;
a
1
2
3
include/save_master_gtid.inc
*** Restart server without --gtid-pos-auto-engines ***
connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a
1
2
3
4
5
6
SELECT * FROM t2 ORDER BY a;
a
1
2
3
*** Verify that no mysql.gtid_slave_pos* table is auto-created ***
SELECT table_name, engine FROM information_schema.tables
WHERE table_schema='mysql' AND table_name LIKE 'gtid_slave_pos%'
ORDER BY table_name;
table_name engine
gtid_slave_pos Aria
SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos GROUP BY domain_id;
domain_id max(seq_no)
0 11
include/stop_slave.inc
SET GLOBAL gtid_pos_auto_engines="innodb";
include/start_slave.inc
connection server_1;
INSERT INTO t1 VALUES (7);
INSERT INTO t2 VALUES (4);
SELECT * FROM t1 ORDER BY a;
a
1
2
3
4
5
6
7
SELECT * FROM t2 ORDER BY a;
a
1
2
3
4
include/save_master_gtid.inc
connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a
1
2
3
4
5
6
7
SELECT * FROM t2 ORDER BY a;
a
1
2
3
4
*** Verify that mysql.gtid_slave_pos_InnoDB is auto-created ***
SELECT lower(table_name), engine FROM information_schema.tables
WHERE table_schema='mysql' AND table_name LIKE 'gtid_slave_pos%'
ORDER BY table_name;
lower(table_name) engine
gtid_slave_pos Aria
gtid_slave_pos_innodb InnoDB
SELECT domain_id, max(seq_no) FROM mysql.gtid_slave_pos GROUP BY domain_id;
domain_id max(seq_no)
0 13
connection server_2;
*** Restart the slave server to prove 'gtid_slave_pos_innodb' autodiscovery ***
connection server_2;
SELECT max(seq_no) FROM mysql.gtid_slave_pos_InnoDB into @seq_no;
Warnings:
Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
connection server_1;
INSERT INTO t2(a) SELECT 1+MAX(a) FROM t2;
include/save_master_gtid.inc
connection server_2;
include/sync_with_master_gtid.inc
include/stop_slave.inc
SET GLOBAL gtid_pos_auto_engines="";
SET sql_log_bin=0;
DROP TABLE mysql.gtid_slave_pos_InnoDB;
SET sql_log_bin=1;
include/start_slave.inc
connection server_1;
DROP TABLE t1, t2;
include/rpl_end.inc