-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
118 changed files
with
1,479 additions
and
4,022 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
SET GLOBAL innodb_file_per_table=0; | ||
CREATE TABLE t(a INT)ENGINE=InnoDB; | ||
SET GLOBAL innodb_file_per_table=1; | ||
CREATE TABLE ibd4(a INT UNIQUE)ENGINE=InnoDB; | ||
CREATE TABLE ibd4f(a INT UNIQUE)ENGINE=InnoDB; | ||
CREATE TABLE ibd5(a INT UNIQUE, b INT UNIQUE)ENGINE=InnoDB; | ||
# Kill the server | ||
DROP TABLE t,ibd4,ibd4f,ibd5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--loose-innodb-sys-indexes | ||
--innodb-data-file-path=ibdata1:1M:autoextend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--source include/have_innodb.inc | ||
--source include/not_embedded.inc | ||
|
||
let INNODB_PAGE_SIZE=`select @@innodb_page_size`; | ||
let MYSQLD_DATADIR=`select @@datadir`; | ||
let MYSQLD_IS_DEBUG=`select version() like '%debug%'`; | ||
--source include/no_checkpoint_start.inc | ||
SET GLOBAL innodb_file_per_table=0; | ||
CREATE TABLE t(a INT)ENGINE=InnoDB; | ||
let INNODB_ROOT_PAGE= `SELECT page_no FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE name='GEN_CLUST_INDEX'`; | ||
SET GLOBAL innodb_file_per_table=1; | ||
|
||
CREATE TABLE ibd4(a INT UNIQUE)ENGINE=InnoDB; | ||
CREATE TABLE ibd4f(a INT UNIQUE)ENGINE=InnoDB; | ||
CREATE TABLE ibd5(a INT UNIQUE, b INT UNIQUE)ENGINE=InnoDB; | ||
|
||
let $drop_tables= DROP TABLE t,ibd4,ibd4f,ibd5; | ||
--let CLEANUP_IF_CHECKPOINT= $drop_tables; | ||
--source ../include/no_checkpoint_end.inc | ||
|
||
perl; | ||
use Fcntl 'SEEK_CUR', 'SEEK_END'; | ||
|
||
my $page_size = $ENV{'INNODB_PAGE_SIZE'}; | ||
my $restart = 'restart'; | ||
if ($ENV{'MYSQLD_IS_DEBUG'}) | ||
{ | ||
# It is impractical to ensure that CREATE TABLE t will extend ibdata1. | ||
# We rely on innodb_system_tablespace_extend_debug=1 | ||
# to recover from this fault injection if no size change was redo-logged. | ||
my $root = $ENV{'INNODB_ROOT_PAGE'}; | ||
open(FILE, "+<", "$ENV{'MYSQLD_DATADIR'}ibdata1") or die; | ||
my $size = sysseek(FILE, 0, SEEK_END) / $page_size; | ||
seek(FILE, $page_size * ($root + 1), SEEK_SET) or die; | ||
my $empty_tail= 1; | ||
while(<FILE>) { unless (/\0*/gso) { $empty_tail= 0; last } } | ||
if ($empty_tail) | ||
{ | ||
$restart = 'restart: --innodb-data-file-size-debug=' . $size; | ||
truncate(FILE, $page_size * $root); | ||
} | ||
close FILE; | ||
} | ||
open(FILE, ">$ENV{MYSQLTEST_VARDIR}/log/start_mysqld.txt") || die; | ||
print FILE '--exec echo "', $restart, '" > $_expect_file_name | ||
--enable_reconnect | ||
--source include/wait_until_connected_again.inc | ||
--disable_reconnect | ||
'; | ||
close FILE; | ||
open(FILE, "+<", "$ENV{'MYSQLD_DATADIR'}test/ibd4.ibd") or die; | ||
truncate(FILE, $page_size * 4); | ||
close FILE; | ||
open(FILE, "+<", "$ENV{'MYSQLD_DATADIR'}test/ibd4f.ibd") or die; | ||
truncate(FILE, $page_size * 4 + 1234); | ||
close FILE; | ||
open(FILE, "+<", "$ENV{'MYSQLD_DATADIR'}test/ibd5.ibd") or die; | ||
truncate(FILE, $page_size * 5); | ||
close FILE; | ||
EOF | ||
|
||
--source $MYSQLTEST_VARDIR/log/start_mysqld.txt | ||
--remove_file $MYSQLTEST_VARDIR/log/start_mysqld.txt | ||
|
||
eval $drop_tables; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.