403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.70.208.156
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /www/server/mysql/src/mysql-test/suite/innodb/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/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;


Youez - 2016 - github.com/yon3zu
LinuXploit