mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
Merge 10.2 into bb-10.2-ext
This commit is contained in:
commit
1f0a22acbd
41 changed files with 1114 additions and 906 deletions
|
|
@ -79,7 +79,6 @@ IF(WITH_INNOBASE_STORAGE_ENGINE OR WITH_XTRADB_STORAGE_ENGINE)
|
|||
../storage/innobase/ut/ut0ut.cc
|
||||
../storage/innobase/buf/buf0buf.cc
|
||||
../storage/innobase/page/page0zip.cc
|
||||
../storage/innobase/os/os0file.cc
|
||||
../storage/innobase/fil/fil0crypt.cc
|
||||
)
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,60 +0,0 @@
|
|||
# include/wait_innodb_all_purged.inc
|
||||
#
|
||||
# SUMMARY
|
||||
#
|
||||
# Waits until purged all undo records of innodb, or operation times out.
|
||||
#
|
||||
# USAGE
|
||||
#
|
||||
# --source include/wait_innodb_all_purged.inc
|
||||
#
|
||||
--source include/have_innodb.inc
|
||||
|
||||
if (`select version() like '%debug%'`) {
|
||||
--disable_query_log
|
||||
|
||||
let $wait_counter_init= 300;
|
||||
if ($wait_timeout)
|
||||
{
|
||||
let $wait_counter_init= `SELECT $wait_timeout * 10`;
|
||||
}
|
||||
# Reset $wait_timeout so that its value won't be used on subsequent
|
||||
# calls, and default will be used instead.
|
||||
let $wait_timeout= 0;
|
||||
|
||||
let $wait_counter= $wait_counter_init;
|
||||
|
||||
# Keep track of how many times the wait condition is tested
|
||||
let $wait_condition_reps= 0;
|
||||
let $prev_trx_age= 0;
|
||||
while ($wait_counter)
|
||||
{
|
||||
let $trx_age = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS
|
||||
WHERE VARIABLE_NAME = 'INNODB_PURGE_TRX_ID_AGE';`;
|
||||
|
||||
if ($trx_age != $prev_trx_age)
|
||||
{
|
||||
let $wait_counter= $wait_counter_init;
|
||||
let $prev_trx_age= $trx_age;
|
||||
}
|
||||
|
||||
let $success= `SELECT $trx_age < 1`;
|
||||
inc $wait_condition_reps;
|
||||
if ($success)
|
||||
{
|
||||
let $wait_counter= 0;
|
||||
}
|
||||
if (!$success)
|
||||
{
|
||||
set global innodb_purge_run_now=ON;
|
||||
real_sleep 0.1;
|
||||
dec $wait_counter;
|
||||
}
|
||||
}
|
||||
if (!$success)
|
||||
{
|
||||
echo Timeout in wait_innodb_all_purged.inc for INNODB_PURGE_TRX_ID_AGE = $trx_age;
|
||||
}
|
||||
|
||||
--enable_query_log
|
||||
}
|
||||
|
|
@ -176,4 +176,14 @@ ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
|
|||
# There must be no UPDATE query event;
|
||||
include/show_binlog_events.inc
|
||||
drop table t1, t2;
|
||||
*** MDEV-11937: InnoDB flushes redo log too often ***
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
SET @old_flush = @@GLOBAL.innodb_flush_log_at_trx_commit;
|
||||
SET GLOBAL innodb_flush_log_at_trx_commit=1;
|
||||
SELECT IF(@num_sync < 100*1.5, "OK",
|
||||
CONCAT("ERROR: More than 1 fsync per commit (saw ", @num_sync/100, ")")) AS status;
|
||||
status
|
||||
OK
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL innodb_flush_log_at_trx_commit=@old_flush;
|
||||
End of tests
|
||||
|
|
|
|||
|
|
@ -172,4 +172,33 @@ source include/show_binlog_events.inc;
|
|||
# cleanup bug#27716
|
||||
drop table t1, t2;
|
||||
|
||||
--echo *** MDEV-11937: InnoDB flushes redo log too often ***
|
||||
|
||||
# Count number of log fsyncs reported by InnoDB per commit.
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
|
||||
SET @old_flush = @@GLOBAL.innodb_flush_log_at_trx_commit;
|
||||
SET GLOBAL innodb_flush_log_at_trx_commit=1;
|
||||
|
||||
--let $syncs1 = query_get_value(SHOW STATUS LIKE 'Innodb_os_log_fsyncs', Value, 1)
|
||||
--let $ROWS = 100
|
||||
--disable_query_log
|
||||
let $count = $ROWS;
|
||||
while ($count) {
|
||||
eval INSERT INTO t1 VALUES ($count);
|
||||
dec $count;
|
||||
}
|
||||
--let $syncs2 = query_get_value(SHOW STATUS LIKE 'Innodb_os_log_fsyncs', Value, 1)
|
||||
eval SET @num_sync = $syncs2 - $syncs1;
|
||||
--enable_query_log
|
||||
|
||||
# Allow a bit of slack, in case some background process or something
|
||||
# is introducing a few more syncs.
|
||||
eval SELECT IF(@num_sync < $ROWS*1.5, "OK",
|
||||
CONCAT("ERROR: More than 1 fsync per commit (saw ", @num_sync/$ROWS, ")")) AS status;
|
||||
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL innodb_flush_log_at_trx_commit=@old_flush;
|
||||
|
||||
|
||||
--echo End of tests
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
set global innodb_compression_algorithm = 1;
|
||||
# Create and populate a tables
|
||||
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
|
||||
|
|
@ -5,6 +7,7 @@ CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ROW_FOR
|
|||
CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=NO;
|
||||
CREATE TABLE t4 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1;
|
||||
CREATE TABLE t5 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
|
||||
CREATE TABLE t6 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
|
||||
# Write file to make mysql-test-run.pl expect the "crash", but don't
|
||||
# start it until it's told to
|
||||
# We give 30 seconds to do a clean shutdown because we do not want
|
||||
|
|
@ -16,6 +19,27 @@ CREATE TABLE t5 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_CO
|
|||
# Run innochecksum on t3
|
||||
# Run innochecksum on t4
|
||||
# Run innochecksum on t4
|
||||
# Run innochecksum on t5
|
||||
# Run innochecksum on t6
|
||||
# Backup tables before corrupting
|
||||
# Corrupt FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
|
||||
# Run innochecksum on t2
|
||||
# Run innochecksum on t3
|
||||
# no encryption corrupting the field should not have effect
|
||||
# Run innochecksum on t6
|
||||
# no encryption corrupting the field should not have effect
|
||||
# Restore the original tables
|
||||
# Corrupt FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION+4 (post encryption checksum)
|
||||
# Run innochecksum on t2
|
||||
# Run innochecksum on t3
|
||||
# Run innochecksum on t6
|
||||
# no encryption corrupting the field should not have effect
|
||||
# Restore the original tables
|
||||
# Corrupt FIL_DATA+10 (data)
|
||||
# Run innochecksum on t2
|
||||
# Run innochecksum on t3
|
||||
# Run innochecksum on t6
|
||||
# Restore the original tables
|
||||
# Write file to make mysql-test-run.pl start up the server again
|
||||
# Cleanup
|
||||
DROP TABLE t1, t2, t3, t4, t5;
|
||||
DROP TABLE t1, t2, t3, t4, t5, t6;
|
||||
|
|
|
|||
|
|
@ -2,21 +2,25 @@
|
|||
# MDEV-8773: InnoDB innochecksum does not work with encrypted or page compressed tables
|
||||
#
|
||||
|
||||
# Don't test under embedded
|
||||
--source include/innodb_page_size_small.inc
|
||||
# Don't test under embedded as we restart server
|
||||
-- source include/not_embedded.inc
|
||||
# Require InnoDB
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_file_key_management_plugin.inc
|
||||
-- source include/innodb_page_size_small.inc
|
||||
|
||||
if (!$INNOCHECKSUM) {
|
||||
--echo Need innochecksum binary
|
||||
--die Need innochecksum binary
|
||||
}
|
||||
|
||||
let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
|
||||
|
||||
--disable_warnings
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
# zlib
|
||||
set global innodb_compression_algorithm = 1;
|
||||
--enable_warnings
|
||||
|
||||
--echo # Create and populate a tables
|
||||
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
|
||||
|
|
@ -24,9 +28,11 @@ CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ROW_FOR
|
|||
CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ENCRYPTED=NO;
|
||||
CREATE TABLE t4 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1;
|
||||
CREATE TABLE t5 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
|
||||
CREATE TABLE t6 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
|
||||
|
||||
--disable_query_log
|
||||
--let $i = 1000
|
||||
begin;
|
||||
while ($i)
|
||||
{
|
||||
INSERT INTO t1 (b) VALUES (REPEAT('abcdefghijklmnopqrstuvwxyz', 100));
|
||||
|
|
@ -36,6 +42,8 @@ INSERT INTO t2 SELECT * FROM t1;
|
|||
INSERT INTO t3 SELECT * FROM t1;
|
||||
INSERT INTO t4 SELECT * FROM t1;
|
||||
INSERT INTO t5 SELECT * FROM t1;
|
||||
INSERT INTO t6 SELECT * FROM t1;
|
||||
commit;
|
||||
--enable_query_log
|
||||
|
||||
let $MYSQLD_DATADIR=`select @@datadir`;
|
||||
|
|
@ -44,6 +52,10 @@ let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd;
|
|||
let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd;
|
||||
let t4_IBD = $MYSQLD_DATADIR/test/t4.ibd;
|
||||
let t5_IBD = $MYSQLD_DATADIR/test/t5.ibd;
|
||||
let t6_IBD = $MYSQLD_DATADIR/test/t6.ibd;
|
||||
|
||||
let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
|
||||
let MYSQLD_DATADIR=`select @@datadir`;
|
||||
|
||||
--echo # Write file to make mysql-test-run.pl expect the "crash", but don't
|
||||
--echo # start it until it's told to
|
||||
|
|
@ -77,17 +89,198 @@ shutdown_server 30;
|
|||
|
||||
--exec $INNOCHECKSUM $t4_IBD
|
||||
|
||||
--echo # Run innochecksum on t5
|
||||
|
||||
--exec $INNOCHECKSUM $t5_IBD
|
||||
|
||||
--echo # Run innochecksum on t6
|
||||
|
||||
--exec $INNOCHECKSUM $t6_IBD
|
||||
|
||||
--enable_result_log
|
||||
|
||||
--echo # Backup tables before corrupting
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t1.ibd.backup
|
||||
--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_DATADIR/test/t2.ibd.backup
|
||||
--copy_file $MYSQLD_DATADIR/test/t3.ibd $MYSQLD_DATADIR/test/t3.ibd.backup
|
||||
--copy_file $MYSQLD_DATADIR/test/t4.ibd $MYSQLD_DATADIR/test/t4.ibd.backup
|
||||
--copy_file $MYSQLD_DATADIR/test/t5.ibd $MYSQLD_DATADIR/test/t5.ibd.backup
|
||||
--copy_file $MYSQLD_DATADIR/test/t6.ibd $MYSQLD_DATADIR/test/t6.ibd.backup
|
||||
|
||||
#
|
||||
# MDEV-11939: innochecksum mistakes a file for an encrypted one
|
||||
#
|
||||
|
||||
--echo # Corrupt FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
|
||||
|
||||
perl;
|
||||
open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t1.ibd") or die "open";
|
||||
binmode FILE;
|
||||
seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 26, SEEK_SET) or die "seek";
|
||||
print FILE pack("H*", "c00lcafedeadb017");
|
||||
close FILE or die "close";
|
||||
open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t2.ibd") or die "open";
|
||||
binmode FILE;
|
||||
seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 26, SEEK_SET) or die "seek";
|
||||
print FILE pack("H*", "c00lcafedeadb017");
|
||||
close FILE or die "close";
|
||||
open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t3.ibd") or die "open";
|
||||
binmode FILE;
|
||||
seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 26, SEEK_SET) or die "seek";
|
||||
print FILE pack("H*", "c00lcafedeadb017");
|
||||
close FILE or die "close";
|
||||
open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t6.ibd") or die "open";
|
||||
binmode FILE;
|
||||
seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 26, SEEK_SET) or die "seek";
|
||||
print FILE pack("H*", "c00lcafedeadb017");
|
||||
close FILE or die "close";
|
||||
EOF
|
||||
|
||||
-- disable_result_log
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM $t1_IBD
|
||||
|
||||
--echo # Run innochecksum on t2
|
||||
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM $t2_IBD
|
||||
|
||||
--echo # Run innochecksum on t3
|
||||
--echo # no encryption corrupting the field should not have effect
|
||||
--exec $INNOCHECKSUM $t3_IBD
|
||||
|
||||
--echo # Run innochecksum on t6
|
||||
--echo # no encryption corrupting the field should not have effect
|
||||
--exec $INNOCHECKSUM $t6_IBD
|
||||
|
||||
--enable_result_log
|
||||
|
||||
--echo # Restore the original tables
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.ibd
|
||||
--remove_file $MYSQLD_DATADIR/test/t2.ibd
|
||||
--remove_file $MYSQLD_DATADIR/test/t3.ibd
|
||||
--remove_file $MYSQLD_DATADIR/test/t4.ibd
|
||||
--remove_file $MYSQLD_DATADIR/test/t5.ibd
|
||||
--remove_file $MYSQLD_DATADIR/test/t6.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.ibd.backup $MYSQLD_DATADIR/test/t1.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t2.ibd.backup $MYSQLD_DATADIR/test/t2.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t3.ibd.backup $MYSQLD_DATADIR/test/t3.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t4.ibd.backup $MYSQLD_DATADIR/test/t4.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t5.ibd.backup $MYSQLD_DATADIR/test/t5.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t6.ibd.backup $MYSQLD_DATADIR/test/t6.ibd
|
||||
|
||||
--echo # Corrupt FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION+4 (post encryption checksum)
|
||||
|
||||
perl;
|
||||
open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t1.ibd") or die "open";
|
||||
binmode FILE;
|
||||
seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 30, SEEK_SET) or die "seek";
|
||||
print FILE pack("H*", "c00lcafedeadb017");
|
||||
close FILE or die "close";
|
||||
open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t2.ibd") or die "open";
|
||||
binmode FILE;
|
||||
seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 30, SEEK_SET) or die "seek";
|
||||
print FILE pack("H*", "c00lcafedeadb017");
|
||||
close FILE or die "close";
|
||||
open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t3.ibd") or die "open";
|
||||
binmode FILE;
|
||||
seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 30, SEEK_SET) or die "seek";
|
||||
print FILE pack("H*", "c00lcafedeadb017");
|
||||
close FILE or die "close";
|
||||
open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t6.ibd") or die "open";
|
||||
binmode FILE;
|
||||
seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 30, SEEK_SET) or die "seek";
|
||||
print FILE pack("H*", "c00lcafedeadb017");
|
||||
close FILE or die "close";
|
||||
EOF
|
||||
|
||||
-- disable_result_log
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM $t1_IBD
|
||||
|
||||
--echo # Run innochecksum on t2
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM $t2_IBD
|
||||
|
||||
--echo # Run innochecksum on t3
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM $t3_IBD
|
||||
|
||||
--echo # Run innochecksum on t6
|
||||
--echo # no encryption corrupting the field should not have effect
|
||||
--exec $INNOCHECKSUM $t6_IBD
|
||||
|
||||
--enable_result_log
|
||||
|
||||
--echo # Restore the original tables
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.ibd
|
||||
--remove_file $MYSQLD_DATADIR/test/t2.ibd
|
||||
--remove_file $MYSQLD_DATADIR/test/t3.ibd
|
||||
--remove_file $MYSQLD_DATADIR/test/t4.ibd
|
||||
--remove_file $MYSQLD_DATADIR/test/t5.ibd
|
||||
--remove_file $MYSQLD_DATADIR/test/t6.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.ibd.backup $MYSQLD_DATADIR/test/t1.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t2.ibd.backup $MYSQLD_DATADIR/test/t2.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t3.ibd.backup $MYSQLD_DATADIR/test/t3.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t4.ibd.backup $MYSQLD_DATADIR/test/t4.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t5.ibd.backup $MYSQLD_DATADIR/test/t5.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t6.ibd.backup $MYSQLD_DATADIR/test/t6.ibd
|
||||
|
||||
--echo # Corrupt FIL_DATA+10 (data)
|
||||
|
||||
perl;
|
||||
open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t1.ibd") or die "open";
|
||||
binmode FILE;
|
||||
seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 48, SEEK_SET) or die "seek";
|
||||
print FILE pack("H*", "c00lcafedeadb017");
|
||||
close FILE or die "close";
|
||||
open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t2.ibd") or die "open";
|
||||
binmode FILE;
|
||||
seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 48, SEEK_SET) or die "seek";
|
||||
print FILE pack("H*", "c00lcafedeadb017");
|
||||
close FILE or die "close";
|
||||
open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t3.ibd") or die "open";
|
||||
binmode FILE;
|
||||
seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 48, SEEK_SET) or die "seek";
|
||||
print FILE pack("H*", "c00lcafedeadb017");
|
||||
close FILE or die "close";
|
||||
open(FILE, "+<", "$ENV{MYSQLD_DATADIR}/test/t6.ibd") or die "open";
|
||||
binmode FILE;
|
||||
seek(FILE, $ENV{'INNODB_PAGE_SIZE'} * 3 + 48, SEEK_SET) or die "seek";
|
||||
print FILE pack("H*", "c00lcafedeadb017");
|
||||
close FILE or die "close";
|
||||
EOF
|
||||
|
||||
-- disable_result_log
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM $t1_IBD
|
||||
|
||||
--echo # Run innochecksum on t2
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM $t2_IBD
|
||||
|
||||
--echo # Run innochecksum on t3
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM $t3_IBD
|
||||
|
||||
--echo # Run innochecksum on t6
|
||||
--error 1
|
||||
--exec $INNOCHECKSUM $t6_IBD
|
||||
|
||||
--enable_result_log
|
||||
|
||||
--echo # Restore the original tables
|
||||
--move_file $MYSQLD_DATADIR/test/t1.ibd.backup $MYSQLD_DATADIR/test/t1.ibd
|
||||
--move_file $MYSQLD_DATADIR/test/t2.ibd.backup $MYSQLD_DATADIR/test/t2.ibd
|
||||
--move_file $MYSQLD_DATADIR/test/t3.ibd.backup $MYSQLD_DATADIR/test/t3.ibd
|
||||
--move_file $MYSQLD_DATADIR/test/t4.ibd.backup $MYSQLD_DATADIR/test/t4.ibd
|
||||
--move_file $MYSQLD_DATADIR/test/t5.ibd.backup $MYSQLD_DATADIR/test/t5.ibd
|
||||
--move_file $MYSQLD_DATADIR/test/t6.ibd.backup $MYSQLD_DATADIR/test/t6.ibd
|
||||
|
||||
--echo # Write file to make mysql-test-run.pl start up the server again
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
--echo # Cleanup
|
||||
DROP TABLE t1, t2, t3, t4, t5;
|
||||
|
||||
# reset system
|
||||
--disable_query_log
|
||||
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig;
|
||||
--enable_query_log
|
||||
DROP TABLE t1, t2, t3, t4, t5, t6;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
set default_storage_engine=innodb;
|
||||
set @old_dbug=@@global.debug_dbug;
|
||||
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
|
||||
CREATE TABLE `t` (
|
||||
`a` BLOB,
|
||||
`b` BLOB,
|
||||
|
|
@ -12,9 +14,7 @@ INSERT INTO t VALUES (REPEAT('a', 16000), REPEAT('b', 16000), DEFAULT, "mm", 2);
|
|||
CREATE INDEX idx ON t(c(100));
|
||||
SET global debug_dbug="+d,ib_purge_virtual_index_callback";
|
||||
UPDATE t SET a = REPEAT('m', 16000) WHERE a like "aaa%";
|
||||
select sleep(3);
|
||||
sleep(3)
|
||||
0
|
||||
InnoDB 0 transactions not purged
|
||||
SET global debug_dbug=@old_dbug;
|
||||
DROP TABLE t;
|
||||
CREATE TABLE t (
|
||||
|
|
@ -29,9 +29,7 @@ INSERT INTO t VALUES (REPEAT('a', 100), REPEAT('b', 100), DEFAULT, "mm", 2);
|
|||
CREATE INDEX idx ON t(c(100));
|
||||
SET global debug_dbug="+d,ib_purge_virtual_index_callback";
|
||||
UPDATE t SET a = REPEAT('m', 100) WHERE a like "aaa%";
|
||||
select sleep(3);
|
||||
sleep(3)
|
||||
0
|
||||
InnoDB 0 transactions not purged
|
||||
SET global debug_dbug=@old_dbug;
|
||||
DROP TABLE t;
|
||||
CREATE TABLE t1 (
|
||||
|
|
@ -52,9 +50,7 @@ insert into t1 values(4, 18, default);
|
|||
CREATE INDEX idx ON t1(x);
|
||||
SET global debug_dbug="+d,ib_purge_virtual_index_callback";
|
||||
UPDATE t1 SET id = 10 WHERE id = 1;
|
||||
select sleep(3);
|
||||
sleep(3)
|
||||
0
|
||||
InnoDB 0 transactions not purged
|
||||
SET global debug_dbug=@old_dbug;
|
||||
DROP TABLE t1;
|
||||
connect con1,localhost,root,,;
|
||||
|
|
@ -80,7 +76,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR uncommitted';
|
|||
# enable purge
|
||||
COMMIT;
|
||||
# wait for purge to process the deleted records.
|
||||
Timeout in wait_innodb_all_purged.inc for INNODB_PURGE_TRX_ID_AGE = 4
|
||||
InnoDB 0 transactions not purged
|
||||
SET DEBUG_SYNC= 'now SIGNAL purged';
|
||||
connection default;
|
||||
/* connection default */ ALTER TABLE t1 ADD COLUMN c INT GENERATED ALWAYS AS(a+b), ADD INDEX idx (c), ALGORITHM=INPLACE, LOCK=SHARED;
|
||||
|
|
@ -119,6 +115,7 @@ INSERT INTO t1(a, b) VALUES (8, 8);
|
|||
# enable purge
|
||||
COMMIT;
|
||||
# wait for purge to process the deleted/updated records.
|
||||
InnoDB 1 transactions not purged
|
||||
SET DEBUG_SYNC= 'now SIGNAL purged';
|
||||
disconnect con1;
|
||||
connection default;
|
||||
|
|
@ -141,20 +138,26 @@ DROP TABLE t0, t1;
|
|||
create table t (a blob, b blob, c blob as (concat(a,b)), h varchar(10), index (c(100)));
|
||||
insert t(a,b,h) values (repeat('g', 16000), repeat('x', 16000), "kk");
|
||||
insert t(a,b,h) values (repeat('a', 16000), repeat('b', 16000), "mm");
|
||||
set global innodb_purge_stop_now = 1;
|
||||
set global debug_dbug="+d,ib_purge_virtual_index_callback";
|
||||
connect prevent_purge, localhost, root;
|
||||
start transaction with consistent snapshot;
|
||||
connection default;
|
||||
update t set a = repeat('m', 16000) where a like "aaa%";
|
||||
connect con1, localhost, root;
|
||||
lock table t write;
|
||||
disconnect prevent_purge;
|
||||
connection default;
|
||||
set global innodb_purge_run_now=1;
|
||||
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
|
||||
variable_value>1
|
||||
1
|
||||
disconnect con1;
|
||||
start transaction with consistent snapshot;
|
||||
commit;
|
||||
InnoDB 0 transactions not purged
|
||||
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
|
||||
variable_value>1
|
||||
0
|
||||
set global debug_dbug=@old_dbug;
|
||||
drop table t;
|
||||
set debug_sync=reset;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
|
||||
#
|
||||
# Bug#21869656 UNDO LOG DOES NOT CONTAIN ENOUGH INFORMATION
|
||||
# ON INDEXED VIRTUAL COLUMNS
|
||||
|
|
@ -21,6 +23,7 @@ connection con1;
|
|||
COMMIT;
|
||||
UPDATE t1 SET a=1;
|
||||
connection default;
|
||||
InnoDB 0 transactions not purged
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
|
|
@ -119,6 +122,7 @@ connection con1;
|
|||
COMMIT;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
InnoDB 0 transactions not purged
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
|
|
@ -138,3 +142,4 @@ CREATE TABLE t1 (a VARCHAR(30), b INT, a2 VARCHAR(30) GENERATED ALWAYS AS (a) VI
|
|||
CREATE INDEX idx ON t1(a2(10), b, a2(20));
|
||||
ERROR 42S21: Duplicate column name 'a2'
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
|
||||
set default_storage_engine=innodb;
|
||||
set @old_dbug=@@global.debug_dbug;
|
||||
# Ensure that the history list length will actually be decremented by purge.
|
||||
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
|
||||
|
||||
CREATE TABLE `t` (
|
||||
`a` BLOB,
|
||||
|
|
@ -21,11 +24,10 @@ CREATE INDEX idx ON t(c(100));
|
|||
|
||||
SET global debug_dbug="+d,ib_purge_virtual_index_callback";
|
||||
UPDATE t SET a = REPEAT('m', 16000) WHERE a like "aaa%";
|
||||
select sleep(3);
|
||||
--source ../../innodb/include/wait_all_purged.inc
|
||||
SET global debug_dbug=@old_dbug;
|
||||
DROP TABLE t;
|
||||
|
||||
|
||||
CREATE TABLE t (
|
||||
a TINYBLOB,
|
||||
b TINYBLOB,
|
||||
|
|
@ -41,7 +43,7 @@ CREATE INDEX idx ON t(c(100));
|
|||
|
||||
SET global debug_dbug="+d,ib_purge_virtual_index_callback";
|
||||
UPDATE t SET a = REPEAT('m', 100) WHERE a like "aaa%";
|
||||
select sleep(3);
|
||||
--source ../../innodb/include/wait_all_purged.inc
|
||||
SET global debug_dbug=@old_dbug;
|
||||
DROP TABLE t;
|
||||
|
||||
|
|
@ -68,7 +70,7 @@ CREATE INDEX idx ON t1(x);
|
|||
|
||||
SET global debug_dbug="+d,ib_purge_virtual_index_callback";
|
||||
UPDATE t1 SET id = 10 WHERE id = 1;
|
||||
select sleep(3);
|
||||
--source ../../innodb/include/wait_all_purged.inc
|
||||
SET global debug_dbug=@old_dbug;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
|
@ -109,7 +111,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR uncommitted';
|
|||
COMMIT;
|
||||
|
||||
--echo # wait for purge to process the deleted records.
|
||||
--source include/wait_innodb_all_purged.inc
|
||||
--source ../../innodb/include/wait_all_purged.inc
|
||||
|
||||
SET DEBUG_SYNC= 'now SIGNAL purged';
|
||||
|
||||
|
|
@ -154,7 +156,7 @@ INSERT INTO t1(a, b) VALUES (8, 8);
|
|||
COMMIT;
|
||||
|
||||
--echo # wait for purge to process the deleted/updated records.
|
||||
--source include/wait_innodb_all_purged.inc
|
||||
--source ../../innodb/include/wait_all_purged.inc
|
||||
|
||||
SET DEBUG_SYNC= 'now SIGNAL purged';
|
||||
|
||||
|
|
@ -175,20 +177,24 @@ DROP TABLE t0, t1;
|
|||
create table t (a blob, b blob, c blob as (concat(a,b)), h varchar(10), index (c(100)));
|
||||
insert t(a,b,h) values (repeat('g', 16000), repeat('x', 16000), "kk");
|
||||
insert t(a,b,h) values (repeat('a', 16000), repeat('b', 16000), "mm");
|
||||
set global innodb_purge_stop_now = 1;
|
||||
set global debug_dbug="+d,ib_purge_virtual_index_callback";
|
||||
connect(prevent_purge, localhost, root);
|
||||
start transaction with consistent snapshot;
|
||||
connection default;
|
||||
update t set a = repeat('m', 16000) where a like "aaa%";
|
||||
connect(con1, localhost, root);
|
||||
lock table t write;
|
||||
disconnect prevent_purge;
|
||||
connection default;
|
||||
set global innodb_purge_run_now=1;
|
||||
sleep 3;
|
||||
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
|
||||
disconnect con1;
|
||||
sleep 3;
|
||||
start transaction with consistent snapshot;
|
||||
commit;
|
||||
--source ../../innodb/include/wait_all_purged.inc
|
||||
select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
|
||||
set global debug_dbug=@old_dbug;
|
||||
drop table t;
|
||||
|
||||
--source include/wait_until_count_sessions.inc
|
||||
set debug_sync=reset;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/count_sessions.inc
|
||||
|
||||
# Ensure that the history list length will actually be decremented by purge.
|
||||
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#21869656 UNDO LOG DOES NOT CONTAIN ENOUGH INFORMATION
|
||||
--echo # ON INDEXED VIRTUAL COLUMNS
|
||||
|
|
@ -32,8 +36,7 @@ COMMIT;
|
|||
UPDATE t1 SET a=1;
|
||||
|
||||
connection default;
|
||||
# wait for purge to process the update_undo record (in debug builds)
|
||||
--source include/wait_innodb_all_purged.inc
|
||||
--source ../../innodb/include/wait_all_purged.inc
|
||||
|
||||
CHECK TABLE t1;
|
||||
SELECT b1 FROM t1;
|
||||
|
|
@ -118,8 +121,7 @@ COMMIT;
|
|||
disconnect con1;
|
||||
|
||||
connection default;
|
||||
# wait for purge to process the update_undo record (in debug builds)
|
||||
--source include/wait_innodb_all_purged.inc
|
||||
--source ../../innodb/include/wait_all_purged.inc
|
||||
|
||||
CHECK TABLE t1;
|
||||
SELECT b1 FROM t1;
|
||||
|
|
@ -136,3 +138,4 @@ CREATE INDEX idx ON t1(a2(10), b, a2(20));
|
|||
DROP TABLE t1;
|
||||
|
||||
--source include/wait_until_count_sessions.inc
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_innodb_16k.inc
|
||||
|
||||
# turn on flags
|
||||
|
|
@ -47,17 +46,17 @@ INFORMATION_SCHEMA.INNODB_BUFFER_PAGE s2
|
|||
where s1.SPACE = s2.SPACE AND NAME like 'test/tab1%'
|
||||
and PAGE_TYPE = "INDEX" order by PAGE_NUMBER, NUMBER_RECORDS;
|
||||
|
||||
set global innodb_purge_stop_now=ON;
|
||||
begin;
|
||||
delete from tab1 where a = 12;
|
||||
delete from tab1 where a = 13;
|
||||
delete from tab1 where a = 14;
|
||||
delete from tab1 where a = 5;
|
||||
delete from tab1 where a = 6;
|
||||
delete from tab1 where a = 7;
|
||||
set global innodb_purge_run_now=ON;
|
||||
commit;
|
||||
|
||||
# wait for purge view progress (records are deleted actually by purge)
|
||||
--source include/wait_innodb_all_purged.inc
|
||||
--source include/wait_all_purged.inc
|
||||
|
||||
# not merged yet
|
||||
# | 1,2,3,4 | 8,9,10,11 |
|
||||
|
|
@ -72,34 +71,27 @@ INFORMATION_SCHEMA.INNODB_BUFFER_PAGE s2
|
|||
where s1.SPACE = s2.SPACE AND NAME like 'test/tab1%'
|
||||
and PAGE_TYPE = "INDEX" order by PAGE_NUMBER, NUMBER_RECORDS;
|
||||
|
||||
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 11;
|
||||
set global innodb_purge_run_now=ON;
|
||||
# wait for purge view progress (records are deleted actually by purge)
|
||||
--source include/wait_innodb_all_purged.inc
|
||||
--source include/wait_all_purged.inc
|
||||
|
||||
--echo # check page merge happens (MERGE_THRESHOLD=50 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
||||
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 10;
|
||||
set global innodb_purge_run_now=ON;
|
||||
# wait for purge view progress (records are deleted actually by purge)
|
||||
--source include/wait_innodb_all_purged.inc
|
||||
--source include/wait_all_purged.inc
|
||||
|
||||
--echo # check page merge happens (MERGE_THRESHOLD=35 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
||||
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 9;
|
||||
set global innodb_purge_run_now=ON;
|
||||
# wait for purge view progress (records are deleted actually by purge)
|
||||
--source include/wait_innodb_all_purged.inc
|
||||
--source include/wait_all_purged.inc
|
||||
|
||||
--echo # check page merge happens (MERGE_THRESHOLD=25 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_innodb_16k.inc
|
||||
|
||||
# turn on flags
|
||||
|
|
@ -79,7 +78,7 @@ INFORMATION_SCHEMA.INNODB_BUFFER_PAGE s2
|
|||
where s1.SPACE = s2.SPACE AND NAME like 'test/tab1%'
|
||||
and PAGE_TYPE = "INDEX" order by PAGE_NUMBER, NUMBER_RECORDS;
|
||||
|
||||
set global innodb_purge_stop_now=ON;
|
||||
begin;
|
||||
delete from tab1 where a = 33;
|
||||
delete from tab1 where a = 34;
|
||||
delete from tab1 where a = 35;
|
||||
|
|
@ -100,10 +99,10 @@ delete from tab1 where a = 18;
|
|||
delete from tab1 where a = 19;
|
||||
delete from tab1 where a = 20;
|
||||
delete from tab1 where a = 21;
|
||||
set global innodb_purge_run_now=ON;
|
||||
commit;
|
||||
|
||||
# wait for purge view progress (records are deleted actually by purge)
|
||||
--source include/wait_innodb_all_purged.inc
|
||||
--source include/wait_all_purged.inc
|
||||
|
||||
# secondary index is not merged yet
|
||||
# | 1,..,11 | 22,..,32 |
|
||||
|
|
@ -119,33 +118,27 @@ where s1.SPACE = s2.SPACE AND NAME like 'test/tab1%'
|
|||
and PAGE_TYPE = "INDEX" order by PAGE_NUMBER, NUMBER_RECORDS;
|
||||
|
||||
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 32;
|
||||
set global innodb_purge_run_now=ON;
|
||||
# wait for purge view progress (records are deleted actually by purge)
|
||||
--source include/wait_innodb_all_purged.inc
|
||||
--source include/wait_all_purged.inc
|
||||
|
||||
--echo # check page merge happens (MERGE_THRESHOLD=50 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
||||
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 31;
|
||||
set global innodb_purge_run_now=ON;
|
||||
# wait for purge view progress (records are deleted actually by purge)
|
||||
--source include/wait_innodb_all_purged.inc
|
||||
--source include/wait_all_purged.inc
|
||||
|
||||
--echo # check page merge happens (MERGE_THRESHOLD=45 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
||||
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 30;
|
||||
set global innodb_purge_run_now=ON;
|
||||
# wait for purge view progress (records are deleted actually by purge)
|
||||
--source include/wait_innodb_all_purged.inc
|
||||
--source include/wait_all_purged.inc
|
||||
|
||||
--echo # check page merge happens (MERGE_THRESHOLD=40 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_innodb_16k.inc
|
||||
|
||||
# turn on flags
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
|
||||
CREATE TABLE tab(a BIGINT PRIMARY KEY,c1 TINYTEXT,c2 TEXT,c3 MEDIUMTEXT,
|
||||
c4 TINYBLOB,c5 BLOB,c6 MEDIUMBLOB,c7 LONGBLOB) ENGINE=InnoDB;
|
||||
CREATE INDEX index1 ON tab(c1(255)) COMMENT 'Check index level merge MERGE_THRESHOLD=51';
|
||||
|
|
@ -205,14 +207,15 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
3 2
|
||||
4 7
|
||||
5 7
|
||||
set global innodb_purge_stop_now=ON;
|
||||
begin;
|
||||
delete from tab1 where a = 12;
|
||||
delete from tab1 where a = 13;
|
||||
delete from tab1 where a = 14;
|
||||
delete from tab1 where a = 5;
|
||||
delete from tab1 where a = 6;
|
||||
delete from tab1 where a = 7;
|
||||
set global innodb_purge_run_now=ON;
|
||||
commit;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (nothing is expected)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -228,27 +231,24 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
3 2
|
||||
4 4
|
||||
5 4
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 11;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 1
|
||||
index_page_merge_successful 1
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 10;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=35 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 2
|
||||
index_page_merge_successful 2
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 9;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=25 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -288,14 +288,15 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
3 2
|
||||
4 7
|
||||
5 7
|
||||
set global innodb_purge_stop_now=ON;
|
||||
begin;
|
||||
delete from tab1 where a = 12;
|
||||
delete from tab1 where a = 13;
|
||||
delete from tab1 where a = 14;
|
||||
delete from tab1 where a = 5;
|
||||
delete from tab1 where a = 6;
|
||||
delete from tab1 where a = 7;
|
||||
set global innodb_purge_run_now=ON;
|
||||
commit;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (nothing is expected)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -311,27 +312,24 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
3 2
|
||||
4 4
|
||||
5 4
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 11;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 0
|
||||
index_page_merge_successful 0
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 10;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=35 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 1
|
||||
index_page_merge_successful 1
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 9;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=25 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -371,14 +369,15 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
3 2
|
||||
4 7
|
||||
5 7
|
||||
set global innodb_purge_stop_now=ON;
|
||||
begin;
|
||||
delete from tab1 where a = 12;
|
||||
delete from tab1 where a = 13;
|
||||
delete from tab1 where a = 14;
|
||||
delete from tab1 where a = 5;
|
||||
delete from tab1 where a = 6;
|
||||
delete from tab1 where a = 7;
|
||||
set global innodb_purge_run_now=ON;
|
||||
commit;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (nothing is expected)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -394,27 +393,24 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
3 2
|
||||
4 4
|
||||
5 4
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 11;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 0
|
||||
index_page_merge_successful 0
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 10;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=35 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 0
|
||||
index_page_merge_successful 0
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 9;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=25 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -459,14 +455,15 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
3 2
|
||||
4 7
|
||||
5 7
|
||||
set global innodb_purge_stop_now=ON;
|
||||
begin;
|
||||
delete from tab1 where a = 12;
|
||||
delete from tab1 where a = 13;
|
||||
delete from tab1 where a = 14;
|
||||
delete from tab1 where a = 5;
|
||||
delete from tab1 where a = 6;
|
||||
delete from tab1 where a = 7;
|
||||
set global innodb_purge_run_now=ON;
|
||||
commit;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (nothing is expected)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -483,27 +480,24 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
3 2
|
||||
4 4
|
||||
5 4
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 11;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 0
|
||||
index_page_merge_successful 0
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 10;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=35 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 1
|
||||
index_page_merge_successful 1
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 9;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=25 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -872,7 +866,7 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
4 2
|
||||
27 21
|
||||
28 21
|
||||
set global innodb_purge_stop_now=ON;
|
||||
begin;
|
||||
delete from tab1 where a = 33;
|
||||
delete from tab1 where a = 34;
|
||||
delete from tab1 where a = 35;
|
||||
|
|
@ -893,7 +887,8 @@ delete from tab1 where a = 18;
|
|||
delete from tab1 where a = 19;
|
||||
delete from tab1 where a = 20;
|
||||
delete from tab1 where a = 21;
|
||||
set global innodb_purge_run_now=ON;
|
||||
commit;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (nothing is expected)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -910,27 +905,24 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
4 2
|
||||
27 11
|
||||
28 11
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 32;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 1
|
||||
index_page_merge_successful 1
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 31;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=45 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 2
|
||||
index_page_merge_successful 2
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 30;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=40 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -1000,7 +992,7 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
4 2
|
||||
27 21
|
||||
28 21
|
||||
set global innodb_purge_stop_now=ON;
|
||||
begin;
|
||||
delete from tab1 where a = 33;
|
||||
delete from tab1 where a = 34;
|
||||
delete from tab1 where a = 35;
|
||||
|
|
@ -1021,7 +1013,8 @@ delete from tab1 where a = 18;
|
|||
delete from tab1 where a = 19;
|
||||
delete from tab1 where a = 20;
|
||||
delete from tab1 where a = 21;
|
||||
set global innodb_purge_run_now=ON;
|
||||
commit;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (nothing is expected)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -1038,27 +1031,24 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
4 2
|
||||
27 11
|
||||
28 11
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 32;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 0
|
||||
index_page_merge_successful 0
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 31;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=45 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 1
|
||||
index_page_merge_successful 1
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 30;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=40 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -1128,7 +1118,7 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
4 2
|
||||
27 21
|
||||
28 21
|
||||
set global innodb_purge_stop_now=ON;
|
||||
begin;
|
||||
delete from tab1 where a = 33;
|
||||
delete from tab1 where a = 34;
|
||||
delete from tab1 where a = 35;
|
||||
|
|
@ -1149,7 +1139,8 @@ delete from tab1 where a = 18;
|
|||
delete from tab1 where a = 19;
|
||||
delete from tab1 where a = 20;
|
||||
delete from tab1 where a = 21;
|
||||
set global innodb_purge_run_now=ON;
|
||||
commit;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (nothing is expected)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -1166,27 +1157,24 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
4 2
|
||||
27 11
|
||||
28 11
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 32;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 0
|
||||
index_page_merge_successful 0
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 31;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=45 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 0
|
||||
index_page_merge_successful 0
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 30;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=40 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -1257,7 +1245,7 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
4 2
|
||||
27 21
|
||||
28 21
|
||||
set global innodb_purge_stop_now=ON;
|
||||
begin;
|
||||
delete from tab1 where a = 33;
|
||||
delete from tab1 where a = 34;
|
||||
delete from tab1 where a = 35;
|
||||
|
|
@ -1278,7 +1266,8 @@ delete from tab1 where a = 18;
|
|||
delete from tab1 where a = 19;
|
||||
delete from tab1 where a = 20;
|
||||
delete from tab1 where a = 21;
|
||||
set global innodb_purge_run_now=ON;
|
||||
commit;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (nothing is expected)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -1295,27 +1284,24 @@ PAGE_NUMBER NUMBER_RECORDS
|
|||
4 2
|
||||
27 11
|
||||
28 11
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 32;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 0
|
||||
index_page_merge_successful 0
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 31;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=45 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
name count_reset
|
||||
index_page_merge_attempts 1
|
||||
index_page_merge_successful 1
|
||||
set global innodb_purge_stop_now=ON;
|
||||
delete from tab1 where a = 30;
|
||||
set global innodb_purge_run_now=ON;
|
||||
InnoDB 0 transactions not purged
|
||||
# check page merge happens (MERGE_THRESHOLD=40 causes merge here)
|
||||
SELECT name,count_reset FROM information_schema.innodb_metrics
|
||||
WHERE name like 'index_page_merge_%';
|
||||
|
|
@ -1323,3 +1309,4 @@ name count_reset
|
|||
index_page_merge_attempts 2
|
||||
index_page_merge_successful 2
|
||||
DROP TABLE tab1;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
DROP TABLE if exists t1;
|
||||
DROP TABLE if exists t2;
|
||||
Testing tables with large records
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), c VARCHAR(256), KEY SECOND(a, b,c)) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES (1, REPEAT('A', 256), REPEAT('B', 256));
|
||||
|
|
@ -13,6 +11,7 @@ INSERT INTO t1 (b) SELECT b from t1;
|
|||
INSERT INTO t1 (b) SELECT b from t1;
|
||||
INSERT INTO t1 (b) SELECT b from t1;
|
||||
INSERT INTO t1 (b) SELECT b from t1;
|
||||
SET GLOBAL innodb_fast_shutdown = 0;
|
||||
optimize table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
||||
|
|
@ -57,6 +56,7 @@ insert into t1 values (204, REPEAT('A', 256), REPEAT('B', 256));
|
|||
DROP TABLE t1;
|
||||
Testing table with small records
|
||||
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(16), c VARCHAR(32), KEY SECOND(a,b,c)) ENGINE=INNODB;
|
||||
SET GLOBAL innodb_fast_shutdown = 0;
|
||||
optimize table t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t2 optimize status OK
|
||||
|
|
|
|||
|
|
@ -11,9 +11,11 @@
|
|||
# Check actual behavior for table, partitioned table and temporary table
|
||||
# #############################################################
|
||||
--source include/have_innodb_16k.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_partition.inc
|
||||
|
||||
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
|
||||
|
||||
# Check index merge threshold by create index on all datatypes
|
||||
|
||||
CREATE TABLE tab(a BIGINT PRIMARY KEY,c1 TINYTEXT,c2 TEXT,c3 MEDIUMTEXT,
|
||||
|
|
@ -187,3 +189,4 @@ CREATE INDEX index1 ON tab1(b(750)) COMMENT 'MERGE_THRESHOLD=45';
|
|||
--source suite/innodb/include/innodb_merge_threshold_secondary.inc
|
||||
|
||||
DROP TABLE tab1;
|
||||
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
|
||||
|
|
|
|||
|
|
@ -4,11 +4,6 @@
|
|||
--source include/not_embedded.inc
|
||||
--source include/have_innodb_16k.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE if exists t1;
|
||||
DROP TABLE if exists t2;
|
||||
--enable_warnings
|
||||
|
||||
--echo Testing tables with large records
|
||||
# Create table.
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), c VARCHAR(256), KEY SECOND(a, b,c)) ENGINE=INNODB;
|
||||
|
|
@ -36,7 +31,7 @@ while ($size)
|
|||
}
|
||||
--enable_query_log
|
||||
|
||||
--source include/wait_innodb_all_purged.inc
|
||||
SET GLOBAL innodb_fast_shutdown = 0;
|
||||
--source include/restart_mysqld.inc
|
||||
optimize table t1;
|
||||
|
||||
|
|
@ -135,7 +130,7 @@ while ($size)
|
|||
}
|
||||
--enable_query_log
|
||||
|
||||
--source include/wait_innodb_all_purged.inc
|
||||
SET GLOBAL innodb_fast_shutdown = 0;
|
||||
--source include/restart_mysqld.inc
|
||||
optimize table t2;
|
||||
|
||||
|
|
@ -206,5 +201,3 @@ if ($second_before == $second_after) {
|
|||
}
|
||||
|
||||
DROP TABLE t2;
|
||||
|
||||
--source include/wait_innodb_all_purged.inc
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ allow-mismatches 0
|
|||
write crc32
|
||||
page-type-summary FALSE
|
||||
page-type-dump MYSQLTEST_VARDIR/tmp/dump.txt
|
||||
per-page-details FALSE
|
||||
log (No default value)
|
||||
leaf FALSE
|
||||
merge 0
|
||||
|
|
@ -41,7 +42,7 @@ innochecksum Ver #.#.#
|
|||
Copyright (c) YEAR, YEAR , Oracle, MariaDB Corporation Ab and others.
|
||||
|
||||
InnoDB offline file checksum utility.
|
||||
Usage: innochecksum [-c] [-s <start page>] [-e <end page>] [-p <page>] [-v] [-a <allow mismatches>] [-n] [-C <strict-check>] [-w <write>] [-S] [-D <page type dump>] [-l <log>] [-e] <filename or [-]>
|
||||
Usage: innochecksum [-c] [-s <start page>] [-e <end page>] [-p <page>] [-i] [-v] [-a <allow mismatches>] [-n] [-C <strict-check>] [-w <write>] [-S] [-D <page type dump>] [-l <log>] [-l] [-m <merge pages>] <filename or [-]>
|
||||
-?, --help Displays this help and exits.
|
||||
-I, --info Synonym for --help.
|
||||
-V, --version Displays version information and exits.
|
||||
|
|
@ -62,8 +63,10 @@ Usage: innochecksum [-c] [-s <start page>] [-e <end page>] [-p <page>] [-v] [-a
|
|||
Display a count of each page type in a tablespace.
|
||||
-D, --page-type-dump=name
|
||||
Dump the page type info for each page in a tablespace.
|
||||
-i, --per-page-details
|
||||
Print out per-page detail information.
|
||||
-l, --log=name log output.
|
||||
-e, --leaf Examine leaf index pages
|
||||
-f, --leaf Examine leaf index pages
|
||||
-m, --merge=# leaf page count if merge given number of consecutive
|
||||
pages
|
||||
|
||||
|
|
@ -81,6 +84,7 @@ allow-mismatches 0
|
|||
write crc32
|
||||
page-type-summary FALSE
|
||||
page-type-dump (No default value)
|
||||
per-page-details FALSE
|
||||
log (No default value)
|
||||
leaf FALSE
|
||||
merge 0
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
# Set the environmental variables
|
||||
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
|
||||
call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to.*");
|
||||
[1]: Further Test are for rewrite checksum (innodb|crc32|none) for all ibd file & start the server.
|
||||
CREATE TABLE tab1 (pk INTEGER NOT NULL PRIMARY KEY,
|
||||
linestring_key GEOMETRY NOT NULL,
|
||||
|
|
@ -105,6 +106,7 @@ File::tab#.ibd
|
|||
# Page compressed page
|
||||
# Page compressed encrypted page
|
||||
# Other type of page
|
||||
|
||||
===============================================
|
||||
Additional information:
|
||||
Undo page type: # insert, # update, # other
|
||||
|
|
@ -139,6 +141,7 @@ File::tab#.ibd
|
|||
# Page compressed page
|
||||
# Page compressed encrypted page
|
||||
# Other type of page
|
||||
|
||||
===============================================
|
||||
Additional information:
|
||||
Undo page type: # insert, # update, # other
|
||||
|
|
@ -160,14 +163,14 @@ Filename::tab#.ibd
|
|||
==============================================================================
|
||||
PAGE_NO | PAGE_TYPE | EXTRA INFO
|
||||
==============================================================================
|
||||
#:: # | File Space Header | -
|
||||
#:: # | Insert Buffer Bitmap | -
|
||||
#:: # | Inode page | -
|
||||
#:: # | Index page | index id=#, page level=# leaf #, No. of records=#, garbage=#, n_recs=#, -
|
||||
#:: # | Index page | index id=#, page level=# leaf #, No. of records=#, garbage=#, n_recs=#, -
|
||||
#:: # | Index page | index id=#, page level=# leaf #, No. of records=#, garbage=#, n_recs=#, -
|
||||
#:: # | Index page | index id=#, page level=# leaf #, No. of records=#, garbage=#, n_recs=#, -
|
||||
#:: # | Freshly allocated page | -
|
||||
#::# | File Space Header | -
|
||||
#::# | Insert Buffer Bitmap | -
|
||||
#::# | Inode page | -
|
||||
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
|
||||
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
|
||||
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
|
||||
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
|
||||
#::# | Freshly allocated page | -
|
||||
# Variables used by page type dump for ibdata1
|
||||
|
||||
Variables (--variable-name=value)
|
||||
|
|
@ -184,6 +187,7 @@ allow-mismatches 0
|
|||
write crc32
|
||||
page-type-summary FALSE
|
||||
page-type-dump MYSQLTEST_VARDIR/tmp/dump.txt
|
||||
per-page-details FALSE
|
||||
log (No default value)
|
||||
leaf FALSE
|
||||
merge 0
|
||||
|
|
@ -194,14 +198,14 @@ Filename::tab#.ibd
|
|||
==============================================================================
|
||||
PAGE_NO | PAGE_TYPE | EXTRA INFO
|
||||
==============================================================================
|
||||
#:: # | File Space Header | -
|
||||
#:: # | Insert Buffer Bitmap | -
|
||||
#:: # | Inode page | -
|
||||
#:: # | Index page | index id=#, page level=# leaf #, No. of records=#, garbage=#, n_recs=#, -
|
||||
#:: # | Index page | index id=#, page level=# leaf #, No. of records=#, garbage=#, n_recs=#, -
|
||||
#:: # | Index page | index id=#, page level=# leaf #, No. of records=#, garbage=#, n_recs=#, -
|
||||
#:: # | Index page | index id=#, page level=# leaf #, No. of records=#, garbage=#, n_recs=#, -
|
||||
#:: # | Freshly allocated page | -
|
||||
#::# | File Space Header | -
|
||||
#::# | Insert Buffer Bitmap | -
|
||||
#::# | Inode page | -
|
||||
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
|
||||
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
|
||||
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
|
||||
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
|
||||
#::# | Freshly allocated page | -
|
||||
[6]: check the valid lower bound values for option
|
||||
# allow-mismatches,page,start-page,end-page
|
||||
[9]: check the both short and long options "page" and "start-page" when
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@
|
|||
let MYSQLD_BASEDIR= `SELECT @@basedir`;
|
||||
let MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
|
||||
|
||||
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
|
||||
call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to.*");
|
||||
|
||||
--echo [1]: Further Test are for rewrite checksum (innodb|crc32|none) for all ibd file & start the server.
|
||||
|
||||
|
|
|
|||
|
|
@ -31,16 +31,17 @@ The database buffer buf_pool
|
|||
Created 11/5/1995 Heikki Tuuri
|
||||
*******************************************************/
|
||||
|
||||
#include "ha_prototypes.h"
|
||||
|
||||
#include "univ.i"
|
||||
#include "mtr0types.h"
|
||||
#include "mach0data.h"
|
||||
#include "page0size.h"
|
||||
#include "buf0buf.h"
|
||||
#include "os0api.h"
|
||||
#include <string.h>
|
||||
|
||||
#ifdef UNIV_NONINL
|
||||
#include "buf0buf.ic"
|
||||
#endif
|
||||
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
#include "string.h"
|
||||
#include "mach0data.h"
|
||||
#endif /* UNIV_INNOCHECKSUM */
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
#include "mem0mem.h"
|
||||
#include "btr0btr.h"
|
||||
|
|
@ -64,7 +65,6 @@ Created 11/5/1995 Heikki Tuuri
|
|||
#include "fsp0sysspace.h"
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
#include "page0zip.h"
|
||||
#include "buf0checksum.h"
|
||||
#include "sync0sync.h"
|
||||
#include "buf0dump.h"
|
||||
#include "ut0new.h"
|
||||
|
|
@ -645,10 +645,10 @@ buf_page_is_checksum_valid_crc32(
|
|||
#ifdef UNIV_INNOCHECKSUM
|
||||
if (log_file
|
||||
&& srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_CRC32) {
|
||||
fprintf(log_file, "page::%lu;"
|
||||
fprintf(log_file, "page::%llu;"
|
||||
" crc32 calculated = %u;"
|
||||
" recorded checksum field1 = %lu recorded"
|
||||
" checksum field2 =%lu\n", cur_page_num,
|
||||
" recorded checksum field1 = " ULINTPF " recorded"
|
||||
" checksum field2 =" ULINTPF "\n", cur_page_num,
|
||||
crc32, checksum_field1, checksum_field2);
|
||||
}
|
||||
#endif /* UNIV_INNOCHECKSUM */
|
||||
|
|
@ -702,33 +702,34 @@ buf_page_is_checksum_valid_innodb(
|
|||
#ifdef UNIV_INNOCHECKSUM
|
||||
if (log_file
|
||||
&& srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_INNODB) {
|
||||
fprintf(log_file, "page::%lu;"
|
||||
fprintf(log_file, "page::%llu;"
|
||||
" old style: calculated ="
|
||||
" %lu; recorded = %lu\n",
|
||||
" " ULINTPF "; recorded = " ULINTPF "\n",
|
||||
cur_page_num, old_checksum,
|
||||
checksum_field2);
|
||||
fprintf(log_file, "page::%lu;"
|
||||
fprintf(log_file, "page::%llu;"
|
||||
" new style: calculated ="
|
||||
" %lu; crc32 = %u; recorded = %lu\n",
|
||||
" " ULINTPF "; crc32 = %u; recorded = " ULINTPF "\n",
|
||||
cur_page_num, new_checksum,
|
||||
buf_calc_page_crc32(read_buf), checksum_field1);
|
||||
}
|
||||
|
||||
if (log_file
|
||||
&& srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB) {
|
||||
fprintf(log_file, "page::%lu;"
|
||||
fprintf(log_file, "page::%llu;"
|
||||
" old style: calculated ="
|
||||
" %lu; recorded checksum = %lu\n",
|
||||
" " ULINTPF "; recorded checksum = " ULINTPF "\n",
|
||||
cur_page_num, old_checksum,
|
||||
checksum_field2);
|
||||
fprintf(log_file, "page::%lu;"
|
||||
fprintf(log_file, "page::%llu;"
|
||||
" new style: calculated ="
|
||||
" %lu; recorded checksum = %lu\n",
|
||||
" " ULINTPF "; recorded checksum = " ULINTPF "\n",
|
||||
cur_page_num, new_checksum,
|
||||
checksum_field1);
|
||||
}
|
||||
#endif /* UNIV_INNOCHECKSUM */
|
||||
|
||||
|
||||
if (checksum_field2 != mach_read_from_4(read_buf + FIL_PAGE_LSN)
|
||||
&& checksum_field2 != old_checksum) {
|
||||
DBUG_LOG("checksum",
|
||||
|
|
@ -788,9 +789,9 @@ buf_page_is_checksum_valid_none(
|
|||
if (log_file
|
||||
&& srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_NONE) {
|
||||
fprintf(log_file,
|
||||
"page::%lu; none checksum: calculated"
|
||||
" = %lu; recorded checksum_field1 = %lu"
|
||||
" recorded checksum_field2 = %lu\n",
|
||||
"page::%llu; none checksum: calculated"
|
||||
" = " ULINTPF "; recorded checksum_field1 = " ULINTPF
|
||||
" recorded checksum_field2 = " ULINTPF "\n",
|
||||
cur_page_num, BUF_NO_CHECKSUM_MAGIC,
|
||||
checksum_field1, checksum_field2);
|
||||
}
|
||||
|
|
@ -811,16 +812,18 @@ buf_page_is_corrupted(
|
|||
bool check_lsn,
|
||||
const byte* read_buf,
|
||||
const page_size_t& page_size,
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
const fil_space_t* space)
|
||||
#else
|
||||
const void* space)
|
||||
#endif
|
||||
{
|
||||
ulint checksum_field1;
|
||||
ulint checksum_field2;
|
||||
|
||||
size_t checksum_field1 = 0;
|
||||
size_t checksum_field2 = 0;
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
DBUG_EXECUTE_IF("buf_page_import_corrupt_failure", return(true); );
|
||||
|
||||
ulint page_type = mach_read_from_2(
|
||||
read_buf + FIL_PAGE_TYPE);
|
||||
#endif
|
||||
ulint page_type = mach_read_from_2(read_buf + FIL_PAGE_TYPE);
|
||||
|
||||
/* We can trust page type if page compression is set on tablespace
|
||||
flags because page compression flag means file must have been
|
||||
|
|
@ -833,15 +836,12 @@ buf_page_is_corrupted(
|
|||
decompressed at this stage). */
|
||||
if ((page_type == FIL_PAGE_PAGE_COMPRESSED ||
|
||||
page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED)
|
||||
&& space && FSP_FLAGS_HAS_PAGE_COMPRESSION(space->flags)) {
|
||||
return(false);
|
||||
}
|
||||
#else
|
||||
if (mach_read_from_4(read_buf+FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION) != 0
|
||||
|| mach_read_from_2(read_buf+FIL_PAGE_TYPE) == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED) {
|
||||
return(false);
|
||||
}
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
&& space && FSP_FLAGS_HAS_PAGE_COMPRESSION(space->flags)
|
||||
#endif
|
||||
) {
|
||||
return(false);
|
||||
}
|
||||
|
||||
if (!page_size.is_compressed()
|
||||
&& memcmp(read_buf + FIL_PAGE_LSN + 4,
|
||||
|
|
@ -850,14 +850,13 @@ buf_page_is_corrupted(
|
|||
|
||||
/* Stored log sequence numbers at the start and the end
|
||||
of page do not match */
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
ib::info() << "Log sequence number at the start "
|
||||
<< mach_read_from_4(read_buf + FIL_PAGE_LSN + 4)
|
||||
<< " and the end "
|
||||
<< mach_read_from_4(read_buf + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM + 4)
|
||||
<< " do not match";
|
||||
#endif
|
||||
#endif /* UNIV_INNOCHECKSUM */
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
|
@ -920,10 +919,9 @@ buf_page_is_corrupted(
|
|||
&& *reinterpret_cast<const ib_uint64_t*>(
|
||||
read_buf + FIL_PAGE_LSN) == 0) {
|
||||
|
||||
/* make sure that the page is really empty */
|
||||
|
||||
ulint i;
|
||||
|
||||
/* make sure that the page is really empty */
|
||||
for (i = 0; i < page_size.logical(); ++i) {
|
||||
|
||||
/* The FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID has been
|
||||
|
|
@ -944,7 +942,7 @@ buf_page_is_corrupted(
|
|||
#ifdef UNIV_INNOCHECKSUM
|
||||
if (i >= page_size.logical()) {
|
||||
if (log_file) {
|
||||
fprintf(log_file, "Page::%lu"
|
||||
fprintf(log_file, "Page::%llu"
|
||||
" is empty and uncorrupted\n",
|
||||
cur_page_num);
|
||||
}
|
||||
|
|
@ -978,31 +976,34 @@ buf_page_is_corrupted(
|
|||
|
||||
if (buf_page_is_checksum_valid_none(read_buf,
|
||||
checksum_field1, checksum_field2)) {
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
if (curr_algo
|
||||
== SRV_CHECKSUM_ALGORITHM_STRICT_CRC32) {
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
page_warn_strict_checksum(
|
||||
curr_algo,
|
||||
SRV_CHECKSUM_ALGORITHM_NONE,
|
||||
page_id);
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
}
|
||||
#else /* !UNIV_INNOCHECKSUM */
|
||||
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
if (log_file) {
|
||||
fprintf(log_file, "page::%lu;"
|
||||
fprintf(log_file, "page::%llu;"
|
||||
" old style: calculated = %u;"
|
||||
" recorded = " ULINTPF "\n",
|
||||
" recorded = " ULINTPF ";\n",
|
||||
cur_page_num,
|
||||
buf_calc_page_old_checksum(read_buf),
|
||||
checksum_field2);
|
||||
fprintf(log_file, "page::%lu;"
|
||||
fprintf(log_file, "page::%llu;"
|
||||
" new style: calculated = %u;"
|
||||
" crc32 = %u; recorded = " ULINTPF "\n",
|
||||
" crc32 = %u; recorded = " ULINTPF ";\n",
|
||||
cur_page_num,
|
||||
buf_calc_page_new_checksum(read_buf),
|
||||
buf_calc_page_crc32(read_buf),
|
||||
checksum_field1);
|
||||
}
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
#endif /* UNIV_INNOCHECKSUM */
|
||||
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
|
@ -1022,15 +1023,16 @@ buf_page_is_corrupted(
|
|||
|
||||
if (buf_page_is_checksum_valid_innodb(read_buf,
|
||||
checksum_field1, checksum_field2)) {
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
if (curr_algo
|
||||
== SRV_CHECKSUM_ALGORITHM_STRICT_CRC32) {
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
page_warn_strict_checksum(
|
||||
curr_algo,
|
||||
SRV_CHECKSUM_ALGORITHM_INNODB,
|
||||
page_id);
|
||||
#endif
|
||||
}
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
|
@ -1044,7 +1046,7 @@ buf_page_is_corrupted(
|
|||
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
if (log_file) {
|
||||
fprintf(log_file, "Fail; page %lu"
|
||||
fprintf(log_file, "Fail; page::%llu;"
|
||||
" invalid (fails crc32 checksum)\n",
|
||||
cur_page_num);
|
||||
}
|
||||
|
|
@ -1061,30 +1063,32 @@ buf_page_is_corrupted(
|
|||
|
||||
if (buf_page_is_checksum_valid_none(read_buf,
|
||||
checksum_field1, checksum_field2)) {
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
if (curr_algo
|
||||
== SRV_CHECKSUM_ALGORITHM_STRICT_INNODB) {
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
page_warn_strict_checksum(
|
||||
curr_algo,
|
||||
SRV_CHECKSUM_ALGORITHM_NONE,
|
||||
page_id);
|
||||
#endif
|
||||
}
|
||||
#else /* !UNIV_INNOCHECKSUM */
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
if (log_file) {
|
||||
fprintf(log_file, "page::%lu;"
|
||||
fprintf(log_file, "page::%llu;"
|
||||
" old style: calculated = %u;"
|
||||
" recorded = %lu\n", cur_page_num,
|
||||
" recorded = %zu;\n", cur_page_num,
|
||||
buf_calc_page_old_checksum(read_buf),
|
||||
checksum_field2);
|
||||
fprintf(log_file, "page::%lu;"
|
||||
fprintf(log_file, "page::%llu;"
|
||||
" new style: calculated = %u;"
|
||||
" crc32 = %u; recorded = %lu\n",
|
||||
" crc32 = %u; recorded = %zu;\n",
|
||||
cur_page_num,
|
||||
buf_calc_page_new_checksum(read_buf),
|
||||
buf_calc_page_crc32(read_buf),
|
||||
checksum_field1);
|
||||
}
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
#endif /* UNIV_INNOCHECKSUM */
|
||||
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
|
@ -1092,26 +1096,28 @@ buf_page_is_corrupted(
|
|||
checksum_field1, checksum_field2, false)
|
||||
|| buf_page_is_checksum_valid_crc32(read_buf,
|
||||
checksum_field1, checksum_field2, true)) {
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
|
||||
if (curr_algo
|
||||
== SRV_CHECKSUM_ALGORITHM_STRICT_INNODB) {
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
page_warn_strict_checksum(
|
||||
curr_algo,
|
||||
SRV_CHECKSUM_ALGORITHM_CRC32,
|
||||
page_id);
|
||||
#endif
|
||||
}
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
|
||||
return(false);
|
||||
}
|
||||
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
if (log_file) {
|
||||
fprintf(log_file, "Fail; page %lu"
|
||||
fprintf(log_file, "Fail; page::%llu;"
|
||||
" invalid (fails innodb checksum)\n",
|
||||
cur_page_num);
|
||||
}
|
||||
#endif /* UNIV_INNOCHECKSUM */
|
||||
|
||||
return(true);
|
||||
|
||||
case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
|
||||
|
|
@ -1147,11 +1153,12 @@ buf_page_is_corrupted(
|
|||
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
if (log_file) {
|
||||
fprintf(log_file, "Fail; page %lu"
|
||||
fprintf(log_file, "Fail; page::%llu;"
|
||||
" invalid (fails none checksum)\n",
|
||||
cur_page_num);
|
||||
}
|
||||
#endif /* UNIV_INNOCHECKSUM */
|
||||
|
||||
return(true);
|
||||
|
||||
case SRV_CHECKSUM_ALGORITHM_NONE:
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ Modified Jan Lindström jan.lindstrom@mariadb.com
|
|||
*******************************************************/
|
||||
|
||||
#include "fil0fil.h"
|
||||
#include "mtr0types.h"
|
||||
#include "mach0data.h"
|
||||
#include "page0size.h"
|
||||
#include "page0zip.h"
|
||||
|
|
|
|||
|
|
@ -1688,18 +1688,6 @@ thd_is_replication_slave_thread(
|
|||
return thd && ((ibool) thd_slave_thread(thd));
|
||||
}
|
||||
|
||||
/******************************************************************//**
|
||||
Gets information on the durability property requested by thread.
|
||||
Used when writing either a prepare or commit record to the log
|
||||
buffer. @return the durability property. */
|
||||
enum durability_properties
|
||||
thd_requested_durability(
|
||||
/*=====================*/
|
||||
const THD* thd) /*!< in: thread handle */
|
||||
{
|
||||
return(thd_get_durability_property(thd));
|
||||
}
|
||||
|
||||
/******************************************************************//**
|
||||
Returns true if transaction should be flagged as read-only.
|
||||
@return true if the thd is marked as read-only */
|
||||
|
|
@ -4841,10 +4829,6 @@ innobase_commit(
|
|||
this one, to allow then to group commit with us. */
|
||||
thd_wakeup_subsequent_commits(thd, 0);
|
||||
|
||||
if (!read_only) {
|
||||
trx->flush_log_later = false;
|
||||
}
|
||||
|
||||
/* Now do a write + flush of logs. */
|
||||
trx_commit_complete_for_mysql(trx);
|
||||
|
||||
|
|
|
|||
|
|
@ -570,11 +570,6 @@ bool thd_binlog_filter_ok(const MYSQL_THD thd);
|
|||
*/
|
||||
bool thd_sqlcom_can_generate_row_events(const MYSQL_THD thd);
|
||||
|
||||
/** Gets information on the durability property requested by a thread.
|
||||
@param thd Thread handle
|
||||
@return a durability property. */
|
||||
durability_properties thd_get_durability_property(const MYSQL_THD thd);
|
||||
|
||||
/** Is strict sql_mode set.
|
||||
@param thd Thread object
|
||||
@return True if sql_mode has strict mode (all or trans), false otherwise. */
|
||||
|
|
|
|||
|
|
@ -211,6 +211,7 @@ struct buf_pools_list_size_t {
|
|||
ulint unzip_LRU_bytes; /*!< unzip_LRU size in bytes */
|
||||
ulint flush_list_bytes; /*!< flush_list size in bytes */
|
||||
};
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
|
||||
/** Page identifier. */
|
||||
class page_id_t {
|
||||
|
|
@ -333,6 +334,7 @@ operator<<(
|
|||
std::ostream& out,
|
||||
const page_id_t& page_id);
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
/********************************************************************//**
|
||||
Acquire mutex on all buffer pool instances */
|
||||
UNIV_INLINE
|
||||
|
|
@ -823,9 +825,16 @@ buf_page_is_corrupted(
|
|||
bool check_lsn,
|
||||
const byte* read_buf,
|
||||
const page_size_t& page_size,
|
||||
const fil_space_t* space = NULL)
|
||||
MY_ATTRIBUTE((warn_unused_result));
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
const fil_space_t* space = NULL)
|
||||
#else
|
||||
const void* space = NULL)
|
||||
#endif
|
||||
MY_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
|
||||
/**********************************************************************//**
|
||||
Gets the space id, page offset, and byte offset within page of a
|
||||
pointer pointing to a buffer frame containing a file page. */
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ Created 04/01/2015 Jan Lindström
|
|||
|
||||
#include "os0event.h"
|
||||
#include "my_crypt.h"
|
||||
#endif /*! UNIV_INNOCHECKSUM */
|
||||
|
||||
/**
|
||||
* Magic pattern in start of crypt data on page 0
|
||||
|
|
@ -101,6 +102,8 @@ struct fil_space_rotate_state_t
|
|||
} scrubbing;
|
||||
};
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
|
||||
struct fil_space_crypt_t : st_encryption_scheme
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@ Created 10/25/1995 Heikki Tuuri
|
|||
#define fil0fil_h
|
||||
#include "univ.i"
|
||||
|
||||
struct fil_space_t;
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
|
||||
#include "log0recv.h"
|
||||
|
|
@ -281,22 +279,23 @@ but in the MySQL Embedded Server Library and mysqlbackup it is not the default
|
|||
directory, and we must set the base file path explicitly */
|
||||
extern const char* fil_path_to_mysql_datadir;
|
||||
|
||||
/** Initial size of a single-table tablespace in pages */
|
||||
#define FIL_IBD_FILE_INITIAL_SIZE 4
|
||||
|
||||
/** 'null' (undefined) page offset in the context of file spaces */
|
||||
#define FIL_NULL ULINT32_UNDEFINED
|
||||
|
||||
/* Space address data type; this is intended to be used when
|
||||
addresses accurate to a byte are stored in file pages. If the page part
|
||||
of the address is FIL_NULL, the address is considered undefined. */
|
||||
|
||||
typedef byte fil_faddr_t; /*!< 'type' definition in C: an address
|
||||
stored in a file page is a string of bytes */
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
|
||||
/** Initial size of a single-table tablespace in pages */
|
||||
#define FIL_IBD_FILE_INITIAL_SIZE 4
|
||||
|
||||
/** 'null' (undefined) page offset in the context of file spaces */
|
||||
#define FIL_NULL ULINT32_UNDEFINED
|
||||
|
||||
|
||||
#define FIL_ADDR_PAGE 0 /* first in address is the page offset */
|
||||
#define FIL_ADDR_BYTE 4 /* then comes 2-byte byte offset within page*/
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
#define FIL_ADDR_SIZE 6 /* address size is 6 bytes */
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
|
|
@ -431,8 +430,6 @@ index */
|
|||
#define fil_page_index_page_check(page) \
|
||||
fil_page_type_is_index(fil_page_get_type(page))
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
|
||||
/** Enum values for encryption table option */
|
||||
enum fil_encryption_t {
|
||||
/** Encrypted if innodb_encrypt_tables=ON (srv_encrypt_tables) */
|
||||
|
|
@ -454,6 +451,8 @@ extern ulint fil_n_pending_tablespace_flushes;
|
|||
/** Number of files currently open */
|
||||
extern ulint fil_n_file_opened;
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
|
||||
/** Look up a tablespace.
|
||||
The caller should hold an InnoDB table lock or a MDL that prevents
|
||||
the tablespace from being dropped during the operation,
|
||||
|
|
@ -1315,6 +1314,7 @@ fil_page_reset_type(
|
|||
byte* page,
|
||||
ulint type,
|
||||
mtr_t* mtr);
|
||||
|
||||
/** Get the file page type.
|
||||
@param[in] page file page
|
||||
@return page type */
|
||||
|
|
@ -1325,6 +1325,7 @@ fil_page_get_type(
|
|||
{
|
||||
return(mach_read_from_2(page + FIL_PAGE_TYPE));
|
||||
}
|
||||
|
||||
/** Check (and if needed, reset) the page type.
|
||||
Data files created before MySQL 5.1 may contain
|
||||
garbage in the FIL_PAGE_TYPE field.
|
||||
|
|
|
|||
|
|
@ -158,8 +158,6 @@ descriptor page, but used only in the first. */
|
|||
FSP_FREE_LIMIT at a time */
|
||||
/* @} */
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
|
||||
/* @defgroup File Segment Inode Constants (moved from fsp0fsp.c) @{ */
|
||||
|
||||
/* FILE SEGMENT INODE
|
||||
|
|
@ -293,6 +291,7 @@ the extent are free and which contain old tuple version to clean. */
|
|||
/** Offset of the descriptor array on a descriptor page */
|
||||
#define XDES_ARR_OFFSET (FSP_HEADER_OFFSET + FSP_HEADER_SIZE)
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
/* @} */
|
||||
|
||||
/**********************************************************************//**
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ xdes_calc_descriptor_index(
|
|||
return(ut_2pow_remainder(offset, page_size.physical())
|
||||
/ FSP_EXTENT_SIZE);
|
||||
}
|
||||
#endif /*!UNIV_INNOCHECKSUM */
|
||||
|
||||
/**********************************************************************//**
|
||||
Gets a descriptor bit of a page.
|
||||
|
|
@ -80,6 +81,7 @@ xdes_get_bit(
|
|||
bit_index));
|
||||
}
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
/** Calculates the page where the descriptor of a page resides.
|
||||
@param[in] page_size page size
|
||||
@param[in] offset page offset
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ mach_write_to_2(
|
|||
/*============*/
|
||||
byte* b, /*!< in: pointer to two bytes where to store */
|
||||
ulint n); /*!< in: ulint integer to be stored, >= 0, < 64k */
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
/** The following function is used to fetch data from 2 consecutive
|
||||
bytes. The most significant byte is at the lowest address.
|
||||
@param[in] b pointer to 2 bytes where to store
|
||||
|
|
@ -72,6 +73,8 @@ uint16_t
|
|||
mach_read_from_2(
|
||||
const byte* b)
|
||||
MY_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
/********************************************************//**
|
||||
The following function is used to convert a 16-bit data item
|
||||
to the canonical format, for fast bytewise equality test
|
||||
|
|
@ -362,6 +365,8 @@ mach_write_ulonglong(
|
|||
ulint len, /*!< in: length of dest */
|
||||
bool usign); /*!< in: signed or unsigned flag */
|
||||
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
|
||||
/** Read 1 to 4 bytes from a file page buffered in the buffer pool.
|
||||
@param[in] ptr pointer where to read
|
||||
@param[in] type MLOG_1BYTE, MLOG_2BYTES, or MLOG_4BYTES
|
||||
|
|
@ -373,8 +378,6 @@ mach_read_ulint(
|
|||
mlog_id_t type)
|
||||
MY_ATTRIBUTE((warn_unused_result));
|
||||
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
|
||||
#include "mach0data.ic"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -865,6 +865,8 @@ mach_write_ulonglong(
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
|
||||
/** Read 1 to 4 bytes from a file page buffered in the buffer pool.
|
||||
@param[in] ptr pointer where to read
|
||||
@param[in] type MLOG_1BYTE, MLOG_2BYTES, or MLOG_4BYTES
|
||||
|
|
@ -889,5 +891,3 @@ mach_read_ulint(
|
|||
ut_error;
|
||||
return(0);
|
||||
}
|
||||
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
|
|
|
|||
|
|
@ -85,8 +85,6 @@ Otherwise written as 0. @see PAGE_ROOT_AUTO_INC */
|
|||
This field should not be written to after
|
||||
page creation. */
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
|
||||
#define PAGE_BTR_SEG_LEAF 36 /* file segment header for the leaf pages in
|
||||
a B-tree: defined only on the root page of a
|
||||
B-tree, but not in the root of an ibuf tree */
|
||||
|
|
@ -141,6 +139,8 @@ Otherwise written as 0. @see PAGE_ROOT_AUTO_INC */
|
|||
#define PAGE_SAME_PAGE 4
|
||||
#define PAGE_NO_DIRECTION 5
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
|
||||
/* PAGE DIRECTORY
|
||||
==============
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ Created 2/2/1994 Heikki Tuuri
|
|||
#ifndef page0page_ic
|
||||
#define page0page_ic
|
||||
|
||||
#include "mach0data.h"
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
#include "mach0data.h"
|
||||
#ifdef UNIV_DEBUG
|
||||
# include "log0recv.h"
|
||||
#endif /* !UNIV_DEBUG */
|
||||
|
|
@ -40,6 +40,7 @@ Created 2/2/1994 Heikki Tuuri
|
|||
#undef UNIV_INLINE
|
||||
#define UNIV_INLINE
|
||||
#endif
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
|
||||
/************************************************************//**
|
||||
Gets the start of a page.
|
||||
|
|
@ -53,6 +54,7 @@ page_align(
|
|||
return((page_t*) ut_align_down(ptr, UNIV_PAGE_SIZE));
|
||||
}
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
/************************************************************//**
|
||||
Gets the offset within a page.
|
||||
@return offset from the start of the page */
|
||||
|
|
@ -181,7 +183,6 @@ page_header_get_field(
|
|||
}
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
|
||||
/*************************************************************//**
|
||||
Sets the given header field. */
|
||||
UNIV_INLINE
|
||||
|
|
@ -285,6 +286,8 @@ page_header_reset_last_insert(
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
|
||||
/************************************************************//**
|
||||
Determine whether the page is in new-style compact format.
|
||||
@return nonzero if the page is in compact format, zero if it is in
|
||||
|
|
@ -298,6 +301,7 @@ page_is_comp(
|
|||
return(page[PAGE_HEADER + PAGE_N_HEAP] & 0x80);
|
||||
}
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
/************************************************************//**
|
||||
TRUE if the record is on a page in compact format.
|
||||
@return nonzero if in compact format */
|
||||
|
|
@ -326,6 +330,8 @@ page_rec_get_heap_no(
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
|
||||
/************************************************************//**
|
||||
Determine whether the page is a B-tree leaf.
|
||||
@return true if the page is a B-tree leaf (PAGE_LEVEL = 0) */
|
||||
|
|
@ -338,6 +344,7 @@ page_is_leaf(
|
|||
return(!*(const uint16*) (page + (PAGE_HEADER + PAGE_LEVEL)));
|
||||
}
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
/************************************************************//**
|
||||
Determine whether the page is empty.
|
||||
@return true if the page is empty (PAGE_N_RECS = 0) */
|
||||
|
|
@ -627,6 +634,8 @@ page_get_middle_rec(
|
|||
return(page_rec_get_nth(page, middle));
|
||||
}
|
||||
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
|
||||
/*************************************************************//**
|
||||
Gets the page number.
|
||||
@return page number */
|
||||
|
|
@ -640,6 +649,7 @@ page_get_page_no(
|
|||
return(mach_read_from_4(page + FIL_PAGE_OFFSET));
|
||||
}
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
/*************************************************************//**
|
||||
Gets the tablespace identifier.
|
||||
@return space id */
|
||||
|
|
@ -653,6 +663,8 @@ page_get_space_id(
|
|||
return(mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID));
|
||||
}
|
||||
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
|
||||
/*************************************************************//**
|
||||
Gets the number of user records on page (infimum and supremum records
|
||||
are not user records).
|
||||
|
|
@ -666,6 +678,7 @@ page_get_n_recs(
|
|||
return(page_header_get_field(page, PAGE_N_RECS));
|
||||
}
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
/*************************************************************//**
|
||||
Gets the number of dir slots in directory.
|
||||
@return number of slots */
|
||||
|
|
@ -1054,6 +1067,8 @@ page_rec_get_base_extra_size(
|
|||
return(REC_N_NEW_EXTRA_BYTES + (ulint) !page_rec_is_comp(rec));
|
||||
}
|
||||
|
||||
#endif /* UNIV_INNOCHECKSUM */
|
||||
|
||||
/************************************************************//**
|
||||
Returns the sum of the sizes of the records in the record list, excluding
|
||||
the infimum and supremum records.
|
||||
|
|
@ -1077,6 +1092,7 @@ page_get_data_size(
|
|||
return(ret);
|
||||
}
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
/************************************************************//**
|
||||
Allocates a block of memory from the free list of an index page. */
|
||||
UNIV_INLINE
|
||||
|
|
|
|||
|
|
@ -27,12 +27,14 @@ Created 5/30/1994 Heikki Tuuri
|
|||
#ifndef rem0rec_h
|
||||
#define rem0rec_h
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
#include "univ.i"
|
||||
#include "data0data.h"
|
||||
#include "rem0types.h"
|
||||
#include "mtr0types.h"
|
||||
#include "page0types.h"
|
||||
#include "trx0types.h"
|
||||
#endif /*! UNIV_INNOCHECKSUM */
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
|
||||
|
|
@ -92,6 +94,7 @@ offsets[] array, first passed to rec_get_offsets() */
|
|||
#define REC_OFFS_NORMAL_SIZE OFFS_IN_REC_NORMAL_SIZE
|
||||
#define REC_OFFS_SMALL_SIZE 10
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
/******************************************************//**
|
||||
The following function is used to get the pointer of the next chained record
|
||||
on the same page.
|
||||
|
|
@ -1112,4 +1115,5 @@ int wsrep_rec_get_foreign_key(
|
|||
|
||||
#include "rem0rec.ic"
|
||||
|
||||
#endif /* !UNIV_INNOCHECKSUM */
|
||||
#endif /* rem0rec_h */
|
||||
|
|
|
|||
|
|
@ -108,13 +108,8 @@ support cross-platform development and expose comonly used SQL names. */
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
extern bool strict_verify;
|
||||
extern FILE* log_file;
|
||||
extern uintmax_t cur_page_num;
|
||||
#endif /* UNIV_INNOCHECKSUM */
|
||||
|
||||
#include "my_pthread.h"
|
||||
|
||||
/* Following defines are to enable performance schema
|
||||
instrumentation in each of five InnoDB modules if
|
||||
HAVE_PSI_INTERFACE is defined. */
|
||||
|
|
@ -487,6 +482,12 @@ in both 32-bit and 64-bit environments. */
|
|||
# define UINT64PFx "%016" PRIx64
|
||||
#endif
|
||||
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
extern bool strict_verify;
|
||||
extern FILE* log_file;
|
||||
extern unsigned long long cur_page_num;
|
||||
#endif /* UNIV_INNOCHECKSUM */
|
||||
|
||||
typedef int64_t ib_int64_t;
|
||||
typedef uint64_t ib_uint64_t;
|
||||
typedef uint32_t ib_uint32_t;
|
||||
|
|
|
|||
|
|
@ -821,13 +821,6 @@ recv_find_max_checkpoint_0(log_group_t** max_group, ulint* max_field)
|
|||
continue;
|
||||
}
|
||||
|
||||
group->state = LOG_GROUP_OK;
|
||||
|
||||
group->lsn = mach_read_from_8(
|
||||
buf + LOG_CHECKPOINT_LSN);
|
||||
group->lsn_offset = static_cast<ib_uint64_t>(
|
||||
mach_read_from_4(buf + OFFSET_HIGH32)) << 32
|
||||
| mach_read_from_4(buf + OFFSET_LOW32);
|
||||
checkpoint_no = mach_read_from_8(
|
||||
buf + LOG_CHECKPOINT_NO);
|
||||
|
||||
|
|
@ -838,12 +831,21 @@ recv_find_max_checkpoint_0(log_group_t** max_group, ulint* max_field)
|
|||
|
||||
DBUG_PRINT("ib_log",
|
||||
("checkpoint " UINT64PF " at " LSN_PF " found",
|
||||
checkpoint_no, group->lsn));
|
||||
checkpoint_no,
|
||||
mach_read_from_8(buf + LOG_CHECKPOINT_LSN)));
|
||||
|
||||
if (checkpoint_no >= max_no) {
|
||||
*max_group = group;
|
||||
*max_field = field;
|
||||
max_no = checkpoint_no;
|
||||
|
||||
group->state = LOG_GROUP_OK;
|
||||
|
||||
group->lsn = mach_read_from_8(
|
||||
buf + LOG_CHECKPOINT_LSN);
|
||||
group->lsn_offset = static_cast<ib_uint64_t>(
|
||||
mach_read_from_4(buf + OFFSET_HIGH32)) << 32
|
||||
| mach_read_from_4(buf + OFFSET_LOW32);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -998,22 +1000,22 @@ recv_find_max_checkpoint(ulint* max_field)
|
|||
continue;
|
||||
}
|
||||
|
||||
group->state = LOG_GROUP_OK;
|
||||
|
||||
group->lsn = mach_read_from_8(
|
||||
buf + LOG_CHECKPOINT_LSN);
|
||||
group->lsn_offset = mach_read_from_8(
|
||||
buf + LOG_CHECKPOINT_OFFSET);
|
||||
checkpoint_no = mach_read_from_8(
|
||||
buf + LOG_CHECKPOINT_NO);
|
||||
|
||||
DBUG_PRINT("ib_log",
|
||||
("checkpoint " UINT64PF " at " LSN_PF " found ",
|
||||
checkpoint_no, group->lsn));
|
||||
("checkpoint " UINT64PF " at " LSN_PF " found",
|
||||
checkpoint_no, mach_read_from_8(
|
||||
buf + LOG_CHECKPOINT_LSN)));
|
||||
|
||||
if (checkpoint_no >= max_no) {
|
||||
*max_field = field;
|
||||
max_no = checkpoint_no;
|
||||
group->state = LOG_GROUP_OK;
|
||||
group->lsn = mach_read_from_8(
|
||||
buf + LOG_CHECKPOINT_LSN);
|
||||
group->lsn_offset = mach_read_from_8(
|
||||
buf + LOG_CHECKPOINT_OFFSET);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3148,7 +3150,11 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn)
|
|||
|
||||
err = recv_find_max_checkpoint(&max_cp_field);
|
||||
|
||||
if (err != DB_SUCCESS) {
|
||||
if (err != DB_SUCCESS
|
||||
|| (log_sys->log.format != 0
|
||||
&& (log_sys->log.format & ~LOG_HEADER_FORMAT_ENCRYPTED)
|
||||
!= LOG_HEADER_FORMAT_CURRENT)) {
|
||||
|
||||
log_mutex_exit();
|
||||
return(err);
|
||||
}
|
||||
|
|
@ -3178,8 +3184,7 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn)
|
|||
case 0:
|
||||
log_mutex_exit();
|
||||
return(recv_log_format_0_recover(checkpoint_lsn));
|
||||
case LOG_HEADER_FORMAT_CURRENT:
|
||||
case LOG_HEADER_FORMAT_CURRENT | LOG_HEADER_FORMAT_ENCRYPTED:
|
||||
default:
|
||||
if (end_lsn == 0) {
|
||||
break;
|
||||
}
|
||||
|
|
@ -3187,8 +3192,6 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn)
|
|||
contiguous_lsn = end_lsn;
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
default:
|
||||
recv_sys->found_corrupt_log = true;
|
||||
log_mutex_exit();
|
||||
return(DB_ERROR);
|
||||
|
|
|
|||
|
|
@ -4980,24 +4980,19 @@ page_zip_verify_checksum(
|
|||
const void* data, /*!< in: compressed page */
|
||||
ulint size) /*!< in: size of compressed page */
|
||||
{
|
||||
const unsigned char* p = static_cast<const unsigned char*>(data)
|
||||
+ FIL_PAGE_SPACE_OR_CHKSUM;
|
||||
ib_uint32_t stored;
|
||||
ib_uint32_t calc;
|
||||
|
||||
const uint32_t stored = static_cast<uint32_t>(
|
||||
mach_read_from_4(p));
|
||||
stored = static_cast<ib_uint32_t>(mach_read_from_4(
|
||||
static_cast<const unsigned char*>(data) + FIL_PAGE_SPACE_OR_CHKSUM));
|
||||
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
p = static_cast<const unsigned char*>(data) + FIL_PAGE_TYPE;
|
||||
bool no_checksum = (mach_read_from_2(p) == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED);
|
||||
p = static_cast<const unsigned char*>(data) + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION;
|
||||
bool encrypted = (mach_read_from_4(p) != 0);
|
||||
p = static_cast<const unsigned char*>(data) + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION + 4;
|
||||
const uint32_t checksum = static_cast<uint32_t>(mach_read_from_4(p));
|
||||
|
||||
if (no_checksum) {
|
||||
return (TRUE);
|
||||
}
|
||||
#endif
|
||||
ulint page_no MY_ATTRIBUTE((unused)) =
|
||||
mach_read_from_4(static_cast<const unsigned char*>
|
||||
(data) + FIL_PAGE_OFFSET);
|
||||
ulint space_id MY_ATTRIBUTE((unused)) =
|
||||
mach_read_from_4(static_cast<const unsigned char*>
|
||||
(data) + FIL_PAGE_SPACE_ID);
|
||||
const page_id_t page_id(space_id, page_no);
|
||||
|
||||
#if FIL_PAGE_LSN % 8
|
||||
#error "FIL_PAGE_LSN must be 64 bit aligned"
|
||||
|
|
@ -5017,7 +5012,7 @@ page_zip_verify_checksum(
|
|||
}
|
||||
if (i >= size) {
|
||||
if (log_file) {
|
||||
fprintf(log_file, "Page::%lu is empty and"
|
||||
fprintf(log_file, "Page::%llu is empty and"
|
||||
" uncorrupted\n", cur_page_num);
|
||||
}
|
||||
|
||||
|
|
@ -5041,21 +5036,12 @@ page_zip_verify_checksum(
|
|||
return(TRUE);
|
||||
}
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
ulint page_no = mach_read_from_4(static_cast<
|
||||
const unsigned char*>
|
||||
(data) + FIL_PAGE_OFFSET);
|
||||
ulint space_id = mach_read_from_4(static_cast<
|
||||
const unsigned char*>
|
||||
(data) + FIL_PAGE_SPACE_ID);
|
||||
const page_id_t page_id(space_id, page_no);
|
||||
#endif /* UNIV_INNOCHECKSUM */
|
||||
|
||||
const uint32_t calc = page_zip_calc_checksum(data, size, curr_algo);
|
||||
calc = static_cast<ib_uint32_t>(page_zip_calc_checksum(
|
||||
data, size, curr_algo));
|
||||
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
if (log_file) {
|
||||
fprintf(log_file, "page::%lu;"
|
||||
fprintf(log_file, "page::%llu;"
|
||||
" %s checksum: calculated = %u;"
|
||||
" recorded = %u\n", cur_page_num,
|
||||
buf_checksum_algorithm_name(
|
||||
|
|
@ -5070,21 +5056,17 @@ page_zip_verify_checksum(
|
|||
data, size, SRV_CHECKSUM_ALGORITHM_CRC32);
|
||||
|
||||
if (log_file) {
|
||||
fprintf(log_file, "page::%lu: crc32 checksum:"
|
||||
fprintf(log_file, "page::%llu: crc32 checksum:"
|
||||
" calculated = %u; recorded = %u\n",
|
||||
cur_page_num, crc32, stored);
|
||||
fprintf(log_file, "page::%lu: none checksum:"
|
||||
fprintf(log_file, "page::%llu: none checksum:"
|
||||
" calculated = %lu; recorded = %u\n",
|
||||
cur_page_num, BUF_NO_CHECKSUM_MAGIC, stored);
|
||||
}
|
||||
}
|
||||
#endif /* UNIV_INNOCHECKSUM */
|
||||
|
||||
if (stored == calc
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
|| ( encrypted == true && stored == checksum)
|
||||
#endif
|
||||
) {
|
||||
if (stored == calc) {
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
|
|
@ -5116,11 +5098,7 @@ page_zip_verify_checksum(
|
|||
if (legacy_big_endian_checksum) {
|
||||
const uint32_t calculated =
|
||||
page_zip_calc_checksum(data, size, curr_algo, true);
|
||||
if (stored == calculated
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
|| ( encrypted == true && calculated == checksum)
|
||||
#endif
|
||||
) {
|
||||
if (stored == calculated) {
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
|
@ -5130,11 +5108,7 @@ page_zip_verify_checksum(
|
|||
uint32_t calculated =
|
||||
page_zip_calc_checksum(data, size, SRV_CHECKSUM_ALGORITHM_INNODB);
|
||||
|
||||
if (stored == calculated
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
|| ( encrypted == true && stored == checksum)
|
||||
#endif
|
||||
) {
|
||||
if (stored == calculated) {
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
if (curr_algo
|
||||
|
|
@ -5154,11 +5128,7 @@ page_zip_verify_checksum(
|
|||
|
||||
/* If legacy checksum is not checked, do it now. */
|
||||
if ((legacy_checksum_checked
|
||||
&& stored == calculated)
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
|| ( encrypted == true && calculated == checksum)
|
||||
#endif
|
||||
) {
|
||||
&& stored == calculated)) {
|
||||
legacy_big_endian_checksum = true;
|
||||
return(TRUE);
|
||||
}
|
||||
|
|
@ -5168,11 +5138,7 @@ page_zip_verify_checksum(
|
|||
case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
|
||||
case SRV_CHECKSUM_ALGORITHM_INNODB: {
|
||||
|
||||
if (stored == BUF_NO_CHECKSUM_MAGIC
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
|| ( encrypted == true && checksum == BUF_NO_CHECKSUM_MAGIC)
|
||||
#endif
|
||||
) {
|
||||
if (stored == BUF_NO_CHECKSUM_MAGIC) {
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
if (curr_algo
|
||||
== SRV_CHECKSUM_ALGORITHM_STRICT_INNODB) {
|
||||
|
|
@ -5191,14 +5157,8 @@ page_zip_verify_checksum(
|
|||
uint32_t calculated1;
|
||||
|
||||
if (stored == calculated
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
|| ( encrypted == true && checksum == calculated)
|
||||
#endif
|
||||
|| stored == (calculated1 =
|
||||
page_zip_calc_checksum(data, size, SRV_CHECKSUM_ALGORITHM_CRC32, true))
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
|| ( encrypted == true && checksum == calculated1)
|
||||
#endif
|
||||
) {
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
if (curr_algo
|
||||
|
|
@ -5222,12 +5182,7 @@ page_zip_verify_checksum(
|
|||
data, size, SRV_CHECKSUM_ALGORITHM_CRC32, true);
|
||||
|
||||
if (stored == calculated
|
||||
|| stored == calculated1
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
|| ( encrypted == true && checksum == calculated)
|
||||
|| ( encrypted == true && checksum == calculated1)
|
||||
#endif
|
||||
) {
|
||||
|| stored == calculated1) {
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
page_warn_strict_checksum(
|
||||
curr_algo,
|
||||
|
|
@ -5240,11 +5195,7 @@ page_zip_verify_checksum(
|
|||
calculated = page_zip_calc_checksum(
|
||||
data, size, SRV_CHECKSUM_ALGORITHM_INNODB);
|
||||
|
||||
if (stored == calculated
|
||||
#ifdef UNIV_INNOCHECKSUM
|
||||
|| ( encrypted == true && checksum == calculated)
|
||||
#endif
|
||||
) {
|
||||
if (stored == calculated) {
|
||||
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
page_warn_strict_checksum(
|
||||
|
|
|
|||
|
|
@ -1845,9 +1845,7 @@ trx_commit_in_memory(
|
|||
} else if (trx->flush_log_later) {
|
||||
/* Do nothing yet */
|
||||
trx->must_flush_log_later = true;
|
||||
} else if (srv_flush_log_at_trx_commit == 0
|
||||
|| thd_requested_durability(trx->mysql_thd)
|
||||
== HA_IGNORE_DURABILITY) {
|
||||
} else if (srv_flush_log_at_trx_commit == 0) {
|
||||
/* Do nothing */
|
||||
} else {
|
||||
trx_flush_log_if_needed(lsn, trx);
|
||||
|
|
@ -2261,8 +2259,7 @@ trx_commit_complete_for_mysql(
|
|||
{
|
||||
if (trx->id != 0
|
||||
|| !trx->must_flush_log_later
|
||||
|| thd_requested_durability(trx->mysql_thd)
|
||||
== HA_IGNORE_DURABILITY) {
|
||||
|| (srv_flush_log_at_trx_commit == 1 && trx->active_commit_ordered)) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -2750,18 +2747,7 @@ trx_prepare(
|
|||
trx_sys_mutex_exit();
|
||||
/*--------------------------------------*/
|
||||
|
||||
switch (thd_requested_durability(trx->mysql_thd)) {
|
||||
case HA_IGNORE_DURABILITY:
|
||||
/* We set the HA_IGNORE_DURABILITY during prepare phase of
|
||||
binlog group commit to not flush redo log for every transaction
|
||||
here. So that we can flush prepared records of transactions to
|
||||
redo log in a group right before writing them to binary log
|
||||
during flush stage of binlog group commit. */
|
||||
break;
|
||||
case HA_REGULAR_DURABILITY:
|
||||
if (lsn == 0) {
|
||||
break;
|
||||
}
|
||||
if (lsn) {
|
||||
/* Depending on the my.cnf options, we may now write the log
|
||||
buffer to the log files, making the prepared state of the
|
||||
transaction durable if the OS does not crash. We may also
|
||||
|
|
|
|||
|
|
@ -45,9 +45,11 @@ insert into t1 values (1,10,10);
|
|||
insert into t1 values (2,10,10);
|
||||
insert into t1 values (11,20,20);
|
||||
insert into t1 values (12,20,20);
|
||||
set @tmp_rfirr= @@rocksdb_force_index_records_in_range;
|
||||
set rocksdb_force_index_records_in_range= 12;
|
||||
explain select * from t1 force index(col1) where col1=10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref col1 col1 5 const 2000
|
||||
1 SIMPLE t1 ref col1 col1 5 const 24
|
||||
select * from t1 force index(col1) where col1=10;
|
||||
pk col1 col2
|
||||
1 10 10
|
||||
|
|
@ -56,6 +58,7 @@ select * from t1 use index () where col1=10;
|
|||
pk col1 col2
|
||||
2 10 10
|
||||
1 10 10
|
||||
set rocksdb_force_index_records_in_range= @tmp_rfirr;
|
||||
drop table t1;
|
||||
#
|
||||
# Issue #108: Index-only scans do not work for partitioned tables and extended keys
|
||||
|
|
|
|||
|
|
@ -55,9 +55,16 @@ insert into t1 values (2,10,10);
|
|||
|
||||
insert into t1 values (11,20,20);
|
||||
insert into t1 values (12,20,20);
|
||||
|
||||
set @tmp_rfirr= @@rocksdb_force_index_records_in_range;
|
||||
set rocksdb_force_index_records_in_range= 12;
|
||||
|
||||
explain select * from t1 force index(col1) where col1=10;
|
||||
select * from t1 force index(col1) where col1=10;
|
||||
select * from t1 use index () where col1=10;
|
||||
|
||||
set rocksdb_force_index_records_in_range= @tmp_rfirr;
|
||||
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue