2011-02-15 12:12:27 +02:00
|
|
|
# Bug #60049 Verify that purge leaves no garbage in unique secondary indexes
|
|
|
|
# This test requires a fresh server start-up and a slow shutdown.
|
|
|
|
# This was a suspected bug (not a bug).
|
|
|
|
|
2011-02-17 09:45:07 +02:00
|
|
|
-- source include/not_embedded.inc
|
2012-08-23 00:32:25 +03:00
|
|
|
-- source include/have_innodb.inc
|
|
|
|
-- source include/have_innodb_16k.inc
|
2011-02-15 12:12:27 +02:00
|
|
|
|
2012-08-23 00:32:25 +03:00
|
|
|
-- disable_query_log
|
2016-08-12 11:17:45 +03:00
|
|
|
call mtr.add_suppression('\\[ERROR\\] InnoDB: Table `mysql`.`innodb_(table|index)_stats` not found');
|
|
|
|
call mtr.add_suppression('\\[ERROR\\] InnoDB: Fetch of persistent statistics requested for table `mysql`.`gtid_executed`');
|
|
|
|
|
2012-08-23 00:32:25 +03:00
|
|
|
let $create1 = query_get_value(SHOW CREATE TABLE mysql.innodb_table_stats, Create Table, 1);
|
|
|
|
let $create2 = query_get_value(SHOW CREATE TABLE mysql.innodb_index_stats, Create Table, 1);
|
|
|
|
DROP TABLE mysql.innodb_index_stats;
|
|
|
|
DROP TABLE mysql.innodb_table_stats;
|
|
|
|
-- enable_query_log
|
|
|
|
|
2013-07-14 23:20:25 +02:00
|
|
|
CREATE TABLE t(a INT)ENGINE=InnoDB STATS_PERSISTENT=0;
|
2011-02-15 12:12:27 +02:00
|
|
|
RENAME TABLE t TO u;
|
|
|
|
DROP TABLE u;
|
|
|
|
SELECT @@innodb_fast_shutdown;
|
|
|
|
let $MYSQLD_DATADIR=`select @@datadir`;
|
|
|
|
|
2016-08-12 11:17:45 +03:00
|
|
|
--source include/shutdown_mysqld.inc
|
2011-02-15 12:12:27 +02:00
|
|
|
|
|
|
|
# Check the tail of ID_IND (SYS_TABLES.ID)
|
|
|
|
let IBDATA1=$MYSQLD_DATADIR/ibdata1;
|
|
|
|
perl;
|
|
|
|
my $file = $ENV{'IBDATA1'};
|
|
|
|
open(FILE, "<$file") || die "Unable to open $file";
|
|
|
|
# Read DICT_HDR_TABLE_IDS, the root page number of ID_IND (SYS_TABLES.ID).
|
|
|
|
seek(FILE, 7*16384+38+36, 0) || die "Unable to seek $file";
|
|
|
|
die unless read(FILE, $_, 4) == 4;
|
2011-02-16 15:34:16 +02:00
|
|
|
my $sys_tables_id_root = unpack("N", $_);
|
2011-02-15 12:12:27 +02:00
|
|
|
print "Last record of ID_IND root page ($sys_tables_id_root):\n";
|
|
|
|
# This should be the last record in ID_IND. Dump it in hexadecimal.
|
|
|
|
seek(FILE, $sys_tables_id_root*16384 + 152, 0) || die "Unable to seek $file";
|
|
|
|
read(FILE, $_, 32) || die "Unable to read $file";
|
|
|
|
close(FILE);
|
2011-02-16 15:34:16 +02:00
|
|
|
print unpack("H*", $_), "\n";
|
2011-02-15 12:12:27 +02:00
|
|
|
EOF
|
|
|
|
|
2016-08-12 11:17:45 +03:00
|
|
|
--source include/start_mysqld.inc
|
2012-08-23 00:32:25 +03:00
|
|
|
|
|
|
|
-- disable_query_log
|
|
|
|
USE mysql;
|
|
|
|
eval $create1;
|
|
|
|
eval $create2;
|