summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/include/restart_and_reinit.inc
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/innodb/include/restart_and_reinit.inc')
-rw-r--r--mysql-test/suite/innodb/include/restart_and_reinit.inc19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/include/restart_and_reinit.inc b/mysql-test/suite/innodb/include/restart_and_reinit.inc
new file mode 100644
index 00000000000..f95373c4037
--- /dev/null
+++ b/mysql-test/suite/innodb/include/restart_and_reinit.inc
@@ -0,0 +1,19 @@
+#
+# few innodb tests depend on innodb tablespace being completelty clean and new
+#
+# this file deletes old innodb files and restarts mysqld
+#
+
+let $_server_id= `SELECT @@server_id`;
+let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect;
+let $datadir= `SELECT @@datadir`;
+exec echo "wait" > $_expect_file_name;
+shutdown_server 10; # give it 10 seconds to die
+remove_file $datadir/ib_logfile0;
+remove_file $datadir/ib_logfile1;
+remove_file $datadir/ibdata1;
+exec echo "restart" > $_expect_file_name;
+enable_reconnect;
+source include/wait_until_connected_again.inc;
+disable_reconnect;
+