403Webshell
Server IP : 104.21.38.3  /  Your IP : 162.158.171.27
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/innodb_bug12400341.test
# Test for bug #12400341: INNODB CAN LEAVE ORPHAN IBD FILES AROUND

-- source include/have_innodb.inc

--disable_warnings
if (`select count(*)=0 from information_schema.global_variables where variable_name = 'INNODB_TRX_RSEG_N_SLOTS_DEBUG'`)
{
  --skip Test requires InnoDB built with UNIV_DEBUG definition.
}
--enable_warnings

# Don't test under valgrind, undo slots of the previous test might exist still
# and cause unstable result.
--source include/not_valgrind.inc

--disable_query_log
call mtr.add_suppression("\\[Warning\\] InnoDB: Cannot find a free slot for an undo log. Do you have too");

set @old_innodb_trx_rseg_n_slots_debug = @@innodb_trx_rseg_n_slots_debug;
set global innodb_trx_rseg_n_slots_debug = 32;
--enable_query_log

set @old_innodb_rollback_segments = @@innodb_rollback_segments;
set global innodb_rollback_segments=1;

show variables like "max_connections";
show variables like "innodb_thread_concurrency";
show variables like "innodb_file_per_table";

--disable_warnings
drop database if exists mysqltest;
--enable_warnings

create database mysqltest;
CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int DEFAULT 0) ENGINE=InnoDB;

--disable_query_log
#
# Insert in 1 transaction which needs over 1 page undo record to avoid the insert_undo cached,
# because the cached insert_undo can be reused at "CREATE TABLE" statement later.
#
START TRANSACTION;
let $c = 4096;
while ($c)
{
  eval INSERT INTO mysqltest.transtable (id) VALUES ($c);
  dec $c;
}
COMMIT;

let $c = 32;
while ($c)
{
  # if failed at here, it might be shortage of file descriptors limit.
  connect (con$c,localhost,root,,);
  dec $c;
}
--enable_query_log

select count(*) from information_schema.processlist;

#
# fill the all undo slots
#
--disable_query_log
let $c = 32;
while ($c)
{
  connection con$c;
  START TRANSACTION;
  eval UPDATE mysqltest.transtable SET val = 1 WHERE id = 33 - $c;
  dec $c;
}
--enable_query_log

connection default;

--error ER_TOO_MANY_CONCURRENT_TRXS
CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB;

select count(*) from information_schema.processlist;

--disable_query_log
let $c = 32;
while ($c)
{
  connection con$c;
  ROLLBACK;
  dec $c;
}
--enable_query_log

connection default;
select count(*) from information_schema.processlist;

--disable_query_log
let $c = 32;
while ($c)
{
  disconnect con$c;
  dec $c;
}
--enable_query_log

#
# If the isolated .ibd file remained, the drop database should fail.
#
drop database mysqltest;

set global innodb_rollback_segments = @old_innodb_rollback_segments;

--disable_query_log
set global innodb_trx_rseg_n_slots_debug = @old_innodb_trx_rseg_n_slots_debug;
--enable_query_log

Youez - 2016 - github.com/yon3zu
LinuXploit