Debian Codegraph @

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

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