Debian Codegraph @

mysql-test/suite/perfschema/t/dml_handler.test

raw
1 # Tests for PERFORMANCE_SCHEMA
2
3 --source include/not_embedded.inc
4 --source include/have_perfschema.inc
5
6 #==============================================================================
7 # This test verifies that the peformance schema storage engine does not support
8 # HANDLER operations.
9 #
10 # Get the list of tables from information_schema.tables, store the table names
11 # in a temporary table. For each table in the list, attempt a HANDLER ... OPEN,
12 # which should return error 1031, "Table storage engine for '<table name>'
13 # doesn't have this option."
14 #
15 --echo #
16 --echo # Create a temporary table of performance schema table names
17 --echo #
18
19 CREATE TEMPORARY TABLE table_list (id INT AUTO_INCREMENT, PRIMARY KEY (id)) AS
20 SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
21 WHERE TABLE_SCHEMA='performance_schema'
22 ORDER BY TABLE_NAME;
23
24 --disable_cursor_protocol
25 --enable_prepare_warnings
26
27 SELECT COUNT(*) FROM table_list INTO @table_count;
28 --enable_cursor_protocol
29
30 let $count=`SELECT @table_count`;
31
32 --echo #
33 --echo # For each table in the performance schema, attempt HANDLER...OPEN,
34 --echo # which should fail with an error 1031, ER_ILLEGAL_HA.
35 --echo #
36
37 while ($count > 0)
38 {
39 --disable_cursor_protocol
40 eval SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=$count;
41 --enable_cursor_protocol
42 let $table_name = `SELECT @table_name`;
43 --error ER_ILLEGAL_HA
44 eval HANDLER performance_schema.$table_name OPEN;
45 dec $count;
46 }
47
48 --disable_prepare_warnings
49
50 DROP TEMPORARY TABLE table_list;