You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.4 KiB

  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).
  4. -- source include/not_embedded.inc
  5. -- source include/have_innodb_plugin.inc
  6. CREATE TABLE t(a INT)ENGINE=InnoDB;
  7. RENAME TABLE t TO u;
  8. DROP TABLE u;
  9. SELECT @@innodb_fast_shutdown;
  10. let $MYSQLD_DATADIR=`select @@datadir`;
  11. # Shut down the server
  12. -- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
  13. -- shutdown_server 30
  14. -- source include/wait_until_disconnected.inc
  15. # Check the tail of ID_IND (SYS_TABLES.ID)
  16. let IBDATA1=$MYSQLD_DATADIR/ibdata1;
  17. perl;
  18. my $file = $ENV{'IBDATA1'};
  19. open(FILE, "<$file") || die "Unable to open $file";
  20. # Read DICT_HDR_TABLE_IDS, the root page number of ID_IND (SYS_TABLES.ID).
  21. seek(FILE, 7*16384+38+36, 0) || die "Unable to seek $file";
  22. die unless read(FILE, $_, 4) == 4;
  23. my $sys_tables_id_root = unpack("N", $_);
  24. print "Last record of ID_IND root page ($sys_tables_id_root):\n";
  25. # This should be the last record in ID_IND. Dump it in hexadecimal.
  26. seek(FILE, $sys_tables_id_root*16384 + 152, 0) || die "Unable to seek $file";
  27. read(FILE, $_, 32) || die "Unable to read $file";
  28. close(FILE);
  29. print unpack("H*", $_), "\n";
  30. EOF
  31. # Restart the server.
  32. -- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
  33. -- enable_reconnect
  34. -- source include/wait_until_connected_again.inc