mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.11 into 11.0
This commit is contained in:
@@ -16,10 +16,9 @@ if ($stop_position)
|
||||
--exec $MYSQL_BINLOG -F --print-table-metadata $_stop_position_opt $binlog_file > $output_file
|
||||
|
||||
|
||||
--let SEARCH_PATTERN= # (?:Columns\(| {8}).*
|
||||
--let SEARCH_PATTERN= (?m-s:# (?:Columns\(| {8}).*)
|
||||
--let SEARCH_FILE= $output_file
|
||||
--let SEARCH_OUTPUT=matches
|
||||
--let SEARCH_TYPE="_gm_"
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
if ($print_primary_key)
|
||||
|
@@ -69,8 +69,6 @@ INSERT INTO t2 VALUES (5, "i1a");
|
||||
connection server_4;
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
include/start_slave.inc
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a b
|
||||
@@ -91,8 +89,6 @@ connection server_2;
|
||||
include/stop_slave.inc
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
include/start_slave.inc
|
||||
connection server_4;
|
||||
UPDATE t2 SET b="j1a" WHERE a=5;
|
||||
@@ -121,8 +117,6 @@ include/save_master_gtid.inc
|
||||
connection server_3;
|
||||
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4,
|
||||
MASTER_USE_GTID=CURRENT_POS;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
include/start_slave.inc
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
|
@@ -2,6 +2,8 @@ include/master-slave.inc
|
||||
[connection master]
|
||||
call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, .*error.* 1153");
|
||||
call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
|
||||
call mtr.add_suppression("Could not write packet:");
|
||||
call mtr.add_suppression("Got a packet bigger than 'max_allowed_packet' bytes");
|
||||
drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
|
||||
create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
|
||||
connection master;
|
||||
|
@@ -37,7 +37,9 @@ connection con_temp1;
|
||||
BEGIN;
|
||||
INSERT INTO t2 VALUES (21);
|
||||
connection server_2;
|
||||
START SLAVE;
|
||||
START SLAVE IO_THREAD;
|
||||
include/wait_for_slave_param.inc [Read_Master_Log_Pos]
|
||||
START SLAVE SQL_THREAD;
|
||||
connection con_temp2;
|
||||
SET @old_dbug= @@GLOBAL.debug_dbug;
|
||||
SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger";
|
||||
|
@@ -64,7 +64,7 @@ SET sql_mode=@mode;
|
||||
# Test litteral concat
|
||||
#
|
||||
SELECT 'a' 'b';
|
||||
a
|
||||
ab
|
||||
ab
|
||||
SELECT 'a' '';
|
||||
a
|
||||
@@ -76,13 +76,13 @@ SELECT '' '';
|
||||
NULL
|
||||
NULL
|
||||
SELECT '' 'b' 'c';
|
||||
b
|
||||
bc
|
||||
bc
|
||||
SELECT '' '' 'c';
|
||||
c
|
||||
c
|
||||
SELECT 'a' '' 'c';
|
||||
a
|
||||
ac
|
||||
ac
|
||||
SELECT 'a' '' '';
|
||||
a
|
||||
|
@@ -22,8 +22,9 @@ insert t2 values (repeat('tempsecret', 12));
|
||||
insert t3 values (repeat('dummysecret', 12));
|
||||
|
||||
--echo # Wait max 10 min for key encryption threads to encrypt all spaces
|
||||
--let $tables_count= `select count(*) + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'`
|
||||
--let $wait_timeout= 600
|
||||
--let $wait_condition=SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
|
||||
--let $wait_condition=SELECT COUNT(*) = $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--sorted_result
|
||||
@@ -93,8 +94,9 @@ UNLOCK TABLES;
|
||||
SET GLOBAL innodb_encrypt_tables = on;
|
||||
|
||||
--echo # Wait max 10 min for key encryption threads to encrypt all spaces
|
||||
--let $tables_count= `select count(*) + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'`
|
||||
--let $wait_timeout= 600
|
||||
--let $wait_condition=SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
--let $wait_condition=SELECT COUNT(*) = $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--sorted_result
|
||||
|
@@ -26,9 +26,4 @@ connection master;
|
||||
CHANGE MASTER TO MASTER_USER='root', MASTER_SSL=0, MASTER_SSL_CA='', MASTER_SSL_CERT='',
|
||||
MASTER_SSL_KEY='', MASTER_SSL_CRL='', MASTER_SSL_CRLPATH='';
|
||||
CHANGE MASTER TO MASTER_USER='root', MASTER_PASSWORD='', MASTER_SSL=0;
|
||||
"Usage of CURRENT_POS in CHANGE MASTER MASTER_USE_GTID is dreprecated.
|
||||
CHANGE MASTER TO MASTER_USE_GTID=CURRENT_POS;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS;
|
||||
include/rpl_end.inc
|
||||
|
@@ -1,6 +1,6 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
|
||||
SET GLOBAL LOG_WARNINGS=4;
|
||||
create table t1(n int);
|
||||
insert into t1 values(get_lock("lock",2));
|
||||
disconnect master;
|
||||
@@ -35,4 +35,5 @@ NULL
|
||||
connection master1;
|
||||
drop table t1;
|
||||
connection slave;
|
||||
connection default;
|
||||
include/rpl_end.inc
|
||||
|
21
mysql-test/suite/galera/r/MDEV-33136.result
Normal file
21
mysql-test/suite/galera/r/MDEV-33136.result
Normal file
@@ -0,0 +1,21 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
connect node_1a,127.0.0.1,root,,test,$NODE_MYPORT_1;
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
|
||||
connection node_1a;
|
||||
TRUNCATE TABLE t1;
|
||||
SET SESSION wsrep_retry_autocommit = 0;
|
||||
SET DEBUG_SYNC = 'dict_stats_mdl_acquired SIGNAL may_toi WAIT_FOR bf_abort';
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection node_1;
|
||||
SET DEBUG_SYNC = 'now WAIT_FOR may_toi';
|
||||
TRUNCATE TABLE t1;
|
||||
connection node_1a;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
connection node_1;
|
||||
SET DEBUG_SYNC = 'RESET';
|
||||
DROP TABLE t1;
|
||||
disconnect node_1a;
|
||||
disconnect node_2;
|
||||
disconnect node_1;
|
@@ -12,9 +12,9 @@ connection node_1;
|
||||
connection node_2;
|
||||
Starting server ...
|
||||
connection node_1;
|
||||
# Both should return FOUND 2 as we have bootstrap and SST
|
||||
FOUND 2 /Desyncing and pausing the provider/ in mysqld.1.err
|
||||
FOUND 2 /Resuming and resyncing the provider/ in mysqld.1.err
|
||||
# Both should return NOT FOUND as we have mariabackup with backup locks
|
||||
NOT FOUND /Desyncing and pausing the provider/ in mysqld.1.err
|
||||
NOT FOUND /Resuming and resyncing the provider/ in mysqld.1.err
|
||||
connection node_1;
|
||||
SET GLOBAL wsrep_mode = "BF_ABORT_MARIABACKUP";
|
||||
# Restart node_2, force SST.
|
||||
@@ -25,9 +25,9 @@ connection node_2;
|
||||
Starting server ...
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
# Both should return FOUND 3 as we have 1 new SST
|
||||
FOUND 3 /Desyncing and pausing the provider/ in mysqld.1.err
|
||||
FOUND 3 /Resuming and resyncing the provider/ in mysqld.1.err
|
||||
# Both should return NOT FOUND as we have mariabackup with backup locks
|
||||
NOT FOUND /Desyncing and pausing the provider/ in mysqld.1.err
|
||||
NOT FOUND /Resuming and resyncing the provider/ in mysqld.1.err
|
||||
SET GLOBAL wsrep_mode = "";
|
||||
DROP TABLE t;
|
||||
# Case 2: MariaBackup backup from node_2
|
||||
@@ -46,11 +46,13 @@ SET GLOBAL wsrep_mode = "BF_ABORT_MARIABACKUP";
|
||||
SELECT @@wsrep_mode;
|
||||
@@wsrep_mode
|
||||
BF_ABORT_MARIABACKUP
|
||||
# Both should return FOUND 1 as node should not desync
|
||||
FOUND 1 /Desyncing and pausing the provider/ in mysqld.2.err
|
||||
FOUND 1 /Resuming and resyncing the provider/ in mysqld.2.err
|
||||
# Should return FOUND 1 because only last backup does not desync
|
||||
FOUND 1 /Server not desynched from group because WSREP_MODE_BF_MARIABACKUP used./ in mysqld.2.err
|
||||
# Both should return FOUND 2 because both backups do desync but on different points
|
||||
FOUND 2 /Desyncing and pausing the provider/ in mysqld.2.err
|
||||
FOUND 2 /Resuming and resyncing the provider/ in mysqld.2.err
|
||||
# Should return FOUND 1 as server did not desync at BLOCK_DDL
|
||||
FOUND 1 /Server not desynched from group at BLOCK_DDL because WSREP_MODE_BF_MARIABACKUP is used./ in mysqld.2.err
|
||||
# Should return FOUND 1 as server did desync and pause at BLOCK_COMMIT
|
||||
FOUND 1 /Server desynched from group during BACKUP STAGE BLOCK_COMMIT./ in mysqld.2.err
|
||||
SET GLOBAL wsrep_mode = "";
|
||||
connection node_1;
|
||||
DROP TABLE t;
|
||||
|
@@ -10,7 +10,7 @@ INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t2 VALUES (1);
|
||||
connection node_2a;
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification');
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE 'Commit' or STATE = 'Waiting for certification');
|
||||
EXPECT_1
|
||||
1
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%';
|
||||
|
@@ -8,8 +8,6 @@ connection node_4;
|
||||
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node.");
|
||||
connection node_3;
|
||||
CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_1, master_use_gtid=current_pos;;
|
||||
Warnings:
|
||||
Warning 1681 'master_use_gtid=current_pos' is deprecated and will be removed in a future release. Please use master_demote_to_slave=1 instead
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
connection node_1;
|
||||
|
44
mysql-test/suite/galera/t/MDEV-33136.test
Normal file
44
mysql-test/suite/galera/t/MDEV-33136.test
Normal file
@@ -0,0 +1,44 @@
|
||||
#
|
||||
# MDEV-33136: Properly BF-abort user transactions with explicit locks
|
||||
#
|
||||
# User transactions may acquire explicit MDL locks from InnoDB level
|
||||
# when persistent statistics is re-read for a table.
|
||||
# If such a transaction would be subject to BF-abort, it was improperly
|
||||
# detected as a system transaction and wouldn't get aborted.
|
||||
#
|
||||
# The fix: Check if a transaction holding explicit MDL locks is a user
|
||||
# transaction in the MDL conflict handling code.
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_debug_sync.inc
|
||||
--source include/have_debug.inc
|
||||
|
||||
--connect node_1a,127.0.0.1,root,,test,$NODE_MYPORT_1
|
||||
|
||||
--connection node_1
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
|
||||
|
||||
--connection node_1a
|
||||
TRUNCATE TABLE t1;
|
||||
# TRUNCATE forces the next statement to re-read statistics from persistent storage,
|
||||
# which will acquire MDL locks on the statistics tables in InnoDB.
|
||||
SET SESSION wsrep_retry_autocommit = 0;
|
||||
SET DEBUG_SYNC = 'dict_stats_mdl_acquired SIGNAL may_toi WAIT_FOR bf_abort';
|
||||
--send
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
--connection node_1
|
||||
SET DEBUG_SYNC = 'now WAIT_FOR may_toi';
|
||||
TRUNCATE TABLE t1;
|
||||
|
||||
--connection node_1a
|
||||
# Local INSERT gets aborted.
|
||||
--error ER_LOCK_DEADLOCK
|
||||
--reap
|
||||
|
||||
# Cleanup
|
||||
--connection node_1
|
||||
SET DEBUG_SYNC = 'RESET';
|
||||
DROP TABLE t1;
|
||||
--disconnect node_1a
|
||||
--source include/galera_end.inc
|
@@ -13,7 +13,7 @@
|
||||
CREATE TABLE t(i INT NOT NULL PRIMARY KEY) ENGINE INNODB;
|
||||
INSERT INTO t VALUES(1);
|
||||
#
|
||||
# In default settings donor should desync
|
||||
# In default settings donor should not desync
|
||||
#
|
||||
--echo # Restart node_2, force SST.
|
||||
--connection node_2
|
||||
@@ -37,7 +37,7 @@ let $restart_noprint=2;
|
||||
|
||||
--connection node_1
|
||||
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
--echo # Both should return FOUND 2 as we have bootstrap and SST
|
||||
--echo # Both should return NOT FOUND as we have mariabackup with backup locks
|
||||
let SEARCH_PATTERN = Desyncing and pausing the provider;
|
||||
--source include/search_pattern_in_file.inc
|
||||
let SEARCH_PATTERN = Resuming and resyncing the provider;
|
||||
@@ -76,7 +76,7 @@ let $restart_noprint=2;
|
||||
|
||||
--connection node_1
|
||||
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
--echo # Both should return FOUND 3 as we have 1 new SST
|
||||
--echo # Both should return NOT FOUND as we have mariabackup with backup locks
|
||||
let SEARCH_PATTERN = Desyncing and pausing the provider;
|
||||
--source include/search_pattern_in_file.inc
|
||||
let SEARCH_PATTERN = Resuming and resyncing the provider;
|
||||
@@ -117,13 +117,16 @@ let $targetdir=$MYSQLTEST_VARDIR/tmp/backup2;
|
||||
--enable_result_log
|
||||
|
||||
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.2.err;
|
||||
--echo # Both should return FOUND 1 as node should not desync
|
||||
--echo # Both should return FOUND 2 because both backups do desync but on different points
|
||||
let SEARCH_PATTERN = Desyncing and pausing the provider;
|
||||
--source include/search_pattern_in_file.inc
|
||||
let SEARCH_PATTERN = Resuming and resyncing the provider;
|
||||
--source include/search_pattern_in_file.inc
|
||||
--echo # Should return FOUND 1 because only last backup does not desync
|
||||
let SEARCH_PATTERN = Server not desynched from group because WSREP_MODE_BF_MARIABACKUP used.;
|
||||
--echo # Should return FOUND 1 as server did not desync at BLOCK_DDL
|
||||
let SEARCH_PATTERN = Server not desynched from group at BLOCK_DDL because WSREP_MODE_BF_MARIABACKUP is used.;
|
||||
--source include/search_pattern_in_file.inc
|
||||
--echo # Should return FOUND 1 as server did desync and pause at BLOCK_COMMIT
|
||||
let SEARCH_PATTERN = Server desynched from group during BACKUP STAGE BLOCK_COMMIT.;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
SET GLOBAL wsrep_mode = "";
|
||||
|
@@ -32,7 +32,7 @@ INSERT INTO t2 VALUES (1);
|
||||
--connection node_2a
|
||||
--sleep 1
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE '%committing%' or STATE = 'Waiting for certification');
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE (STATE LIKE 'Commit' or STATE = 'Waiting for certification');
|
||||
SELECT COUNT(*) AS EXPECT_1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table metadata lock%';
|
||||
SELECT COUNT(*) AS EXPECT_0 FROM t1;
|
||||
SELECT COUNT(*) AS EXPECT_0 FROM t2;
|
||||
|
@@ -51,7 +51,7 @@ SET SESSION wsrep_sync_wait = 0;
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'committing%';
|
||||
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Commit';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
UNLOCK TABLES;
|
||||
|
@@ -96,11 +96,8 @@ a b c
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT, b INT, c INT GENERATED ALWAYS AS(a+b));
|
||||
INSERT INTO t1(a, b) VALUES (1, 1), (2, 2), (3, 3), (4, 4);
|
||||
connection con1;
|
||||
# disable purge
|
||||
BEGIN;
|
||||
SELECT * FROM t0;
|
||||
a
|
||||
connect stop_purge,localhost,root,,;
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
connection default;
|
||||
DELETE FROM t1 WHERE a = 1;
|
||||
UPDATE t1 SET a = 2, b = 2 WHERE a = 5;
|
||||
@@ -109,10 +106,11 @@ SET DEBUG_SYNC= 'inplace_after_index_build SIGNAL uncommitted WAIT_FOR purged';
|
||||
ALTER TABLE t1 ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=NONE;
|
||||
connection con1;
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR uncommitted';
|
||||
BEGIN;
|
||||
DELETE FROM t1 WHERE a = 3;
|
||||
UPDATE t1 SET a = 7, b = 7 WHERE a = 4;
|
||||
INSERT INTO t1(a, b) VALUES (8, 8);
|
||||
# enable purge
|
||||
disconnect stop_purge;
|
||||
COMMIT;
|
||||
# wait for purge to process the deleted/updated records.
|
||||
InnoDB 2 transactions not purged
|
||||
|
@@ -131,9 +131,8 @@ CREATE TABLE t1 (a INT, b INT, c INT GENERATED ALWAYS AS(a+b));
|
||||
|
||||
INSERT INTO t1(a, b) VALUES (1, 1), (2, 2), (3, 3), (4, 4);
|
||||
|
||||
connection con1;
|
||||
--echo # disable purge
|
||||
BEGIN; SELECT * FROM t0;
|
||||
connect (stop_purge,localhost,root,,);
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
|
||||
connection default;
|
||||
DELETE FROM t1 WHERE a = 1;
|
||||
@@ -148,13 +147,14 @@ send ALTER TABLE t1 ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=NONE;
|
||||
connection con1;
|
||||
SET DEBUG_SYNC= 'now WAIT_FOR uncommitted';
|
||||
|
||||
BEGIN;
|
||||
DELETE FROM t1 WHERE a = 3;
|
||||
|
||||
UPDATE t1 SET a = 7, b = 7 WHERE a = 4;
|
||||
|
||||
INSERT INTO t1(a, b) VALUES (8, 8);
|
||||
|
||||
--echo # enable purge
|
||||
disconnect stop_purge;
|
||||
COMMIT;
|
||||
|
||||
--echo # wait for purge to process the deleted/updated records.
|
||||
|
@@ -51,7 +51,7 @@ ADD INDEX(a,b,d), ADD INDEX(a,d,b), ADD INDEX(b,c,d), ADD INDEX(b,d,c),
|
||||
ALGORITHM=COPY;
|
||||
connection default;
|
||||
SET DEBUG_SYNC='now WAIT_FOR hung';
|
||||
# restart: --innodb-force-recovery=3 --debug_dbug=+d,recv_ran_out_of_buffer
|
||||
# restart: --innodb-force-recovery=3
|
||||
disconnect hang;
|
||||
FTS_INDEX_1.ibd
|
||||
FTS_INDEX_2.ibd
|
||||
|
@@ -105,3 +105,60 @@ t1 CREATE TABLE `t1` (
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC='RESET';
|
||||
#
|
||||
# MDEV-33593: Auto increment deadlock error causes ASSERT in subsequent save point
|
||||
#
|
||||
CREATE TABLE t1(col1 INT PRIMARY KEY AUTO_INCREMENT, col2 INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2(col1 INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t1(col2) values(100);
|
||||
connect con1, localhost, root,,;
|
||||
START TRANSACTION;
|
||||
# T1: Acquiring Row X lock on table t2
|
||||
INSERT INTO t2 values(100);
|
||||
connect con2, localhost, root,,;
|
||||
START TRANSACTION;
|
||||
# T2: Wait for (T1) row lock on t2 after acquiring GAP Lock on t1
|
||||
UPDATE t1 SET col2 = 20 where col1 = 10;
|
||||
SET DEBUG_SYNC='lock_wait_before_suspend SIGNAL t2_waiting';
|
||||
INSERT INTO t2 values(100);
|
||||
connection default;
|
||||
SET DEBUG_SYNC='now WAIT_FOR t2_waiting';
|
||||
# T3: Wait for (T2) II row Lock on t1 after acquiring Auto Increment Lock on t1
|
||||
SET DEBUG_SYNC='lock_wait_before_suspend SIGNAL t3_waiting';
|
||||
INSERT INTO t1(col2) SELECT col2 from t1;
|
||||
connection con1;
|
||||
SAVEPOINT s1;
|
||||
SET DEBUG_SYNC='now WAIT_FOR t3_waiting';
|
||||
# T1: Wait for (T3) auto increment lock on t1 causing T1 -> T3 -> T2 -> T1 deadlock
|
||||
SET debug_dbug = '+d,innodb_deadlock_victim_self';
|
||||
INSERT INTO t1(col2) VALUES(200);
|
||||
ERROR HY000: Failed to read auto-increment value from storage engine
|
||||
# The transaction should have been rolled back
|
||||
SELECT * FROM t1;
|
||||
col1 col2
|
||||
1 100
|
||||
SELECT * FROM t2;
|
||||
col1
|
||||
# Release the previous savepoint using the same name
|
||||
SAVEPOINT s1;
|
||||
COMMIT;
|
||||
connection con2;
|
||||
COMMIT;
|
||||
connection default;
|
||||
COMMIT;
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
# Cleanup
|
||||
SELECT * FROM t1;
|
||||
col1 col2
|
||||
1 100
|
||||
2 100
|
||||
DROP TABLE t1;
|
||||
SELECT * FROM t2;
|
||||
col1
|
||||
100
|
||||
DROP TABLE t2;
|
||||
SET DEBUG_SYNC='RESET';
|
||||
#
|
||||
# End of 10.5 tests
|
||||
#
|
||||
|
@@ -1,10 +0,0 @@
|
||||
call mtr.add_suppression("InnoDB: Difficult to find free blocks in the buffer pool");
|
||||
SET @saved_debug = @@SESSION.debug_dbug;
|
||||
SET SESSION debug_dbug="+d,ib_lru_force_no_free_page";
|
||||
CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
|
||||
COMMIT;
|
||||
SET debug_dbug = @saved_debug;
|
||||
DROP TABLE t1;
|
||||
FOUND 1 /InnoDB: Difficult to find free blocks / in mysqld.1.err
|
@@ -37,7 +37,7 @@ test.t1 analyze status Engine-independent statistics collected
|
||||
test.t1 analyze status OK
|
||||
SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
|
||||
CLUST_INDEX_SIZE
|
||||
1856
|
||||
1792
|
||||
connection con2;
|
||||
DELETE FROM t1 WHERE a00 = 'cnm';
|
||||
COMMIT;
|
||||
@@ -80,7 +80,7 @@ test.t1 analyze status Engine-independent statistics collected
|
||||
test.t1 analyze status OK
|
||||
SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
|
||||
CLUST_INDEX_SIZE
|
||||
1856
|
||||
1792
|
||||
DELETE FROM t1 WHERE a00 = 'dpn';
|
||||
COMMIT;
|
||||
INSERT INTO t1 SET a00 = 'dpn';
|
||||
@@ -117,6 +117,6 @@ test.t1 analyze status Engine-independent statistics collected
|
||||
test.t1 analyze status OK
|
||||
SELECT CLUST_INDEX_SIZE FROM information_schema.INNODB_SYS_TABLESTATS WHERE NAME = 'test/t1';
|
||||
CLUST_INDEX_SIZE
|
||||
1856
|
||||
1792
|
||||
SET DEBUG_SYNC = 'RESET';
|
||||
DROP TABLE t1;
|
||||
|
@@ -431,10 +431,6 @@ a
|
||||
connection con1;
|
||||
begin work;
|
||||
insert into t1 values (5);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
5
|
||||
insert into t1 values (2);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
select * from t1;
|
||||
@@ -509,10 +505,6 @@ a
|
||||
connection con1;
|
||||
begin work;
|
||||
insert into t1 values (5);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
5
|
||||
insert into t1 values (2);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
select * from t1;
|
||||
@@ -1217,10 +1209,6 @@ a
|
||||
connection con1;
|
||||
begin work;
|
||||
insert into t1 values (5);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
5
|
||||
insert into t1 values (2);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
select * from t1;
|
||||
|
@@ -86,7 +86,6 @@ buffer_flush_n_to_flush_by_age buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NUL
|
||||
buffer_flush_adaptive_avg_time buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Avg time (ms) spent for adaptive flushing recently.
|
||||
buffer_flush_adaptive_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of adaptive flushes passed during the recent Avg period.
|
||||
buffer_LRU_get_free_loops buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Total loops in LRU get free.
|
||||
buffer_LRU_get_free_waits buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Total sleep waits in LRU get free.
|
||||
buffer_flush_avg_page_rate buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Average number of pages at which flushing is happening
|
||||
buffer_flush_lsn_avg_rate buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Average redo generation rate
|
||||
buffer_flush_pct_for_dirty buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Percent of IO capacity used to avoid max dirty page limit
|
||||
@@ -106,7 +105,6 @@ buffer_LRU_batch_num_scan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NUL
|
||||
buffer_LRU_batch_scanned_per_call buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Pages scanned per LRU batch call
|
||||
buffer_LRU_batch_flush_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Total pages flushed as part of LRU batches
|
||||
buffer_LRU_batch_evict_total_pages buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Total pages evicted as part of LRU batches
|
||||
buffer_LRU_single_flush_failure_count Buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of times attempt to flush a single page from LRU failed
|
||||
buffer_LRU_get_free_search Buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of searches performed for a clean page
|
||||
buffer_LRU_search_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages scanned as part of LRU search
|
||||
buffer_LRU_search_num_scan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Number of times LRU search is performed
|
||||
|
@@ -174,3 +174,10 @@ SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_VIRTUAL LIMIT ROWS EXAMINED 5;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN LIMIT ROWS EXAMINED 5;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS LIMIT ROWS EXAMINED 5;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-33462 Disallow LOCK=NONE operation on statistics table
|
||||
#
|
||||
ALTER TABLE mysql.innodb_table_stats FORCE, LOCK=NONE;
|
||||
ERROR 0A000: LOCK=NONE is not supported. Reason: innodb_table_stats. Try LOCK=SHARED
|
||||
ALTER TABLE mysql.innodb_index_stats FORCE, LOCK=NONE;
|
||||
ERROR 0A000: LOCK=NONE is not supported. Reason: innodb_index_stats. Try LOCK=SHARED
|
||||
|
@@ -17,10 +17,6 @@ a
|
||||
connection con1;
|
||||
begin work;
|
||||
insert into t1 values (5);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
5
|
||||
insert into t1 values (2);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
select * from t1;
|
||||
|
@@ -202,27 +202,3 @@ Table Op Msg_type Msg_text
|
||||
test.t2 check status OK
|
||||
DROP TABLE t1,t2;
|
||||
db.opt
|
||||
#
|
||||
# MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
|
||||
# ADD PRIMARY KEY or OPTIMIZE TABLE
|
||||
#
|
||||
CREATE TABLE t1(f1 year default null, f2 year default null,
|
||||
f3 text, f4 year default null, f5 year default null,
|
||||
f6 year default null, f7 year default null,
|
||||
f8 year default null)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
|
||||
INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
|
||||
ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
|
||||
set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
|
||||
ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ADD COLUMN f10 YEAR DEFAULT NULL, ALGORITHM=INPLACE;
|
||||
connect con1,localhost,root,,,;
|
||||
SET DEBUG_SYNC="now WAIT_FOR con1_insert";
|
||||
INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
|
||||
INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
|
||||
SET DEBUG_SYNC="now SIGNAL con1_finish";
|
||||
connection default;
|
||||
disconnect con1;
|
||||
SET DEBUG_SYNC=RESET;
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
DROP TABLE t1;
|
||||
|
@@ -2,7 +2,7 @@
|
||||
FROM information_schema.global_status
|
||||
WHERE variable_name = 'innodb_instant_alter_column';
|
||||
instants
|
||||
-35
|
||||
+36
|
||||
-37
|
||||
+38
|
||||
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
|
||||
# End of 10.6 tests
|
||||
|
@@ -481,10 +481,59 @@ SET DEBUG_SYNC="now WAIT_FOR try_insert";
|
||||
INSERT INTO t1 VALUES(1, 2);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
SET DEBUG_SYNC="now SIGNAL alter_progress";
|
||||
disconnect con1;
|
||||
connection default;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
|
||||
# ADD PRIMARY KEY or OPTIMIZE TABLE
|
||||
#
|
||||
CREATE TABLE t1(f1 year default null, f2 year default null,
|
||||
f3 text, f4 year default null, f5 year default null,
|
||||
f6 year default null, f7 year default null,
|
||||
f8 year default null)ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
|
||||
ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
|
||||
set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
|
||||
ALTER TABLE t1 ADD COLUMN f10 YEAR DEFAULT NULL, FORCE, ALGORITHM=INPLACE;
|
||||
connection con1;
|
||||
SET DEBUG_SYNC="now WAIT_FOR con1_insert";
|
||||
INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
|
||||
INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
|
||||
SET DEBUG_SYNC="now SIGNAL con1_finish";
|
||||
connection default;
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-19044 Alter table corrupts while applying the
|
||||
# modification log
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
f1 INT,
|
||||
f2 INT,
|
||||
f3 char(19) CHARACTER SET utf8mb3,
|
||||
f4 VARCHAR(500),
|
||||
f5 TEXT)ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(3, 1, REPEAT('a', 2), REPEAT("b", 20),'a');
|
||||
ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL, ALGORITHM=INSTANT;
|
||||
INSERT INTO t1 VALUES(1, 2, REPEAT('InnoDB', 2),
|
||||
REPEAT("MariaDB", 20), REPEAT('a', 8000), 12);
|
||||
INSERT INTO t1 VALUES(1, 2, REPEAT('MYSQL', 2),
|
||||
REPEAT("MariaDB", 20), REPEAT('a', 8000), 12);
|
||||
SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL con1_begin WAIT_FOR con1_update';
|
||||
ALTER TABLE t1 MODIFY COLUMN f2 INT NOT NULL, FORCE, ALGORITHM=INPLACE;
|
||||
connection con1;
|
||||
SET DEBUG_SYNC='now WAIT_FOR con1_begin';
|
||||
UPDATE t1 SET f2=204 order by f1 limit 2;
|
||||
SET DEBUG_SYNC='now SIGNAL con1_update';
|
||||
connection default;
|
||||
disconnect con1;
|
||||
SET DEBUG_SYNC=reset;
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
DROP TABLE t1;
|
||||
# End of 10.4 tests
|
||||
#
|
||||
# MDEV-22867 Assertion instant.n_core_fields == n_core_fields
|
||||
@@ -529,6 +578,6 @@ SELECT variable_value-@old_instant instants
|
||||
FROM information_schema.global_status
|
||||
WHERE variable_name = 'innodb_instant_alter_column';
|
||||
instants
|
||||
35
|
||||
37
|
||||
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
|
||||
# End of 10.6 tests
|
||||
|
@@ -47,6 +47,9 @@ CREATE TABLE t1 (k INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t1 SET k=1;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 SET k=2;
|
||||
SELECT count(*) > 0 FROM mysql.innodb_index_stats lock in share mode;
|
||||
count(*) > 0
|
||||
1
|
||||
connect con1,localhost,root,,test;
|
||||
SET innodb_lock_wait_timeout=0;
|
||||
CREATE TABLE t2 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB
|
||||
@@ -54,4 +57,6 @@ AS SELECT k FROM t1;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
disconnect con1;
|
||||
connection default;
|
||||
SET innodb_lock_wait_timeout=default;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
|
108
mysql-test/suite/innodb/r/lock_isolation.result
Normal file
108
mysql-test/suite/innodb/r/lock_isolation.result
Normal file
@@ -0,0 +1,108 @@
|
||||
#
|
||||
# MDEV-26642 Weird SELECT view when a record is
|
||||
# modified to the same value by two transactions
|
||||
# MDEV-32898 Phantom rows caused by updates of PRIMARY KEY
|
||||
#
|
||||
CREATE TABLE t(a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
|
||||
INSERT INTO t VALUES (1,1),(2,2);
|
||||
BEGIN;
|
||||
SELECT * FROM t LOCK IN SHARE MODE;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
connect con_weird,localhost,root;
|
||||
BEGIN;
|
||||
SELECT * FROM t;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
connect consistent,localhost,root;
|
||||
SET innodb_snapshot_isolation=ON;
|
||||
BEGIN;
|
||||
SELECT * FROM t;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
connection default;
|
||||
UPDATE t SET a=3 WHERE b=2;
|
||||
COMMIT;
|
||||
connection consistent;
|
||||
UPDATE t SET b=3;
|
||||
ERROR HY000: Record has changed since last read in table 't'
|
||||
SELECT * FROM t;
|
||||
a b
|
||||
1 1
|
||||
3 2
|
||||
COMMIT;
|
||||
connection con_weird;
|
||||
UPDATE t SET b=3;
|
||||
SELECT * FROM t;
|
||||
a b
|
||||
1 3
|
||||
2 2
|
||||
3 3
|
||||
COMMIT;
|
||||
connection default;
|
||||
SELECT * FROM t;
|
||||
a b
|
||||
1 3
|
||||
3 3
|
||||
DROP TABLE t;
|
||||
#
|
||||
# MDEV-26643 Inconsistent behaviors of UPDATE under
|
||||
# READ UNCOMMITTED and READ COMMITTED isolation level
|
||||
#
|
||||
CREATE TABLE t(a INT, b INT) ENGINE=InnoDB;
|
||||
INSERT INTO t VALUES(NULL, 1), (2, 2);
|
||||
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
BEGIN;
|
||||
UPDATE t SET a = 10;
|
||||
connection consistent;
|
||||
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
UPDATE t SET b = 20 WHERE a;
|
||||
connection default;
|
||||
COMMIT;
|
||||
connection consistent;
|
||||
SELECT * FROM t;
|
||||
a b
|
||||
10 20
|
||||
10 20
|
||||
connection default;
|
||||
TRUNCATE TABLE t;
|
||||
INSERT INTO t VALUES(NULL, 1), (2, 2);
|
||||
BEGIN;
|
||||
UPDATE t SET a = 10;
|
||||
connection consistent;
|
||||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
UPDATE t SET b = 20 WHERE a;
|
||||
connection default;
|
||||
COMMIT;
|
||||
connection consistent;
|
||||
SELECT * FROM t;
|
||||
a b
|
||||
10 20
|
||||
10 20
|
||||
disconnect consistent;
|
||||
connection default;
|
||||
TRUNCATE TABLE t;
|
||||
INSERT INTO t VALUES(NULL, 1), (2, 2);
|
||||
BEGIN;
|
||||
UPDATE t SET a = 10;
|
||||
connection con_weird;
|
||||
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
UPDATE t SET b = 20 WHERE a;
|
||||
connection default;
|
||||
SELECT * FROM t;
|
||||
a b
|
||||
10 1
|
||||
10 2
|
||||
COMMIT;
|
||||
connection con_weird;
|
||||
COMMIT;
|
||||
disconnect con_weird;
|
||||
connection default;
|
||||
SELECT * FROM t;
|
||||
a b
|
||||
10 1
|
||||
10 20
|
||||
DROP TABLE t;
|
12
mysql-test/suite/innodb/r/log_upgrade_101_flags.result
Normal file
12
mysql-test/suite/innodb/r/log_upgrade_101_flags.result
Normal file
@@ -0,0 +1,12 @@
|
||||
call mtr.add_suppression("InnoDB: The change buffer is corrupted");
|
||||
call mtr.add_suppression("InnoDB: Tablespace size stored in header is 768 pages, but the sum of data file sizes is 384 pages");
|
||||
call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS of file");
|
||||
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-force-recovery=5 --innodb-log-file-size=4m --innodb_page_size=32k --innodb_buffer_pool_size=10M
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
COUNT(*)
|
||||
1
|
||||
FOUND 1 /InnoDB: Upgrading redo log:/ in mysqld.1.err
|
||||
# restart
|
||||
# End of 10.5 tests
|
@@ -51,7 +51,6 @@ buffer_flush_n_to_flush_by_age disabled
|
||||
buffer_flush_adaptive_avg_time disabled
|
||||
buffer_flush_adaptive_avg_pass disabled
|
||||
buffer_LRU_get_free_loops disabled
|
||||
buffer_LRU_get_free_waits disabled
|
||||
buffer_flush_avg_page_rate disabled
|
||||
buffer_flush_lsn_avg_rate disabled
|
||||
buffer_flush_pct_for_dirty disabled
|
||||
@@ -71,7 +70,6 @@ buffer_LRU_batch_num_scan disabled
|
||||
buffer_LRU_batch_scanned_per_call disabled
|
||||
buffer_LRU_batch_flush_total_pages enabled
|
||||
buffer_LRU_batch_evict_total_pages enabled
|
||||
buffer_LRU_single_flush_failure_count disabled
|
||||
buffer_LRU_get_free_search disabled
|
||||
buffer_LRU_search_scanned disabled
|
||||
buffer_LRU_search_num_scan disabled
|
||||
|
@@ -21,11 +21,17 @@ path
|
||||
DROP DATABASE abc_def;
|
||||
# restart
|
||||
DROP DATABASE abc_def2;
|
||||
call mtr.add_suppression("InnoDB: (Operating system error|Error number \\d+ means|Cannot rename file)");
|
||||
call mtr.add_suppression("InnoDB: Cannot rename '.*t1.ibd' to '.*non_existing_db.*' because the target schema directory doesn't exist");
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(100);
|
||||
RENAME TABLE t1 TO non_existing_db.t1;
|
||||
ERROR HY000: Error on rename of './test/t1' to './non_existing_db/t1' (errno: 168 "Unknown (generic) error from engine")
|
||||
FOUND 1 /\[ERROR\] InnoDB: Cannot rename file '.*t1\.ibd' to '.*non_existing_db/ in mysqld.1.err
|
||||
FOUND 1 /\[ERROR\] InnoDB: Cannot rename '.*t1\.ibd' to '.*non_existing_db/ in mysqld.1.err
|
||||
SET GLOBAL innodb_fast_shutdown=2;
|
||||
# restart
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
100
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-25509 Atomic DDL: Assertion `err != DB_DUPLICATE_KEY'
|
||||
|
@@ -57,7 +57,7 @@ ALTER TABLE t ADD INDEX(b,c,d,a),ADD INDEX(b,c,a,d),ADD INDEX(b,a,c,d),ADD INDEX
|
||||
connection default;
|
||||
SET DEBUG_SYNC='now WAIT_FOR hung';
|
||||
let $shutdown_timeout=0;
|
||||
--let $restart_parameters= --innodb-force-recovery=3 --debug_dbug="+d,recv_ran_out_of_buffer"
|
||||
--let $restart_parameters= --innodb-force-recovery=3
|
||||
--source include/restart_mysqld.inc
|
||||
disconnect hang;
|
||||
let $shutdown_timeout=;
|
||||
|
@@ -92,3 +92,69 @@ SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
SET DEBUG_SYNC='RESET';
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33593: Auto increment deadlock error causes ASSERT in subsequent save point
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(col1 INT PRIMARY KEY AUTO_INCREMENT, col2 INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2(col1 INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t1(col2) values(100);
|
||||
|
||||
--connect(con1, localhost, root,,)
|
||||
START TRANSACTION;
|
||||
--echo # T1: Acquiring Row X lock on table t2
|
||||
INSERT INTO t2 values(100);
|
||||
|
||||
--connect(con2, localhost, root,,)
|
||||
START TRANSACTION;
|
||||
--echo # T2: Wait for (T1) row lock on t2 after acquiring GAP Lock on t1
|
||||
UPDATE t1 SET col2 = 20 where col1 = 10;
|
||||
SET DEBUG_SYNC='lock_wait_before_suspend SIGNAL t2_waiting';
|
||||
--send INSERT INTO t2 values(100)
|
||||
|
||||
--connection default
|
||||
SET DEBUG_SYNC='now WAIT_FOR t2_waiting';
|
||||
--echo # T3: Wait for (T2) II row Lock on t1 after acquiring Auto Increment Lock on t1
|
||||
SET DEBUG_SYNC='lock_wait_before_suspend SIGNAL t3_waiting';
|
||||
--send INSERT INTO t1(col2) SELECT col2 from t1
|
||||
|
||||
--connection con1
|
||||
SAVEPOINT s1;
|
||||
SET DEBUG_SYNC='now WAIT_FOR t3_waiting';
|
||||
--echo # T1: Wait for (T3) auto increment lock on t1 causing T1 -> T3 -> T2 -> T1 deadlock
|
||||
SET debug_dbug = '+d,innodb_deadlock_victim_self';
|
||||
--error ER_AUTOINC_READ_FAILED
|
||||
INSERT INTO t1(col2) VALUES(200);
|
||||
|
||||
--echo # The transaction should have been rolled back
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
--echo # Release the previous savepoint using the same name
|
||||
SAVEPOINT s1;
|
||||
COMMIT;
|
||||
|
||||
--connection con2
|
||||
--reap
|
||||
COMMIT;
|
||||
|
||||
--connection default
|
||||
--reap
|
||||
COMMIT;
|
||||
|
||||
--disconnect con1
|
||||
--disconnect con2
|
||||
|
||||
--echo # Cleanup
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
SET DEBUG_SYNC='RESET';
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.5 tests
|
||||
--echo #
|
||||
|
@@ -1,24 +0,0 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
call mtr.add_suppression("InnoDB: Difficult to find free blocks in the buffer pool");
|
||||
|
||||
SET @saved_debug = @@SESSION.debug_dbug;
|
||||
SET SESSION debug_dbug="+d,ib_lru_force_no_free_page";
|
||||
|
||||
CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
|
||||
COMMIT;
|
||||
|
||||
SET debug_dbug = @saved_debug;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# There should be only one message
|
||||
#
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
--let SEARCH_PATTERN=InnoDB: Difficult to find free blocks
|
||||
--source include/search_pattern_in_file.inc
|
@@ -96,3 +96,11 @@ SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_VIRTUAL LIMIT ROWS EXAMINED 5;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN LIMIT ROWS EXAMINED 5;
|
||||
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS LIMIT ROWS EXAMINED 5;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33462 Disallow LOCK=NONE operation on statistics table
|
||||
--echo #
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
ALTER TABLE mysql.innodb_table_stats FORCE, LOCK=NONE;
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
||||
ALTER TABLE mysql.innodb_index_stats FORCE, LOCK=NONE;
|
||||
|
@@ -230,29 +230,3 @@ CHECK TABLE t2;
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
--list_files $MYSQLD_DATADIR/test
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
|
||||
--echo # ADD PRIMARY KEY or OPTIMIZE TABLE
|
||||
--echo #
|
||||
CREATE TABLE t1(f1 year default null, f2 year default null,
|
||||
f3 text, f4 year default null, f5 year default null,
|
||||
f6 year default null, f7 year default null,
|
||||
f8 year default null)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
|
||||
INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
|
||||
ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
|
||||
set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
|
||||
send ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ADD COLUMN f10 YEAR DEFAULT NULL, ALGORITHM=INPLACE;
|
||||
|
||||
connect(con1,localhost,root,,,);
|
||||
SET DEBUG_SYNC="now WAIT_FOR con1_insert";
|
||||
INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
|
||||
INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
|
||||
SET DEBUG_SYNC="now SIGNAL con1_finish";
|
||||
|
||||
connection default;
|
||||
reap;
|
||||
disconnect con1;
|
||||
SET DEBUG_SYNC=RESET;
|
||||
CHECK TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
@@ -551,11 +551,62 @@ SET DEBUG_SYNC="now WAIT_FOR try_insert";
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
INSERT INTO t1 VALUES(1, 2);
|
||||
SET DEBUG_SYNC="now SIGNAL alter_progress";
|
||||
disconnect con1;
|
||||
connection default;
|
||||
reap;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
|
||||
--echo # ADD PRIMARY KEY or OPTIMIZE TABLE
|
||||
--echo #
|
||||
CREATE TABLE t1(f1 year default null, f2 year default null,
|
||||
f3 text, f4 year default null, f5 year default null,
|
||||
f6 year default null, f7 year default null,
|
||||
f8 year default null)ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
|
||||
ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
|
||||
set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
|
||||
send ALTER TABLE t1 ADD COLUMN f10 YEAR DEFAULT NULL, FORCE, ALGORITHM=INPLACE;
|
||||
|
||||
connection con1;
|
||||
SET DEBUG_SYNC="now WAIT_FOR con1_insert";
|
||||
INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
|
||||
INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
|
||||
SET DEBUG_SYNC="now SIGNAL con1_finish";
|
||||
|
||||
connection default;
|
||||
reap;
|
||||
CHECK TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-19044 Alter table corrupts while applying the
|
||||
--echo # modification log
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
f1 INT,
|
||||
f2 INT,
|
||||
f3 char(19) CHARACTER SET utf8mb3,
|
||||
f4 VARCHAR(500),
|
||||
f5 TEXT)ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(3, 1, REPEAT('a', 2), REPEAT("b", 20),'a');
|
||||
ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL, ALGORITHM=INSTANT;
|
||||
INSERT INTO t1 VALUES(1, 2, REPEAT('InnoDB', 2),
|
||||
REPEAT("MariaDB", 20), REPEAT('a', 8000), 12);
|
||||
INSERT INTO t1 VALUES(1, 2, REPEAT('MYSQL', 2),
|
||||
REPEAT("MariaDB", 20), REPEAT('a', 8000), 12);
|
||||
SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL con1_begin WAIT_FOR con1_update';
|
||||
send ALTER TABLE t1 MODIFY COLUMN f2 INT NOT NULL, FORCE, ALGORITHM=INPLACE;
|
||||
connection con1;
|
||||
SET DEBUG_SYNC='now WAIT_FOR con1_begin';
|
||||
UPDATE t1 SET f2=204 order by f1 limit 2;
|
||||
SET DEBUG_SYNC='now SIGNAL con1_update';
|
||||
connection default;
|
||||
reap;
|
||||
disconnect con1;
|
||||
SET DEBUG_SYNC=reset;
|
||||
CHECK TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of 10.4 tests
|
||||
|
||||
|
@@ -51,6 +51,7 @@ CREATE TABLE t1 (k INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t1 SET k=1;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 SET k=2;
|
||||
SELECT count(*) > 0 FROM mysql.innodb_index_stats lock in share mode;
|
||||
|
||||
--connect (con1,localhost,root,,test)
|
||||
SET innodb_lock_wait_timeout=0;
|
||||
@@ -59,5 +60,6 @@ CREATE TABLE t2 (pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB
|
||||
AS SELECT k FROM t1;
|
||||
--disconnect con1
|
||||
--connection default
|
||||
|
||||
SET innodb_lock_wait_timeout=default;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
|
110
mysql-test/suite/innodb/t/lock_isolation.test
Normal file
110
mysql-test/suite/innodb/t/lock_isolation.test
Normal file
@@ -0,0 +1,110 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-26642 Weird SELECT view when a record is
|
||||
--echo # modified to the same value by two transactions
|
||||
--echo # MDEV-32898 Phantom rows caused by updates of PRIMARY KEY
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t(a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
|
||||
INSERT INTO t VALUES (1,1),(2,2);
|
||||
BEGIN; SELECT * FROM t LOCK IN SHARE MODE;
|
||||
--connect con_weird,localhost,root
|
||||
BEGIN;
|
||||
SELECT * FROM t;
|
||||
--connect consistent,localhost,root
|
||||
SET innodb_snapshot_isolation=ON;
|
||||
BEGIN;
|
||||
SELECT * FROM t;
|
||||
--connection default
|
||||
UPDATE t SET a=3 WHERE b=2;
|
||||
COMMIT;
|
||||
--connection consistent
|
||||
--error ER_CHECKREAD
|
||||
UPDATE t SET b=3;
|
||||
SELECT * FROM t;
|
||||
COMMIT;
|
||||
--connection con_weird
|
||||
UPDATE t SET b=3;
|
||||
SELECT * FROM t;
|
||||
COMMIT;
|
||||
--connection default
|
||||
SELECT * FROM t;
|
||||
DROP TABLE t;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-26643 Inconsistent behaviors of UPDATE under
|
||||
--echo # READ UNCOMMITTED and READ COMMITTED isolation level
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t(a INT, b INT) ENGINE=InnoDB;
|
||||
INSERT INTO t VALUES(NULL, 1), (2, 2);
|
||||
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
BEGIN; UPDATE t SET a = 10;
|
||||
|
||||
--connection consistent
|
||||
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
--send UPDATE t SET b = 20 WHERE a
|
||||
|
||||
--connection default
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = 'Updating'
|
||||
and info = 'UPDATE t SET b = 20 WHERE a';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
COMMIT;
|
||||
|
||||
--connection consistent
|
||||
--reap
|
||||
SELECT * FROM t;
|
||||
|
||||
--connection default
|
||||
TRUNCATE TABLE t;
|
||||
INSERT INTO t VALUES(NULL, 1), (2, 2);
|
||||
BEGIN; UPDATE t SET a = 10;
|
||||
|
||||
--connection consistent
|
||||
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
--send UPDATE t SET b = 20 WHERE a
|
||||
|
||||
--connection default
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where info = 'UPDATE t SET b = 20 WHERE a';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
COMMIT;
|
||||
|
||||
--connection consistent
|
||||
--reap
|
||||
SELECT * FROM t;
|
||||
--disconnect consistent
|
||||
|
||||
--connection default
|
||||
TRUNCATE TABLE t;
|
||||
INSERT INTO t VALUES(NULL, 1), (2, 2);
|
||||
BEGIN; UPDATE t SET a = 10;
|
||||
|
||||
--connection con_weird
|
||||
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
send UPDATE t SET b = 20 WHERE a;
|
||||
|
||||
--connection default
|
||||
let $wait_condition=
|
||||
select count(*) = 1 from information_schema.processlist
|
||||
where state = 'Updating'
|
||||
and info = 'UPDATE t SET b = 20 WHERE a';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT * FROM t;
|
||||
COMMIT;
|
||||
|
||||
--connection con_weird
|
||||
--reap
|
||||
COMMIT;
|
||||
--disconnect con_weird
|
||||
|
||||
--connection default
|
||||
SELECT * FROM t;
|
||||
DROP TABLE t;
|
107
mysql-test/suite/innodb/t/log_upgrade_101_flags.test
Normal file
107
mysql-test/suite/innodb/t/log_upgrade_101_flags.test
Normal file
@@ -0,0 +1,107 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/big_test.inc
|
||||
--source include/not_embedded.inc
|
||||
call mtr.add_suppression("InnoDB: The change buffer is corrupted");
|
||||
call mtr.add_suppression("InnoDB: Tablespace size stored in header is 768 pages, but the sum of data file sizes is 384 pages");
|
||||
call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS of file");
|
||||
--source include/shutdown_mysqld.inc
|
||||
let bugdir= $MYSQLTEST_VARDIR/tmp/log_upgrade;
|
||||
--mkdir $bugdir
|
||||
--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err
|
||||
--let $dirs= --innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir --innodb-undo-directory=$bugdir
|
||||
|
||||
# Test case similar to log_upgrade.test
|
||||
perl;
|
||||
do "$ENV{MTR_SUITE_DIR}/../innodb/include/crc32.pl";
|
||||
my $polynomial = 0x82f63b78; # CRC-32C
|
||||
|
||||
die unless open OUT, ">", "$ENV{bugdir}/ibdata1";
|
||||
binmode OUT;
|
||||
|
||||
my $head = pack("Nx[18]", 0);
|
||||
# Add FSP_SPACE_FLAGS as 49152 (10.1.0...10.1.20), page_size = 32k
|
||||
my $body = pack("x[8]Nx[4]Nx[2]Nx[32696]", 768, 49152, 97937874);
|
||||
my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
|
||||
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
|
||||
|
||||
# Dummy change buffer header page (page 3).
|
||||
die unless seek(OUT, 3 * 32768, 0);
|
||||
## FIL_PAGE_OFFSET, FIL_PAGE_PREV, FIL_PAGE_NEXT, FIL_PAGE_TYPE
|
||||
my $head = pack("NNNx[8]n", 3, 0xffffffff, 0xffffffff, 6);
|
||||
my $body = pack("x[62]nnx[32656]", 2, 50);
|
||||
my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
|
||||
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
|
||||
|
||||
# Dummy change buffer root page (page 4).
|
||||
## FIL_PAGE_OFFSET, FIL_PAGE_PREV, FIL_PAGE_NEXT
|
||||
my $head = pack("NNNx[10]", 4, 0xffffffff, 0xffffffff);
|
||||
my $body = chr(0) x 32722;
|
||||
my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
|
||||
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
|
||||
|
||||
|
||||
# Dictionary header page (page 7).
|
||||
die unless seek(OUT, 7 * 32768, 0);
|
||||
$head = pack("Nx[18]", 7);
|
||||
$body = pack("x[32]Nx[8]Nx[32674]", 8, 9);
|
||||
$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
|
||||
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
|
||||
|
||||
# Empty SYS_TABLES page (page 8).
|
||||
$head = pack("NNNx[8]n", 8, ~0, ~0, 17855);
|
||||
$body = pack("nnx[31]Cx[20]", 2, 124, 1);
|
||||
$body .= pack("nxnn", 0x801, 3, 116) . "infimum";
|
||||
$body .= pack("xnxnxx", 0x901, 0x803) . "supremum";
|
||||
$body .= pack("x[32632]nn", 116, 101);
|
||||
$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
|
||||
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
|
||||
|
||||
# Empty SYS_INDEXES page (page 9).
|
||||
$head = pack("NNNx[8]n", 9, ~0, ~0, 17855);
|
||||
$body = pack("nnx[31]Cx[20]", 2, 124, 3);
|
||||
$body .= pack("nxnn", 0x801, 3, 116) . "infimum";
|
||||
$body .= pack("xnxnxx", 0x901, 0x803) . "supremum";
|
||||
$body .= pack("x[32632]nn", 116, 101);
|
||||
$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
|
||||
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
|
||||
|
||||
die unless seek(OUT, 768 * 16384 - 1, 0);
|
||||
print OUT chr(0);
|
||||
close OUT or die;
|
||||
|
||||
die unless open OUT, ">", "$ENV{bugdir}/ib_logfile0";
|
||||
binmode OUT;
|
||||
$_= pack("Nx[5]nx[5]", 1, 0x1286) . "BogoDB 4.3.2.1" . chr(0) x 478;
|
||||
print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
|
||||
# checkpoint page 1 and all-zero checkpoint 2
|
||||
$_= pack("x[13]nCNNx[484]", 0x1286, 12, 2, 0x80c);
|
||||
print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
|
||||
die unless seek(OUT, 0x1FFFFFFFF, 0);
|
||||
print OUT chr(0);
|
||||
close OUT or die;
|
||||
die unless open OUT, ">", "$ENV{bugdir}/ib_logfile1";
|
||||
binmode OUT;
|
||||
die unless seek(OUT, 0x800, 0); # the first 2048 bytes are unused!
|
||||
$_= pack("Nnnx[500]", 0x80000944, 12, 12);
|
||||
print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
|
||||
die unless seek(OUT, 0x1FFFFFFFF, 0);
|
||||
print OUT chr(0);
|
||||
close OUT or die;
|
||||
EOF
|
||||
|
||||
--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=4m --innodb_page_size=32k --innodb_buffer_pool_size=10M
|
||||
--source include/start_mysqld.inc
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
--source include/shutdown_mysqld.inc
|
||||
--let SEARCH_PATTERN= InnoDB: Upgrading redo log:
|
||||
--source include/search_pattern_in_file.inc
|
||||
--let $restart_parameters= $dirs
|
||||
|
||||
--remove_files_wildcard $bugdir
|
||||
--rmdir $bugdir
|
||||
--let $restart_parameters=
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
--echo # End of 10.5 tests
|
@@ -4,10 +4,6 @@
|
||||
SET @save_stats_persistent = @@GLOBAL.innodb_stats_persistent;
|
||||
SET GLOBAL innodb_stats_persistent = 0;
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Difficult to find free blocks in the buffer pool");
|
||||
--enable_query_log
|
||||
|
||||
CREATE TABLE t1 (
|
||||
a SERIAL, b CHAR(255) NOT NULL DEFAULT '', c BOOLEAN DEFAULT false,
|
||||
l LINESTRING NOT NULL DEFAULT ST_linefromtext('linestring(448 -689,
|
||||
|
@@ -32,17 +32,22 @@ DROP DATABASE abc_def;
|
||||
|
||||
DROP DATABASE abc_def2;
|
||||
|
||||
call mtr.add_suppression("InnoDB: (Operating system error|Error number \\d+ means|Cannot rename file)");
|
||||
call mtr.add_suppression("InnoDB: Cannot rename '.*t1.ibd' to '.*non_existing_db.*' because the target schema directory doesn't exist");
|
||||
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(100);
|
||||
--replace_result "\\" "/"
|
||||
--error ER_ERROR_ON_RENAME
|
||||
RENAME TABLE t1 TO non_existing_db.t1;
|
||||
|
||||
--let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot rename file '.*t1\.ibd' to '.*non_existing_db
|
||||
--let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot rename '.*t1\.ibd' to '.*non_existing_db
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
SET GLOBAL innodb_fast_shutdown=2;
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
SELECT * FROM t1;
|
||||
# Cleanup
|
||||
DROP TABLE t1;
|
||||
|
||||
|
@@ -32,3 +32,15 @@ database
|
||||
database
|
||||
DROP TABLE t1_fk;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-32346 Assertion failure sym_node->table != NULL
|
||||
# in pars_retrieve_table_def on UPDATE
|
||||
#
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT, b TEXT, FOREIGN KEY(a) REFERENCES t1(a),
|
||||
FULLTEXT (b))ENGINE=InnoDB;
|
||||
INSERT INTO t1 SET a=1;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
UPDATE t1 SET a=2;
|
||||
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
|
||||
DROP TABLE t2,t1;
|
||||
|
@@ -32,3 +32,16 @@ SELECT * FROM t1_fk WHERE MATCH(a) AGAINST('database');
|
||||
|
||||
DROP TABLE t1_fk;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-32346 Assertion failure sym_node->table != NULL
|
||||
--echo # in pars_retrieve_table_def on UPDATE
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (a INT, b TEXT, FOREIGN KEY(a) REFERENCES t1(a),
|
||||
FULLTEXT (b))ENGINE=InnoDB;
|
||||
INSERT INTO t1 SET a=1;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
--error ER_ROW_IS_REFERENCED_2
|
||||
UPDATE t1 SET a=2;
|
||||
DROP TABLE t2,t1;
|
||||
|
@@ -9,11 +9,6 @@
|
||||
--source include/not_embedded.inc
|
||||
-- source include/big_test.inc
|
||||
|
||||
--disable_query_log
|
||||
# This warning occurs due to small buffer pool size(i.e. 8MB). It doesn't occur
|
||||
# with --mysqld=--innodb_buffer_pool_size=10MB
|
||||
call mtr.add_suppression("\\[Warning\\] InnoDB: Difficult to find free blocks in the buffer pool.*");
|
||||
--enable_query_log
|
||||
let MYSQLD_BASEDIR= `SELECT @@basedir`;
|
||||
let MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
|
||||
|
@@ -193,3 +193,29 @@ ALTER TABLE t1 DISABLE KEYS;
|
||||
INSERT INTO t1 VALUES (1, 'Nine chars or more');
|
||||
ALTER TABLE t1 ENABLE KEYS;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-25923 Memory not freed or Assertion `old_flags == ((my_flags &
|
||||
# 0x10000U) ? 1 : 0)' failed in my_realloc upon ALTER on Aria table
|
||||
# with GIS column
|
||||
#
|
||||
CREATE TABLE t1 (pk INT PRIMARY KEY, a POINT DEFAULT ST_GEOMFROMTEXT('Point(1 1)')) ENGINE=Aria;
|
||||
INSERT INTO t1 (pk) SELECT seq FROM seq_1_to_100;
|
||||
SET @old_threads= @@SESSION.aria_repair_threads;
|
||||
SET SESSION aria_repair_threads= 2;
|
||||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-33562: Assertion `(old_flags & 1) == ((my_flags & 0x10000U) ?
|
||||
# 1 : 0)' failed in my_realloc from sort_get_next_record on INSERT
|
||||
#
|
||||
SET @old_mode= @@SESSION.sql_mode;
|
||||
SET sql_mode='';
|
||||
CREATE TEMPORARY TABLE t (b TEXT, INDEX s(b(300))) ROW_FORMAT=DYNAMIC ENGINE=Aria;
|
||||
INSERT INTO t VALUES (REPEAT ('a',10000000));
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'b' at row 1
|
||||
CREATE TABLE ti LIKE t;
|
||||
INSERT INTO ti SELECT * FROM t;
|
||||
DROP TABLE t, ti;
|
||||
SET SESSION aria_repair_threads= @old_threads;
|
||||
SET SESSION sql_mode= @old_mode;
|
||||
|
@@ -203,3 +203,31 @@ ALTER TABLE t1 DISABLE KEYS;
|
||||
INSERT INTO t1 VALUES (1, 'Nine chars or more');
|
||||
ALTER TABLE t1 ENABLE KEYS;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-25923 Memory not freed or Assertion `old_flags == ((my_flags &
|
||||
--echo # 0x10000U) ? 1 : 0)' failed in my_realloc upon ALTER on Aria table
|
||||
--echo # with GIS column
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (pk INT PRIMARY KEY, a POINT DEFAULT ST_GEOMFROMTEXT('Point(1 1)')) ENGINE=Aria;
|
||||
INSERT INTO t1 (pk) SELECT seq FROM seq_1_to_100;
|
||||
SET @old_threads= @@SESSION.aria_repair_threads;
|
||||
SET SESSION aria_repair_threads= 2;
|
||||
ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-33562: Assertion `(old_flags & 1) == ((my_flags & 0x10000U) ?
|
||||
--echo # 1 : 0)' failed in my_realloc from sort_get_next_record on INSERT
|
||||
--echo #
|
||||
|
||||
SET @old_mode= @@SESSION.sql_mode;
|
||||
SET sql_mode='';
|
||||
CREATE TEMPORARY TABLE t (b TEXT, INDEX s(b(300))) ROW_FORMAT=DYNAMIC ENGINE=Aria;
|
||||
INSERT INTO t VALUES (REPEAT ('a',10000000));
|
||||
CREATE TABLE ti LIKE t;
|
||||
INSERT INTO ti SELECT * FROM t;
|
||||
DROP TABLE t, ti;
|
||||
SET SESSION aria_repair_threads= @old_threads;
|
||||
SET SESSION sql_mode= @old_mode;
|
||||
|
@@ -1798,7 +1798,7 @@ t5 CREATE TABLE `t5` (
|
||||
`param09` longtext DEFAULT NULL,
|
||||
`const10` bigint(17) DEFAULT NULL,
|
||||
`param10` bigint(20) DEFAULT NULL,
|
||||
`const11` int(4) DEFAULT NULL,
|
||||
`const11` int(5) DEFAULT NULL,
|
||||
`param11` bigint(20) DEFAULT NULL,
|
||||
`const12` binary(0) DEFAULT NULL,
|
||||
`param12` bigint(20) DEFAULT NULL,
|
||||
@@ -1828,7 +1828,7 @@ def test t5 t5 const09 const09 12 19 19 Y 128 0 63
|
||||
def test t5 t5 param09 param09 252 4294967295 19 Y 16 0 8
|
||||
def test t5 t5 const10 const10 8 17 9 Y 32768 0 63
|
||||
def test t5 t5 param10 param10 8 20 9 Y 32768 0 63
|
||||
def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
|
||||
def test t5 t5 const11 const11 3 5 4 Y 32768 0 63
|
||||
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
|
||||
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
|
||||
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
|
||||
|
@@ -30,7 +30,7 @@ let $_innodb_data_file_path=`select @@innodb_data_file_path`;
|
||||
let $_innodb_data_home_dir=`select @@innodb_data_home_dir`;
|
||||
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
exec $XTRABACKUP --prepare --target-dir=$targetdir;
|
||||
|
||||
|
@@ -4,7 +4,7 @@ INSERT into t1 values(1);
|
||||
connect con2, localhost, root,,;
|
||||
connection con2;
|
||||
set lock_wait_timeout=1;
|
||||
SET debug_sync='copy_data_between_tables_before_reset_backup_lock SIGNAL go WAIT_FOR after_backup_stage_block_commit';
|
||||
SET debug_sync='copy_data_between_tables_before_reset_backup_lock SIGNAL go WAIT_FOR after_backup_stage_block_ddl';
|
||||
SET debug_sync='alter_table_after_temp_table_drop SIGNAL temp_table_dropped';
|
||||
SET debug_sync='now WAIT_FOR after_backup_stage_start';ALTER TABLE test.t1 FORCE, algorithm=COPY;|
|
||||
connection default;
|
||||
|
@@ -18,7 +18,7 @@ INSERT into t1 values(1);
|
||||
connect con2, localhost, root,,;
|
||||
connection con2;
|
||||
set lock_wait_timeout=1;
|
||||
SET debug_sync='copy_data_between_tables_before_reset_backup_lock SIGNAL go WAIT_FOR after_backup_stage_block_commit';
|
||||
SET debug_sync='copy_data_between_tables_before_reset_backup_lock SIGNAL go WAIT_FOR after_backup_stage_block_ddl';
|
||||
SET debug_sync='alter_table_after_temp_table_drop SIGNAL temp_table_dropped';
|
||||
DELIMITER |;
|
||||
send SET debug_sync='now WAIT_FOR after_backup_stage_start';ALTER TABLE test.t1 FORCE, algorithm=COPY;|
|
||||
@@ -27,7 +27,7 @@ connection default;
|
||||
|
||||
# setup mariabackup events
|
||||
let after_backup_stage_start=SET debug_sync='now SIGNAL after_backup_stage_start WAIT_FOR go';
|
||||
let after_backup_stage_block_commit=SET debug_sync='now SIGNAL after_backup_stage_block_commit';
|
||||
let after_backup_stage_block_ddl=SET debug_sync='now SIGNAL after_backup_stage_block_ddl';
|
||||
let backup_fix_ddl=SET debug_sync='now WAIT_FOR temp_table_dropped';
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,mariabackup_events;
|
||||
|
@@ -19,7 +19,7 @@ dec $n;
|
||||
}
|
||||
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$basedir;
|
||||
--enable_result_log
|
||||
let $n=100;
|
||||
while ($n) {
|
||||
@@ -36,7 +36,7 @@ disconnect flush_log;
|
||||
connection default;
|
||||
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir ;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir ;
|
||||
exec $XTRABACKUP --prepare --verbose --target-dir=$basedir ;
|
||||
--enable_result_log
|
||||
|
||||
|
@@ -8,7 +8,7 @@ start transaction;
|
||||
INSERT INTO t VALUES(1);
|
||||
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$basedir;
|
||||
--enable_result_log
|
||||
|
||||
exec $XTRABACKUP --prepare --target-dir=$basedir ;
|
||||
|
1
mysql-test/suite/mariabackup/aria_backup.opt
Normal file
1
mysql-test/suite/mariabackup/aria_backup.opt
Normal file
@@ -0,0 +1 @@
|
||||
--loose-partition --loose-aria-log-file-size=8388608
|
780
mysql-test/suite/mariabackup/aria_backup.result
Normal file
780
mysql-test/suite/mariabackup/aria_backup.result
Normal file
@@ -0,0 +1,780 @@
|
||||
###
|
||||
# Test for backup to stream
|
||||
#####
|
||||
###
|
||||
# Test for mix of online/offline backup tables
|
||||
#####
|
||||
CREATE TABLE t_default(i INT PRIMARY KEY)
|
||||
ENGINE ARIA;
|
||||
INSERT INTO t_default VALUES (1);
|
||||
CREATE TABLE t_tr_p_ch(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_tr_p_ch VALUES (1);
|
||||
CREATE TABLE t_tr_p_nch(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=0;
|
||||
INSERT INTO t_tr_p_nch VALUES (1);
|
||||
CREATE TABLE t_p_ch(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=0 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_p_ch VALUES (1);
|
||||
CREATE TABLE t_p_nch(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=0 ROW_FORMAT=PAGE PAGE_CHECKSUM=0;
|
||||
INSERT INTO t_p_nch VALUES (1);
|
||||
CREATE TABLE t_fixed(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=0 ROW_FORMAT=FIXED PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_fixed VALUES (1);
|
||||
CREATE TABLE t_dyn(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=0 ROW_FORMAT=DYNAMIC PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_dyn VALUES (1);
|
||||
# Test for partitioned table
|
||||
CREATE TABLE t_part_online(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL = 1 PAGE_CHECKSUM = 1
|
||||
PARTITION BY RANGE( i ) (
|
||||
PARTITION p0 VALUES LESS THAN (10),
|
||||
PARTITION p1 VALUES LESS THAN (20),
|
||||
PARTITION p2 VALUES LESS THAN (30)
|
||||
);
|
||||
INSERT INTO t_part_online VALUES(5);
|
||||
INSERT INTO t_part_online VALUES(15);
|
||||
INSERT INTO t_part_online VALUES(25);
|
||||
SELECT * FROM t_part_online;
|
||||
i
|
||||
5
|
||||
15
|
||||
25
|
||||
CREATE TABLE t_part_offline(i INT)
|
||||
ENGINE ARIA TRANSACTIONAL = 0 PAGE_CHECKSUM = 0
|
||||
PARTITION BY RANGE( i ) (
|
||||
PARTITION p0 VALUES LESS THAN (10),
|
||||
PARTITION p1 VALUES LESS THAN (20),
|
||||
PARTITION p2 VALUES LESS THAN (30)
|
||||
);
|
||||
INSERT INTO t_part_offline VALUES(5);
|
||||
INSERT INTO t_part_offline VALUES(15);
|
||||
INSERT INTO t_part_offline VALUES(25);
|
||||
# Test for filename to tablename mapping
|
||||
CREATE TABLE `t 1 t-1`(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO `t 1 t-1` VALUES (1);
|
||||
CREATE TABLE `t-part online`(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL = 1 PAGE_CHECKSUM = 1
|
||||
PARTITION BY RANGE( i ) (
|
||||
PARTITION p0 VALUES LESS THAN (10),
|
||||
PARTITION p1 VALUES LESS THAN (20),
|
||||
PARTITION p2 VALUES LESS THAN (30)
|
||||
);
|
||||
INSERT INTO `t-part online` VALUES(5);
|
||||
INSERT INTO `t-part online` VALUES(15);
|
||||
INSERT INTO `t-part online` VALUES(25);
|
||||
###
|
||||
# Test for redo log files backup;
|
||||
#####
|
||||
CREATE TABLE t_logs_1(i INT)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
CREATE TABLE t_logs_2 LIKE t_logs_1;
|
||||
CREATE TABLE t_bulk_ins LIKE t_logs_1;
|
||||
INSERT INTO t_logs_1 VALUES
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
|
||||
# Generate several log files
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
###
|
||||
# Test for DML during backup for online backup
|
||||
#####
|
||||
CREATE TABLE t_dml_ins(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_dml_ins VALUES(1);
|
||||
CREATE TABLE t_dml_upd(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_dml_upd VALUES(1);
|
||||
CREATE TABLE t_dml_del(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_dml_del VALUES(1);
|
||||
###
|
||||
# Test for DDL during backup for online backup
|
||||
#####
|
||||
CREATE DATABASE test_for_db_drop;
|
||||
CREATE TABLE test_for_db_drop.t(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_db_create(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
SHOW DATABASES;
|
||||
Database
|
||||
information_schema
|
||||
mtr
|
||||
mysql
|
||||
performance_schema
|
||||
sys
|
||||
test
|
||||
test_for_db_drop
|
||||
CREATE TABLE t_alter(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
INSERT INTO t_alter VALUES (1);
|
||||
CREATE TABLE t_trunc(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
INSERT INTO t_trunc VALUES (1);
|
||||
CREATE TABLE t_ch_i (i int(10), index(i) ) ENGINE=Aria;
|
||||
INSERT INTO t_ch_i VALUES(1);
|
||||
CREATE TABLE t_change_engine(i INT PRIMARY KEY) ENGINE InnoDB;
|
||||
INSERT INTO t_change_engine VALUES (1);
|
||||
CREATE TABLE t_rename(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE DATABASE test_for_rename;
|
||||
CREATE TABLE t_rename_2(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_rename_3(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_rename_4(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_delete(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_delete_2(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_rename_alter(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_rename_create(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_part_create(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_part_add_part(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_part_change_eng(i INT PRIMARY KEY) ENGINE ARIA PARTITION BY HASH(i) PARTITIONS 2;
|
||||
CREATE TABLE t_part_change_eng_2(i INT PRIMARY KEY) ENGINE InnoDB PARTITION BY HASH(i) PARTITIONS 2;
|
||||
CREATE TABLE t_part_change_eng_3(i INT PRIMARY KEY) ENGINE Aria;
|
||||
CREATE TABLE t_part_alter(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 2;
|
||||
CREATE TABLE t_part_alter_2(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 3;
|
||||
CREATE TABLE t_part_drop(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 2;
|
||||
CREATE TABLE t_part_rename(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 2;
|
||||
CREATE TABLE t_part_rename_3(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 2;
|
||||
CREATE TABLE t_part_rm_part(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 2;
|
||||
SET SESSION debug_dbug="+d,maria_flush_whole_log";
|
||||
SET GLOBAL aria_checkpoint_interval=10000;
|
||||
### Backup to stream
|
||||
# xtrabackup prepare
|
||||
# shutdown server
|
||||
# remove datadir
|
||||
# xtrabackup move back
|
||||
# restart
|
||||
### Result for DDL test
|
||||
SHOW CREATE TABLE t_alter;
|
||||
Table Create Table
|
||||
t_alter CREATE TABLE `t_alter` (
|
||||
`i` int(11) NOT NULL,
|
||||
`c` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
|
||||
SELECT * FROM t_alter;
|
||||
i c
|
||||
1 NULL
|
||||
SHOW CREATE TABLE t_change_engine;
|
||||
Table Create Table
|
||||
t_change_engine CREATE TABLE `t_change_engine` (
|
||||
`i` int(11) NOT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
|
||||
SELECT * FROM t_change_engine;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_trunc;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_ch_i;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_rename_new;
|
||||
i
|
||||
SELECT * FROM test_for_rename.t_rename_new_2;
|
||||
i
|
||||
SELECT * FROM t_rename_new_new_3;
|
||||
i
|
||||
SELECT * FROM t_rename_new_4;
|
||||
i
|
||||
SELECT * FROM t_delete;
|
||||
ERROR 42S02: Table 'test.t_delete' doesn't exist
|
||||
SHOW CREATE TABLE t_delete_2;
|
||||
Table Create Table
|
||||
t_delete_2 CREATE TABLE `t_delete_2` (
|
||||
`i` int(11) NOT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
|
||||
SELECT * FROM t_rename_alter_2;
|
||||
i c
|
||||
SELECT * FROM t_rename_create;
|
||||
d
|
||||
SELECT * FROM t_rename_create_new;
|
||||
i
|
||||
SHOW CREATE TABLE t_part_create_2;
|
||||
Table Create Table
|
||||
t_part_create_2 CREATE TABLE `t_part_create_2` (
|
||||
`i` int(11) DEFAULT NULL
|
||||
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
PARTITION BY HASH (`i`)
|
||||
PARTITIONS 2
|
||||
SELECT * FROM t_part_create_2;
|
||||
i
|
||||
SHOW CREATE TABLE t_part_add_part;
|
||||
Table Create Table
|
||||
t_part_add_part CREATE TABLE `t_part_add_part` (
|
||||
`i` int(11) NOT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
|
||||
PARTITION BY HASH (`i`)
|
||||
PARTITIONS 2
|
||||
SELECT * FROM t_part_add_part;
|
||||
i
|
||||
SHOW CREATE TABLE t_part_change_eng;
|
||||
Table Create Table
|
||||
t_part_change_eng CREATE TABLE `t_part_change_eng` (
|
||||
`i` int(11) NOT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
PARTITION BY HASH (`i`)
|
||||
PARTITIONS 2
|
||||
SELECT * FROM t_part_change_eng;
|
||||
i
|
||||
SHOW CREATE TABLE t_part_change_eng_2;
|
||||
Table Create Table
|
||||
t_part_change_eng_2 CREATE TABLE `t_part_change_eng_2` (
|
||||
`i` int(11) NOT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
PARTITION BY HASH (`i`)
|
||||
PARTITIONS 2
|
||||
SELECT * FROM t_part_change_eng_2;
|
||||
i
|
||||
SELECT * FROM t_part_alter;
|
||||
i c
|
||||
SHOW CREATE TABLE t_part_alter_2;
|
||||
Table Create Table
|
||||
t_part_alter_2 CREATE TABLE `t_part_alter_2` (
|
||||
`i` int(11) NOT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
PARTITION BY HASH (`i`)
|
||||
PARTITIONS 2
|
||||
SELECT * FROM t_part_alter_2;
|
||||
i
|
||||
SELECT * FROM t_part_drop;
|
||||
ERROR 42S02: Table 'test.t_part_drop' doesn't exist
|
||||
SELECT * FROM t_part_rename;
|
||||
ERROR 42S02: Table 'test.t_part_rename' doesn't exist
|
||||
SELECT * FROM t_part_rename_2;
|
||||
i
|
||||
SELECT * FROM t_part_rename_3;
|
||||
ERROR 42S02: Table 'test.t_part_rename_3' doesn't exist
|
||||
SELECT * FROM test_for_rename.t_part_rename_4;
|
||||
i
|
||||
SHOW CREATE TABLE t_part_rm_part;
|
||||
Table Create Table
|
||||
t_part_rm_part CREATE TABLE `t_part_rm_part` (
|
||||
`i` int(11) NOT NULL,
|
||||
`c` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
|
||||
SELECT * FROM t_part_rm_part;
|
||||
i c
|
||||
SHOW DATABASES;
|
||||
Database
|
||||
information_schema
|
||||
mtr
|
||||
mysql
|
||||
performance_schema
|
||||
sys
|
||||
test
|
||||
test_for_db_create
|
||||
test_for_rename
|
||||
### Clean up for DDL test
|
||||
DROP DATABASE test_for_db_create;
|
||||
DROP TABLE t_db_create;
|
||||
DROP TABLE t_change_engine;
|
||||
DROP TABLE t_alter;
|
||||
DROP TABLE t_trunc;
|
||||
DROP TABLE t_ch_i;
|
||||
DROP TABLE t_rename_new;
|
||||
DROP TABLE t_rename_new_new_3;
|
||||
DROP TABLE t_rename_new_4;
|
||||
DROP TABLE t_delete_2;
|
||||
DROP TABLE t_rename_alter_2;
|
||||
DROP TABLE t_rename_create;
|
||||
DROP TABLE t_rename_create_new;
|
||||
DROP TABLE t_part_create;
|
||||
DROP TABLE t_part_create_2;
|
||||
DROP TABLE t_part_add_part;
|
||||
DROP TABLE t_part_change_eng;
|
||||
DROP TABLE t_part_change_eng_2;
|
||||
DROP TABLE t_part_change_eng_3;
|
||||
DROP TABLE t_part_alter;
|
||||
DROP TABLE t_part_alter_2;
|
||||
DROP TABLE t_part_rename_2;
|
||||
DROP TABLE t_part_rm_part;
|
||||
DROP DATABASE test_for_rename;
|
||||
### Result for DML test
|
||||
SELECT * FROM t_dml_ins;
|
||||
i
|
||||
1
|
||||
2
|
||||
SELECT * FROM t_dml_upd;
|
||||
i
|
||||
2
|
||||
SELECT * FROM t_dml_del;
|
||||
i
|
||||
### Clean up for DML test
|
||||
DROP TABLE t_dml_ins;
|
||||
DROP TABLE t_dml_upd;
|
||||
DROP TABLE t_dml_del;
|
||||
### Result for redo log files backup
|
||||
# ok
|
||||
# ok
|
||||
# ok
|
||||
### Cleanup for redo log files backup
|
||||
DROP TABLE t_logs_1;
|
||||
DROP TABLE t_logs_2;
|
||||
DROP TABLE t_bulk_ins;
|
||||
### Result for online/offline tables test
|
||||
SELECT * FROM t_default;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_tr_p_ch;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_tr_p_nch;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_p_ch;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_p_nch;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_fixed;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_dyn;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_part_online;
|
||||
i
|
||||
5
|
||||
15
|
||||
25
|
||||
SELECT * FROM t_part_offline;
|
||||
i
|
||||
5
|
||||
15
|
||||
25
|
||||
SELECT * FROM `t 1 t-1`;
|
||||
i
|
||||
1
|
||||
SELECT * FROM `t-part online`;
|
||||
i
|
||||
5
|
||||
15
|
||||
25
|
||||
### Cleanup for online/offline tables test
|
||||
DROP TABLE t_default;
|
||||
DROP TABLE t_tr_p_ch;
|
||||
DROP TABLE t_tr_p_nch;
|
||||
DROP TABLE t_p_ch;
|
||||
DROP TABLE t_p_nch;
|
||||
DROP TABLE t_fixed;
|
||||
DROP TABLE t_dyn;
|
||||
DROP TABLE t_part_online;
|
||||
DROP TABLE t_part_offline;
|
||||
DROP TABLE `t 1 t-1`;
|
||||
DROP TABLE `t-part online`;
|
||||
###
|
||||
# Test for backup to directory
|
||||
#####
|
||||
###
|
||||
# Test for mix of online/offline backup tables
|
||||
#####
|
||||
CREATE TABLE t_default(i INT PRIMARY KEY)
|
||||
ENGINE ARIA;
|
||||
INSERT INTO t_default VALUES (1);
|
||||
CREATE TABLE t_tr_p_ch(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_tr_p_ch VALUES (1);
|
||||
CREATE TABLE t_tr_p_nch(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=0;
|
||||
INSERT INTO t_tr_p_nch VALUES (1);
|
||||
CREATE TABLE t_p_ch(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=0 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_p_ch VALUES (1);
|
||||
CREATE TABLE t_p_nch(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=0 ROW_FORMAT=PAGE PAGE_CHECKSUM=0;
|
||||
INSERT INTO t_p_nch VALUES (1);
|
||||
CREATE TABLE t_fixed(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=0 ROW_FORMAT=FIXED PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_fixed VALUES (1);
|
||||
CREATE TABLE t_dyn(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=0 ROW_FORMAT=DYNAMIC PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_dyn VALUES (1);
|
||||
# Test for partitioned table
|
||||
CREATE TABLE t_part_online(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL = 1 PAGE_CHECKSUM = 1
|
||||
PARTITION BY RANGE( i ) (
|
||||
PARTITION p0 VALUES LESS THAN (10),
|
||||
PARTITION p1 VALUES LESS THAN (20),
|
||||
PARTITION p2 VALUES LESS THAN (30)
|
||||
);
|
||||
INSERT INTO t_part_online VALUES(5);
|
||||
INSERT INTO t_part_online VALUES(15);
|
||||
INSERT INTO t_part_online VALUES(25);
|
||||
SELECT * FROM t_part_online;
|
||||
i
|
||||
5
|
||||
15
|
||||
25
|
||||
CREATE TABLE t_part_offline(i INT)
|
||||
ENGINE ARIA TRANSACTIONAL = 0 PAGE_CHECKSUM = 0
|
||||
PARTITION BY RANGE( i ) (
|
||||
PARTITION p0 VALUES LESS THAN (10),
|
||||
PARTITION p1 VALUES LESS THAN (20),
|
||||
PARTITION p2 VALUES LESS THAN (30)
|
||||
);
|
||||
INSERT INTO t_part_offline VALUES(5);
|
||||
INSERT INTO t_part_offline VALUES(15);
|
||||
INSERT INTO t_part_offline VALUES(25);
|
||||
# Test for filename to tablename mapping
|
||||
CREATE TABLE `t 1 t-1`(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO `t 1 t-1` VALUES (1);
|
||||
CREATE TABLE `t-part online`(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL = 1 PAGE_CHECKSUM = 1
|
||||
PARTITION BY RANGE( i ) (
|
||||
PARTITION p0 VALUES LESS THAN (10),
|
||||
PARTITION p1 VALUES LESS THAN (20),
|
||||
PARTITION p2 VALUES LESS THAN (30)
|
||||
);
|
||||
INSERT INTO `t-part online` VALUES(5);
|
||||
INSERT INTO `t-part online` VALUES(15);
|
||||
INSERT INTO `t-part online` VALUES(25);
|
||||
###
|
||||
# Test for redo log files backup;
|
||||
#####
|
||||
CREATE TABLE t_logs_1(i INT)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
CREATE TABLE t_logs_2 LIKE t_logs_1;
|
||||
CREATE TABLE t_bulk_ins LIKE t_logs_1;
|
||||
INSERT INTO t_logs_1 VALUES
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
|
||||
# Generate several log files
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
###
|
||||
# Test for DML during backup for online backup
|
||||
#####
|
||||
CREATE TABLE t_dml_ins(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_dml_ins VALUES(1);
|
||||
CREATE TABLE t_dml_upd(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_dml_upd VALUES(1);
|
||||
CREATE TABLE t_dml_del(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_dml_del VALUES(1);
|
||||
###
|
||||
# Test for DDL during backup for online backup
|
||||
#####
|
||||
CREATE DATABASE test_for_db_drop;
|
||||
CREATE TABLE test_for_db_drop.t(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_db_create(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
SHOW DATABASES;
|
||||
Database
|
||||
information_schema
|
||||
mtr
|
||||
mysql
|
||||
performance_schema
|
||||
sys
|
||||
test
|
||||
test_for_db_drop
|
||||
CREATE TABLE t_alter(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
INSERT INTO t_alter VALUES (1);
|
||||
CREATE TABLE t_trunc(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
INSERT INTO t_trunc VALUES (1);
|
||||
CREATE TABLE t_ch_i (i int(10), index(i) ) ENGINE=Aria;
|
||||
INSERT INTO t_ch_i VALUES(1);
|
||||
CREATE TABLE t_change_engine(i INT PRIMARY KEY) ENGINE InnoDB;
|
||||
INSERT INTO t_change_engine VALUES (1);
|
||||
CREATE TABLE t_rename(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE DATABASE test_for_rename;
|
||||
CREATE TABLE t_rename_2(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_rename_3(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_rename_4(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_delete(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_delete_2(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_rename_alter(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_rename_create(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_part_create(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_part_add_part(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
CREATE TABLE t_part_change_eng(i INT PRIMARY KEY) ENGINE ARIA PARTITION BY HASH(i) PARTITIONS 2;
|
||||
CREATE TABLE t_part_change_eng_2(i INT PRIMARY KEY) ENGINE InnoDB PARTITION BY HASH(i) PARTITIONS 2;
|
||||
CREATE TABLE t_part_change_eng_3(i INT PRIMARY KEY) ENGINE Aria;
|
||||
CREATE TABLE t_part_alter(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 2;
|
||||
CREATE TABLE t_part_alter_2(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 3;
|
||||
CREATE TABLE t_part_drop(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 2;
|
||||
CREATE TABLE t_part_rename(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 2;
|
||||
CREATE TABLE t_part_rename_3(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 2;
|
||||
CREATE TABLE t_part_rm_part(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 2;
|
||||
SET SESSION debug_dbug="+d,maria_flush_whole_log";
|
||||
SET GLOBAL aria_checkpoint_interval=10000;
|
||||
### Backup to dir
|
||||
# xtrabackup prepare
|
||||
# shutdown server
|
||||
# remove datadir
|
||||
# xtrabackup move back
|
||||
# restart
|
||||
### Result for DDL test
|
||||
SHOW CREATE TABLE t_alter;
|
||||
Table Create Table
|
||||
t_alter CREATE TABLE `t_alter` (
|
||||
`i` int(11) NOT NULL,
|
||||
`c` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
|
||||
SELECT * FROM t_alter;
|
||||
i c
|
||||
1 NULL
|
||||
SHOW CREATE TABLE t_change_engine;
|
||||
Table Create Table
|
||||
t_change_engine CREATE TABLE `t_change_engine` (
|
||||
`i` int(11) NOT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
|
||||
SELECT * FROM t_change_engine;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_trunc;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_ch_i;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_rename_new;
|
||||
i
|
||||
SELECT * FROM test_for_rename.t_rename_new_2;
|
||||
i
|
||||
SELECT * FROM t_rename_new_new_3;
|
||||
i
|
||||
SELECT * FROM t_rename_new_4;
|
||||
i
|
||||
SELECT * FROM t_delete;
|
||||
ERROR 42S02: Table 'test.t_delete' doesn't exist
|
||||
SHOW CREATE TABLE t_delete_2;
|
||||
Table Create Table
|
||||
t_delete_2 CREATE TABLE `t_delete_2` (
|
||||
`i` int(11) NOT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
|
||||
SELECT * FROM t_rename_alter_2;
|
||||
i c
|
||||
SELECT * FROM t_rename_create;
|
||||
d
|
||||
SELECT * FROM t_rename_create_new;
|
||||
i
|
||||
SHOW CREATE TABLE t_part_create_2;
|
||||
Table Create Table
|
||||
t_part_create_2 CREATE TABLE `t_part_create_2` (
|
||||
`i` int(11) DEFAULT NULL
|
||||
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
PARTITION BY HASH (`i`)
|
||||
PARTITIONS 2
|
||||
SELECT * FROM t_part_create_2;
|
||||
i
|
||||
SHOW CREATE TABLE t_part_add_part;
|
||||
Table Create Table
|
||||
t_part_add_part CREATE TABLE `t_part_add_part` (
|
||||
`i` int(11) NOT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
|
||||
PARTITION BY HASH (`i`)
|
||||
PARTITIONS 2
|
||||
SELECT * FROM t_part_add_part;
|
||||
i
|
||||
SHOW CREATE TABLE t_part_change_eng;
|
||||
Table Create Table
|
||||
t_part_change_eng CREATE TABLE `t_part_change_eng` (
|
||||
`i` int(11) NOT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
PARTITION BY HASH (`i`)
|
||||
PARTITIONS 2
|
||||
SELECT * FROM t_part_change_eng;
|
||||
i
|
||||
SHOW CREATE TABLE t_part_change_eng_2;
|
||||
Table Create Table
|
||||
t_part_change_eng_2 CREATE TABLE `t_part_change_eng_2` (
|
||||
`i` int(11) NOT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
PARTITION BY HASH (`i`)
|
||||
PARTITIONS 2
|
||||
SELECT * FROM t_part_change_eng_2;
|
||||
i
|
||||
SELECT * FROM t_part_alter;
|
||||
i c
|
||||
SHOW CREATE TABLE t_part_alter_2;
|
||||
Table Create Table
|
||||
t_part_alter_2 CREATE TABLE `t_part_alter_2` (
|
||||
`i` int(11) NOT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
PARTITION BY HASH (`i`)
|
||||
PARTITIONS 2
|
||||
SELECT * FROM t_part_alter_2;
|
||||
i
|
||||
SELECT * FROM t_part_drop;
|
||||
ERROR 42S02: Table 'test.t_part_drop' doesn't exist
|
||||
SELECT * FROM t_part_rename;
|
||||
ERROR 42S02: Table 'test.t_part_rename' doesn't exist
|
||||
SELECT * FROM t_part_rename_2;
|
||||
i
|
||||
SELECT * FROM t_part_rename_3;
|
||||
ERROR 42S02: Table 'test.t_part_rename_3' doesn't exist
|
||||
SELECT * FROM test_for_rename.t_part_rename_4;
|
||||
i
|
||||
SHOW CREATE TABLE t_part_rm_part;
|
||||
Table Create Table
|
||||
t_part_rm_part CREATE TABLE `t_part_rm_part` (
|
||||
`i` int(11) NOT NULL,
|
||||
`c` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`i`)
|
||||
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
|
||||
SELECT * FROM t_part_rm_part;
|
||||
i c
|
||||
SHOW DATABASES;
|
||||
Database
|
||||
information_schema
|
||||
mtr
|
||||
mysql
|
||||
performance_schema
|
||||
sys
|
||||
test
|
||||
test_for_db_create
|
||||
test_for_rename
|
||||
### Clean up for DDL test
|
||||
DROP DATABASE test_for_db_create;
|
||||
DROP TABLE t_db_create;
|
||||
DROP TABLE t_change_engine;
|
||||
DROP TABLE t_alter;
|
||||
DROP TABLE t_trunc;
|
||||
DROP TABLE t_ch_i;
|
||||
DROP TABLE t_rename_new;
|
||||
DROP TABLE t_rename_new_new_3;
|
||||
DROP TABLE t_rename_new_4;
|
||||
DROP TABLE t_delete_2;
|
||||
DROP TABLE t_rename_alter_2;
|
||||
DROP TABLE t_rename_create;
|
||||
DROP TABLE t_rename_create_new;
|
||||
DROP TABLE t_part_create;
|
||||
DROP TABLE t_part_create_2;
|
||||
DROP TABLE t_part_add_part;
|
||||
DROP TABLE t_part_change_eng;
|
||||
DROP TABLE t_part_change_eng_2;
|
||||
DROP TABLE t_part_change_eng_3;
|
||||
DROP TABLE t_part_alter;
|
||||
DROP TABLE t_part_alter_2;
|
||||
DROP TABLE t_part_rename_2;
|
||||
DROP TABLE t_part_rm_part;
|
||||
DROP DATABASE test_for_rename;
|
||||
### Result for DML test
|
||||
SELECT * FROM t_dml_ins;
|
||||
i
|
||||
1
|
||||
2
|
||||
SELECT * FROM t_dml_upd;
|
||||
i
|
||||
2
|
||||
SELECT * FROM t_dml_del;
|
||||
i
|
||||
### Clean up for DML test
|
||||
DROP TABLE t_dml_ins;
|
||||
DROP TABLE t_dml_upd;
|
||||
DROP TABLE t_dml_del;
|
||||
### Result for redo log files backup
|
||||
# ok
|
||||
# ok
|
||||
# ok
|
||||
### Cleanup for redo log files backup
|
||||
DROP TABLE t_logs_1;
|
||||
DROP TABLE t_logs_2;
|
||||
DROP TABLE t_bulk_ins;
|
||||
### Result for online/offline tables test
|
||||
SELECT * FROM t_default;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_tr_p_ch;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_tr_p_nch;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_p_ch;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_p_nch;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_fixed;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_dyn;
|
||||
i
|
||||
1
|
||||
SELECT * FROM t_part_online;
|
||||
i
|
||||
5
|
||||
15
|
||||
25
|
||||
SELECT * FROM t_part_offline;
|
||||
i
|
||||
5
|
||||
15
|
||||
25
|
||||
SELECT * FROM `t 1 t-1`;
|
||||
i
|
||||
1
|
||||
SELECT * FROM `t-part online`;
|
||||
i
|
||||
5
|
||||
15
|
||||
25
|
||||
### Cleanup for online/offline tables test
|
||||
DROP TABLE t_default;
|
||||
DROP TABLE t_tr_p_ch;
|
||||
DROP TABLE t_tr_p_nch;
|
||||
DROP TABLE t_p_ch;
|
||||
DROP TABLE t_p_nch;
|
||||
DROP TABLE t_fixed;
|
||||
DROP TABLE t_dyn;
|
||||
DROP TABLE t_part_online;
|
||||
DROP TABLE t_part_offline;
|
||||
DROP TABLE `t 1 t-1`;
|
||||
DROP TABLE `t-part online`;
|
425
mysql-test/suite/mariabackup/aria_backup.test
Normal file
425
mysql-test/suite/mariabackup/aria_backup.test
Normal file
@@ -0,0 +1,425 @@
|
||||
--source include/have_aria.inc
|
||||
--source include/have_partition.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/big_test.inc
|
||||
# This test timeouts with msan
|
||||
--source include/not_msan.inc
|
||||
|
||||
--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
|
||||
--let $backup_stream=2
|
||||
--let $backup_dir=1
|
||||
--let $backup_variant=$backup_stream
|
||||
|
||||
while ($backup_variant) {
|
||||
if ($backup_variant == $backup_stream) {
|
||||
--echo ###
|
||||
--echo # Test for backup to stream
|
||||
--echo #####
|
||||
}
|
||||
if ($backup_variant == $backup_dir) {
|
||||
--echo ###
|
||||
--echo # Test for backup to directory
|
||||
--echo #####
|
||||
}
|
||||
|
||||
--echo ###
|
||||
--echo # Test for mix of online/offline backup tables
|
||||
--echo #####
|
||||
|
||||
CREATE TABLE t_default(i INT PRIMARY KEY)
|
||||
ENGINE ARIA;
|
||||
INSERT INTO t_default VALUES (1);
|
||||
|
||||
CREATE TABLE t_tr_p_ch(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_tr_p_ch VALUES (1);
|
||||
|
||||
CREATE TABLE t_tr_p_nch(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=0;
|
||||
INSERT INTO t_tr_p_nch VALUES (1);
|
||||
|
||||
CREATE TABLE t_p_ch(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=0 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_p_ch VALUES (1);
|
||||
|
||||
CREATE TABLE t_p_nch(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=0 ROW_FORMAT=PAGE PAGE_CHECKSUM=0;
|
||||
INSERT INTO t_p_nch VALUES (1);
|
||||
|
||||
CREATE TABLE t_fixed(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=0 ROW_FORMAT=FIXED PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_fixed VALUES (1);
|
||||
|
||||
CREATE TABLE t_dyn(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=0 ROW_FORMAT=DYNAMIC PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_dyn VALUES (1);
|
||||
|
||||
--echo # Test for partitioned table
|
||||
CREATE TABLE t_part_online(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL = 1 PAGE_CHECKSUM = 1
|
||||
PARTITION BY RANGE( i ) (
|
||||
PARTITION p0 VALUES LESS THAN (10),
|
||||
PARTITION p1 VALUES LESS THAN (20),
|
||||
PARTITION p2 VALUES LESS THAN (30)
|
||||
);
|
||||
|
||||
INSERT INTO t_part_online VALUES(5);
|
||||
INSERT INTO t_part_online VALUES(15);
|
||||
INSERT INTO t_part_online VALUES(25);
|
||||
SELECT * FROM t_part_online;
|
||||
|
||||
CREATE TABLE t_part_offline(i INT)
|
||||
ENGINE ARIA TRANSACTIONAL = 0 PAGE_CHECKSUM = 0
|
||||
PARTITION BY RANGE( i ) (
|
||||
PARTITION p0 VALUES LESS THAN (10),
|
||||
PARTITION p1 VALUES LESS THAN (20),
|
||||
PARTITION p2 VALUES LESS THAN (30)
|
||||
);
|
||||
|
||||
INSERT INTO t_part_offline VALUES(5);
|
||||
INSERT INTO t_part_offline VALUES(15);
|
||||
INSERT INTO t_part_offline VALUES(25);
|
||||
|
||||
--echo # Test for filename to tablename mapping
|
||||
CREATE TABLE `t 1 t-1`(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO `t 1 t-1` VALUES (1);
|
||||
|
||||
CREATE TABLE `t-part online`(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL = 1 PAGE_CHECKSUM = 1
|
||||
PARTITION BY RANGE( i ) (
|
||||
PARTITION p0 VALUES LESS THAN (10),
|
||||
PARTITION p1 VALUES LESS THAN (20),
|
||||
PARTITION p2 VALUES LESS THAN (30)
|
||||
);
|
||||
|
||||
INSERT INTO `t-part online` VALUES(5);
|
||||
INSERT INTO `t-part online` VALUES(15);
|
||||
INSERT INTO `t-part online` VALUES(25);
|
||||
|
||||
|
||||
--echo ###
|
||||
--echo # Test for redo log files backup;
|
||||
--echo #####
|
||||
CREATE TABLE t_logs_1(i INT)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
CREATE TABLE t_logs_2 LIKE t_logs_1;
|
||||
CREATE TABLE t_bulk_ins LIKE t_logs_1;
|
||||
INSERT INTO t_logs_1 VALUES
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
|
||||
(0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
|
||||
--echo # Generate several log files
|
||||
--let $i = 0
|
||||
while ($i < 14) {
|
||||
INSERT INTO t_logs_1 SELECT * FROM t_logs_1;
|
||||
--inc $i
|
||||
}
|
||||
|
||||
--echo ###
|
||||
--echo # Test for DML during backup for online backup
|
||||
--echo #####
|
||||
CREATE TABLE t_dml_ins(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_dml_ins VALUES(1);
|
||||
--let after_aria_table_copy_test_t_dml_ins=INSERT INTO test.t_dml_ins VALUES(2)
|
||||
CREATE TABLE t_dml_upd(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_dml_upd VALUES(1);
|
||||
--let after_aria_table_copy_test_t_dml_upd=UPDATE test.t_dml_upd SET i = 2
|
||||
CREATE TABLE t_dml_del(i INT PRIMARY KEY)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
INSERT INTO t_dml_del VALUES(1);
|
||||
--let after_aria_table_copy_test_t_dml_del=DELETE FROM test.t_dml_del
|
||||
|
||||
--echo ###
|
||||
--echo # Test for DDL during backup for online backup
|
||||
--echo #####
|
||||
CREATE DATABASE test_for_db_drop;
|
||||
CREATE TABLE test_for_db_drop.t(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
--let after_aria_table_copy_test_for_db_drop_t=DROP DATABASE test_for_db_drop
|
||||
CREATE TABLE t_db_create(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
--let after_aria_table_copy_test_t_db_create=CREATE DATABASE test_for_db_create
|
||||
--sorted_result
|
||||
SHOW DATABASES;
|
||||
|
||||
CREATE TABLE t_alter(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
INSERT INTO t_alter VALUES (1);
|
||||
--let after_aria_table_copy_test_t_alter=ALTER TABLE test.t_alter ADD COLUMN c INT
|
||||
|
||||
CREATE TABLE t_trunc(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
INSERT INTO t_trunc VALUES (1);
|
||||
--let after_aria_table_copy_test_t_trunc=TRUNCATE TABLE test.t_trunc
|
||||
|
||||
CREATE TABLE t_ch_i (i int(10), index(i) ) ENGINE=Aria;
|
||||
INSERT INTO t_ch_i VALUES(1);
|
||||
--let after_aria_table_copy_test_t_ch_i=ALTER TABLE test.t_ch_i DISABLE KEYS
|
||||
|
||||
CREATE TABLE t_change_engine(i INT PRIMARY KEY) ENGINE InnoDB;
|
||||
INSERT INTO t_change_engine VALUES (1);
|
||||
--let after_aria_background=begin not atomic ALTER TABLE test.t_change_engine ENGINE = ARIA; INSERT INTO test.t_logs_1 SELECT * FROM test.t_logs_1; INSERT INTO test.t_bulk_ins SELECT * FROM test.t_logs_1; INSERT INTO test.t_logs_2 SET i = 1; end
|
||||
|
||||
CREATE TABLE t_rename(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
--let after_aria_table_copy_test_t_rename=RENAME TABLE test.t_rename TO test.t_rename_new
|
||||
CREATE DATABASE test_for_rename;
|
||||
CREATE TABLE t_rename_2(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
--let after_aria_table_copy_test_t_rename_2=RENAME TABLE test.t_rename_2 TO test_for_rename.t_rename_new_2
|
||||
|
||||
CREATE TABLE t_rename_3(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
--let after_aria_table_copy_test_t_rename_3=begin not atomic RENAME TABLE test.t_rename_3 TO test.t_rename_new_3; RENAME TABLE test.t_rename_new_3 TO test.t_rename_new_new_3; end
|
||||
|
||||
CREATE TABLE t_rename_4(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
--let after_aria_table_copy_test_t_rename_4=begin not atomic RENAME TABLE test.t_rename_4 TO test.t_rename_new_4; RENAME TABLE test.t_rename_new_4 TO test.t_rename_new_new_4; RENAME TABLE test.t_rename_new_new_4 TO test.t_rename_new_4; end
|
||||
|
||||
CREATE TABLE t_delete(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
--let after_aria_table_copy_test_t_delete=DROP TABLE test.t_delete
|
||||
|
||||
CREATE TABLE t_delete_2(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
--let after_aria_table_copy_test_t_delete_2=ALTER TABLE test.t_delete_2 ENGINE=Innodb
|
||||
|
||||
CREATE TABLE t_rename_alter(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
--let after_aria_table_copy_test_t_rename_alter=begin not atomic RENAME TABLE test.t_rename_alter TO test.t_rename_alter_2; ALTER TABLE test.t_rename_alter_2 ADD COLUMN c INT; end
|
||||
|
||||
CREATE TABLE t_rename_create(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
--let after_aria_table_copy_test_t_rename_create=begin not atomic RENAME TABLE test.t_rename_create TO test.t_rename_create_new; CREATE TABLE test.t_rename_create(d INT PRIMARY KEY) ENGINE ARIA; end
|
||||
|
||||
CREATE TABLE t_part_create(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
--let after_aria_table_copy_test_t_part_create=create table test.t_part_create_2 (i int) engine=Aria PARTITION BY HASH(i) PARTITIONS 2
|
||||
|
||||
CREATE TABLE t_part_add_part(i INT PRIMARY KEY) ENGINE ARIA;
|
||||
--let after_aria_table_copy_test_t_part_add_part=alter table test.t_part_add_part PARTITION BY HASH(i) PARTITIONS 2
|
||||
|
||||
CREATE TABLE t_part_change_eng(i INT PRIMARY KEY) ENGINE ARIA PARTITION BY HASH(i) PARTITIONS 2;
|
||||
--let after_aria_table_copy_test_t_part_change_eng=alter table test.t_part_change_eng ENGINE=InnoDB
|
||||
|
||||
CREATE TABLE t_part_change_eng_2(i INT PRIMARY KEY) ENGINE InnoDB PARTITION BY HASH(i) PARTITIONS 2;
|
||||
CREATE TABLE t_part_change_eng_3(i INT PRIMARY KEY) ENGINE Aria;
|
||||
--let after_aria_table_copy_test_t_part_change_eng_3=alter table test.t_part_change_eng_2 ENGINE=Aria
|
||||
|
||||
CREATE TABLE t_part_alter(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 2;
|
||||
--let after_aria_table_copy_test_t_part_alter=alter table test.t_part_alter ADD COLUMN c INT
|
||||
|
||||
CREATE TABLE t_part_alter_2(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 3;
|
||||
--let after_aria_table_copy_test_t_part_alter_2=alter table test.t_part_alter_2 COALESCE PARTITION 1
|
||||
|
||||
CREATE TABLE t_part_drop(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 2;
|
||||
--let after_aria_table_copy_test_t_part_drop=DROP table test.t_part_drop
|
||||
|
||||
CREATE TABLE t_part_rename(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 2;
|
||||
--let after_aria_table_copy_test_t_part_rename=RENAME TABLE test.t_part_rename TO test.t_part_rename_2
|
||||
|
||||
CREATE TABLE t_part_rename_3(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 2;
|
||||
--let after_aria_table_copy_test_t_part_rename_3=RENAME TABLE test.t_part_rename_3 TO test_for_rename.t_part_rename_4
|
||||
|
||||
CREATE TABLE t_part_rm_part(i INT PRIMARY KEY) ENGINE Aria PARTITION BY HASH(i) PARTITIONS 2;
|
||||
--let after_aria_table_copy_test_t_part_rm_part=begin not atomic ALTER TABLE test.t_part_rm_part REMOVE PARTITIONING; ALTER TABLE test.t_part_rm_part ADD COLUMN c INT; end
|
||||
|
||||
SET SESSION debug_dbug="+d,maria_flush_whole_log";
|
||||
SET GLOBAL aria_checkpoint_interval=10000;
|
||||
|
||||
--mkdir $targetdir
|
||||
|
||||
if ($backup_variant == $backup_stream) {
|
||||
--echo ### Backup to stream
|
||||
--let $streamfile=$MYSQLTEST_VARDIR/tmp/backup.xb
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --dbug=+d,mariabackup_events --stream=xbstream > $streamfile 2>$targetdir/backup_stream.log;
|
||||
--disable_result_log
|
||||
exec $XBSTREAM -x -C $targetdir < $streamfile;
|
||||
--enable_result_log
|
||||
}
|
||||
|
||||
if ($backup_variant == $backup_dir) {
|
||||
--echo ### Backup to dir
|
||||
--disable_result_log
|
||||
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --dbug=+d,mariabackup_events
|
||||
--enable_result_log
|
||||
}
|
||||
|
||||
--let $t_logs_1_records_count_before_backup=`SELECT COUNT(*) FROM t_logs_1`
|
||||
--let $t_logs_2_records_count_before_backup=`SELECT COUNT(*) FROM t_logs_2`
|
||||
--let $t_bulk_ins_records_count_before_backup=`SELECT COUNT(*) FROM t_bulk_ins`
|
||||
|
||||
--echo # xtrabackup prepare
|
||||
--disable_result_log
|
||||
--exec $XTRABACKUP --prepare --target-dir=$targetdir
|
||||
--source include/restart_and_restore.inc
|
||||
--enable_result_log
|
||||
|
||||
--echo ### Result for DDL test
|
||||
SHOW CREATE TABLE t_alter;
|
||||
SELECT * FROM t_alter;
|
||||
SHOW CREATE TABLE t_change_engine;
|
||||
SELECT * FROM t_change_engine;
|
||||
SELECT * FROM t_trunc;
|
||||
SELECT * FROM t_ch_i;
|
||||
SELECT * FROM t_rename_new;
|
||||
SELECT * FROM test_for_rename.t_rename_new_2;
|
||||
SELECT * FROM t_rename_new_new_3;
|
||||
SELECT * FROM t_rename_new_4;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SELECT * FROM t_delete;
|
||||
SHOW CREATE TABLE t_delete_2;
|
||||
SELECT * FROM t_rename_alter_2;
|
||||
SELECT * FROM t_rename_create;
|
||||
SELECT * FROM t_rename_create_new;
|
||||
SHOW CREATE TABLE t_part_create_2;
|
||||
SELECT * FROM t_part_create_2;
|
||||
SHOW CREATE TABLE t_part_add_part;
|
||||
SELECT * FROM t_part_add_part;
|
||||
SHOW CREATE TABLE t_part_change_eng;
|
||||
SELECT * FROM t_part_change_eng;
|
||||
SHOW CREATE TABLE t_part_change_eng_2;
|
||||
SELECT * FROM t_part_change_eng_2;
|
||||
SELECT * FROM t_part_alter;
|
||||
SHOW CREATE TABLE t_part_alter_2;
|
||||
SELECT * FROM t_part_alter_2;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SELECT * FROM t_part_drop;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SELECT * FROM t_part_rename;
|
||||
SELECT * FROM t_part_rename_2;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SELECT * FROM t_part_rename_3;
|
||||
SELECT * FROM test_for_rename.t_part_rename_4;
|
||||
SHOW CREATE TABLE t_part_rm_part;
|
||||
SELECT * FROM t_part_rm_part;
|
||||
--sorted_result
|
||||
SHOW DATABASES;
|
||||
|
||||
--echo ### Clean up for DDL test
|
||||
DROP DATABASE test_for_db_create;
|
||||
DROP TABLE t_db_create;
|
||||
DROP TABLE t_change_engine;
|
||||
DROP TABLE t_alter;
|
||||
DROP TABLE t_trunc;
|
||||
DROP TABLE t_ch_i;
|
||||
DROP TABLE t_rename_new;
|
||||
DROP TABLE t_rename_new_new_3;
|
||||
DROP TABLE t_rename_new_4;
|
||||
DROP TABLE t_delete_2;
|
||||
DROP TABLE t_rename_alter_2;
|
||||
DROP TABLE t_rename_create;
|
||||
DROP TABLE t_rename_create_new;
|
||||
DROP TABLE t_part_create;
|
||||
DROP TABLE t_part_create_2;
|
||||
DROP TABLE t_part_add_part;
|
||||
DROP TABLE t_part_change_eng;
|
||||
DROP TABLE t_part_change_eng_2;
|
||||
DROP TABLE t_part_change_eng_3;
|
||||
DROP TABLE t_part_alter;
|
||||
DROP TABLE t_part_alter_2;
|
||||
DROP TABLE t_part_rename_2;
|
||||
DROP TABLE t_part_rm_part;
|
||||
DROP DATABASE test_for_rename;
|
||||
--let after_aria_table_copy_test_for_db_drop_t=
|
||||
--let after_aria_table_copy_test_t_db_create=
|
||||
--let after_aria_table_copy_test_t_alter=
|
||||
--let after_aria_background=
|
||||
--let after_aria_table_copy_test_t_trunc=
|
||||
--let after_aria_table_copy_test_t_ch_i=
|
||||
--let after_aria_table_copy_test_t_rename=
|
||||
--let after_aria_table_copy_test_t_rename_2=
|
||||
--let after_aria_table_copy_test_t_rename_3=
|
||||
--let after_aria_table_copy_test_t_rename_4=
|
||||
--let after_aria_table_copy_test_t_delete=
|
||||
--let after_aria_table_copy_test_t_delete_2=
|
||||
--let after_aria_table_copy_test_t_rename_alter=
|
||||
--let after_aria_table_copy_test_t_rename_create=
|
||||
--let after_aria_table_copy_test_t_part_create=
|
||||
--let after_aria_table_copy_test_t_part_add_part=
|
||||
--let after_aria_table_copy_test_t_part_change_eng=
|
||||
--let after_aria_table_copy_test_t_part_change_eng_3=
|
||||
--let after_aria_table_copy_test_t_part_alter=
|
||||
--let after_aria_table_copy_test_t_part_alter_2=
|
||||
--let after_aria_table_copy_test_t_part_drop=
|
||||
--let after_aria_table_copy_test_t_part_rename=
|
||||
--let after_aria_table_copy_test_t_part_rename_3=
|
||||
--let after_aria_table_copy_test_t_part_rm_part=
|
||||
|
||||
--echo ### Result for DML test
|
||||
SELECT * FROM t_dml_ins;
|
||||
SELECT * FROM t_dml_upd;
|
||||
SELECT * FROM t_dml_del;
|
||||
|
||||
--echo ### Clean up for DML test
|
||||
DROP TABLE t_dml_ins;
|
||||
DROP TABLE t_dml_upd;
|
||||
DROP TABLE t_dml_del;
|
||||
--let after_aria_table_copy_test_t_dml_ins=
|
||||
--let after_aria_table_copy_test_t_dml_upd=
|
||||
--let after_aria_table_copy_test_t_dml_del=
|
||||
|
||||
--echo ### Result for redo log files backup
|
||||
--let $t_logs_1_records_count_after_backup=`SELECT COUNT(*) FROM t_logs_1`
|
||||
--let $t_logs_2_records_count_after_backup=`SELECT COUNT(*) FROM t_logs_2`
|
||||
--let $t_bulk_ins_records_count_after_backup=`SELECT COUNT(*) FROM t_bulk_ins`
|
||||
if ($t_logs_1_records_count_after_backup == $t_logs_1_records_count_before_backup) {
|
||||
--echo # ok
|
||||
}
|
||||
if ($t_logs_1_records_count_after_backup != $t_logs_1_records_count_before_backup) {
|
||||
--echo # failed
|
||||
}
|
||||
if ($t_logs_2_records_count_after_backup == $t_logs_2_records_count_before_backup) {
|
||||
--echo # ok
|
||||
}
|
||||
if ($t_logs_2_records_count_after_backup != $t_logs_2_records_count_before_backup) {
|
||||
--echo # failed
|
||||
}
|
||||
if ($t_bulk_ins_records_count_after_backup == $t_bulk_ins_records_count_before_backup) {
|
||||
--echo # ok
|
||||
}
|
||||
if ($t_bulk_ins_records_count_after_backup != $t_bulk_ins_records_count_before_backup) {
|
||||
--echo # failed
|
||||
}
|
||||
|
||||
--echo ### Cleanup for redo log files backup
|
||||
DROP TABLE t_logs_1;
|
||||
DROP TABLE t_logs_2;
|
||||
DROP TABLE t_bulk_ins;
|
||||
--let $t_logs_1_records_count_before_backup=
|
||||
--let $t_logs_1_records_count_after_backup=
|
||||
--let $t_logs_2_records_count_before_backup=
|
||||
--let $t_logs_2_records_count_after_backup=
|
||||
--let $t_bulk_ins_records_count_before_backup=
|
||||
--let $t_bulk_ins_records_count_after_backup=
|
||||
|
||||
--echo ### Result for online/offline tables test
|
||||
SELECT * FROM t_default;
|
||||
SELECT * FROM t_tr_p_ch;
|
||||
SELECT * FROM t_tr_p_nch;
|
||||
SELECT * FROM t_p_ch;
|
||||
SELECT * FROM t_p_nch;
|
||||
SELECT * FROM t_fixed;
|
||||
SELECT * FROM t_dyn;
|
||||
SELECT * FROM t_part_online;
|
||||
SELECT * FROM t_part_offline;
|
||||
SELECT * FROM `t 1 t-1`;
|
||||
SELECT * FROM `t-part online`;
|
||||
|
||||
--echo ### Cleanup for online/offline tables test
|
||||
DROP TABLE t_default;
|
||||
DROP TABLE t_tr_p_ch;
|
||||
DROP TABLE t_tr_p_nch;
|
||||
DROP TABLE t_p_ch;
|
||||
DROP TABLE t_p_nch;
|
||||
DROP TABLE t_fixed;
|
||||
DROP TABLE t_dyn;
|
||||
DROP TABLE t_part_online;
|
||||
DROP TABLE t_part_offline;
|
||||
DROP TABLE `t 1 t-1`;
|
||||
DROP TABLE `t-part online`;
|
||||
|
||||
if ($backup_variant == $backup_stream) {
|
||||
--remove_file $streamfile
|
||||
}
|
||||
--rmdir $targetdir
|
||||
--dec $backup_variant
|
||||
}
|
||||
|
1
mysql-test/suite/mariabackup/aria_log.opt
Normal file
1
mysql-test/suite/mariabackup/aria_log.opt
Normal file
@@ -0,0 +1 @@
|
||||
--loose-aria-log-file-size=8388608
|
@@ -35,7 +35,6 @@ DROP TABLE t1;
|
||||
SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
|
||||
SHOW ENGINE aria logs;
|
||||
Type Name Status
|
||||
Aria aria_log.00000001 free
|
||||
Aria aria_log.00000002 in use
|
||||
# Restarting mariadbd with default parameters
|
||||
# restart
|
||||
|
@@ -48,7 +48,6 @@ SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
|
||||
--replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
|
||||
SHOW ENGINE aria logs;
|
||||
|
||||
|
||||
--echo # mariadb-backup --backup
|
||||
--disable_result_log
|
||||
--mkdir $targetdir
|
||||
@@ -61,7 +60,6 @@ SHOW ENGINE aria logs;
|
||||
--exec $XTRABACKUP --prepare --target-dir=$targetdir
|
||||
--enable_result_log
|
||||
|
||||
|
||||
--echo # shutdown server
|
||||
--disable_result_log
|
||||
--source include/shutdown_mysqld.inc
|
||||
@@ -70,12 +68,14 @@ SHOW ENGINE aria logs;
|
||||
--echo # remove aria-log-dir-path
|
||||
--rmdir $ARIA_LOGDIR_FS
|
||||
|
||||
|
||||
--echo # mariadb-backup --copy-back
|
||||
--let $mariadb_backup_parameters=--defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$datadir --target-dir=$targetdir --parallel=2 --throttle=1 --aria-log-dir-path=$ARIA_LOGDIR_MARIADB
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--exec echo "# with parameters: $mariadb_backup_parameters"
|
||||
--exec $XTRABACKUP $mariadb_backup_parameters
|
||||
|
||||
|
||||
--echo # starting server
|
||||
--let $restart_parameters=$server_parameters
|
||||
--source include/start_mysqld.inc
|
||||
@@ -91,7 +91,7 @@ DROP TABLE t1;
|
||||
--echo # Testing aria log files after --copy-back
|
||||
SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
|
||||
--file_exists $ARIA_LOGDIR_FS/aria_log_control
|
||||
--file_exists $ARIA_LOGDIR_FS/aria_log.00000001
|
||||
#--file_exists $ARIA_LOGDIR_FS/aria_log.00000001
|
||||
--file_exists $ARIA_LOGDIR_FS/aria_log.00000002
|
||||
--error 1
|
||||
--file_exists $ARIA_LOGDIR_FS/aria_log.00000003
|
||||
|
@@ -35,7 +35,6 @@ DROP TABLE t1;
|
||||
SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
|
||||
SHOW ENGINE aria logs;
|
||||
Type Name Status
|
||||
Aria aria_log.00000001 free
|
||||
Aria aria_log.00000002 in use
|
||||
# Restarting mariadbd with default parameters
|
||||
# restart
|
||||
|
@@ -0,0 +1,2 @@
|
||||
--loose-aria-log-file-size=8388608
|
||||
--loose-restart-for-aria_log_rotate_during_backup="This is needed to recreate datadir, to have Aria start logs from aria_log.00000001"
|
@@ -0,0 +1,58 @@
|
||||
SHOW VARIABLES LIKE 'aria_log_file_size';
|
||||
Variable_name Value
|
||||
aria_log_file_size 8388608
|
||||
CREATE PROCEDURE display_aria_log_control(ctrl BLOB)
|
||||
BEGIN
|
||||
SELECT HEX(REVERSE(SUBSTRING(ctrl, 42, 4))) AS last_logno;
|
||||
END;
|
||||
$$
|
||||
CREATE PROCEDURE populate_t1()
|
||||
BEGIN
|
||||
FOR id IN 0..9 DO
|
||||
INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024));
|
||||
END FOR;
|
||||
END;
|
||||
$$
|
||||
CREATE TABLE test.t1(id INT, txt LONGTEXT) ENGINE=Aria;
|
||||
# MYSQLD_DATADIR/aria_log_control before --backup
|
||||
CALL display_aria_log_control(@aria_log_control);
|
||||
last_logno
|
||||
00000001
|
||||
# Running --backup
|
||||
# MYSQLD_DATADIR/aria_log_control after --backup
|
||||
CALL display_aria_log_control(@aria_log_control);
|
||||
last_logno
|
||||
00000002
|
||||
# targetdir/aria_log_control after --backup
|
||||
CALL display_aria_log_control(@aria_log_control);
|
||||
last_logno
|
||||
00000001
|
||||
# Running --prepare
|
||||
# targetdir/aria_log_control after --prepare
|
||||
CALL display_aria_log_control(@aria_log_control);
|
||||
last_logno
|
||||
00000002
|
||||
# shutdown server
|
||||
# remove datadir
|
||||
# xtrabackup move back
|
||||
# restart
|
||||
# MYSQLD_DATADIR/aria_log_control after --copy-back
|
||||
CALL display_aria_log_control(@aria_log_control);
|
||||
last_logno
|
||||
00000002
|
||||
# Checking that after --restore all t1 data is there
|
||||
SELECT id, LENGTH(txt) FROM t1 ORDER BY id;
|
||||
id LENGTH(txt)
|
||||
0 1048576
|
||||
1 1048576
|
||||
2 1048576
|
||||
3 1048576
|
||||
4 1048576
|
||||
5 1048576
|
||||
6 1048576
|
||||
7 1048576
|
||||
8 1048576
|
||||
9 1048576
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE populate_t1;
|
||||
DROP PROCEDURE display_aria_log_control;
|
@@ -0,0 +1,82 @@
|
||||
--source include/have_debug.inc
|
||||
--source include/have_aria.inc
|
||||
|
||||
SHOW VARIABLES LIKE 'aria_log_file_size';
|
||||
|
||||
--let $MYSQLD_DATADIR= `select @@datadir`
|
||||
--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
|
||||
mkdir $targetdir;
|
||||
|
||||
|
||||
DELIMITER $$;
|
||||
CREATE PROCEDURE display_aria_log_control(ctrl BLOB)
|
||||
BEGIN
|
||||
SELECT HEX(REVERSE(SUBSTRING(ctrl, 42, 4))) AS last_logno;
|
||||
END;
|
||||
$$
|
||||
DELIMITER ;$$
|
||||
|
||||
DELIMITER $$;
|
||||
CREATE PROCEDURE populate_t1()
|
||||
BEGIN
|
||||
FOR id IN 0..9 DO
|
||||
INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024));
|
||||
END FOR;
|
||||
END;
|
||||
$$
|
||||
DELIMITER ;$$
|
||||
|
||||
|
||||
CREATE TABLE test.t1(id INT, txt LONGTEXT) ENGINE=Aria;
|
||||
|
||||
--echo # MYSQLD_DATADIR/aria_log_control before --backup
|
||||
--let ARIA_DATADIR=$MYSQLD_DATADIR
|
||||
--source include/aria_log_control_load.inc
|
||||
CALL display_aria_log_control(@aria_log_control);
|
||||
|
||||
|
||||
--echo # Running --backup
|
||||
--let after_scanning_log_files=CALL test.populate_t1
|
||||
--disable_result_log
|
||||
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --dbug=+d,mariabackup_events 2>&1
|
||||
--let after_scanning_log_files=
|
||||
--enable_result_log
|
||||
|
||||
--echo # MYSQLD_DATADIR/aria_log_control after --backup
|
||||
--let ARIA_DATADIR=$MYSQLD_DATADIR
|
||||
--source include/aria_log_control_load.inc
|
||||
CALL display_aria_log_control(@aria_log_control);
|
||||
|
||||
--echo # targetdir/aria_log_control after --backup
|
||||
--let ARIA_DATADIR=$targetdir
|
||||
--source include/aria_log_control_load.inc
|
||||
CALL display_aria_log_control(@aria_log_control);
|
||||
|
||||
|
||||
--echo # Running --prepare
|
||||
--disable_result_log
|
||||
--exec $XTRABACKUP --prepare --target-dir=$targetdir
|
||||
--enable_result_log
|
||||
|
||||
--echo # targetdir/aria_log_control after --prepare
|
||||
--let ARIA_DATADIR=$targetdir
|
||||
--source include/aria_log_control_load.inc
|
||||
CALL display_aria_log_control(@aria_log_control);
|
||||
|
||||
|
||||
--disable_result_log
|
||||
--source include/restart_and_restore.inc
|
||||
--enable_result_log
|
||||
|
||||
--echo # MYSQLD_DATADIR/aria_log_control after --copy-back
|
||||
--let ARIA_DATADIR=$MYSQLD_DATADIR
|
||||
--source include/aria_log_control_load.inc
|
||||
CALL display_aria_log_control(@aria_log_control);
|
||||
|
||||
--echo # Checking that after --restore all t1 data is there
|
||||
SELECT id, LENGTH(txt) FROM t1 ORDER BY id;
|
||||
DROP TABLE t1;
|
||||
rmdir $targetdir;
|
||||
|
||||
DROP PROCEDURE populate_t1;
|
||||
DROP PROCEDURE display_aria_log_control;
|
@@ -22,7 +22,7 @@ eval GRANT ALL PRIVILEGES ON *.* to '$USERNAME';
|
||||
|
||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf -u $USERNAME --backup --protocol=pipe --target-dir=$targetdir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf -u $USERNAME --backup --parallel=10 --protocol=pipe --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
--replace_result $USERNAME USERNAME
|
||||
eval DROP USER '$USERNAME';
|
||||
|
@@ -6,8 +6,6 @@ GRANT RELOAD, PROCESS on *.* to backup@localhost;
|
||||
FOUND 1 /missing required privilege REPLICA MONITOR/ in backup.log
|
||||
GRANT REPLICA MONITOR ON *.* TO backup@localhost;
|
||||
REVOKE REPLICA MONITOR ON *.* FROM backup@localhost;
|
||||
FOUND 1 /missing required privilege CONNECTION ADMIN/ in backup.log
|
||||
GRANT CONNECTION ADMIN ON *.* TO backup@localhost;
|
||||
FOUND 1 /missing required privilege REPLICATION SLAVE ADMIN/ in backup.log
|
||||
FOUND 1 /missing required privilege REPLICA MONITOR/ in backup.log
|
||||
GRANT REPLICATION SLAVE ADMIN ON *.* TO backup@localhost;
|
||||
|
@@ -3,14 +3,14 @@ CREATE user backup@localhost;
|
||||
|
||||
# backup possible for unprivileges user, with --no-lock
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup -ubackup --no-lock --target-dir=$targetdir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 -ubackup --no-lock --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
rmdir $targetdir;
|
||||
|
||||
# backup fails without --no-lock, because of FTWRL
|
||||
--disable_result_log
|
||||
error 1;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup -ubackup --target-dir=$targetdir > $MYSQLTEST_VARDIR/tmp/backup.log 2>&1;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 -ubackup --target-dir=$targetdir > $MYSQLTEST_VARDIR/tmp/backup.log 2>&1;
|
||||
--enable_result_log
|
||||
|
||||
let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/backup.log;
|
||||
@@ -23,7 +23,7 @@ let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/backup.log;
|
||||
# backup succeeds with RELOAD privilege
|
||||
GRANT RELOAD, PROCESS on *.* to backup@localhost;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup -ubackup --target-dir=$targetdir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 -ubackup --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
rmdir $targetdir;
|
||||
|
||||
@@ -45,24 +45,6 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup -ubackup --sl
|
||||
rmdir $targetdir;
|
||||
REVOKE REPLICA MONITOR ON *.* FROM backup@localhost;
|
||||
|
||||
# TODO need a query that would delay a BACKUP STAGE START/ BACKUP STAGE BLOCK_COMMIT longer than the kill-long-queries-timeout
|
||||
#--send SELECT SLEEP(9) kill_me
|
||||
|
||||
# kill-long-query-type=(not empty) requires CONNECTION ADMIN
|
||||
--disable_result_log
|
||||
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup -ubackup --kill-long-query-type=ALL --kill-long-queries-timeout=4 --target-dir=$targetdir > $MYSQLTEST_VARDIR/tmp/backup.log 2>&1;
|
||||
--enable_result_log
|
||||
rmdir $targetdir;
|
||||
|
||||
--let SEARCH_PATTERN= missing required privilege CONNECTION ADMIN
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
GRANT CONNECTION ADMIN ON *.* TO backup@localhost;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup -ubackup --kill-long-query-type=all --kill-long-queries-timeout=1 --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
rmdir $targetdir;
|
||||
|
||||
# --safe-slave-backup requires REPLICATION SLAVE ADMIN, and REPLICA MONITOR
|
||||
--disable_result_log
|
||||
error 1;
|
||||
|
@@ -3,7 +3,7 @@ FLUSH PRIVILEGES;
|
||||
echo # xtrabackup backup;
|
||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --user=backup_user --password=x --ssl --backup --target-dir=$targetdir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --user=backup_user --password=x --ssl --backup --parallel=10 --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
|
||||
echo # xtrabackup prepare;
|
||||
|
@@ -9,7 +9,7 @@ INSERT INTO t VALUES(1);
|
||||
SHOW VARIABLES like 'log_bin';
|
||||
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$basedir;
|
||||
--enable_result_log
|
||||
|
||||
exec $XTRABACKUP --prepare --binlog-info=1 --target-dir=$basedir ;
|
||||
|
@@ -4,7 +4,7 @@ echo # xtrabackup backup;
|
||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --compress --target-dir=$targetdir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --compress --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
|
||||
INSERT INTO t VALUES(2);
|
||||
|
@@ -7,7 +7,7 @@ mkdir $targetdir;
|
||||
|
||||
echo # xtrabackup backup;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,mariabackup_events;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --dbug=+d,mariabackup_events;
|
||||
--enable_result_log
|
||||
|
||||
--let after_load_tables=
|
||||
|
@@ -8,7 +8,7 @@ mkdir $table_data_dir;
|
||||
echo # xtrabackup backup;
|
||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,mariabackup_events;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --dbug=+d,mariabackup_events;
|
||||
--enable_result_log
|
||||
--source include/shutdown_mysqld.inc
|
||||
echo # xtrabackup prepare;
|
||||
|
@@ -7,7 +7,7 @@ INSERT INTO t VALUES(1);
|
||||
echo # xtrabackup backup;
|
||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
--source include/shutdown_mysqld.inc
|
||||
echo # xtrabackup prepare;
|
||||
@@ -21,6 +21,7 @@ rmdir $table_data_dir;
|
||||
SELECT * FROM t;
|
||||
DROP TABLE t;
|
||||
rmdir $targetdir;
|
||||
rmdir $table_data_dir;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18200 MariaBackup full backup failed with InnoDB: Failing assertion: success
|
||||
@@ -32,8 +33,8 @@ chmod 0000 $DATADIR/ibdata1;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
chmod 0755 $DATADIR/ibdata1;
|
||||
rmdir $table_data_dir;
|
||||
rmdir $targetdir;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.4 tests
|
||||
--echo #
|
||||
|
67
mysql-test/suite/mariabackup/ddl_for_common_engine.result
Normal file
67
mysql-test/suite/mariabackup/ddl_for_common_engine.result
Normal file
@@ -0,0 +1,67 @@
|
||||
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CSV;
|
||||
CREATE TABLE t2 (a INT NOT NULL) ENGINE=CSV;
|
||||
CREATE TABLE t3 (a INT NOT NULL) ENGINE=CSV;
|
||||
### Backup to dir
|
||||
# xtrabackup prepare
|
||||
# shutdown server
|
||||
# remove datadir
|
||||
# xtrabackup move back
|
||||
# restart
|
||||
SELECT * FROM t4;
|
||||
a
|
||||
SELECT * FROM t2;
|
||||
ERROR 42S02: Table 'test.t2' doesn't exist
|
||||
SELECT * FROM t3;
|
||||
ERROR 42S02: Table 'test.t3' doesn't exist
|
||||
SELECT * FROM t5;
|
||||
a
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
DROP TABLE t4, t5, t1;
|
||||
CREATE TABLE t1_m1 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
CREATE TABLE t1_m2 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
CREATE TABLE t1 (a INT NOT NULL) ENGINE=MERGE UNION=(t1_m1, t1_m2) INSERT_METHOD=LAST;
|
||||
CREATE TABLE t2_m1 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
CREATE TABLE t2_m2 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
CREATE TABLE t2 (a INT NOT NULL) ENGINE=MERGE UNION=(t2_m1, t2_m2) INSERT_METHOD=LAST;
|
||||
CREATE TABLE t3_m1 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
CREATE TABLE t3_m2 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
CREATE TABLE t3 (a INT NOT NULL) ENGINE=MERGE UNION=(t3_m1, t3_m2) INSERT_METHOD=LAST;
|
||||
### Backup to dir
|
||||
# xtrabackup prepare
|
||||
# shutdown server
|
||||
# remove datadir
|
||||
# xtrabackup move back
|
||||
# restart
|
||||
SELECT * FROM t4;
|
||||
a
|
||||
SELECT * FROM t2;
|
||||
ERROR 42S02: Table 'test.t2' doesn't exist
|
||||
SELECT * FROM t3;
|
||||
ERROR 42S02: Table 'test.t3' doesn't exist
|
||||
SELECT * FROM t5;
|
||||
a
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
DROP TABLE t4, t5, t1;
|
||||
DROP TABLE t1_m1, t1_m2, t2_m1, t2_m2, t3_m1, t3_m2;
|
||||
CREATE TABLE t1 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
CREATE TABLE t2 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
CREATE TABLE t3 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
### Backup to dir
|
||||
# xtrabackup prepare
|
||||
# shutdown server
|
||||
# remove datadir
|
||||
# xtrabackup move back
|
||||
# restart
|
||||
SELECT * FROM t4;
|
||||
a
|
||||
SELECT * FROM t2;
|
||||
ERROR 42S02: Table 'test.t2' doesn't exist
|
||||
SELECT * FROM t3;
|
||||
ERROR 42S02: Table 'test.t3' doesn't exist
|
||||
SELECT * FROM t5;
|
||||
a
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
DROP TABLE t4, t5, t1;
|
79
mysql-test/suite/mariabackup/ddl_for_common_engine.test
Normal file
79
mysql-test/suite/mariabackup/ddl_for_common_engine.test
Normal file
@@ -0,0 +1,79 @@
|
||||
# This test is just to ensure the DDL processing works for common engines like
|
||||
# MyISAM, ARCHIVE, CSV etc. The more complex test for different cases is
|
||||
# implemented in aria_backup.test.
|
||||
--source include/have_archive.inc
|
||||
--source include/have_csv.inc
|
||||
--source include/have_debug.inc
|
||||
|
||||
--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
|
||||
|
||||
--let $e_myisam = 1
|
||||
--let $e_merge = 2
|
||||
--let $e_csv = 3
|
||||
--let $e_archive = 4
|
||||
# 'rename' is not logged in $e_archive, return when fix
|
||||
--let $e_var = $e_csv
|
||||
|
||||
while ($e_var) {
|
||||
if ($e_var == $e_csv) {
|
||||
--let $engine = CSV
|
||||
}
|
||||
if ($e_var == $e_archive) {
|
||||
--let $engine = ARCHIVE
|
||||
}
|
||||
if ($e_var == $e_merge) {
|
||||
--let $engine = MERGE
|
||||
}
|
||||
if ($e_var == $e_myisam) {
|
||||
--let $engine = MyISAM
|
||||
}
|
||||
|
||||
if ($e_var == $e_merge) {
|
||||
CREATE TABLE t1_m1 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
CREATE TABLE t1_m2 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
CREATE TABLE t1 (a INT NOT NULL) ENGINE=MERGE UNION=(t1_m1, t1_m2) INSERT_METHOD=LAST;
|
||||
CREATE TABLE t2_m1 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
CREATE TABLE t2_m2 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
CREATE TABLE t2 (a INT NOT NULL) ENGINE=MERGE UNION=(t2_m1, t2_m2) INSERT_METHOD=LAST;
|
||||
CREATE TABLE t3_m1 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
CREATE TABLE t3_m2 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
CREATE TABLE t3 (a INT NOT NULL) ENGINE=MERGE UNION=(t3_m1, t3_m2) INSERT_METHOD=LAST;
|
||||
}
|
||||
if ($e_var != $e_merge) {
|
||||
eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=$engine;
|
||||
eval CREATE TABLE t2 (a INT NOT NULL) ENGINE=$engine;
|
||||
eval CREATE TABLE t3 (a INT NOT NULL) ENGINE=$engine;
|
||||
}
|
||||
|
||||
--let after_ce_table_copy_test_t1=begin not atomic CREATE TABLE test.t4 LIKE test.t1; DROP TABLE test.t2; RENAME TABLE test.t3 TO test.t5; end
|
||||
|
||||
--mkdir $targetdir
|
||||
--echo ### Backup to dir
|
||||
--disable_result_log
|
||||
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --dbug=+d,mariabackup_events
|
||||
--enable_result_log
|
||||
|
||||
--echo # xtrabackup prepare
|
||||
--disable_result_log
|
||||
--exec $XTRABACKUP --prepare --target-dir=$targetdir
|
||||
--source include/restart_and_restore.inc
|
||||
--enable_result_log
|
||||
--rmdir $targetdir
|
||||
|
||||
SELECT * FROM t4;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SELECT * FROM t2;
|
||||
--error ER_NO_SUCH_TABLE
|
||||
SELECT * FROM t3;
|
||||
SELECT * FROM t5;
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t4, t5, t1;
|
||||
|
||||
if ($e_var == $e_merge) {
|
||||
DROP TABLE t1_m1, t1_m2, t2_m1, t2_m2, t3_m1, t3_m2;
|
||||
}
|
||||
--let after_ce_table_copy_test_t1=
|
||||
--dec $e_var
|
||||
}
|
||||
|
@@ -1 +1,3 @@
|
||||
log_page_corruption : MDEV-26210
|
||||
mariabackup.xb_compressed_encrypted : MDEV-26154 (error 194 "Tablespace is missing for a table")
|
||||
innodb_ddl_on_intermediate_table : MENT-1213
|
||||
|
@@ -37,7 +37,7 @@ echo # xtrabackup backup;
|
||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
let $backuplog=$MYSQLTEST_VARDIR/tmp/backup.log;
|
||||
--error 1
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --core-file > $backuplog;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --core-file > $backuplog;
|
||||
--enable_result_log
|
||||
|
||||
--let SEARCH_PATTERN=Database page corruption detected.*
|
||||
|
@@ -65,7 +65,7 @@ if (`select @@innodb_checksum_algorithm LIKE '%full_crc32'`)
|
||||
}
|
||||
--disable_result_log
|
||||
--error $expect_error
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --extended-validation --target-dir=$targetdir --core-file > $backuplog;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --extended-validation --target-dir=$targetdir --core-file > $backuplog;
|
||||
--enable_result_log
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ rmdir $targetdir;
|
||||
|
||||
# Due to very constructed nature of the "corruption" (faking checksums), the "corruption" won't be found without --extended-validation
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
|
||||
drop table t1;
|
||||
|
@@ -2,7 +2,7 @@ let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
let $extra_lsndir=$MYSQLTEST_VARDIR/tmp/extra_lsndir;
|
||||
mkdir $extra_lsndir;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --extra-lsndir=$extra_lsndir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --extra-lsndir=$extra_lsndir;
|
||||
--enable_result_log
|
||||
list_files $extra_lsndir;
|
||||
rmdir $extra_lsndir;
|
||||
|
@@ -7,7 +7,7 @@ let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
--let $backup_log=$MYSQLTEST_VARDIR/tmp/backup.log
|
||||
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir > $backup_log 2>&1;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --parallel=10 > $backup_log 2>&1;
|
||||
--enable_result_log
|
||||
|
||||
# The following warning must not appear after MDEV-27343 fix
|
||||
|
@@ -79,7 +79,7 @@ INSERT INTO t VALUES(1);
|
||||
echo # xtrabackup backup;
|
||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
SET GLOBAL innodb_flush_log_at_trx_commit=1;
|
||||
INSERT INTO t VALUES(2);
|
||||
|
@@ -18,7 +18,7 @@ INSERT INTO t VALUES(1);
|
||||
|
||||
echo # Create full backup , modify table, then create incremental/differential backup;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$basedir;
|
||||
--enable_result_log
|
||||
|
||||
SET GLOBAL innodb_flush_log_at_trx_commit = 1;
|
||||
@@ -26,7 +26,7 @@ INSERT INTO t VALUES(2);
|
||||
SELECT * FROM t;
|
||||
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$incremental_dir --incremental-basedir=$basedir;
|
||||
echo # Prepare full backup, apply incremental one;
|
||||
exec $XTRABACKUP --prepare --target-dir=$basedir;
|
||||
exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir;
|
||||
|
@@ -0,0 +1,5 @@
|
||||
CREATE TABLE IF NOT EXISTS t1 ( col1 INT, col_text TEXT ) ENGINE = InnoDB;
|
||||
ALTER TABLE t1 ADD FULLTEXT KEY `ftidx1` ( col_text );
|
||||
# xtrabackup backup
|
||||
SET debug_sync='RESET';
|
||||
DROP TABLE t1;
|
@@ -0,0 +1,18 @@
|
||||
--source include/have_debug.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
|
||||
--mkdir $targetdir
|
||||
|
||||
CREATE TABLE IF NOT EXISTS t1 ( col1 INT, col_text TEXT ) ENGINE = InnoDB;
|
||||
ALTER TABLE t1 ADD FULLTEXT KEY `ftidx1` ( col_text );
|
||||
|
||||
echo # xtrabackup backup;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --dbug=+d,mariabackup_events,emulate_ddl_on_intermediate_table;
|
||||
--enable_result_log
|
||||
|
||||
SET debug_sync='RESET';
|
||||
rmdir $targetdir;
|
||||
DROP TABLE t1;
|
@@ -16,7 +16,7 @@ CREATE TABLE `bobby``tables` (id INT, name VARCHAR(50), purchased DATE) ENGINE I
|
||||
set global innodb_log_checkpoint_now = 1;
|
||||
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --lock-ddl-per-table=1 --dbug=+d,check_mdl_lock_works;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --lock-ddl-per-table=1 --dbug=+d,check_mdl_lock_works;
|
||||
--enable_result_log
|
||||
DROP TABLE t;
|
||||
DROP TABLE `bobby``tables`;
|
||||
|
@@ -7,7 +7,7 @@ let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
let $backuplog=$MYSQLTEST_VARDIR/tmp/backup.log;
|
||||
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,log_intermittent_checksum_mismatch --core-file > $backuplog;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --dbug=+d,log_intermittent_checksum_mismatch --core-file > $backuplog;
|
||||
--enable_result_log
|
||||
|
||||
--let SEARCH_RANGE = 10000000
|
||||
|
@@ -0,0 +1,20 @@
|
||||
#
|
||||
# Start of 10.5 tests
|
||||
#
|
||||
#
|
||||
# MENT-1587 mariabackup failing due to aria log file copy
|
||||
#
|
||||
CREATE TABLE t1(i INT PRIMARY KEY) ENGINE=ARIA;
|
||||
INSERT INTO t1 VALUES (10);
|
||||
# Prepare full backup
|
||||
# shutdown server
|
||||
# remove datadir
|
||||
# xtrabackup move back
|
||||
# restart
|
||||
SELECT * FROM t1;
|
||||
i
|
||||
10
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.5 tests
|
||||
#
|
@@ -0,0 +1,47 @@
|
||||
--let $MYSQLD_DATADIR=`select @@datadir`
|
||||
|
||||
--echo #
|
||||
--echo # Start of 10.5 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MENT-1587 mariabackup failing due to aria log file copy
|
||||
--echo #
|
||||
|
||||
|
||||
--let $basedir=$MYSQLTEST_VARDIR/tmp/backup
|
||||
--let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1
|
||||
|
||||
CREATE TABLE t1(i INT PRIMARY KEY) ENGINE=ARIA;
|
||||
INSERT INTO t1 VALUES (10);
|
||||
|
||||
#
|
||||
# Add a log file with a number outside of last_log_number
|
||||
# specified in aria_log_control.
|
||||
# The actual file number written in the header is 4.
|
||||
# Let's rename it to 100 for test purposes.
|
||||
# Hopefully 100 should be enough.
|
||||
#
|
||||
--copy_file suite/mariabackup/std_data/ment1587_aria_log.00000004 $MYSQLD_DATADIR/aria_log.00000100
|
||||
|
||||
--disable_result_log
|
||||
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir
|
||||
--enable_result_log
|
||||
|
||||
--disable_result_log
|
||||
--echo # Prepare full backup
|
||||
--exec $XTRABACKUP --prepare --target-dir=$basedir
|
||||
--enable_result_log
|
||||
|
||||
--let $targetdir=$basedir
|
||||
--source include/restart_and_restore.inc
|
||||
--enable_result_log
|
||||
--rmdir $basedir
|
||||
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.5 tests
|
||||
--echo #
|
24
mysql-test/suite/mariabackup/log_tables.result
Normal file
24
mysql-test/suite/mariabackup/log_tables.result
Normal file
@@ -0,0 +1,24 @@
|
||||
CREATE TABLE t(i INT)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
SET GLOBAL general_log = 1;
|
||||
SET GLOBAL log_output = 'TABLE';
|
||||
INSERT INTO t VALUES (1);
|
||||
SELECT * FROM mysql.general_log
|
||||
WHERE argument LIKE "INSERT INTO %" AND
|
||||
(command_type = "Query" OR command_type = "Execute") ;
|
||||
event_time user_host thread_id server_id command_type argument
|
||||
TIMESTAMP USER_HOST THREAD_ID 1 Query INSERT INTO t VALUES (1)
|
||||
# Insert new row into general_log table after it has been copied on BLOCK_DDL.
|
||||
# Backup to dir.
|
||||
# Xtrabackup prepare.
|
||||
# shutdown server
|
||||
# remove datadir
|
||||
# xtrabackup move back
|
||||
# restart
|
||||
SELECT * FROM mysql.general_log
|
||||
WHERE argument LIKE "INSERT INTO %" AND
|
||||
(command_type = "Query" OR command_type = "Execute") ;
|
||||
event_time user_host thread_id server_id command_type argument
|
||||
TIMESTAMP USER_HOST THREAD_ID 1 Query INSERT INTO t VALUES (1)
|
||||
TIMESTAMP USER_HOST THREAD_ID 1 Query INSERT INTO test.t VALUES (2)
|
||||
DROP TABLE t;
|
49
mysql-test/suite/mariabackup/log_tables.test
Normal file
49
mysql-test/suite/mariabackup/log_tables.test
Normal file
@@ -0,0 +1,49 @@
|
||||
# Test for copying log tables tail
|
||||
--source include/have_aria.inc
|
||||
--source include/have_debug.inc
|
||||
|
||||
--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
|
||||
|
||||
CREATE TABLE t(i INT)
|
||||
ENGINE ARIA TRANSACTIONAL=1 ROW_FORMAT=PAGE PAGE_CHECKSUM=1;
|
||||
|
||||
--let $general_log_old = `SELECT @@global.general_log`
|
||||
--let $log_output_old = `SELECT @@global.log_output`
|
||||
|
||||
SET GLOBAL general_log = 1;
|
||||
SET GLOBAL log_output = 'TABLE';
|
||||
|
||||
INSERT INTO t VALUES (1);
|
||||
|
||||
--replace_column 1 TIMESTAMP 2 USER_HOST 3 THREAD_ID 5 Query
|
||||
--sorted_result
|
||||
SELECT * FROM mysql.general_log
|
||||
WHERE argument LIKE "INSERT INTO %" AND
|
||||
(command_type = "Query" OR command_type = "Execute") ;
|
||||
|
||||
--echo # Insert new row into general_log table after it has been copied on BLOCK_DDL.
|
||||
--let after_stage_block_ddl=INSERT INTO test.t VALUES (2)
|
||||
|
||||
--echo # Backup to dir.
|
||||
--disable_result_log
|
||||
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --dbug=+d,mariabackup_events
|
||||
--enable_result_log
|
||||
|
||||
--echo # Xtrabackup prepare.
|
||||
--disable_result_log
|
||||
--exec $XTRABACKUP --prepare --target-dir=$targetdir
|
||||
--source include/restart_and_restore.inc
|
||||
--enable_result_log
|
||||
|
||||
--replace_column 1 TIMESTAMP 2 USER_HOST 3 THREAD_ID 5 Query
|
||||
--sorted_result
|
||||
SELECT * FROM mysql.general_log
|
||||
WHERE argument LIKE "INSERT INTO %" AND
|
||||
(command_type = "Query" OR command_type = "Execute") ;
|
||||
|
||||
--rmdir $targetdir
|
||||
DROP TABLE t;
|
||||
--disable_query_log
|
||||
--eval SET GLOBAL general_log = $general_log_old
|
||||
--eval SET GLOBAL log_output = $log_output_old
|
||||
--enable_query_log
|
@@ -11,7 +11,7 @@ CREATE TABLE t(a varchar(40) PRIMARY KEY, b varchar(40), c varchar(40), d varcha
|
||||
|
||||
echo # Create full backup , modify table, then create incremental/differential backup;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$basedir;
|
||||
--enable_result_log
|
||||
|
||||
SET debug_dbug='+d,skip_page_checksum',foreign_key_checks=0,unique_checks=0;
|
||||
|
@@ -24,7 +24,7 @@ call mtr.add_suppression('InnoDB: Ignoring tablespace for test/t1 because it cou
|
||||
echo # xtrabackup backup;
|
||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
|
||||
rmdir $targetdir;
|
||||
|
@@ -9,6 +9,6 @@ CREATE TABLE t1(i int) ENGINE=INNODB;
|
||||
echo # xtrabackup backup;
|
||||
--disable_result_log
|
||||
error 1;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --no-lock --dbug=+d,mariabackup_events;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --no-lock --dbug=+d,mariabackup_events;
|
||||
--enable_result_log
|
||||
rmdir $targetdir;
|
||||
|
@@ -14,7 +14,7 @@ echo # xtrabackup backup;
|
||||
|
||||
let targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup "--tables=test.*1" --target-dir=$targetdir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 "--tables=test.*1" --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
list_files $targetdir/test *.ibd;
|
||||
list_files $targetdir/test *.new;
|
||||
|
@@ -28,7 +28,7 @@ echo # xtrabackup backup;
|
||||
|
||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup "--tables-exclude=test.*2" "--databases-exclude=db2" --target-dir=$targetdir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 "--tables-exclude=test.*2" "--databases-exclude=db2" --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
|
||||
COMMIT;
|
||||
|
@@ -14,7 +14,7 @@ PARTITION BY RANGE (i)
|
||||
PARTITION p3 VALUES LESS THAN (400) DATA DIRECTORY = '$MYSQLTEST_VARDIR/partitdata',
|
||||
PARTITION p4 VALUES LESS THAN MAXVALUE);
|
||||
INSERT INTO t VALUES (1), (101), (201), (301), (401);
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir;
|
||||
exec $XTRABACKUP --prepare --target-dir=$targetdir;
|
||||
DROP TABLE t;
|
||||
rmdir $MYSQLTEST_VARDIR/partitdata;
|
||||
|
@@ -16,7 +16,7 @@ echo # xtrabackup backup;
|
||||
|
||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
--disable_result_log
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup "--tables=test.t1" --target-dir=$targetdir;
|
||||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 "--tables=test.t1" --target-dir=$targetdir;
|
||||
--enable_result_log
|
||||
INSERT INTO t1 VALUES (1), (101), (201), (301);
|
||||
|
||||
|
@@ -61,3 +61,15 @@ SELECT * from t6;
|
||||
i
|
||||
5
|
||||
DROP TABLE t6;
|
||||
#
|
||||
# MDEV-33011 mariabackup --backup: FATAL ERROR: ... Can't open datafile cool_down/t3
|
||||
#
|
||||
# Simulate zero initialized page to defer tablespace load after rename log is found
|
||||
SET @save_dbug = @@SESSION.debug_dbug;
|
||||
SET DEBUG_DBUG="+d,checkpoint_after_file_create";
|
||||
CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
# RENAME that fails after redo log entry is written and flushed
|
||||
RENAME TABLE t1 TO non_existing_db.t1;
|
||||
ERROR HY000: Error on rename of './test/t1' to './non_existing_db/t1' (errno: 168 "Unknown (generic) error from engine")
|
||||
DROP TABLE t1;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user