mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Merge bb-10.2-ext into 10.3
This commit is contained in:
@@ -8,21 +8,15 @@ PRIMARY KEY(id)
|
||||
INSERT INTO t1 VALUES(1), (2), (3);
|
||||
BEGIN;
|
||||
SELECT * FROM t1 WHERE id = 1 FOR UPDATE;
|
||||
id
|
||||
1
|
||||
connect con1,localhost,root,,;
|
||||
BEGIN;
|
||||
SELECT * FROM t1 WHERE id = 2 FOR UPDATE;
|
||||
id
|
||||
2
|
||||
SELECT * FROM t1 WHERE id = 1 FOR UPDATE;
|
||||
connection default;
|
||||
SELECT * FROM t1 WHERE id = 2 FOR UPDATE;
|
||||
connection con1;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
ROLLBACK;
|
||||
connection default;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
ROLLBACK;
|
||||
DROP TABLE t1;
|
||||
disconnect con1;
|
||||
|
||||
@@ -470,8 +470,6 @@ ddl_online_create_index 0
|
||||
ddl_pending_alter_table 0
|
||||
ddl_sort_file_alter_table 0
|
||||
ddl_log_file_alter_table 2
|
||||
connection con1;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
@@ -498,6 +496,25 @@ ERROR 42000: Duplicate key name 'c2h'
|
||||
SET DEBUG_SYNC = 'RESET';
|
||||
SET GLOBAL innodb_monitor_disable = module_ddl;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-13205 assertion !dict_index_is_online_ddl(index) upon ALTER TABLE
|
||||
#
|
||||
CREATE TABLE t1 (c VARCHAR(64)) ENGINE=InnoDB;
|
||||
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL t1u_created WAIT_FOR dup_done';
|
||||
ALTER TABLE t1 ADD UNIQUE(c);
|
||||
connection con1;
|
||||
SET DEBUG_SYNC = 'now WAIT_FOR t1u_created';
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES('bar'),('bar');
|
||||
SET DEBUG_SYNC = 'now SIGNAL dup_done';
|
||||
connection default;
|
||||
ERROR 23000: Duplicate entry 'bar' for key 'c'
|
||||
SET DEBUG_SYNC = 'RESET';
|
||||
disconnect con1;
|
||||
CREATE TABLE t2 (c VARCHAR(64)) ENGINE=InnoDB;
|
||||
ALTER TABLE t2 ADD FOREIGN KEY (c) REFERENCES t1 (c);
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
|
||||
DROP TABLE t2,t1;
|
||||
SET GLOBAL innodb_file_per_table = @global_innodb_file_per_table_orig;
|
||||
SET GLOBAL innodb_monitor_enable = default;
|
||||
SET GLOBAL innodb_monitor_disable = default;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
call mtr.add_suppression("\\[Warning\\] InnoDB: Difficult to find free blocks in the buffer pool.");
|
||||
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 SESSION debug_dbug="";
|
||||
DROP TABLE t1;
|
||||
FOUND 1 /InnoDB: Difficult to find free blocks / in mysqld.1.err
|
||||
@@ -17,6 +17,13 @@ WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
||||
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err
|
||||
# empty redo log from before MariaDB 10.2.2
|
||||
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
|
||||
# redo log from "after" MariaDB 10.2.2, but with invalid header checksum
|
||||
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
@@ -93,19 +100,32 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
||||
FOUND 1 /InnoDB: MLOG_FILE_NAME incorrect:bigot/ in mysqld.1.err
|
||||
FOUND 1 /len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;/ in mysqld.1.err
|
||||
# missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
|
||||
# 10.2 missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
|
||||
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
||||
NOT FOUND /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42$/ in mysqld.1.err
|
||||
# Clean 10.2 redo log
|
||||
FOUND 1 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err
|
||||
# 10.3 missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
|
||||
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
||||
InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES
|
||||
FOUND 1 /InnoDB: Upgrading redo log:/ in mysqld.1.err
|
||||
FOUND 2 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err
|
||||
# Empty 10.3 redo log
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
COUNT(*)
|
||||
1
|
||||
FOUND 1 /InnoDB: .* started; log sequence number 1213970/ in mysqld.1.err
|
||||
# Empty 10.2 redo log
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
COUNT(*)
|
||||
1
|
||||
FOUND 2 /InnoDB: Upgrading redo log:/ in mysqld.1.err
|
||||
# Minimal MariaDB 10.1.21 encrypted redo log
|
||||
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
|
||||
@@ -18,6 +18,8 @@ CREATE TABLE t1(
|
||||
|
||||
INSERT INTO t1 VALUES(1), (2), (3);
|
||||
|
||||
# We are not interested query results, only errors
|
||||
--disable_result_log
|
||||
BEGIN;
|
||||
|
||||
SELECT * FROM t1 WHERE id = 1 FOR UPDATE;
|
||||
@@ -39,12 +41,22 @@ reap;
|
||||
|
||||
ROLLBACK;
|
||||
|
||||
#
|
||||
# Note here that con1 is the older transaction as it
|
||||
# query started wait first. Thus, con1 gets lock
|
||||
# wait timeout first. There is possibility that
|
||||
# default connection gets lock timeout also or
|
||||
# as con1 is rolled back it gets the locks it waited
|
||||
# and does the update.
|
||||
#
|
||||
connection default;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
--error 0,ER_LOCK_WAIT_TIMEOUT
|
||||
reap;
|
||||
|
||||
ROLLBACK;
|
||||
|
||||
--enable_result_log
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
disconnect con1;
|
||||
|
||||
@@ -457,8 +457,6 @@ connection default;
|
||||
reap;
|
||||
--enable_parsing
|
||||
#remove below con1 disconnect if above test case is enabled
|
||||
connection con1;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
@@ -474,6 +472,31 @@ SET GLOBAL innodb_monitor_disable = module_ddl;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-13205 assertion !dict_index_is_online_ddl(index) upon ALTER TABLE
|
||||
--echo #
|
||||
CREATE TABLE t1 (c VARCHAR(64)) ENGINE=InnoDB;
|
||||
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL t1u_created WAIT_FOR dup_done';
|
||||
send ALTER TABLE t1 ADD UNIQUE(c);
|
||||
|
||||
connection con1;
|
||||
SET DEBUG_SYNC = 'now WAIT_FOR t1u_created';
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES('bar'),('bar');
|
||||
SET DEBUG_SYNC = 'now SIGNAL dup_done';
|
||||
|
||||
connection default;
|
||||
--error ER_DUP_ENTRY
|
||||
reap;
|
||||
|
||||
SET DEBUG_SYNC = 'RESET';
|
||||
disconnect con1;
|
||||
CREATE TABLE t2 (c VARCHAR(64)) ENGINE=InnoDB;
|
||||
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
ALTER TABLE t2 ADD FOREIGN KEY (c) REFERENCES t1 (c);
|
||||
DROP TABLE t2,t1;
|
||||
|
||||
# Check that all connections opened by test cases in this file are really
|
||||
# gone so execution of other tests won't be affected by their presence.
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
||||
24
mysql-test/suite/innodb/t/innodb-lru-force-no-free-page.test
Normal file
24
mysql-test/suite/innodb/t/innodb-lru-force-no-free-page.test
Normal file
@@ -0,0 +1,24 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
|
||||
call mtr.add_suppression("\\[Warning\\] InnoDB: Difficult to find free blocks in the buffer pool.");
|
||||
|
||||
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 SESSION debug_dbug="";
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# There should be only one message
|
||||
#
|
||||
let SEARCH_RANGE= -50000;
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
--let SEARCH_PATTERN=InnoDB: Difficult to find free blocks
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
@@ -2,3 +2,5 @@
|
||||
--default-storage-engine=MyISAM
|
||||
--innodb-strict-mode=0
|
||||
--innodb-file-per-table=0
|
||||
--loose-innodb-track-changed-pages
|
||||
--loose-innodb-log-archive
|
||||
|
||||
@@ -8,12 +8,10 @@
|
||||
-- source include/not_encrypted.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Table `test`.`t1` is corrupted. Please drop the table and recreate.");
|
||||
call mtr.add_suppression("InnoDB: Cannot open table test/t1 from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.");
|
||||
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \[page id: space=[0-9]+, page number=[0-9]+\]. You may have to recover from a backup.");
|
||||
call mtr.add_suppression("InnoDB: We detected index corruption in an InnoDB type table.*");
|
||||
call mtr.add_suppression("mysqld: Index for table 't1' is corrupt; try to repair it");
|
||||
call mtr.add_suppression("mysqld.exe: Index for table 't1' is corrupt; try to repair it");
|
||||
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted\\. Please drop the table and recreate\\.");
|
||||
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page");
|
||||
call mtr.add_suppression("InnoDB: We detected index corruption in an InnoDB type table");
|
||||
call mtr.add_suppression("Index for table 't1' is corrupt; try to repair it");
|
||||
--enable_query_log
|
||||
|
||||
--echo # Ensure that purge will not crash on the table after we corrupt it.
|
||||
|
||||
@@ -16,6 +16,7 @@ call mtr.add_suppression("InnoDB: Log scan aborted at LSN");
|
||||
call mtr.add_suppression("InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42\\r?$");
|
||||
call mtr.add_suppression("InnoDB: Obtaining redo log encryption key version 1 failed");
|
||||
call mtr.add_suppression("InnoDB: Decrypting checkpoint failed");
|
||||
call mtr.add_suppression("InnoDB: Are you sure you are using the right ib_logfiles to start up the database\\? Log sequence number in the ib_logfiles is 1213964,");
|
||||
--enable_query_log
|
||||
|
||||
let bugdir= $MYSQLTEST_VARDIR/tmp/log_corruption;
|
||||
@@ -140,6 +141,24 @@ eval $check_no_innodb;
|
||||
let SEARCH_PATTERN=InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\\.2\\.2, and it appears corrupted;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo # empty redo log from before MariaDB 10.2.2
|
||||
perl;
|
||||
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
|
||||
binmode OUT;
|
||||
die unless seek(OUT, 0x800, 0);
|
||||
print OUT pack("NnnNx[496]N", 0x80000944, 12, 12, 0, 0xb2a);
|
||||
close OUT or die;
|
||||
EOF
|
||||
--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=1m
|
||||
--source include/start_mysqld.inc
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
--source include/shutdown_mysqld.inc
|
||||
--let SEARCH_PATTERN= InnoDB: Upgrading redo log:
|
||||
--source include/search_pattern_in_file.inc
|
||||
--let $restart_parameters= $dirs
|
||||
|
||||
--echo # redo log from "after" MariaDB 10.2.2, but with invalid header checksum
|
||||
perl;
|
||||
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
|
||||
@@ -336,7 +355,7 @@ let SEARCH_PATTERN=InnoDB: MLOG_FILE_NAME incorrect:bigot;
|
||||
--let SEARCH_PATTERN= len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo # missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
|
||||
--echo # 10.2 missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
|
||||
perl;
|
||||
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
|
||||
binmode OUT;
|
||||
@@ -364,27 +383,61 @@ EOF
|
||||
--source include/start_mysqld.inc
|
||||
eval $check_no_innodb;
|
||||
--source include/shutdown_mysqld.inc
|
||||
--let SEARCH_PATTERN= InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42\$
|
||||
--let SEARCH_PATTERN= InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo # Clean 10.2 redo log
|
||||
--echo # 10.3 missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
|
||||
perl;
|
||||
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
|
||||
binmode OUT;
|
||||
print OUT pack("Nx[5]nx[5]", 103, 0x1286), "MariaDB 10.3.1";
|
||||
print OUT pack("x[478]N", 0x85021a0f);
|
||||
close OUT or die;
|
||||
EOF
|
||||
|
||||
--source include/start_mysqld.inc
|
||||
eval $check_no_innodb;
|
||||
--source include/shutdown_mysqld.inc
|
||||
--let SEARCH_PATTERN= InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo # Empty 10.3 redo log
|
||||
perl;
|
||||
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
|
||||
binmode OUT;
|
||||
die unless seek(OUT, 0x800, 0);
|
||||
print OUT pack("H*", "800009440022000c00000001");
|
||||
# dummy padding (MLOG_DUMMY_RECORD)
|
||||
print OUT " " x 6;
|
||||
# MLOG_CHECKPOINT record
|
||||
print OUT pack("CNN", 56, 0, 0x12860c);
|
||||
# padding (MLOG_DUMMY_RECORD) and block checksum
|
||||
print OUT " " x 481, pack("N", 0xe9b21b7b);
|
||||
print OUT pack("NnnNx[496]N", 0x80000944, 12, 12, 1, 0x46c8a2a2);
|
||||
close OUT or die;
|
||||
EOF
|
||||
|
||||
--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=1m
|
||||
--source include/start_mysqld.inc
|
||||
eval $check_no_innodb;
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
--source include/shutdown_mysqld.inc
|
||||
--let SEARCH_PATTERN= InnoDB: .* started; log sequence number 1213970
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--echo # Empty 10.2 redo log
|
||||
perl;
|
||||
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
|
||||
binmode OUT;
|
||||
# header block
|
||||
print OUT pack("Nx[5]nx[5]", 1, 0x1286);
|
||||
print OUT "ibbackup was here!!!1!";
|
||||
print OUT pack("x[470]N", 0x52b54540);
|
||||
# In encryption.innodb_log_corruption the previous step would
|
||||
# replace the block with an encrypted one. Rewrite it as it was.
|
||||
die unless seek(OUT, 0x800, 0);
|
||||
print OUT pack("NnnNx[496]N", 0x80000944, 12, 12, 1, 0x46c8a2a2);
|
||||
close OUT or die;
|
||||
EOF
|
||||
|
||||
--source include/start_mysqld.inc
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
--source include/shutdown_mysqld.inc
|
||||
--let SEARCH_PATTERN= InnoDB: Upgrading redo log:
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
Reference in New Issue
Block a user