summaryrefslogtreecommitdiff
path: root/mysql-test/include/percona_nonflushing_analyze_debug.inc
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/include/percona_nonflushing_analyze_debug.inc')
-rw-r--r--mysql-test/include/percona_nonflushing_analyze_debug.inc32
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/include/percona_nonflushing_analyze_debug.inc b/mysql-test/include/percona_nonflushing_analyze_debug.inc
new file mode 100644
index 00000000000..b2f6df51ab8
--- /dev/null
+++ b/mysql-test/include/percona_nonflushing_analyze_debug.inc
@@ -0,0 +1,32 @@
+#
+# Test ANALYZE TABLE that does not flush table definition cache
+# Arguments:
+# $percona_nonflushing_analyze_table - table to test
+#
+
+--source include/count_sessions.inc
+
+--connect con1,localhost,root
+
+SET DEBUG_SYNC="handler_ha_index_next_end SIGNAL idx_scan_in_progress WAIT_FOR finish_scan";
+
+send_eval SELECT * FROM $percona_nonflushing_analyze_table;
+
+--connection default
+
+SET DEBUG_SYNC="now WAIT_FOR idx_scan_in_progress";
+
+eval ANALYZE TABLE $percona_nonflushing_analyze_table;
+
+# With the bug fixed this should not block
+eval SELECT * FROM $percona_nonflushing_analyze_table;
+
+SET DEBUG_SYNC="now SIGNAL finish_scan";
+
+--connection con1
+reap;
+--disconnect con1
+--connection default
+SET DEBUG_SYNC='reset';
+
+--source include/wait_until_count_sessions.inc