1
# Bug #60049 Verify that purge leaves no garbage in unique secondary indexes
2
# This test requires a fresh server start-up and a slow shutdown.
3
# This was a suspected bug (not a bug).
5
-- source include/not_embedded.inc
6
-- source include/have_innodb_plugin.inc
8
CREATE TABLE t(a INT)ENGINE=InnoDB;
11
SELECT @@innodb_fast_shutdown;
12
let $MYSQLD_DATADIR=`select @@datadir`;
14
# Shut down the server
15
-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
17
-- source include/wait_until_disconnected.inc
19
# Check the tail of ID_IND (SYS_TABLES.ID)
20
let IBDATA1=$MYSQLD_DATADIR/ibdata1;
22
my $file = $ENV{'IBDATA1'};
23
open(FILE, "<$file") || die "Unable to open $file";
24
# Read DICT_HDR_TABLE_IDS, the root page number of ID_IND (SYS_TABLES.ID).
25
seek(FILE, 7*16384+38+36, 0) || die "Unable to seek $file";
26
die unless read(FILE, $_, 4) == 4;
27
my $sys_tables_id_root = unpack("N", $_);
28
print "Last record of ID_IND root page ($sys_tables_id_root):\n";
29
# This should be the last record in ID_IND. Dump it in hexadecimal.
30
seek(FILE, $sys_tables_id_root*16384 + 152, 0) || die "Unable to seek $file";
31
read(FILE, $_, 32) || die "Unable to read $file";
33
print unpack("H*", $_), "\n";
37
-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
39
-- source include/wait_until_connected_again.inc