Current Path : /home/usr.opt/mysql57/mysql-test/suite/innodb/t/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/innodb/t/trx_id_future.test |
--echo # --echo # Bug #20445525 ADD A CONSISTENCY CHECK AGAINST DB_TRX_ID BEING --echo # IN THE FUTURE --echo # --source include/have_nodebug.inc --source include/have_innodb.inc --source include/not_embedded.inc let PAGE_SIZE=`select @@innodb_page_size`; CREATE TABLE t1(a INT) row_format=redundant engine=innoDB; INSERT INTO t1 VALUES(1); let MYSQLD_DATADIR=`select @@datadir`; --source include/shutdown_mysqld.inc perl; $page_size=$ENV{PAGE_SIZE}; my $file = "$ENV{MYSQLD_DATADIR}/test/t1.ibd"; open(FILE, "+<", $file) || die "Unable to open $file"; #Seek the the infimum record and get the offset to next record #Infimum record exist at offset 101 for redundant format #And offset to the next record is present 2 bytes prior to #infimum record seek(FILE, 3*$page_size+101-2, 0) || die "Unable to seek $file"; die unless read(FILE, $_, 2) == 2; my $record_offset = unpack("n*", $_); #In this case the first record should be at offset 135 die unless $record_offset == 135; my $trx_id_of_rec = 3*$page_size + $record_offset + 6; # Modify DB_TRX_ID of the record to a value which is greater than # max_trx_id seek(FILE, $trx_id_of_rec , 0) || die "Unable to seek $file"; my $corrupted_trx_id = "\xff" x 6; syswrite(FILE, $corrupted_trx_id) || die "Unable to write"; #Modify the checksums of the page seek(FILE, 3*$page_size, 0) || die "Unable to seek $file"; syswrite(FILE, pack("H*","deadbeef",4)) || die "Unable to write"; seek(FILE, 4*$page_size-8, 0) || die "Unable to seek $file"; syswrite(FILE, pack("H*","deadbeef",4)) || die "Unable to write"; close(FILE) EOF --source include/start_mysqld.inc --disable_query_log call mtr.add_suppression("\\[Warning\\] InnoDB: A transaction id in a record of table `\.\.*`\.`\.\.*` is newer than the system-wide maximum."); --enable_query_log SELECT * FROM t1; DROP TABLE t1;