1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 11.0 into 11.1

This commit is contained in:
Marko Mäkelä
2024-03-28 12:15:36 +02:00
727 changed files with 22650 additions and 8324 deletions

View File

@@ -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)

View File

@@ -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;

View File

@@ -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;

View File

@@ -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";

View File

@@ -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

View File

@@ -9,7 +9,7 @@ INSERT INTO t2 VALUES(2);
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
SELECT * FROM t1;
Got one of the listed errors
ERROR HY000: Table `test`.`t1` is corrupted. Please drop the table and recreate.
SELECT * FROM t2;
a
2

View File

@@ -32,7 +32,7 @@ foobar 2
# Restart server with keysbad3.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keysbad3.txt
SELECT * FROM t1;
ERROR 42S02: Table 'test.t1' doesn't exist in engine
ERROR HY000: Table `test`.`t1` is corrupted. Please drop the table and recreate.
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keysbad3.txt
DROP TABLE t1;
# Start server with keys3.txt
@@ -44,31 +44,31 @@ INSERT INTO t2 VALUES ('foobar',1,2);
# Restart server with keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
SELECT * FROM t2;
ERROR 42S02: Table 'test.t2' doesn't exist in engine
ERROR HY000: Table `test`.`t2` is corrupted. Please drop the table and recreate.
SELECT * FROM t2 where id = 1;
ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
ERROR HY000: Table `test`.`t2` is corrupted. Please drop the table and recreate.
SELECT * FROM t2 where b = 1;
ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
ERROR HY000: Table `test`.`t2` is corrupted. Please drop the table and recreate.
INSERT INTO t2 VALUES ('tmp',3,3);
ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
ERROR HY000: Table `test`.`t2` is corrupted. Please drop the table and recreate.
DELETE FROM t2 where b = 3;
ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
ERROR HY000: Table `test`.`t2` is corrupted. Please drop the table and recreate.
DELETE FROM t2 where id = 3;
ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
ERROR HY000: Table `test`.`t2` is corrupted. Please drop the table and recreate.
UPDATE t2 set b = b +1;
ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
ERROR HY000: Table `test`.`t2` is corrupted. Please drop the table and recreate.
OPTIMIZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 optimize Error Table test/t2 is corrupted. Please drop the table and recreate.
test.t2 optimize Error Table `test`.`t2` is corrupted. Please drop the table and recreate.
test.t2 optimize error Corrupt
ALTER TABLE t2 ADD COLUMN d INT;
ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
ERROR HY000: Table `test`.`t2` is corrupted. Please drop the table and recreate.
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze Error Table test/t2 is corrupted. Please drop the table and recreate.
test.t2 analyze Error Table `test`.`t2` is corrupted. Please drop the table and recreate.
test.t2 analyze error Corrupt
TRUNCATE TABLE t2;
ERROR HY000: Table test/t2 is corrupted. Please drop the table and recreate.
ERROR HY000: Table `test`.`t2` is corrupted. Please drop the table and recreate.
DROP TABLE t2;
# Start server with keys2.txt

View File

@@ -13,24 +13,24 @@ ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
# restart: --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys3.txt
SELECT * FROM t1;
ERROR 42S02: Table 'test.t1' doesn't exist in engine
ERROR HY000: Table `test`.`t1` is corrupted. Please drop the table and recreate.
SHOW WARNINGS;
Level Code Message
Error 1932 Table 'test.t1' doesn't exist in engine
Error 1877 Table `test`.`t1` is corrupted. Please drop the table and recreate.
ALTER TABLE t1 ENGINE=InnoDB;
ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
ERROR HY000: Table `test`.`t1` is corrupted. Please drop the table and recreate.
SHOW WARNINGS;
Level Code Message
Error 1877 Table test/t1 is corrupted. Please drop the table and recreate.
Error 1877 Table `test`.`t1` is corrupted. Please drop the table and recreate.
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize Error Table test/t1 is corrupted. Please drop the table and recreate.
test.t1 optimize Error Table `test`.`t1` is corrupted. Please drop the table and recreate.
test.t1 optimize error Corrupt
SHOW WARNINGS;
Level Code Message
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check Error Table test/t1 is corrupted. Please drop the table and recreate.
test.t1 check Error Table `test`.`t1` is corrupted. Please drop the table and recreate.
test.t1 check error Corrupt
SHOW WARNINGS;
Level Code Message
@@ -40,7 +40,7 @@ backup: t1
UNLOCK TABLES;
# restart: --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys3.txt
ALTER TABLE t1 DISCARD TABLESPACE;
ERROR 42S02: Table 'test.t1' doesn't exist in engine
ERROR HY000: Table `test`.`t1` is corrupted. Please drop the table and recreate.
DROP TABLE t1;
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
@@ -61,7 +61,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `ENCRYPTED`=YES `ENCRYPTION_KEY_ID`=4
# restart: --innodb-encrypt-tables --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys3.txt
RENAME TABLE t1 TO t1new;
ERROR HY000: Error on rename of './test/t1' to './test/t1new' (errno: 155 "The table does not exist in the storage engine")
ERROR HY000: Table `test`.`t1` is corrupted. Please drop the table and recreate.
ALTER TABLE t1 RENAME TO t1new;
ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
ERROR HY000: Table `test`.`t1` is corrupted. Please drop the table and recreate.
DROP TABLE t1;

View File

@@ -1,7 +1,7 @@
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted; key_version=1");
call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("InnoDB: Unable to decompress ..test.t[1-3]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]");
call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted");
call mtr.add_suppression("Table `test`\\.`t[12]` is corrupted");
# Restart mysqld --file-key-management-filename=keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
set GLOBAL innodb_default_encryption_key_id=4;
@@ -16,9 +16,9 @@ insert into t3 values (1, repeat('secret',6000));
# Restart mysqld --file-key-management-filename=keys3.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys3.txt
select count(*) from t1 FORCE INDEX (b) where b like 'secret%';
ERROR 42S02: Table 'test.t1' doesn't exist in engine
ERROR HY000: Table `test`.`t1` is corrupted. Please drop the table and recreate.
select count(*) from t2 FORCE INDEX (b) where b like 'secret%';
ERROR 42S02: Table 'test.t2' doesn't exist in engine
ERROR HY000: Table `test`.`t2` is corrupted. Please drop the table and recreate.
select count(*) from t3 FORCE INDEX (b) where b like 'secret%';
count(*)
1

View File

@@ -1,8 +1,7 @@
call mtr.add_suppression("InnoDB: Table `test`\\.`t[15]` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("Table `test`\\.`t[15]` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[15]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t[15].ibd looks corrupted; key_version=1");
call mtr.add_suppression("InnoDB: Table `test`\\.`t[15]` is corrupted");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
# restart: --innodb-encrypt-tables=ON --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
create table t5 (
@@ -24,9 +23,9 @@ insert into t1 values (1,2,'maria','db','encryption');
alter table t1 encrypted='yes' `encryption_key_id`=1;
# restart: --innodb-encrypt-tables=OFF
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist in engine
ERROR HY000: Table `test`.`t1` is corrupted. Please drop the table and recreate.
select * from t5;
ERROR 42S02: Table 'test.t5' doesn't exist in engine
ERROR HY000: Table `test`.`t5` is corrupted. Please drop the table and recreate.
# restart: --innodb-encrypt-tables=ON --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
drop table t1;
drop table t5;

View File

@@ -1,4 +1,4 @@
call mtr.add_suppression("InnoDB: Table `test`\\.`t[13]` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("Table `test`\\.`t[13]` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=\\d+, page number=[36]\\] in file .*test.t[123]\\.ibd looks corrupted; key_version=");
call mtr.add_suppression("\\[ERROR\\] InnoDB: We detected index corruption in an InnoDB type table");
call mtr.add_suppression("\\[ERROR\\] (mysqld|mariadbd).*: Index for table 't2' is corrupt; try to repair it");
@@ -17,11 +17,11 @@ COMMIT;
# Corrupt tables
# restart
SELECT * FROM t1;
ERROR 42S02: Table 'test.t1' doesn't exist in engine
ERROR HY000: Table `test`.`t1` is corrupted. Please drop the table and recreate.
SELECT * FROM t2;
Got one of the listed errors
SELECT * FROM t3;
ERROR 42S02: Table 'test.t3' doesn't exist in engine
ERROR HY000: Table `test`.`t3` is corrupted. Please drop the table and recreate.
# Restore the original tables
# restart
DROP TABLE t1,t2,t3;

View File

@@ -38,11 +38,11 @@ SELECT COUNT(1) FROM t2;
COUNT(1)
2048
SELECT COUNT(1) FROM t2,t1 where t2.a = t1.a;
ERROR 42S02: Table 'test.t1' doesn't exist in engine
ERROR HY000: Table `test`.`t1` is corrupted. Please drop the table and recreate.
SELECT COUNT(1) FROM t1 where b = 'ab';
ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
ERROR HY000: Table `test`.`t1` is corrupted. Please drop the table and recreate.
SELECT COUNT(1) FROM t1;
ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
ERROR HY000: Table `test`.`t1` is corrupted. Please drop the table and recreate.
# Start server with keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt

View File

@@ -22,6 +22,15 @@ insert into t2 select * from t1;
insert into t3 select * from t1;
insert into t4 select * from t1;
commit;
# Flush all dirty pages from buffer pool
SET @no_checkpoint_save_pct= @@GLOBAL.innodb_max_dirty_pages_pct;
SET @no_checkpoint_save_pct_lwm= @@GLOBAL.innodb_max_dirty_pages_pct_lwm;
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
SET GLOBAL innodb_max_dirty_pages_pct=0.0;
SET GLOBAL innodb_max_dirty_pages_pct= @no_checkpoint_save_pct;
SET GLOBAL innodb_max_dirty_pages_pct_lwm= @no_checkpoint_save_pct_lwm;
CREATE TABLE t5 (a VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES;
SET GLOBAL innodb_flush_log_at_trx_commit=1;
begin;
@@ -41,6 +50,6 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /\[ERROR\] InnoDB: Encryption key is not found for .*test.t1.ibd/ in mysqld.1.err
FOUND 1 /\[ERROR\] InnoDB: Encryption key is not found for .*test.t[1-5].ibd/ in mysqld.1.err
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
drop table t1,t2,t3,t4,t5;

View File

@@ -60,7 +60,7 @@ call mtr.add_suppression("Table .*t1.* is corrupted. Please drop the table and r
let $restart_parameters=--innodb_force_recovery=1 --skip-innodb-buffer-pool-load-at-startup;
--source include/restart_mysqld.inc
--error ER_NO_SUCH_TABLE_IN_ENGINE,ER_TABLE_CORRUPT
--error ER_TABLE_CORRUPT
SELECT * FROM t1;
SELECT * FROM t2;
CHECK TABLE t2;

View File

@@ -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

View File

@@ -42,7 +42,7 @@ SELECT * FROM t1;
-- source include/restart_mysqld.inc
--disable_warnings
--error ER_NO_SUCH_TABLE_IN_ENGINE
--error ER_TABLE_CORRUPT
SELECT * FROM t1;
--enable_warnings
@@ -71,7 +71,7 @@ INSERT INTO t2 VALUES ('foobar',1,2);
-- source include/restart_mysqld.inc
--disable_warnings
--error ER_NO_SUCH_TABLE_IN_ENGINE
--error ER_TABLE_CORRUPT
SELECT * FROM t2;
--error ER_TABLE_CORRUPT

View File

@@ -30,7 +30,7 @@ INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
--let $restart_parameters=--plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
--source include/restart_mysqld.inc
--error ER_NO_SUCH_TABLE_IN_ENGINE
--error ER_TABLE_CORRUPT
SELECT * FROM t1;
--replace_regex /key_id [1-9][0-9]*/\1 /
SHOW WARNINGS;
@@ -61,7 +61,7 @@ UNLOCK TABLES;
--let $restart_parameters=--plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
--source include/restart_mysqld.inc
--error ER_NO_SUCH_TABLE_IN_ENGINE
--error ER_TABLE_CORRUPT
ALTER TABLE t1 DISCARD TABLESPACE;
# Drop table will succeed.
DROP TABLE t1;
@@ -93,7 +93,7 @@ SHOW CREATE TABLE t1;
--let $restart_parameters= --innodb-encrypt-tables --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
--source include/restart_mysqld.inc
--error ER_ERROR_ON_RENAME
--error ER_TABLE_CORRUPT
RENAME TABLE t1 TO t1new;
--error ER_TABLE_CORRUPT
ALTER TABLE t1 RENAME TO t1new;

View File

@@ -7,7 +7,7 @@
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted; key_version=1");
call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("InnoDB: Unable to decompress ..test.t[1-3]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]");
call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted");
call mtr.add_suppression("Table `test`\\.`t[12]` is corrupted");
--echo # Restart mysqld --file-key-management-filename=keys2.txt
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
@@ -26,9 +26,9 @@ insert into t3 values (1, repeat('secret',6000));
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
-- source include/restart_mysqld.inc
--error ER_NO_SUCH_TABLE_IN_ENGINE
--error ER_TABLE_CORRUPT
select count(*) from t1 FORCE INDEX (b) where b like 'secret%';
--error ER_NO_SUCH_TABLE_IN_ENGINE
--error ER_TABLE_CORRUPT
select count(*) from t2 FORCE INDEX (b) where b like 'secret%';
select count(*) from t3 FORCE INDEX (b) where b like 'secret%';

View File

@@ -7,11 +7,10 @@
# MDEV-9559: Server without encryption configs crashes if selecting from an implicitly encrypted table
#
call mtr.add_suppression("InnoDB: Table `test`\\.`t[15]` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("Table `test`\\.`t[15]` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[15]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t[15].ibd looks corrupted; key_version=1");
call mtr.add_suppression("InnoDB: Table `test`\\.`t[15]` is corrupted");
# Suppression for builds where file_key_management plugin is linked statically
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
@@ -43,9 +42,9 @@ alter table t1 encrypted='yes' `encryption_key_id`=1;
--let $restart_parameters=--innodb-encrypt-tables=OFF
--source include/restart_mysqld.inc
--error ER_NO_SUCH_TABLE_IN_ENGINE
--error ER_TABLE_CORRUPT
select * from t1;
--error ER_NO_SUCH_TABLE_IN_ENGINE
--error ER_TABLE_CORRUPT
select * from t5;
--let $restart_parameters=--innodb-encrypt-tables=ON --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt

View File

@@ -7,7 +7,7 @@
# Don't test under embedded
-- source include/not_embedded.inc
call mtr.add_suppression("InnoDB: Table `test`\\.`t[13]` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("Table `test`\\.`t[13]` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=\\d+, page number=[36]\\] in file .*test.t[123]\\.ibd looks corrupted; key_version=");
call mtr.add_suppression("\\[ERROR\\] InnoDB: We detected index corruption in an InnoDB type table");
call mtr.add_suppression("\\[ERROR\\] (mysqld|mariadbd).*: Index for table 't2' is corrupt; try to repair it");
@@ -67,11 +67,11 @@ EOF
--source include/start_mysqld.inc
--error ER_NO_SUCH_TABLE_IN_ENGINE
--error ER_TABLE_CORRUPT
SELECT * FROM t1;
--error ER_GET_ERRMSG,ER_NOT_KEYFILE
SELECT * FROM t2;
--error ER_NO_SUCH_TABLE_IN_ENGINE
--error ER_TABLE_CORRUPT
SELECT * FROM t3;
--source include/shutdown_mysqld.inc

View File

@@ -46,7 +46,7 @@ CREATE TABLE t4(a int not null primary key auto_increment, b varchar(128)) engin
SELECT SLEEP(5);
SELECT COUNT(1) FROM t3;
SELECT COUNT(1) FROM t2;
--error ER_NO_SUCH_TABLE_IN_ENGINE
--error ER_TABLE_CORRUPT
SELECT COUNT(1) FROM t2,t1 where t2.a = t1.a;
--error ER_TABLE_CORRUPT
SELECT COUNT(1) FROM t1 where b = 'ab';

View File

@@ -42,7 +42,9 @@ insert into t3 select * from t1;
insert into t4 select * from t1;
commit;
let $no_checkpoint_flush= 1;
--source ../../suite/innodb/include/no_checkpoint_start.inc
#
# We test redo log page read at recv_read_page using
# keys that are not in std_data/keys.txt. If checkpoint
@@ -75,7 +77,7 @@ WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_PATTERN = \[ERROR\] InnoDB: Encryption key is not found for .*test.t1.ibd;
let SEARCH_PATTERN = \[ERROR\] InnoDB: Encryption key is not found for .*test.t[1-5].ibd;
--source include/search_pattern_in_file.inc
#

View File

@@ -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

View File

@@ -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

View File

@@ -33,7 +33,6 @@ t1 CREATE TABLE `t1` (
PARTITION `p5` VALUES LESS THAN MAXVALUE ENGINE = ENGINE)
ALTER TABLE t1 ANALYZE PARTITION p1,p2;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
SELECT * FROM t1 ORDER BY c1;
c1 c2

View File

@@ -536,6 +536,22 @@ use federated;
SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM t1 where id=3) dt3
WHERE id=2) dt2) dt;
id name
PREPARE stmt FROM "
SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM t1 where id=3) dt3
WHERE id=3) dt2) dt;
";
EXECUTE stmt;
id name
3 xxx
EXECUTE stmt;
id name
3 xxx
DEALLOCATE PREPARE stmt;
EXPLAIN
SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM t1 where id=3) dt3
WHERE id=3) dt2) dt;
id select_type table type possible_keys key key_len ref rows Extra
1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
connection slave;
CREATE TABLE federated.t10 (a INT,b INT);
CREATE TABLE federated.t11 (a INT, b INT);
@@ -556,6 +572,54 @@ WHERE id=2) dt2) dt
a b a b id name
1 1 NULL NULL NULL NULL
2 2 NULL NULL NULL NULL
#
# MDEV-31361: Second execution of PS for query with derived table
#
connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
id int(20) NOT NULL,
name varchar(16) NOT NULL default ''
)
DEFAULT CHARSET=latin1;
INSERT INTO federated.t1 VALUES
(3,'xxx'), (7,'yyy'), (4,'xxx'), (1,'zzz'), (5,'yyy');
connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
id int(20) NOT NULL,
name varchar(16) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
use federated;
SELECT * FROM
(SELECT * FROM
(SELECT * FROM
(SELECT * FROM t1 where id>3) dt3
WHERE id>3) dt2
) dt;
id name
7 yyy
4 xxx
5 yyy
PREPARE stmt FROM "SELECT * FROM
(SELECT * FROM
(SELECT * FROM
(SELECT * FROM t1 where id>3) dt3
WHERE id>3) dt2
) dt";
EXECUTE stmt;
id name
7 yyy
4 xxx
5 yyy
EXECUTE stmt;
id name
7 yyy
4 xxx
5 yyy
DEALLOCATE PREPARE stmt;
DROP TABLES federated.t1, federated.t2, federated.t3, federated.t10,
federated.t11;
connection slave;

View File

@@ -95,12 +95,9 @@ DEFAULT CHARSET=latin1;
INSERT INTO federated.t3 VALUES
('yyy'), ('www'), ('yyy'), ('xxx'), ('www'), ('yyy'), ('www');
#Enable after fix MDEV-31361
--disable_ps2_protocol
SELECT *
FROM federated.t3, (SELECT * FROM federated.t1 WHERE id > 3) t
WHERE federated.t3.name=t.name;
--enable_ps2_protocol
EXPLAIN
SELECT *
@@ -358,6 +355,18 @@ use federated;
SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM t1 where id=3) dt3
WHERE id=2) dt2) dt;
PREPARE stmt FROM "
SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM t1 where id=3) dt3
WHERE id=3) dt2) dt;
";
EXECUTE stmt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
EXPLAIN
SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM t1 where id=3) dt3
WHERE id=3) dt2) dt;
connection slave;
CREATE TABLE federated.t10 (a INT,b INT);
CREATE TABLE federated.t11 (a INT, b INT);
@@ -383,6 +392,52 @@ SELECT * FROM t10 LEFT JOIN
WHERE id=2) dt2) dt
) ON t10.a=t11.a;
--echo #
--echo # MDEV-31361: Second execution of PS for query with derived table
--echo #
connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
id int(20) NOT NULL,
name varchar(16) NOT NULL default ''
)
DEFAULT CHARSET=latin1;
INSERT INTO federated.t1 VALUES
(3,'xxx'), (7,'yyy'), (4,'xxx'), (1,'zzz'), (5,'yyy');
connection master;
DROP TABLE IF EXISTS federated.t1;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval
CREATE TABLE federated.t1 (
id int(20) NOT NULL,
name varchar(16) NOT NULL default ''
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
use federated;
let $q=
SELECT * FROM
(SELECT * FROM
(SELECT * FROM
(SELECT * FROM t1 where id>3) dt3
WHERE id>3) dt2
) dt;
eval $q;
eval PREPARE stmt FROM "$q";
EXECUTE stmt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLES federated.t1, federated.t2, federated.t3, federated.t10,
federated.t11;
connection slave;

View File

@@ -17,7 +17,6 @@ galera_ssl_upgrade : [Warning] Failed to load slave replication state from table
galera_parallel_simple : timeout related to wsrep_sync_wait
galera_insert_bulk : MDEV-30536 no expected deadlock in galera_insert_bulk test
galera_sequences : MDEV-32561 WSREP FSM failure: no such a transition REPLICATING -> COMMITTED
galera_shutdown_nonprim : MDEV-32635 galera_shutdown_nonprim: mysql_shutdown failed
versioning_trx_id : MDEV-18590 : galera.versioning_trx_id: Test failure: mysqltest: Result content mismatch
galera_concurrent_ctas : MDEV-32779 galera_concurrent_ctas: assertion in the galera::ReplicatorSMM::finish_cert()
galera_as_slave_replay : MDEV-32780 galera_as_slave_replay: assertion in the wsrep::transaction::before_rollback()
@@ -26,5 +25,4 @@ galera_sst_mysqldump_with_key : MDEV-32782 galera_sst_mysqldump_with_key test fa
mdev-31285 : MDEV-25089 Assertion `error.len > 0' failed in galera::ReplicatorSMM::handle_apply_error()
galera_var_ignore_apply_errors : MENT-1997 galera_var_ignore_apply_errors test freezes
MW-402 : temporarily disabled at the request of Codership
MDEV-22232 : temporarily disabled at the request of Codership
galera_desync_overlapped : MDEV-21538 galera_desync_overlapped MTR failed: Result content mismatch

View File

@@ -3,21 +3,21 @@ connection node_1;
connect con1,127.0.0.1,root,,test,$NODE_MYPORT_1;
--- CTAS with empty result set ---
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
SET DEBUG_SYNC = 'create_table_select_before_create SIGNAL may_alter WAIT_FOR bf_abort';
SET DEBUG_SYNC = 'create_table_select_before_create SIGNAL may_run WAIT_FOR bf_abort';
CREATE TABLE t2 SELECT * FROM t1;
connection node_1;
SET DEBUG_SYNC = 'now WAIT_FOR may_alter';
ALTER TABLE t1 DROP FOREIGN KEY b, ALGORITHM=COPY;
SET DEBUG_SYNC = 'now WAIT_FOR may_run';
TRUNCATE TABLE t1;
connection con1;
ERROR 70100: Query execution was interrupted
SET DEBUG_SYNC = 'RESET';
--- CTAS with non-empty result set ---
INSERT INTO t1 VALUES (10), (20), (30);
SET DEBUG_SYNC = 'create_table_select_before_create SIGNAL may_alter WAIT_FOR bf_abort';
SET DEBUG_SYNC = 'create_table_select_before_create SIGNAL may_run WAIT_FOR bf_abort';
CREATE TABLE t2 SELECT * FROM t1;
connection node_1;
SET DEBUG_SYNC = 'now WAIT_FOR may_alter';
ALTER TABLE t1 DROP FOREIGN KEY b, ALGORITHM=COPY;
SET DEBUG_SYNC = 'now WAIT_FOR may_run';
TRUNCATE TABLE t1;
connection con1;
ERROR 70100: Query execution was interrupted
SET DEBUG_SYNC = 'RESET';

View File

@@ -14,7 +14,7 @@ c1
INSERT INTO t1 VALUES (4),(3),(1),(2);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
CREATE TABLE t1 (pk INT PRIMARY KEY, b INT) ENGINE=SEQUENCE;
ERROR 42S01: Table 't1' already exists
ERROR 42000: This version of MariaDB doesn't yet support 'non-InnoDB sequences in Galera cluster'
ALTER TABLE t1 DROP COLUMN c2;
ERROR 42000: Can't DROP COLUMN `c2`; check that it exists
SELECT get_lock ('test', 1.5);

View File

@@ -0,0 +1,38 @@
connection node_2;
connection node_1;
connection node_1;
SET GLOBAL wsrep_load_data_splitting=ON;
Warnings:
Warning 1287 '@@wsrep_load_data_splitting' is deprecated and will be removed in a future release
SET GLOBAL wsrep_replicate_myisam=ON;
Warnings:
Warning 1287 '@@wsrep_replicate_myisam' is deprecated and will be removed in a future release. Please use '@@wsrep_mode=REPLICATE_MYISAM' instead
CREATE TABLE t1 (c1 int) ENGINE=MYISAM;
LOAD DATA INFILE '../../std_data/mdev-25731.dat' IGNORE INTO TABLE t1 LINES TERMINATED BY '\n';
Warnings:
Warning 1235 wsrep_load_data_splitting for other than InnoDB tables
SELECT COUNT(*) AS EXPECT_6 FROM t1;
EXPECT_6
6
connection node_2;
SELECT COUNT(*) AS EXPECT_6 FROM t1;
EXPECT_6
6
connection node_1;
ALTER TABLE t1 ENGINE=InnoDB;
LOAD DATA INFILE '../../std_data/mdev-25731.dat' IGNORE INTO TABLE t1 LINES TERMINATED BY '\n';
SELECT COUNT(*) AS EXPECT_12 FROM t1;
EXPECT_12
12
connection node_2;
SELECT COUNT(*) AS EXPECT_12 FROM t1;
EXPECT_12
12
connection node_1;
DROP TABLE t1;
SET GLOBAL wsrep_load_data_splitting=OFF;
Warnings:
Warning 1287 '@@wsrep_load_data_splitting' is deprecated and will be removed in a future release
SET GLOBAL wsrep_replicate_myisam=OFF;
Warnings:
Warning 1287 '@@wsrep_replicate_myisam' is deprecated and will be removed in a future release. Please use '@@wsrep_mode=REPLICATE_MYISAM' instead

View 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;

View File

@@ -1,7 +1,8 @@
connection node_2;
connection node_1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
SET @wsrep_slave_threads_orig = @@wsrep_slave_threads;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) Engine=InnoDB;
SET GLOBAL wsrep_slave_threads = 10;
# Set slave threads to 10 step 1
SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
@@ -9,7 +10,7 @@ EXPECT_10
10
SET GLOBAL wsrep_slave_threads = 1;
connection node_2;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (NULL);
connection node_1;
# Wait until one of the appliers has exited
SELECT VARIABLE_VALUE AS EXPECT_9 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
@@ -27,33 +28,14 @@ EXPECT_20
20
SET GLOBAL wsrep_slave_threads = 1;
connection node_2;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
INSERT INTO t1 VALUES (6);
INSERT INTO t1 VALUES (7);
INSERT INTO t1 VALUES (8);
INSERT INTO t1 VALUES (9);
INSERT INTO t1 VALUES (10);
INSERT INTO t1 VALUES (11);
INSERT INTO t1 VALUES (12);
INSERT INTO t1 VALUES (13);
INSERT INTO t1 VALUES (14);
INSERT INTO t1 VALUES (16);
INSERT INTO t1 VALUES (17);
INSERT INTO t1 VALUES (18);
INSERT INTO t1 VALUES (19);
INSERT INTO t1 VALUES (20);
connection node_1;
# Wait until 19 of the appliers has exited
SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
EXPECT_1
1
SELECT COUNT(*) FROM t1;
COUNT(*)
20
SELECT COUNT(*) AS EXPECT_51 FROM t1;
EXPECT_51
51
SET GLOBAL wsrep_slave_threads = 10;
# Set slave threads to 10 step 3
SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
@@ -62,22 +44,12 @@ EXPECT_10
connection node_1;
SET GLOBAL wsrep_slave_threads = 1;
connection node_2;
INSERT INTO t1 VALUES (21);
INSERT INTO t1 VALUES (22);
INSERT INTO t1 VALUES (23);
INSERT INTO t1 VALUES (24);
INSERT INTO t1 VALUES (25);
INSERT INTO t1 VALUES (26);
INSERT INTO t1 VALUES (27);
INSERT INTO t1 VALUES (28);
INSERT INTO t1 VALUES (29);
INSERT INTO t1 VALUES (30);
connection node_1;
# Wait until slave threads back to 1
SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
EXPECT_1
1
SELECT COUNT(*) FROM t1;
COUNT(*)
30
SELECT COUNT(*) AS EXPECT_101 FROM t1;
EXPECT_101
101
DROP TABLE t1;

View File

@@ -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;

View File

@@ -1,44 +1,68 @@
connection node_2;
connection node_1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb;
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb;
INSERT INTO t1 VALUES (1, 'a');
INSERT INTO t1 VALUES (2, 'a');
connection node_1;
SET AUTOCOMMIT=ON;
START TRANSACTION;
UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
SET SESSION wsrep_sync_wait=0;
LOCK TABLE t2 WRITE;
connection node_1;
SET @@debug_dbug = "d,sync.wsrep_before_mdl_wait";
SET DEBUG_SYNC= 'wsrep_before_mdl_wait SIGNAL before_mdl_wait WAIT_FOR mdl_wait_continue';
SELECT * FROM t2;;
connection node_1a;
# Wait until select is blocked before MDL lock wait
SET DEBUG_SYNC= 'now WAIT_FOR before_mdl_wait';
connection node_1a;
SET @@debug_dbug = "d,sync.wsrep_after_BF_victim_lock";
connection node_2;
UPDATE t1 SET f2 = 'c' WHERE f1 = 1;
connection node_1a;
SET @@debug_dbug = "";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait";
connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1b;
SET SESSION wsrep_sync_wait=0;
# Wait for conflicting update to block
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock";
connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1c;
connection node_1a;
SET DEBUG_SYNC = "now SIGNAL BF_victim_continue";
UNLOCK TABLES;
connection node_1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
COUNT(*) = 1
connection node_1;
SELECT COUNT(*) AS EXPECT_1 FROM t1 WHERE f2 = 'a';
EXPECT_1
1
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
COUNT(*) = 1
SELECT COUNT(*) AS EXPECT_1 FROM t1 WHERE f2 = 'c';
EXPECT_1
1
SELECT * FROM t1;
f1 f2
1 c
2 a
connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
COUNT(*) = 1
SELECT COUNT(*) AS EXPECT_1 FROM t1 WHERE f2 = 'a';
EXPECT_1
1
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
COUNT(*) = 1
SELECT COUNT(*) AS EXPECT_1 FROM t1 WHERE f2 = 'c';
EXPECT_1
1
SELECT * FROM t1;
f1 f2
1 c
2 a
DROP TABLE t1;
DROP TABLE t2;
connection node_1a;
SET DEBUG_SYNC = "RESET";
connection node_1b;
SET DEBUG_SYNC = "RESET";
connection node_1;
disconnect node_1a;
disconnect node_1b;
disconnect node_1c;

View File

@@ -15,16 +15,37 @@ UPDATE t1 SET f1 = 9;
UPDATE t2 SET f1 = 9 WHERE f1 = 1;
DELETE FROM t1 WHERE f1 = 9;
DELETE FROM t2 WHERE f1 = 9;
TRUNCATE TABLE t1;
TRUNCATE TABLE t1;
SELECT * FROM t1 ORDER BY f1;
f1
SELECT * FROM t2 ORDER BY f1;
f1
2
3
4
5
6
connection node_2;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
SELECT COUNT(*) = 0 FROM t2;
COUNT(*) = 0
0
SELECT * FROM t1 ORDER BY f1;
f1
SELECT * FROM t2 ORDER BY f1;
f1
2
3
4
5
6
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
SELECT * FROM t1 ORDER BY f1;
f1
SELECT * FROM t2 ORDER BY f1;
f1
connection node_2;
SELECT * FROM t1 ORDER BY f1;
f1
SELECT * FROM t2 ORDER BY f1;
f1
connection node_1;
SET GLOBAL wsrep_mode=DEFAULT;
DROP TABLE t1;
DROP TABLE t2;
SET GLOBAL wsrep_mode=DEFAULT;

View File

@@ -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%';

View File

@@ -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;

View File

@@ -0,0 +1,12 @@
connection node_2;
connection node_1;
SET GLOBAL wsrep_ignore_apply_errors=0;
SET SESSION AUTOCOMMIT=0;
SET SESSION max_error_count=0;
CREATE TABLE t0 (id GEOMETRY,parent_id GEOMETRY)ENGINE=SEQUENCE;
ERROR 42000: This version of MariaDB doesn't yet support 'non-InnoDB sequences in Galera cluster'
connection node_2;
SHOW CREATE TABLE t0;
ERROR 42S02: Table 'test.t0' doesn't exist
connection node_1;
SET GLOBAL wsrep_ignore_apply_errors=DEFAULT;

View File

@@ -5,7 +5,12 @@ connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options = 'pc.weight=2';
connection node_2;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
connection node_1;
connection node_2;
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status non-Primary
connection node_1;
SET GLOBAL wsrep_provider_options = 'pc.weight = 1';

View File

@@ -0,0 +1,243 @@
connection node_2;
connection node_1;
# Case 1 CREATE SEQUENCE with no NOCACHE
CREATE SEQUENCE s ENGINE=InnoDB;
ERROR 42000: This version of MariaDB doesn't yet support 'CACHE without INCREMENT BY 0 in Galera cluster'
CREATE SEQUENCE s NOCACHE ENGINE=InnoDB;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
START TRANSACTION;
REPLACE INTO s VALUES (1,1,9223372036854775806,1,1,1000,0,0);
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
SELECT * FROM t1;
a
SELECT * FROM s;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
1 1 9223372036854775806 1 1 1000 0 0
connection node_2;
SELECT * FROM t1;
a
SELECT * FROM s;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
1 1 9223372036854775806 1 1 1000 0 0
connection node_1;
DROP TABLE t1;
DROP SEQUENCE s;
# Case 2 REPLACE INTO ... SELECT with error
CREATE TABLE t (id INT KEY,a YEAR,INDEX (id,a)) engine=innodb;
REPLACE INTO t (id,a)SELECT /*!99997 */ 1;
ERROR 21S01: Column count doesn't match value count at row 1
REPLACE INTO t (id,a)SELECT /*!99997 */ 1,2;
SELECT * FROM t;
id a
1 2002
CREATE TABLE t2 (id INT KEY,a YEAR,INDEX (id,a)) engine=myisam;
REPLACE INTO t2 (id,a)SELECT /*!99997 */ 1;
ERROR 21S01: Column count doesn't match value count at row 1
REPLACE INTO t2 (id,a)SELECT /*!99997 */ 1,2;
Warnings:
Warning 138 Galera cluster does support consistency check only for InnoDB tables.
SELECT * FROM t2;
id a
1 2002
CREATE TABLE t3 (id INT KEY,a YEAR,INDEX (id,a)) engine=aria;
REPLACE INTO t3 (id,a)SELECT /*!99997 */ 1;
ERROR 21S01: Column count doesn't match value count at row 1
REPLACE INTO t3 (id,a)SELECT /*!99997 */ 1,2;
Warnings:
Warning 138 Galera cluster does support consistency check only for InnoDB tables.
SELECT * FROM t3;
id a
1 2002
connection node_2;
SELECT * FROM t;
id a
1 2002
SELECT * FROM t2;
id a
1 2002
SELECT * FROM t3;
id a
1 2002
connection node_1;
DROP TABLE t,t2,t3;
# Bigger REPLACE ... AS SELECT test
CREATE TABLE t1(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t2(id int not null primary key ,b int) ENGINE=MyISAM;
CREATE TABLE t3(id int not null primary key ,b int) ENGINE=Aria;
CREATE TABLE t4(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t5(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t6(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t7(id int not null primary key ,b int) ENGINE=MyISAM;
CREATE TABLE t8(id int not null primary key ,b int) ENGINE=Aria;
INSERT INTO t1(id) SELECT seq FROM seq_1_to_1000;
INSERT INTO t2(id) SELECT seq FROM seq_1_to_1000;
INSERT INTO t3(id) SELECT seq FROM seq_1_to_1000;
REPLACE INTO t4 SELECT * FROM t1;
REPLACE INTO t5 SELECT * FROM t2;
REPLACE INTO t6 SELECT * FROM t3;
ERROR HY000: Transactional commit not supported by involved engine(s)
REPLACE INTO t7 SELECT * FROM t2;
REPLACE INTO t8 SELECT * FROM t3;
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t2;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t3;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t4;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t5;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_0 FROM t6;
EXPECT_0
0
SELECT COUNT(*) AS EXPECT_1000 FROM t7;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t8;
EXPECT_1000
1000
connection node_2;
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t2;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t3;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t4;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t5;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_0 FROM t6;
EXPECT_0
0
SELECT COUNT(*) AS EXPECT_1000 FROM t7;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t8;
EXPECT_1000
1000
connection node_1;
DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8;
# Bigger INSERT INTO ... SELECT test
CREATE TABLE t1(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t2(id int not null primary key ,b int) ENGINE=MyISAM;
CREATE TABLE t3(id int not null primary key ,b int) ENGINE=Aria;
CREATE TABLE t4(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t5(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t6(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t7(id int not null primary key ,b int) ENGINE=MyISAM;
CREATE TABLE t8(id int not null primary key ,b int) ENGINE=Aria;
INSERT INTO t1(id) SELECT seq FROM seq_1_to_1000;
INSERT INTO t2(id) SELECT seq FROM seq_1_to_1000;
INSERT INTO t3(id) SELECT seq FROM seq_1_to_1000;
INSERT INTO t4 SELECT * FROM t1;
INSERT INTO t5 SELECT * FROM t2;
INSERT INTO t6 SELECT * FROM t3;
ERROR HY000: Transactional commit not supported by involved engine(s)
INSERT INTO t7 SELECT * FROM t2;
INSERT INTO t8 SELECT * FROM t3;
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t2;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t3;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t4;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t5;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_0 FROM t6;
EXPECT_0
0
SELECT COUNT(*) AS EXPECT_1000 FROM t7;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t8;
EXPECT_1000
1000
connection node_2;
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t2;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t3;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t4;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t5;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_0 FROM t6;
EXPECT_0
0
SELECT COUNT(*) AS EXPECT_1000 FROM t7;
EXPECT_1000
1000
SELECT COUNT(*) AS EXPECT_1000 FROM t8;
EXPECT_1000
1000
connection node_1;
DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8;
CREATE TABLE t1(pk int not null primary key) engine=innodb;
INSERT INTO t1 values (1),(2),(3),(4);
CREATE VIEW view_t1 AS SELECT * FROM t1;
INSERT INTO view_t1 VALUES (5);
SELECT * FROM t1;
pk
1
2
3
4
5
DROP TABLE t1;
DROP VIEW view_t1;
CREATE TABLE t1(pk int not null primary key) engine=myisam;
INSERT INTO t1 values (1),(2),(3),(4);
CREATE VIEW view_t1 AS SELECT * FROM t1;
INSERT INTO view_t1 VALUES (5);
SELECT * FROM t1;
pk
1
2
3
4
5
DROP TABLE t1;
DROP VIEW view_t1;
CREATE TABLE t1(pk int not null primary key) engine=aria;
INSERT INTO t1 values (1),(2),(3),(4);
CREATE VIEW view_t1 AS SELECT * FROM t1;
INSERT INTO view_t1 VALUES (5);
SELECT * FROM t1;
pk
1
2
3
4
5
DROP TABLE t1;
DROP VIEW view_t1;
SET GLOBAL wsrep_mode=DEFAULT;

View File

@@ -1,23 +1,8 @@
connection node_2;
connection node_1;
connection node_1;
connection node_2;
connection node_1;
CREATE TABLE t ENGINE=InnoDB WITH SYSTEM VERSIONING AS SELECT 1 AS i;
ERROR 42000: This version of MariaDB doesn't yet support 'SYSTEM VERSIONING AS SELECT in Galera cluster'
connection node_2;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`i` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
SELECT * from t;
i
1
DROP TABLE IF EXISTS t;
COMMIT;
connection node_2;
SET SESSION wsrep_sync_wait=0;
Killing server ...
Starting server ...
connection node_2;
call mtr.add_suppression("WSREP: Event .*Write_rows_v1 apply failed:.*");
call mtr.add_suppression("SREP: Failed to apply write set: gtid:.*");
ERROR 42S02: Table 'test.t' doesn't exist

View File

@@ -0,0 +1,211 @@
connection node_2;
connection node_1;
#
# MDEV-33355 Add a Galera-2-node-to-MariaDB replication MTR test cloning the slave with mariadb-backup
#
connect master, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connect slave, 127.0.0.1, root, , test, $NODE_MYPORT_3;
START SLAVE;
include/wait_for_slave_to_start.inc
connection master;
connection slave;
##############################################################
### Initial block with some transactions
### Slave: Make sure replication is not using GTID
connection slave;
# Using_Gtid=No
### Master: Create and populate t1
connection master;
CREATE TABLE t1(a TEXT) ENGINE=InnoDB;
START TRANSACTION;
INSERT INTO t1 VALUES ('tr#00:stmt#00 - slave run#0, before backup');
INSERT INTO t1 VALUES ('tr#00:stmt#01 - slave run#0, before backup');
INSERT INTO t1 VALUES ('tr#00:stmt#02 - slave run#0, before backup');
COMMIT;
connection slave;
##############################################################
### Run the last transaction before mariadb-backup --backup
### Remember SHOW MASTER STATUS and @@gtid_binlog_pos
### before and after the transaction.
### Master: Rember MASTER STATUS and @@gtid_binlog_pos before tr#01
connection master;
### Slave: Remember MASTER STATUS and @@gtid_binlog_pos before tr#01
connection slave;
### Master: Run the actual last transaction before the backup
connection master;
START TRANSACTION;
INSERT INTO t1 VALUES ('tr#01:stmt#00 - slave run#0, before backup');
INSERT INTO t1 VALUES ('tr#01:stmt#01 - slave run#0, before backup');
INSERT INTO t1 VALUES ('tr#01:stmt#02 - slave run#0, before backup');
COMMIT;
connection slave;
### Master: Remember MASTER STATUS and @@gtid_binlog_pos after tr#01
connection master;
### Slave: Remember MASTER STATUS and @@gtid_binlog_pos after tr#01
connection slave;
##############################################################
### Running `mariadb-backup --backup,--prepare` and checking
### that xtrabackup_slave_info and xtrabackup_binlog_info are OK
### Slave: Create a backup
### Slave: Prepare the backup
### Slave: xtrabackup files:
############################ xtrabackup_slave_info
CHANGE MASTER TO MASTER_LOG_FILE='master_after_tr01_show_master_status_file', MASTER_LOG_POS=master_after_tr01_show_master_status_position;
############################ xtrabackup_binlog_info
slave_after_tr01_show_master_status_file slave_after_tr01_show_master_status_position slave_after_tr01_gtid_binlog_pos
############################
##############################################################
### Run more transactions after the backup:
### - while the slave is still running, then
### - while the slave is shut down
### Master: Run another transaction while the slave is still running
connection master;
START TRANSACTION;
INSERT INTO t1 VALUES ('tr#02:stmt#00 - slave run#0, after backup');
INSERT INTO t1 VALUES ('tr#02:stmt#01 - slave run#0, after backup');
INSERT INTO t1 VALUES ('tr#02:stmt@02 - slave run#0, after backup');
COMMIT;
connection slave;
### Master: Remember MASTER STATUS and @@gtid_binlog_pos after tr#02
connection master;
### Slave: Remember MASTER STATUS and @@gtid_binlog_pos after tr#02
connection slave;
### Master: Checking SHOW BINLOG EVENTS
connection master;
SHOW BINLOG EVENTS IN 'master_after_tr01_show_master_status_file' FROM master_after_tr01_show_master_status_position LIMIT 0,1;
Log_name master_after_tr01_show_master_status_file
Pos master_after_tr01_show_master_status_position
Event_type Gtid
Server_id #
End_log_pos #
Info BEGIN GTID master_after_tr02_gtid_binlog_pos
SHOW BINLOG EVENTS IN 'master_after_tr01_show_master_status_file' FROM master_after_tr01_show_master_status_position LIMIT 1,1;
Log_name master_after_tr01_show_master_status_file
Pos #
Event_type Query_or_Annotate_rows
Server_id #
End_log_pos #
Info INSERT INTO t1 VALUES ('tr#02:stmt#00 - slave run#0, after backup')
### Slave: Checking SHOW BINLOG EVENTS
connection slave;
SHOW BINLOG EVENTS IN 'slave_after_tr01_show_master_status_file' FROM slave_after_tr01_show_master_status_position LIMIT 0,1;
Log_name slave_after_tr01_show_master_status_file
Pos #
Event_type Gtid
Server_id 1
End_log_pos #
Info BEGIN GTID slave_after_tr02_gtid_binlog_pos
SHOW BINLOG EVENTS IN 'slave_after_tr01_show_master_status_file' FROM slave_after_tr01_show_master_status_position LIMIT 1,1;
Log_name slave_after_tr01_show_master_status_file
Pos #
Event_type Query_or_Annotate_rows
Server_id #
End_log_pos #
Info INSERT INTO t1 VALUES ('tr#02:stmt#00 - slave run#0, after backup')
### Slave: Stop replication
connection slave;
STOP SLAVE;
include/wait_for_slave_to_stop.inc
RESET SLAVE;
Warnings:
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos'
### Slave: Shutdown the server
connection slave;
### Master: Run a transaction while the slave is shut down
connection master;
START TRANSACTION;
INSERT INTO t1 VALUES ('tr#03:stmt#00 - after slave run#0, slave is shut down, after backup');
INSERT INTO t1 VALUES ('tr#03:stmt#01 - after slave run#0, slave is shut down, after backup');
INSERT INTO t1 VALUES ('tr#03:stmt#02 - after slave run#0, slave is shut down, after backup');
COMMIT;
##############################################################
### Emulate starting a new virgin slave
### Slave: Remove the data directory
### Slave: Copy back the backup
### Slave: Restart the server
connection slave;
# restart
### Slave: Display the restored data before START SLAVE
connection slave;
SELECT * FROM t1 ORDER BY a;
a
tr#00:stmt#00 - slave run#0, before backup
tr#00:stmt#01 - slave run#0, before backup
tr#00:stmt#02 - slave run#0, before backup
tr#01:stmt#00 - slave run#0, before backup
tr#01:stmt#01 - slave run#0, before backup
tr#01:stmt#02 - slave run#0, before backup
### Slave: Execute the CHANGE MASTER statement to set up the host and port
CHANGE MASTER '' TO MASTER_USER='root', MASTER_HOST='127.0.0.1', MASTER_PORT=###, MASTER_CONNECT_RETRY=1;
### Slave: Execute the CHANGE MASTER statement from xtrabackup_slave_info
CHANGE MASTER TO MASTER_LOG_FILE='master_after_tr01_show_master_status_file', MASTER_LOG_POS=master_after_tr01_show_master_status_position;
Warnings:
Note 4190 CHANGE MASTER TO is implicitly changing the value of 'Using_Gtid' from 'Slave_Pos' to 'No'
### Slave: Execute START SLAVE
include/start_slave.inc
### Master: Wait for the slave to apply all master events
connection master;
connection slave;
### Slave: Make sure replication is not using GTID after the slave restart
connection slave;
# Using_Gtid=No
### Slave: Display the restored data after START SLAVE
connection slave;
SELECT * FROM t1 ORDER BY a;
a
tr#00:stmt#00 - slave run#0, before backup
tr#00:stmt#01 - slave run#0, before backup
tr#00:stmt#02 - slave run#0, before backup
tr#01:stmt#00 - slave run#0, before backup
tr#01:stmt#01 - slave run#0, before backup
tr#01:stmt#02 - slave run#0, before backup
tr#02:stmt#00 - slave run#0, after backup
tr#02:stmt#01 - slave run#0, after backup
tr#02:stmt@02 - slave run#0, after backup
tr#03:stmt#00 - after slave run#0, slave is shut down, after backup
tr#03:stmt#01 - after slave run#0, slave is shut down, after backup
tr#03:stmt#02 - after slave run#0, slave is shut down, after backup
##############################################################
### Continue master transactions, check the new slave replicates well.
### Master: Run a transaction after restarting replication
connection master;
START TRANSACTION;
INSERT INTO t1 VALUES ('tr#04:stmt#00 - slave run#1');
INSERT INTO t1 VALUES ('tr#04:stmt#01 - slave run#1');
INSERT INTO t1 VALUES ('tr#04:stmt#02 - slave run#1');
COMMIT;
connection slave;
### Slave: Display the restored data + new transactions
connection slave;
SELECT * FROM t1 ORDER BY a;
a
tr#00:stmt#00 - slave run#0, before backup
tr#00:stmt#01 - slave run#0, before backup
tr#00:stmt#02 - slave run#0, before backup
tr#01:stmt#00 - slave run#0, before backup
tr#01:stmt#01 - slave run#0, before backup
tr#01:stmt#02 - slave run#0, before backup
tr#02:stmt#00 - slave run#0, after backup
tr#02:stmt#01 - slave run#0, after backup
tr#02:stmt@02 - slave run#0, after backup
tr#03:stmt#00 - after slave run#0, slave is shut down, after backup
tr#03:stmt#01 - after slave run#0, slave is shut down, after backup
tr#03:stmt#02 - after slave run#0, slave is shut down, after backup
tr#04:stmt#00 - slave run#1
tr#04:stmt#01 - slave run#1
tr#04:stmt#02 - slave run#1
##############################################################
### Cleanup
### Removing the backup directory
connection master;
DROP TABLE t1;
connection slave;
STOP SLAVE;
include/wait_for_slave_to_stop.inc
RESET SLAVE ALL;
Warnings:
Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos'
connection master;
set global wsrep_on=OFF;
RESET MASTER;
set global wsrep_on=ON;

View File

@@ -18,19 +18,16 @@
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
# Run CTAS until the resulting table gets created,
# then it gets BF aborted by ALTER.
SET DEBUG_SYNC = 'create_table_select_before_create SIGNAL may_alter WAIT_FOR bf_abort';
# then it gets BF aborted by other DDL.
SET DEBUG_SYNC = 'create_table_select_before_create SIGNAL may_run WAIT_FOR bf_abort';
--send
CREATE TABLE t2 SELECT * FROM t1;
# Wait for CTAS to reach the table create point,
# start executing ALTER and BF abort CTAS.
# start executing other DDL and BF abort CTAS.
--connection node_1
SET DEBUG_SYNC = 'now WAIT_FOR may_alter';
--disable_result_log
--error ER_CANT_DROP_FIELD_OR_KEY
ALTER TABLE t1 DROP FOREIGN KEY b, ALGORITHM=COPY;
--enable_result_log
SET DEBUG_SYNC = 'now WAIT_FOR may_run';
TRUNCATE TABLE t1;
--connection con1
# CTAS gets BF aborted.
@@ -46,19 +43,16 @@ SET DEBUG_SYNC = 'RESET';
INSERT INTO t1 VALUES (10), (20), (30);
# Run CTAS until the resulting table gets created,
# then it gets BF aborted by ALTER.
SET DEBUG_SYNC = 'create_table_select_before_create SIGNAL may_alter WAIT_FOR bf_abort';
# then it gets BF aborted by other DDL.
SET DEBUG_SYNC = 'create_table_select_before_create SIGNAL may_run WAIT_FOR bf_abort';
--send
CREATE TABLE t2 SELECT * FROM t1;
# Wait for CTAS to reach the table create point,
# start executing ALTER and BF abort CTAS.
# start executing other DDL and BF abort CTAS.
--connection node_1
SET DEBUG_SYNC = 'now WAIT_FOR may_alter';
--disable_result_log
--error ER_ERROR_ON_RENAME
ALTER TABLE t1 DROP FOREIGN KEY b, ALGORITHM=COPY;
--enable_result_log
SET DEBUG_SYNC = 'now WAIT_FOR may_run';
TRUNCATE TABLE t1;
--connection con1
# CTAS gets BF aborted.

View File

@@ -11,7 +11,11 @@ SET SESSION autocommit=0;
SELECT * FROM t1 WHERE c1 <=0 ORDER BY c1 DESC;
--error ER_LOCK_DEADLOCK
INSERT INTO t1 VALUES (4),(3),(1),(2);
--error ER_TABLE_EXISTS_ERROR
#
# This is because support for CREATE TABLE ENGINE=SEQUENCE
# is done before we check does table exists already.
#
--error ER_NOT_SUPPORTED_YET
CREATE TABLE t1 (pk INT PRIMARY KEY, b INT) ENGINE=SEQUENCE;
--error ER_CANT_DROP_FIELD_OR_KEY
ALTER TABLE t1 DROP COLUMN c2;

View File

@@ -0,0 +1,27 @@
--source include/galera_cluster.inc
--source include/have_aria.inc
--connection node_1
SET GLOBAL wsrep_load_data_splitting=ON;
SET GLOBAL wsrep_replicate_myisam=ON;
CREATE TABLE t1 (c1 int) ENGINE=MYISAM;
LOAD DATA INFILE '../../std_data/mdev-25731.dat' IGNORE INTO TABLE t1 LINES TERMINATED BY '\n';
SELECT COUNT(*) AS EXPECT_6 FROM t1;
--connection node_2
SELECT COUNT(*) AS EXPECT_6 FROM t1;
--connection node_1
ALTER TABLE t1 ENGINE=InnoDB;
LOAD DATA INFILE '../../std_data/mdev-25731.dat' IGNORE INTO TABLE t1 LINES TERMINATED BY '\n';
SELECT COUNT(*) AS EXPECT_12 FROM t1;
--connection node_2
SELECT COUNT(*) AS EXPECT_12 FROM t1;
--connection node_1
DROP TABLE t1;
SET GLOBAL wsrep_load_data_splitting=OFF;
SET GLOBAL wsrep_replicate_myisam=OFF;

View 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

View File

@@ -2,6 +2,8 @@
[mysqld.1]
wsrep-debug=SERVER
loose-wsrep-mw-336=1
[mysqld.2]
wsrep-debug=SERVER
loose-wsrep-mw-336=2

View File

@@ -3,11 +3,12 @@
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/force_restart.inc
--source include/have_sequence.inc
--connection node_1
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
SET @wsrep_slave_threads_orig = @@wsrep_slave_threads;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) Engine=InnoDB;
SET GLOBAL wsrep_slave_threads = 10;
@@ -22,7 +23,7 @@ SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE V
SET GLOBAL wsrep_slave_threads = 1;
--connection node_2
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (NULL);
--connection node_1
--echo # Wait until one of the appliers has exited
@@ -54,27 +55,19 @@ SELECT VARIABLE_VALUE AS EXPECT_20 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE V
SET GLOBAL wsrep_slave_threads = 1;
--connection node_2
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
INSERT INTO t1 VALUES (6);
INSERT INTO t1 VALUES (7);
INSERT INTO t1 VALUES (8);
INSERT INTO t1 VALUES (9);
INSERT INTO t1 VALUES (10);
INSERT INTO t1 VALUES (11);
INSERT INTO t1 VALUES (12);
INSERT INTO t1 VALUES (13);
INSERT INTO t1 VALUES (14);
INSERT INTO t1 VALUES (16);
INSERT INTO t1 VALUES (17);
INSERT INTO t1 VALUES (18);
INSERT INTO t1 VALUES (19);
INSERT INTO t1 VALUES (20);
--disable_query_log
let $c = 50;
while ($c) {
INSERT INTO t1 VALUES(NULL); COMMIT;
dec $c;
}
--enable_query_log
--connection node_1
--let $wait_condition = SELECT COUNT(*) = 51 FROM t1;
--let $wait_condition_on_error_output = SELECT COUNT(*) FROM t1;
--source include/wait_condition_with_debug.inc
--echo # Wait until 19 of the appliers has exited
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
--let $wait_condition_on_error_output = SELECT COUNT(*), 1 as EXPECTED_VALUE FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle'; show processlist
@@ -82,7 +75,7 @@ INSERT INTO t1 VALUES (20);
SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) AS EXPECT_51 FROM t1;
SET GLOBAL wsrep_slave_threads = 10;
--echo # Set slave threads to 10 step 3
@@ -96,16 +89,13 @@ SELECT VARIABLE_VALUE AS EXPECT_10 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE V
SET GLOBAL wsrep_slave_threads = 1;
--connection node_2
INSERT INTO t1 VALUES (21);
INSERT INTO t1 VALUES (22);
INSERT INTO t1 VALUES (23);
INSERT INTO t1 VALUES (24);
INSERT INTO t1 VALUES (25);
INSERT INTO t1 VALUES (26);
INSERT INTO t1 VALUES (27);
INSERT INTO t1 VALUES (28);
INSERT INTO t1 VALUES (29);
INSERT INTO t1 VALUES (30);
--disable_query_log
let $c = 50;
while ($c) {
INSERT INTO t1 VALUES(NULL); COMMIT;
dec $c;
}
--enable_query_log
--connection node_1
--echo # Wait until slave threads back to 1
@@ -115,6 +105,10 @@ INSERT INTO t1 VALUES (30);
SELECT VARIABLE_VALUE AS EXPECT_1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_applier_thread_count';
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) AS EXPECT_101 FROM t1;
DROP TABLE t1;
--disable_query_log
SET GLOBAL wsrep_slave_threads = @wsrep_slave_threads_orig;
--enable_query_log

View File

@@ -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 = "";

View File

@@ -3,70 +3,92 @@
#
--source include/galera_cluster.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
--connection node_1
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb;
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=innodb;
INSERT INTO t1 VALUES (1, 'a');
INSERT INTO t1 VALUES (2, 'a');
--connection node_1
SET AUTOCOMMIT=ON;
START TRANSACTION;
UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
# block access to t2
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1a
SET SESSION wsrep_sync_wait=0;
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2'
--let $wait_condition_on_error_output = SELECT * FROM INFORMATION_SCHEMA.TABLES
--source include/wait_condition_with_debug.inc
LOCK TABLE t2 WRITE;
# Block before MLD lock wait
# Block before MDL lock wait
--connection node_1
SET @@debug_dbug = "d,sync.wsrep_before_mdl_wait";
SET DEBUG_SYNC= 'wsrep_before_mdl_wait SIGNAL before_mdl_wait WAIT_FOR mdl_wait_continue';
--send SELECT * FROM t2;
# Wait for SELECT to be blocked
--connection node_1a
#--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIS WHERE STATE = 'System lock';
#--source include/wait_condition.inc
#--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'init' AND INFO = 'COMMIT';
#--source include/wait_condition.inc
--echo # Wait until select is blocked before MDL lock wait
SET DEBUG_SYNC= 'now WAIT_FOR before_mdl_wait';
# block applier to wait after BF victim is locked
--connection node_1a
SET @@debug_dbug = "d,sync.wsrep_after_BF_victim_lock";
# Issue a conflicting update on node #2
--connection node_2
UPDATE t1 SET f2 = 'c' WHERE f1 = 1;
# Unblock the SELECT, to enter wsrep_thd_is_BF
--connection node_1a
SET @@debug_dbug = "";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait";
--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1b
SET SESSION wsrep_sync_wait=0;
--echo # Wait for conflicting update to block
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Update_rows_log_event:%';
--source include/wait_condition.inc
# unblock applier to try to BF the SELECT
# Unblock the SELECT, to enter wsrep_thd_is_BF
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock";
--connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1c
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Update_rows_log_event:%';
--source include/wait_condition.inc
--connection node_1a
# unblock applier to try to BF the SELECT
SET DEBUG_SYNC = "now SIGNAL BF_victim_continue";
# table lock is not needed anymore
UNLOCK TABLES;
# SELECT succeeds
# SELECT returns deadlock
--connection node_1
--error ER_LOCK_DEADLOCK
--reap
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
--connection node_1
SELECT COUNT(*) AS EXPECT_1 FROM t1 WHERE f2 = 'a';
SELECT COUNT(*) AS EXPECT_1 FROM t1 WHERE f2 = 'c';
SELECT * FROM t1;
--connection node_2
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
SELECT COUNT(*) AS EXPECT_1 FROM t1 WHERE f2 = 'a';
SELECT COUNT(*) AS EXPECT_1 FROM t1 WHERE f2 = 'c';
SELECT * FROM t1;
DROP TABLE t1;
DROP TABLE t2;
--connection node_1a
SET DEBUG_SYNC = "RESET";
--connection node_1b
SET DEBUG_SYNC = "RESET";
--connection node_1
--disconnect node_1a
--disconnect node_1b
--disconnect node_1c

View File

@@ -2,22 +2,24 @@
--source include/have_innodb.inc
#
# This tests simple autocommit replication of MyISAM tables. No updates arrive on the slave.
# This tests simple autocommit replication of MyISAM tables.
#
# Without a PK
SET GLOBAL wsrep_mode=REPLICATE_MYISAM;
# Without a PK
CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2), (3);
# This is TOI
INSERT INTO t1 SELECT 4 FROM DUAL UNION ALL SELECT 5 FROM DUAL;
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1);
INSERT INTO t2 VALUES (2), (3);
# This is TOI
INSERT INTO t2 SELECT 4 FROM DUAL UNION ALL SELECT 5 FROM DUAL;
# Error
@@ -34,16 +36,26 @@ UPDATE t2 SET f1 = 9 WHERE f1 = 1;
DELETE FROM t1 WHERE f1 = 9;
DELETE FROM t2 WHERE f1 = 9;
SELECT * FROM t1 ORDER BY f1;
SELECT * FROM t2 ORDER BY f1;
--connection node_2
SELECT * FROM t1 ORDER BY f1;
SELECT * FROM t2 ORDER BY f1;
# TRUNCATE
TRUNCATE TABLE t1;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
SELECT * FROM t1 ORDER BY f1;
SELECT * FROM t2 ORDER BY f1;
--connection node_2
SELECT COUNT(*) = 0 FROM t1;
SELECT COUNT(*) = 0 FROM t2;
SELECT * FROM t1 ORDER BY f1;
SELECT * FROM t2 ORDER BY f1;
--connection node_1
SET GLOBAL wsrep_mode=DEFAULT;
DROP TABLE t1;
DROP TABLE t2;
SET GLOBAL wsrep_mode=DEFAULT;

View File

@@ -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;

View File

@@ -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;

View File

@@ -0,0 +1,16 @@
--source include/galera_cluster.inc
--source include/have_sequence.inc
SET GLOBAL wsrep_ignore_apply_errors=0;
SET SESSION AUTOCOMMIT=0;
SET SESSION max_error_count=0;
--error ER_NOT_SUPPORTED_YET
CREATE TABLE t0 (id GEOMETRY,parent_id GEOMETRY)ENGINE=SEQUENCE;
--connection node_2
--error ER_NO_SUCH_TABLE
SHOW CREATE TABLE t0;
--connection node_1
SET GLOBAL wsrep_ignore_apply_errors=DEFAULT;

View File

@@ -16,21 +16,27 @@ SET GLOBAL wsrep_provider_options = 'pc.weight=2';
--connection node_2
# Isolate node_2 from the group and wait until wsrep_ready becomes OFF.
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
SET SESSION wsrep_sync_wait = 0;
--let $wait_condition = SELECT VARIABLE_VALUE = 'OFF' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'
--source include/wait_condition.inc
# Verify that graceful shutdown succeeds.
--source include/shutdown_mysqld.inc
--source include/start_mysqld.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1';
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--connection node_2
--let $wait_condition = SELECT VARIABLE_VALUE = 'OFF' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'
--source include/wait_condition.inc
SHOW STATUS LIKE 'wsrep_cluster_status';
# Verify that graceful shutdown succeeds.
--source include/shutdown_mysqld.inc
--source include/start_mysqld.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
# Restore original settings.
SET GLOBAL wsrep_provider_options = 'pc.weight = 1';
--source include/auto_increment_offset_restore.inc

View File

@@ -0,0 +1,188 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_log_bin.inc
--source include/have_sequence.inc
--source include/have_aria.inc
--echo # Case 1 CREATE SEQUENCE with no NOCACHE
--error ER_NOT_SUPPORTED_YET
CREATE SEQUENCE s ENGINE=InnoDB;
CREATE SEQUENCE s NOCACHE ENGINE=InnoDB;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
START TRANSACTION;
REPLACE INTO s VALUES (1,1,9223372036854775806,1,1,1000,0,0);
OPTIMIZE TABLE t1;
SELECT * FROM t1;
SELECT * FROM s;
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 's'
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 1 FROM test.s;
--source include/wait_condition.inc
SELECT * FROM t1;
SELECT * FROM s;
--connection node_1
DROP TABLE t1;
DROP SEQUENCE s;
--echo # Case 2 REPLACE INTO ... SELECT with error
CREATE TABLE t (id INT KEY,a YEAR,INDEX (id,a)) engine=innodb;
--error ER_WRONG_VALUE_COUNT_ON_ROW
REPLACE INTO t (id,a)SELECT /*!99997 */ 1;
REPLACE INTO t (id,a)SELECT /*!99997 */ 1,2;
SELECT * FROM t;
CREATE TABLE t2 (id INT KEY,a YEAR,INDEX (id,a)) engine=myisam;
--error ER_WRONG_VALUE_COUNT_ON_ROW
REPLACE INTO t2 (id,a)SELECT /*!99997 */ 1;
REPLACE INTO t2 (id,a)SELECT /*!99997 */ 1,2;
SELECT * FROM t2;
CREATE TABLE t3 (id INT KEY,a YEAR,INDEX (id,a)) engine=aria;
--error ER_WRONG_VALUE_COUNT_ON_ROW
REPLACE INTO t3 (id,a)SELECT /*!99997 */ 1;
REPLACE INTO t3 (id,a)SELECT /*!99997 */ 1,2;
SELECT * FROM t3;
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't3'
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 1 FROM test.t3;
--source include/wait_condition.inc
SELECT * FROM t;
SELECT * FROM t2;
SELECT * FROM t3;
--connection node_1
DROP TABLE t,t2,t3;
--echo # Bigger REPLACE ... AS SELECT test
CREATE TABLE t1(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t2(id int not null primary key ,b int) ENGINE=MyISAM;
CREATE TABLE t3(id int not null primary key ,b int) ENGINE=Aria;
CREATE TABLE t4(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t5(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t6(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t7(id int not null primary key ,b int) ENGINE=MyISAM;
CREATE TABLE t8(id int not null primary key ,b int) ENGINE=Aria;
INSERT INTO t1(id) SELECT seq FROM seq_1_to_1000;
INSERT INTO t2(id) SELECT seq FROM seq_1_to_1000;
INSERT INTO t3(id) SELECT seq FROM seq_1_to_1000;
REPLACE INTO t4 SELECT * FROM t1;
REPLACE INTO t5 SELECT * FROM t2;
# For some reason Aria storage engine does register_ha
--error ER_ERROR_DURING_COMMIT
REPLACE INTO t6 SELECT * FROM t3;
REPLACE INTO t7 SELECT * FROM t2;
REPLACE INTO t8 SELECT * FROM t3;
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
SELECT COUNT(*) AS EXPECT_1000 FROM t2;
SELECT COUNT(*) AS EXPECT_1000 FROM t3;
SELECT COUNT(*) AS EXPECT_1000 FROM t4;
SELECT COUNT(*) AS EXPECT_1000 FROM t5;
SELECT COUNT(*) AS EXPECT_0 FROM t6;
SELECT COUNT(*) AS EXPECT_1000 FROM t7;
SELECT COUNT(*) AS EXPECT_1000 FROM t8;
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 8 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't_'
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 1000 FROM test.t8;
--source include/wait_condition.inc
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
SELECT COUNT(*) AS EXPECT_1000 FROM t2;
SELECT COUNT(*) AS EXPECT_1000 FROM t3;
SELECT COUNT(*) AS EXPECT_1000 FROM t4;
SELECT COUNT(*) AS EXPECT_1000 FROM t5;
SELECT COUNT(*) AS EXPECT_0 FROM t6;
SELECT COUNT(*) AS EXPECT_1000 FROM t7;
SELECT COUNT(*) AS EXPECT_1000 FROM t8;
--connection node_1
DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8;
--echo # Bigger INSERT INTO ... SELECT test
CREATE TABLE t1(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t2(id int not null primary key ,b int) ENGINE=MyISAM;
CREATE TABLE t3(id int not null primary key ,b int) ENGINE=Aria;
CREATE TABLE t4(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t5(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t6(id int not null primary key ,b int) ENGINE=InnoDB;
CREATE TABLE t7(id int not null primary key ,b int) ENGINE=MyISAM;
CREATE TABLE t8(id int not null primary key ,b int) ENGINE=Aria;
INSERT INTO t1(id) SELECT seq FROM seq_1_to_1000;
INSERT INTO t2(id) SELECT seq FROM seq_1_to_1000;
INSERT INTO t3(id) SELECT seq FROM seq_1_to_1000;
INSERT INTO t4 SELECT * FROM t1;
INSERT INTO t5 SELECT * FROM t2;
# For some reason Aria storage engine does register_ha
--error ER_ERROR_DURING_COMMIT
INSERT INTO t6 SELECT * FROM t3;
INSERT INTO t7 SELECT * FROM t2;
INSERT INTO t8 SELECT * FROM t3;
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
SELECT COUNT(*) AS EXPECT_1000 FROM t2;
SELECT COUNT(*) AS EXPECT_1000 FROM t3;
SELECT COUNT(*) AS EXPECT_1000 FROM t4;
SELECT COUNT(*) AS EXPECT_1000 FROM t5;
SELECT COUNT(*) AS EXPECT_0 FROM t6;
SELECT COUNT(*) AS EXPECT_1000 FROM t7;
SELECT COUNT(*) AS EXPECT_1000 FROM t8;
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 8 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't_'
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 1000 FROM test.t8;
--source include/wait_condition.inc
SELECT COUNT(*) AS EXPECT_1000 FROM t1;
SELECT COUNT(*) AS EXPECT_1000 FROM t2;
SELECT COUNT(*) AS EXPECT_1000 FROM t3;
SELECT COUNT(*) AS EXPECT_1000 FROM t4;
SELECT COUNT(*) AS EXPECT_1000 FROM t5;
SELECT COUNT(*) AS EXPECT_0 FROM t6;
SELECT COUNT(*) AS EXPECT_1000 FROM t7;
SELECT COUNT(*) AS EXPECT_1000 FROM t8;
--connection node_1
DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8;
#
# View
#
CREATE TABLE t1(pk int not null primary key) engine=innodb;
INSERT INTO t1 values (1),(2),(3),(4);
CREATE VIEW view_t1 AS SELECT * FROM t1;
INSERT INTO view_t1 VALUES (5);
SELECT * FROM t1;
DROP TABLE t1;
DROP VIEW view_t1;
CREATE TABLE t1(pk int not null primary key) engine=myisam;
INSERT INTO t1 values (1),(2),(3),(4);
CREATE VIEW view_t1 AS SELECT * FROM t1;
INSERT INTO view_t1 VALUES (5);
SELECT * FROM t1;
DROP TABLE t1;
DROP VIEW view_t1;
CREATE TABLE t1(pk int not null primary key) engine=aria;
INSERT INTO t1 values (1),(2),(3),(4);
CREATE VIEW view_t1 AS SELECT * FROM t1;
INSERT INTO view_t1 VALUES (5);
SELECT * FROM t1;
DROP TABLE t1;
DROP VIEW view_t1;
SET GLOBAL wsrep_mode=DEFAULT;

View File

@@ -1,34 +1,15 @@
--source include/galera_cluster.inc
--let $node_1 = node_1
--let $node_2 = node_2
--source include/auto_increment_offset_save.inc
--connection node_1
#
# Below should not cause nodes to be inconsistent (they could if we
# allow TOI as some error are ignored on applier
#
--error ER_NOT_SUPPORTED_YET
CREATE TABLE t ENGINE=InnoDB WITH SYSTEM VERSIONING AS SELECT 1 AS i;
--connection node_2
--error ER_NO_SUCH_TABLE
SHOW CREATE TABLE t;
SELECT * from t;
DROP TABLE IF EXISTS t;
COMMIT;
#
# Restart node_2, force SST because database is inconsistent compared to node_1
#
--connection node_2
SET SESSION wsrep_sync_wait=0;
--source include/kill_galera.inc
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--echo Starting server ...
let $restart_noprint=2;
--source include/start_mysqld.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
--connection node_2
call mtr.add_suppression("WSREP: Event .*Write_rows_v1 apply failed:.*");
call mtr.add_suppression("SREP: Failed to apply write set: gtid:.*");
--source include/auto_increment_offset_restore.inc

View File

@@ -0,0 +1 @@
!include ../galera_2nodes_as_master.cnf

View File

@@ -0,0 +1,9 @@
--source include/have_innodb.inc
--source include/galera_cluster.inc
--echo #
--echo # MDEV-33355 Add a Galera-2-node-to-MariaDB replication MTR test cloning the slave with mariadb-backup
--echo #
--let cnf=galera2_to_mariadb
--source include/rpl_clone_slave_using_mariadb-backup.inc

View File

@@ -9,6 +9,7 @@ INSERT INTO t1 VALUES (01), (02), (03), (04), (05);
connection node_2;
Unloading wsrep provider ...
SET GLOBAL wsrep_cluster_address = '';
connection node_1;
connection node_3;
Unloading wsrep provider ...
SET GLOBAL wsrep_cluster_address = '';
@@ -33,14 +34,16 @@ SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
INSERT INTO t1 VALUES (51), (52), (53), (54), (55);
connection node_2;
connection node_1;
connection node_3;
connection node_1;
connection node_2;
SELECT COUNT(*) = 30 FROM t1;
COUNT(*) = 30
1
SELECT COUNT(*) = 3 FROM t2;
COUNT(*) = 3
1
SELECT COUNT(*) AS EXPECT_30 FROM t1;
EXPECT_30
30
SELECT COUNT(*) AS EXPECT_3 FROM t2;
EXPECT_3
3
SELECT LENGTH(f1) = 512 * 1024 FROM t2;
LENGTH(f1) = 512 * 1024
1
@@ -48,12 +51,12 @@ LENGTH(f1) = 512 * 1024
1
CALL mtr.add_suppression("WSREP: Unsupported protocol downgrade: incremental data collection disabled");
connection node_3;
SELECT COUNT(*) = 30 FROM t1;
COUNT(*) = 30
1
SELECT COUNT(*) = 3 FROM t2;
COUNT(*) = 3
1
SELECT COUNT(*) AS EXPECT_30 FROM t1;
EXPECT_30
30
SELECT COUNT(*) AS EXPECT_3 FROM t2;
EXPECT_3
3
SELECT LENGTH(f1) = 512 * 1024 FROM t2;
LENGTH(f1) = 512 * 1024
1

View File

@@ -92,3 +92,7 @@ connection node_2;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
connection node_3;
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
disconnect node_1a;
disconnect node_3;
disconnect node_2;
disconnect node_1;

View File

@@ -2,10 +2,22 @@
[mysqld.1]
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.ignore_sb=true;gcache.size=1M'
auto_increment_increment=1
auto_increment_offset=1
# this will force server restarts before this test
loose-galera-ist-gcache-rollover=1
wsrep-debug=1
[mysqld.2]
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.ignore_sb=true;gcache.size=1M'
auto_increment_increment=2
auto_increment_offset=2
loose-galera-ist-gcache-rollover=2
wsrep-debug=1
[mysqld.3]
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.ignore_sb=true;gcache.size=1M'
auto_increment_increment=3
auto_increment_offset=3
loose-galera-ist-gcache-rollover=3
wsrep-debug=1

View File

@@ -12,6 +12,7 @@
--source include/have_innodb.inc
--source include/have_debug_sync.inc
--source include/galera_have_debug_sync.inc
--source include/force_restart.inc
--let $galera_connection_name = node_3
--let $galera_server_number = 3
@@ -24,6 +25,9 @@
--source ../galera/include/auto_increment_offset_save.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--let $wait_condition_on_error_output = SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'wsrep%'; show processlist
--source include/wait_condition_with_debug.inc
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
INSERT INTO t1 VALUES (01), (02), (03), (04), (05);
@@ -32,12 +36,15 @@ INSERT INTO t1 VALUES (01), (02), (03), (04), (05);
--let $wsrep_cluster_address_orig2 = `select @@wsrep_cluster_address`
--source suite/galera/include/galera_stop_replication.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
--connection node_3
--let $wsrep_cluster_address_orig3 = `select @@wsrep_cluster_address`
--source suite/galera/include/galera_stop_replication.inc
--connection node_1
--source include/wait_until_connected_again.inc
INSERT INTO t1 VALUES (11), (12), (13), (14), (15);
# Wait until nodes #2 and #3 have left
@@ -88,29 +95,39 @@ INSERT INTO t1 VALUES (51), (52), (53), (54), (55);
--connection node_2
--source include/wait_until_connected_again.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 2 OR VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
--connection node_3
--source include/wait_until_connected_again.inc
sleep 5;
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
# Final checks
--connection node_2
SELECT COUNT(*) = 30 FROM t1;
SELECT COUNT(*) = 3 FROM t2;
--let $wait_condition = SELECT COUNT(*) = 30 FROM t1
--source include/wait_condition.inc
SELECT COUNT(*) AS EXPECT_30 FROM t1;
SELECT COUNT(*) AS EXPECT_3 FROM t2;
SELECT LENGTH(f1) = 512 * 1024 FROM t2;
CALL mtr.add_suppression("WSREP: Unsupported protocol downgrade: incremental data collection disabled");
# Final checks
--connection node_3
SELECT COUNT(*) = 30 FROM t1;
SELECT COUNT(*) = 3 FROM t2;
--let $wait_condition = SELECT COUNT(*) = 30 FROM t1
--source include/wait_condition.inc
SELECT COUNT(*) AS EXPECT_30 FROM t1;
SELECT COUNT(*) AS EXPECT_3 FROM t2;
SELECT LENGTH(f1) = 512 * 1024 FROM t2;
CALL mtr.add_suppression("WSREP: Unsupported protocol downgrade: incremental data collection disabled");
DROP TABLE t1, t2;
# Restore original auto_increment_offset values.
--source ../galera/include/auto_increment_offset_restore.inc
--let $galera_cluster_size=3
--source ../galera/include/auto_increment_offset_restore.inc
--source include/galera_end.inc

View File

@@ -278,4 +278,9 @@ call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State T
--connection node_3
call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required.");
--disconnect node_1a
# Restore original auto_increment_offset values.
--let $galera_cluster_size=3
--source ../galera/include/auto_increment_offset_restore.inc
--source include/galera_end.inc

View File

@@ -7,11 +7,11 @@ connection node_3;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
connection node_2;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
SELECT COUNT(*) AS EXPECT_0 FROM t1;
EXPECT_0
0
connection node_1;
CREATE TABLE t2 (f1 INTEGER);
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
LOCK TABLE t2 WRITE;
connection node_1;
@@ -37,12 +37,12 @@ count_match
count_match
1
connection node_1;
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
COUNT(*)
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
EXPECT_0
0
connection node_2;
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
COUNT(*)
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
EXPECT_0
0
connection node_1;
DROP TABLE t1;

View File

@@ -15,18 +15,23 @@
--source ../galera/include/auto_increment_offset_save.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
# Block node #2's applier before table t1's inserts have come into play
--connection node_2
SELECT COUNT(*) = 0 FROM t1;
SELECT COUNT(*) AS EXPECT_0 FROM t1;
--connection node_1
CREATE TABLE t2 (f1 INTEGER);
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2'
--source include/wait_condition.inc
LOCK TABLE t2 WRITE;
--connection node_1
@@ -77,10 +82,10 @@ if ($mysql_errno == 1213) {
--enable_query_log
--connection node_1
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
--connection node_2
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log;
--connection node_1
DROP TABLE t1;

View File

@@ -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

View File

@@ -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.

View File

@@ -1,5 +1,28 @@
# Preparation for using no_checkpoint_end.inc
# no_checkpoint_flush: Set to trigger flushing the dirty pages from buffer pool
# and checkpoint before the "no checkpoint" block.
if ($no_checkpoint_flush) {
--echo
--echo # Flush all dirty pages from buffer pool
SET @no_checkpoint_save_pct= @@GLOBAL.innodb_max_dirty_pages_pct;
SET @no_checkpoint_save_pct_lwm= @@GLOBAL.innodb_max_dirty_pages_pct_lwm;
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
SET GLOBAL innodb_max_dirty_pages_pct=0.0;
let $wait_condition =
SELECT variable_value = 0
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
--source include/wait_condition.inc
SET GLOBAL innodb_max_dirty_pages_pct= @no_checkpoint_save_pct;
SET GLOBAL innodb_max_dirty_pages_pct_lwm= @no_checkpoint_save_pct_lwm;
--echo
}
let MYSQLD_DATADIR= `select @@datadir`;
--replace_regex /.*Last checkpoint at[ ]*([0-9]+).*/\1/
let CHECKPOINT_LSN=`SHOW ENGINE INNODB STATUS`;

View File

@@ -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

View File

@@ -14,9 +14,9 @@ disconnect con1;
# and recompute innodb_checksum_algorithm=crc32
# restart
SELECT COUNT(*) FROM bug16720368;
ERROR 42S02: Table 'test.bug16720368' doesn't exist in engine
ERROR HY000: Table `test`.`bug16720368` is corrupted. Please drop the table and recreate.
INSERT INTO bug16720368 VALUES(1);
ERROR HY000: Table test/bug16720368 is corrupted. Please drop the table and recreate.
ERROR HY000: Table `test`.`bug16720368` is corrupted. Please drop the table and recreate.
INSERT INTO bug16720368_1 VALUES(1);
# Shut down the server to uncorrupt the data.
# restart

View File

@@ -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
#

View File

@@ -0,0 +1,232 @@
CREATE TABLE t1 (id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(42);
CREATE TABLE t1b LIKE t1;
INSERT INTO t1b VALUES(3);
CREATE TABLE t1z LIKE t1;
CREATE TABLE t1t (id TINYINT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t0t LIKE t1t;
INSERT INTO t1t VALUES(123);
FLUSH TABLES t1,t1b,t1t FOR EXPORT;
UNLOCK TABLES;
CREATE TABLE t5_7 LIKE t1;
CREATE TABLE t5_7b LIKE t1b;
CREATE TABLE t10_1 LIKE t1;
CREATE TABLE t10_1b LIKE t1b;
ALTER TABLE t1 DISCARD TABLESPACE;
ALTER TABLE t1b DISCARD TABLESPACE;
ALTER TABLE t1z DISCARD TABLESPACE;
ALTER TABLE t1t DISCARD TABLESPACE;
ALTER TABLE t0t DISCARD TABLESPACE;
ALTER TABLE t5_7 DISCARD TABLESPACE;
ALTER TABLE t5_7b DISCARD TABLESPACE;
ALTER TABLE t10_1 DISCARD TABLESPACE;
ALTER TABLE t10_1b DISCARD TABLESPACE;
FLUSH TABLES;
ALTER TABLE t0t IMPORT TABLESPACE;
Warnings:
Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t0t.cfg', will attempt to import without schema verification
INSERT INTO t0t VALUES(NULL);
SELECT * FROM t0t;
id
123
124
DROP TABLE t0t;
ALTER TABLE t1 IMPORT TABLESPACE;
Warnings:
Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t1.cfg', will attempt to import without schema verification
ALTER TABLE t1b IMPORT TABLESPACE;
Warnings:
Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t1b.cfg', will attempt to import without schema verification
ALTER TABLE t1z IMPORT TABLESPACE;
Warnings:
Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t1z.cfg', will attempt to import without schema verification
ALTER TABLE t1t IMPORT TABLESPACE;
Warnings:
Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t1t.cfg', will attempt to import without schema verification
ALTER TABLE t5_7 IMPORT TABLESPACE;
Warnings:
Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t5_7.cfg', will attempt to import without schema verification
ALTER TABLE t5_7b IMPORT TABLESPACE;
Warnings:
Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t5_7b.cfg', will attempt to import without schema verification
ALTER TABLE t10_1 IMPORT TABLESPACE;
Warnings:
Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t10_1.cfg', will attempt to import without schema verification
ALTER TABLE t10_1b IMPORT TABLESPACE;
Warnings:
Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t10_1b.cfg', will attempt to import without schema verification
FOUND 1 /InnoDB: Resetting PAGE_ROOT_AUTO_INC from 128 to 123 on table `test`\.`t0t`/ in mysqld.1.err
FOUND 1 /InnoDB: Resetting PAGE_ROOT_AUTO_INC from 0 to 42 on table `test`\.`t1z`/ in mysqld.1.err
FOUND 1 /InnoDB: Resetting PAGE_ROOT_AUTO_INC from 128 to 123 on table `test`\.`t1t`/ in mysqld.1.err
FOUND 1 /InnoDB: Resetting PAGE_ROOT_AUTO_INC from 3 to 42 on table `test`\.`t5_7` \(created with version 50744\)/ in mysqld.1.err
FOUND 1 /InnoDB: Resetting PAGE_ROOT_AUTO_INC from 3 to 42 on table `test`\.`t10_1` \(created with version 100149\)/ in mysqld.1.err
FOUND 5 /InnoDB: Resetting PAGE_ROOT_AUTO_INC/ in mysqld.1.err
# restart: --read-only
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1b check status OK
test.t1t check status OK
test.t1z check status OK
test.t5_7 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t5_7 check status OK
test.t5_7b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t5_7b check status OK
test.t10_1 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t10_1 check status OK
test.t10_1b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t10_1b check status OK
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1b check status OK
test.t1t check status OK
test.t1z check status OK
test.t5_7 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t5_7 check status OK
test.t5_7b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t5_7b check status OK
test.t10_1 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t10_1 check status OK
test.t10_1b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t10_1b check status OK
# restart: --innodb-read-only --read-only
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1b check status OK
test.t1t check status OK
test.t1z check status OK
test.t5_7 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t5_7 check status OK
test.t5_7b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t5_7b check status OK
test.t10_1 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t10_1 check status OK
test.t10_1b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t10_1b check status OK
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1b check status OK
test.t1t check status OK
test.t1z check status OK
test.t5_7 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t5_7 check status OK
test.t5_7b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t5_7b check status OK
test.t10_1 check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t10_1 check status OK
test.t10_1b check note Auto_increment will be checked on each open until CHECK TABLE FOR UPGRADE is executed
test.t10_1b check status OK
# restart: --innodb-read-only
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1b check status OK
test.t1t check status OK
test.t1z check status OK
test.t5_7 check status Operation failed
test.t5_7b check status Operation failed
test.t10_1 check status Operation failed
test.t10_1b check status Operation failed
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1b check status OK
test.t1t check status OK
test.t1z check status OK
test.t5_7 check status Operation failed
test.t5_7b check status Operation failed
test.t10_1 check status Operation failed
test.t10_1b check status Operation failed
SELECT COUNT(*) FROM t1;
COUNT(*)
1
SELECT COUNT(*) FROM t1b;
COUNT(*)
1
SELECT COUNT(*) FROM t1t;
COUNT(*)
1
SELECT COUNT(*) FROM t1z;
COUNT(*)
1
SELECT COUNT(*) FROM t5_7;
COUNT(*)
1
SELECT COUNT(*) FROM t5_7b;
COUNT(*)
1
SELECT COUNT(*) FROM t10_1;
COUNT(*)
1
SELECT COUNT(*) FROM t10_1b;
COUNT(*)
1
# restart
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1b check status OK
test.t1t check status OK
test.t1z check status OK
test.t5_7 check note Auto_increment checked and .frm file version updated
test.t5_7 check status OK
test.t5_7b check note Auto_increment checked and .frm file version updated
test.t5_7b check status OK
test.t10_1 check note Auto_increment checked and .frm file version updated
test.t10_1 check status OK
test.t10_1b check note Auto_increment checked and .frm file version updated
test.t10_1b check status OK
INSERT INTO t1 VALUES(NULL);
INSERT INTO t1b VALUES(NULL);
INSERT INTO t1t VALUES(NULL);
INSERT INTO t1z VALUES(NULL);
INSERT INTO t5_7 VALUES(NULL);
INSERT INTO t5_7b VALUES(NULL);
INSERT INTO t10_1 VALUES(NULL);
INSERT INTO t10_1b VALUES(NULL);
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1b check status OK
test.t1t check status OK
test.t1z check status OK
test.t5_7 check status OK
test.t5_7b check status OK
test.t10_1 check status OK
test.t10_1b check status OK
SELECT * FROM t1;
id
4
42
SELECT * FROM t1b;
id
3
347
SELECT * FROM t1t;
id
123
124
SELECT * FROM t1z;
id
42
43
SELECT * FROM t5_7;
id
42
43
SELECT * FROM t5_7b;
id
3
347
SELECT * FROM t10_1;
id
42
43
SELECT * FROM t10_1b;
id
3
347
DROP TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;

View File

@@ -1035,9 +1035,22 @@ BEGIN;
INSERT INTO child SET a=1;
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`a`) REFERENCES `parent` (`a`))
connection default;
TRUNCATE TABLE parent;
ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`parent` (`a`))
DROP TABLE parent;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
SET innodb_lock_wait_timeout=0;
RENAME TABLE parent TO transparent;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ALTER TABLE parent FORCE, ALGORITHM=COPY;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ALTER TABLE parent FORCE, ALGORITHM=INPLACE;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET innodb_lock_wait_timeout=0, foreign_key_checks=0;
TRUNCATE TABLE parent;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
DROP TABLE parent;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ALTER TABLE parent FORCE, ALGORITHM=COPY;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ALTER TABLE parent FORCE, ALGORITHM=INPLACE;
@@ -1052,7 +1065,13 @@ TRUNCATE TABLE parent;
ALTER TABLE parent FORCE, ALGORITHM=COPY;
ALTER TABLE parent FORCE, ALGORITHM=INPLACE;
ALTER TABLE parent ADD COLUMN b INT, ALGORITHM=INSTANT;
DROP TABLE child, parent;
SET foreign_key_checks=ON;
TRUNCATE TABLE parent;
ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`parent` (`a`))
ALTER TABLE parent FORCE, ALGORITHM=COPY;
ALTER TABLE parent FORCE, ALGORITHM=INPLACE;
RENAME TABLE parent TO transparent;
DROP TABLE child, transparent;
#
# MDEV-26217 Failing assertion: list.count > 0 in ut_list_remove
# or Assertion `lock->trx == this' failed in dberr_t trx_t::drop_table

View File

@@ -50,7 +50,15 @@ t1 CREATE TABLE `t1` (
`b` blob DEFAULT NULL,
`c` blob DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC
# Auto increment value must be more than maximum column value
SELECT MAX(a) FROM t1;
MAX(a)
45
SELECT auto_increment FROM information_schema.tables
WHERE table_name like 't1';
auto_increment
46
UPDATE t1 set b = repeat("de", 100) where b = repeat("cd", 200);
explain SELECT a FROM t1 where b = repeat("de", 100);
id select_type table type possible_keys key key_len ref rows Extra
@@ -132,7 +140,15 @@ t1 CREATE TABLE `t1` (
`c2` point NOT NULL,
`c3` linestring NOT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=16372 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC
) ENGINE=InnoDB AUTO_INCREMENT=14325 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC
# Auto increment value must be more than maximum column value
SELECT MAX(c1) FROM t1;
MAX(c1)
14324
SELECT auto_increment FROM information_schema.tables
WHERE table_name like 't1';
auto_increment
14325
UPDATE t1 SET C2 = ST_GeomFromText('POINT(0 0)');
SELECT COUNT(*) FROM t1;
COUNT(*)

View File

@@ -15,6 +15,58 @@ CREATE TABLE imp_t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
DROP TABLE imp_t1, t1;
SET GLOBAL innodb_checksum_algorithm=@save_innodb_checksum_algorithm;
#
# MDEV-33400 Adaptive hash index corruption after DISCARD TABLESPACE
#
SET @save_adaptive=@@GLOBAL.innodb_adaptive_hash_index;
SET GLOBAL innodb_adaptive_hash_index=ON;
CREATE TABLE t (a INT PRIMARY KEY) ENGINE=INNODB;
INSERT INTO t SELECT * FROM seq_1_to_131;
ALTER TABLE t ADD hid INT DEFAULT 2;
INSERT INTO t VALUES (251,1);
ALTER TABLE t DISCARD TABLESPACE;
CHECK TABLE mysql.innodb_table_stats;
Table Op Msg_type Msg_text
mysql.innodb_table_stats check status OK
DROP TABLE t;
SET GLOBAL innodb_adaptive_hash_index=@save_adaptive;
# End of 10.4 tests
#
# MDEV-18288: Transportable Tablespaces leave AUTO_INCREMENT in mismatched
# state, causing INSERT errors in newly imported tables when .cfg is not used.
#
CREATE TABLE t1(
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id)
) ENGINE=INNODB;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 DISCARD TABLESPACE;
INSERT INTO t1() VALUES();
INSERT INTO t1() VALUES();
FLUSH TABLES test.t1 FOR EXPORT;
# Copy data file
# Skip CFG file copy
UNLOCK TABLES;
DROP TABLE t1;
ALTER TABLE t2 IMPORT TABLESPACE;
Warnings:
Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t2.cfg', will attempt to import without schema verification
SELECT * FROM t2 ORDER BY id;
id
1
2
INSERT INTO t2() VALUES();
INSERT INTO t2() VALUES();
INSERT INTO t2() VALUES();
SELECT * FROM t2 ORDER BY id;
id
1
2
3
4
5
DROP TABLE t2;
# End of 10.5 tests
#
# MDEV-27006 Assertion `!lock_trx_has_sys_table_locks(trx)'
# failed in dberr_t row_discard_tablespace_for_mysql
# (dict_table_t*, trx_t*)

View File

@@ -0,0 +1,45 @@
call mtr.add_suppression("InnoDB: Added system generated FTS_DOC_ID and FTS_DOC_ID_INDEX while importing the tablespace");
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) not null, fulltext f_idx(f2),
f3 INT as (f1) VIRTUAL, INDEX(f3),
f4 INT as (f1) STORED, INDEX(f4),
f5 INT as (f1) VIRTUAL)ENGINE=InnoDB;
INSERT INTO t1(f1, f2) VALUES(1, "on");
INSERT INTO t1(f1, f2) SELECT seq, "si" FROM seq_2_to_256;
ALTER TABLE t1 ADD COLUMN f6 INT NOT NULL;
ALTER TABLE t1 DROP COLUMN f6;
ALTER TABLE t1 DROP INDEX f_idx;
connect con1,localhost,root,,;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
DELETE FROM t1 WHERE f1 > 1;
FLUSH TABLE t1 FOR EXPORT;
Warnings:
Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
backup: t1
UNLOCK TABLES;
Warnings:
Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) not null,
f3 INT as (f1) VIRTUAL, INDEX(f3),
f4 INT as (f1) STORED, INDEX(f4),
f5 INT as (f1) VIRTUAL)ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` char(2) NOT NULL,
`f3` int(11) GENERATED ALWAYS AS (`f1`) VIRTUAL,
`f4` int(11) GENERATED ALWAYS AS (`f1`) STORED,
`f5` int(11) GENERATED ALWAYS AS (`f1`) VIRTUAL,
PRIMARY KEY (`f1`),
KEY `f3` (`f3`),
KEY `f4` (`f4`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;

View File

@@ -0,0 +1,76 @@
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) NOT NULL, FULLTEXT f_idx(f2),
f3 INT as (f1) VIRTUAL, INDEX(f3))ENGINE=InnoDB;
INSERT INTO t1(f1, f2) VALUES(1, "on");
ALTER TABLE t1 DROP INDEX f_idx;
FLUSH TABLE t1 FOR EXPORT;
Warnings:
Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
backup: t1
UNLOCK TABLES;
Warnings:
Warning 1235 This version of MariaDB doesn't yet support 'FLUSH TABLES on a table that had an FTS index, created on a hidden column, the auxiliary tables haven't been dropped as yet. FTS auxiliary tables will not be flushed.'
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) NOT NULL,
f3 CHAR(2) NOT NULL,
f4 INT AS (f1) VIRTUAL, INDEX(f4))ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Schema mismatch (Number of indexes don't match, table has 2 indexes but the tablespace meta-data file has 3 indexes)
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) NOT NULL,
f3 INT as (f1) VIRTUAL, INDEX(f3))ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files
SET DEBUG_DBUG="+d,ib_import_set_index_root_failure";
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Too many active concurrent transactions
SET DEBUG_DBUG="-d,ib_import_set_index_root_failure";
SET DEBUG_DBUG="+d,ib_import_vcol_update_fail";
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR 23000: Can't write; duplicate key in table 't1'
SET DEBUG_DBUG="-d,ib_import_vcol_update_fail";
restore: t1 .ibd and .cfg files
SET DEBUG_DBUG="+d,ib_import_fts_error";
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR 23000: Can't write; duplicate key in table 't1'
SET DEBUG_DBUG="-d,ib_import_fts_error";
unlink: t1.ibd
unlink: t1.cfg
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS
WHERE table_id IN (SELECT table_id FROM information_schema.innodb_sys_tables where name="test/t1");
NAME
f1
f2
f3
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` char(2) NOT NULL,
`f3` int(11) GENERATED ALWAYS AS (`f1`) VIRTUAL,
PRIMARY KEY (`f1`),
KEY `f3` (`f3`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
FTS_DOC_ID BIGINT SIGNED NOT NULL,
f2 CHAR(2) NOT NULL,
FULLTEXT f_idx(f2))ENGINE=InnoDB;
INSERT INTO t1 VALUES(1, 1, "on");
ALTER TABLE t1 DROP INDEX f_idx;
FLUSH TABLE t1 FOR EXPORT;
backup: t1
UNLOCK TABLES;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
f2 CHAR(2) NOT NULL)ENGINE=InnoDB;
ALTER TABLE t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Schema mismatch (Column f2 ordinal value mismatch, it's at 1 in the table and 2 in the tablespace meta-data file)
DROP TABLE t1;

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -1,5 +0,0 @@
CREATE TABLE t (c INT) ENGINE=INNODB;
SET @save_dbug = @@debug_dbug;
SET debug_dbug = '+d,test_ut_format_name';
DROP TABLE t;
SET debug_dbug = @save_dbug;

View File

@@ -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;

View File

@@ -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

View File

@@ -471,10 +471,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
@@ -519,6 +568,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

View File

@@ -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;

View 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;

View 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

View File

@@ -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

View File

@@ -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'

View File

@@ -4,15 +4,14 @@ Variable_name Value
innodb_doublewrite ON
create table t1(f1 int not null, f2 int not null)engine=innodb;
insert into t1 values (1, 1);
InnoDB 0 transactions not purged
set GLOBAL innodb_log_checkpoint_now=1;
SET GLOBAL innodb_fast_shutdown = 0;
# restart: --debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0
# Make the first page dirty for undo tablespace
set global innodb_saved_page_number_debug = 0;
set global innodb_fil_make_page_dirty_debug = 1;
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
SET GLOBAL innodb_max_dirty_pages_pct=0.0;
SET GLOBAL innodb_buf_flush_list_now = 1;
# Kill the server
# restart
# restart: --debug_dbug=+d,ib_log_checkpoint_avoid_hard --innodb_flush_sync=0
FOUND 1 /Checksum mismatch in the first page of file/ in mysqld.1.err
check table t1;
Table Op Msg_type Msg_text

View File

@@ -27,6 +27,7 @@ delete from t1;
connection con2;
delete from t2;
connection con1;
SET GLOBAL innodb_max_undo_log_size = @@GLOBAL.innodb_page_size * 4294967296;
SET GLOBAL innodb_undo_log_truncate = 1;
commit;
disconnect con1;
@@ -35,6 +36,8 @@ commit;
disconnect con2;
connection default;
SET GLOBAL innodb_max_purge_lag_wait=0;
SET GLOBAL innodb_max_undo_log_size=DEFAULT;
SET GLOBAL innodb_max_purge_lag_wait=0;
set global innodb_fast_shutdown=0;
# restart
drop table t1, t2;

View File

@@ -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=;

View File

@@ -75,7 +75,7 @@ EOF
-- source include/start_mysqld.inc
--error ER_NO_SUCH_TABLE_IN_ENGINE
--error ER_TABLE_CORRUPT
SELECT COUNT(*) FROM bug16720368;
--error ER_TABLE_CORRUPT
INSERT INTO bug16720368 VALUES(1);

View File

@@ -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 #

View File

@@ -0,0 +1,168 @@
--source include/have_innodb.inc
CREATE TABLE t1 (id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(42);
CREATE TABLE t1b LIKE t1;
INSERT INTO t1b VALUES(3);
CREATE TABLE t1z LIKE t1;
CREATE TABLE t1t (id TINYINT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t0t LIKE t1t;
INSERT INTO t1t VALUES(123);
--let DATADIR=`select @@datadir`
--let PAGE_SIZE=`select @@innodb_page_size`
FLUSH TABLES t1,t1b,t1t FOR EXPORT;
--copy_file $DATADIR/test/t1.ibd $DATADIR/test/t.ibd
--copy_file $DATADIR/test/t1.ibd $DATADIR/test/tz.ibd
--copy_file $DATADIR/test/t1b.ibd $DATADIR/test/tb.ibd
--copy_file $DATADIR/test/t1t.ibd $DATADIR/test/tt.ibd
UNLOCK TABLES;
CREATE TABLE t5_7 LIKE t1;
CREATE TABLE t5_7b LIKE t1b;
CREATE TABLE t10_1 LIKE t1;
CREATE TABLE t10_1b LIKE t1b;
ALTER TABLE t1 DISCARD TABLESPACE;
ALTER TABLE t1b DISCARD TABLESPACE;
ALTER TABLE t1z DISCARD TABLESPACE;
ALTER TABLE t1t DISCARD TABLESPACE;
ALTER TABLE t0t DISCARD TABLESPACE;
ALTER TABLE t5_7 DISCARD TABLESPACE;
ALTER TABLE t5_7b DISCARD TABLESPACE;
ALTER TABLE t10_1 DISCARD TABLESPACE;
ALTER TABLE t10_1b DISCARD TABLESPACE;
FLUSH TABLES;
# Update the PAGE_ROOT_AUTO_INC field of a few files.
perl;
do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
sub update_autoinc
{
my ($file, $value) = @_;
open(FILE, "+<$file") || die "Unable to open $file";
binmode FILE;
my $ps= $ENV{PAGE_SIZE};
my $page;
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
my $full_crc32 = unpack("N",substr($page,54,4)) & 0x10; # FIL_SPACE_FLAGS
sysseek(FILE, 3*$ps, 0) || die "Unable to seek $file\n";
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
substr($page,56,8)=pack("NN",0,$value);
my $polynomial = 0x82f63b78; # CRC-32C
if ($full_crc32) {
my $ck = mycrc32(substr($page, 0, $ps-4), 0, $polynomial);
substr($page, $ps-4, 4) = pack("N", $ck);
}
else
{
my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^
mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial));
substr($page,0,4)=$ck;
substr($page,$ps-8,4)=$ck;
}
sysseek(FILE, 3*$ps, 0) || die "Unable to rewind $file\n";
syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
close(FILE) || die "Unable to close $file";
}
update_autoinc("$ENV{DATADIR}/test/tz.ibd", 0);
update_autoinc("$ENV{DATADIR}/test/t.ibd", 3);
update_autoinc("$ENV{DATADIR}/test/tb.ibd", 346);
update_autoinc("$ENV{DATADIR}/test/tt.ibd", 128);
EOF
--remove_file $DATADIR/test/t5_7.frm
--remove_file $DATADIR/test/t5_7b.frm
--copy_file $MYSQL_TEST_DIR/std_data/autoinc_import_57.frm $DATADIR/test/t5_7.frm
--copy_file $MYSQL_TEST_DIR/std_data/autoinc_import_57.frm $DATADIR/test/t5_7b.frm
--remove_file $DATADIR/test/t10_1.frm
--remove_file $DATADIR/test/t10_1b.frm
--copy_file $MYSQL_TEST_DIR/std_data/autoinc_import_101.frm $DATADIR/test/t10_1.frm
--copy_file $MYSQL_TEST_DIR/std_data/autoinc_import_101.frm $DATADIR/test/t10_1b.frm
--copy_file $DATADIR/test/t.ibd $DATADIR/test/t5_7.ibd
--copy_file $DATADIR/test/tb.ibd $DATADIR/test/t5_7b.ibd
--copy_file $DATADIR/test/t.ibd $DATADIR/test/t10_1.ibd
--copy_file $DATADIR/test/tb.ibd $DATADIR/test/t10_1b.ibd
--move_file $DATADIR/test/t.ibd $DATADIR/test/t1.ibd
--move_file $DATADIR/test/tb.ibd $DATADIR/test/t1b.ibd
--copy_file $DATADIR/test/tt.ibd $DATADIR/test/t0t.ibd
--move_file $DATADIR/test/tt.ibd $DATADIR/test/t1t.ibd
--move_file $DATADIR/test/tz.ibd $DATADIR/test/t1z.ibd
ALTER TABLE t0t IMPORT TABLESPACE;
INSERT INTO t0t VALUES(NULL);
SELECT * FROM t0t;
DROP TABLE t0t;
ALTER TABLE t1 IMPORT TABLESPACE;
ALTER TABLE t1b IMPORT TABLESPACE;
ALTER TABLE t1z IMPORT TABLESPACE;
ALTER TABLE t1t IMPORT TABLESPACE;
ALTER TABLE t5_7 IMPORT TABLESPACE;
ALTER TABLE t5_7b IMPORT TABLESPACE;
ALTER TABLE t10_1 IMPORT TABLESPACE;
ALTER TABLE t10_1b IMPORT TABLESPACE;
--let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err
--let SEARCH_PATTERN= InnoDB: Resetting PAGE_ROOT_AUTO_INC from 128 to 123 on table `test`\.`t0t`
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN= InnoDB: Resetting PAGE_ROOT_AUTO_INC from 0 to 42 on table `test`\.`t1z`
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN= InnoDB: Resetting PAGE_ROOT_AUTO_INC from 128 to 123 on table `test`\.`t1t`
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN= InnoDB: Resetting PAGE_ROOT_AUTO_INC from 3 to 42 on table `test`\.`t5_7` \(created with version 50744\)
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN= InnoDB: Resetting PAGE_ROOT_AUTO_INC from 3 to 42 on table `test`\.`t10_1` \(created with version 100149\)
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN= InnoDB: Resetting PAGE_ROOT_AUTO_INC
--source include/search_pattern_in_file.inc
# Restart, so that the InnoDB tables will be loaded into the data dictionary.
--let $restart_parameters=--read-only
--source include/restart_mysqld.inc
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
--let $restart_parameters=--innodb-read-only --read-only
--source include/restart_mysqld.inc
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
--let $restart_parameters=--innodb-read-only
--source include/restart_mysqld.inc
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FROM t1b;
SELECT COUNT(*) FROM t1t;
SELECT COUNT(*) FROM t1z;
SELECT COUNT(*) FROM t5_7;
SELECT COUNT(*) FROM t5_7b;
SELECT COUNT(*) FROM t10_1;
SELECT COUNT(*) FROM t10_1b;
--let $restart_parameters=
--source include/restart_mysqld.inc
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
INSERT INTO t1 VALUES(NULL);
INSERT INTO t1b VALUES(NULL);
INSERT INTO t1t VALUES(NULL);
INSERT INTO t1z VALUES(NULL);
INSERT INTO t5_7 VALUES(NULL);
INSERT INTO t5_7b VALUES(NULL);
INSERT INTO t10_1 VALUES(NULL);
INSERT INTO t10_1b VALUES(NULL);
CHECK TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b FOR UPGRADE;
SELECT * FROM t1;
SELECT * FROM t1b;
SELECT * FROM t1t;
SELECT * FROM t1z;
SELECT * FROM t5_7;
SELECT * FROM t5_7b;
SELECT * FROM t10_1;
SELECT * FROM t10_1b;
DROP TABLE t1, t1b, t1t, t1z, t5_7, t5_7b, t10_1, t10_1b;

Some files were not shown because too many files have changed in this diff Show More