Skip to content

Commit 72d2389

Browse files
committed
5.6.30
1 parent 7e22a1d commit 72d2389

File tree

4 files changed

+322
-0
lines changed

4 files changed

+322
-0
lines changed

mysql-test/suite/perfschema/r/sizing_low.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,4 @@ Performance_schema_table_instances_lost 0
6767
Performance_schema_thread_classes_lost 0
6868
Performance_schema_thread_instances_lost 0
6969
Performance_schema_users_lost 0
70+
CALL mtr.add_suppression("innodb_open_files should not be greater than the open_files_limit.");
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
2+
#
3+
# TEST 1: Normal tables prefixed with "#sql" and "sql".
4+
#
5+
USE test;
6+
CREATE TABLE `#sql_1` (a int, b text);
7+
INSERT INTO `#sql_1` VALUES(1,'one');
8+
9+
CREATE TABLE `sql_1` (a int, b text);
10+
INSERT INTO `sql_1` VALUES(1,'one');
11+
12+
# Verify that the tables are treated as normal tables .
13+
14+
SELECT object_type, object_schema, object_name
15+
FROM performance_schema.objects_summary_global_by_type
16+
WHERE object_schema="test";
17+
object_type object_schema object_name
18+
TABLE test #sql_1
19+
TABLE test sql_1
20+
21+
# Drop the tables, verify that the table objects are removed.
22+
23+
DROP TABLE `#sql_1`;
24+
DROP TABLE `sql_1`;
25+
26+
SELECT object_type, object_schema, object_name
27+
FROM performance_schema.objects_summary_global_by_type
28+
WHERE object_schema="test";
29+
object_type object_schema object_name
30+
31+
#
32+
# TEST 2: Temporary tables, no special prefix.
33+
#
34+
CREATE TEMPORARY TABLE sql_temp2_myisam (a int, b text) ENGINE=MYISAM;
35+
INSERT INTO sql_temp2_myisam VALUES(1,'one');
36+
37+
CREATE TEMPORARY TABLE sql_temp2_innodb (a int, b text) ENGINE=INNODB;
38+
INSERT INTO sql_temp2_innodb VALUES(1,'one');
39+
40+
# Confirm that the temporary tables are ignored.
41+
42+
SELECT object_type, object_schema, object_name
43+
FROM performance_schema.objects_summary_global_by_type
44+
WHERE object_schema="test";
45+
object_type object_schema object_name
46+
47+
# Drop the tables, verify that the table objects are not created.
48+
49+
DROP TABLE sql_temp2_myisam;
50+
DROP TABLE sql_temp2_innodb;
51+
52+
SELECT object_type, object_schema, object_name
53+
FROM performance_schema.objects_summary_global_by_type
54+
WHERE object_schema="test";
55+
object_type object_schema object_name
56+
57+
#
58+
# TEST 3: Temporary tables with the "#sql" prefix.
59+
#
60+
CREATE TEMPORARY TABLE `#sql_temp3_myisam` (a int, b text) ENGINE=MYISAM;
61+
CHECK TABLE `#sql_temp3_myisam`;
62+
Table Op Msg_type Msg_text
63+
test.#sql_temp3_myisam check status OK
64+
INSERT INTO `#sql_temp3_myisam` VALUES(1,'one');
65+
66+
CREATE TEMPORARY TABLE `#sql_temp3_innodb` (a int, b text) ENGINE=INNODB;
67+
CHECK TABLE `#sql_temp3_innodb`;
68+
Table Op Msg_type Msg_text
69+
test.#sql_temp3_innodb check status OK
70+
INSERT INTO `#sql_temp3_innodb` VALUES(1,'one');
71+
72+
# Confirm that the temporary tables are ignored.
73+
74+
SELECT object_type, object_schema, object_name
75+
FROM performance_schema.objects_summary_global_by_type
76+
WHERE object_schema="test";
77+
object_type object_schema object_name
78+
79+
# Drop the temporary tables.
80+
81+
DROP TABLE `#sql_temp3_myisam`;
82+
DROP TABLE `#sql_temp3_innodb`;
83+
84+
# Confirm that the temporary tables are still ignored.
85+
86+
SELECT object_type, object_schema, object_name
87+
FROM performance_schema.objects_summary_global_by_type
88+
WHERE object_schema="test";
89+
object_type object_schema object_name
90+
91+
#
92+
# TEST 4: Special case: MyISAM temporary tables are recreated as non-temporary
93+
# when they are truncated.
94+
#
95+
CREATE TEMPORARY TABLE `sql_temp4_myisam` (a int, b text) ENGINE=MYISAM;
96+
INSERT INTO `sql_temp4_myisam` VALUES(1,'one');
97+
98+
CREATE TEMPORARY TABLE `#sql_temp4_myisam` (a int, b text) ENGINE=MYISAM;
99+
INSERT INTO `#sql_temp4_myisam` VALUES(1,'one');
100+
101+
# Confirm that the MyISAM temporary tables are ignored.
102+
103+
SELECT object_type, object_schema, object_name
104+
FROM performance_schema.objects_summary_global_by_type
105+
WHERE object_schema="test";
106+
object_type object_schema object_name
107+
108+
# Truncate the MyISAM temporary tables, forcing them to be recreated as non-temporary.
109+
110+
TRUNCATE TABLE `sql_temp4_myisam`;
111+
TRUNCATE TABLE `#sql_temp4_myisam`;
112+
113+
# Confirm that the recreated MyISAM tables are still regarded as temporary and ignored.
114+
115+
SELECT object_type, object_schema, object_name
116+
FROM performance_schema.objects_summary_global_by_type
117+
WHERE object_schema="test";
118+
object_type object_schema object_name
119+
120+
# Drop the recreated MyISAM tables;
121+
122+
DROP TABLE `sql_temp4_myisam`;
123+
DROP TABLE `#sql_temp4_myisam`;
124+
125+
# Confirm that the recreated temporary tables are still ignored.
126+
127+
SELECT object_type, object_schema, object_name
128+
FROM performance_schema.objects_summary_global_by_type
129+
WHERE object_schema="test";
130+
object_type object_schema object_name
131+
132+
#
133+
# TEST 5: Generate temporary tables with ALTER MyISAM table.
134+
#
135+
USE test;
136+
CREATE TABLE t1 (a int) ENGINE=MYISAM;
137+
INSERT INTO t1 VALUES (1), (2), (3);
138+
ALTER TABLE t1 ADD COLUMN (b int);
139+
140+
# Confirm that the recreated temporary tables are still ignored.
141+
142+
SELECT object_type, object_schema, object_name
143+
FROM performance_schema.objects_summary_global_by_type
144+
WHERE object_schema="test";
145+
object_type object_schema object_name
146+
147+
# Drop the MyISAM table
148+
149+
DROP TABLE t1;
150+
151+
# Confirm that no tables remain;
152+
153+
SELECT object_type, object_schema, object_name
154+
FROM performance_schema.objects_summary_global_by_type
155+
WHERE object_schema="test";
156+
object_type object_schema object_name

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77

88
--source ../include/sizing_auto.inc
99

10+
CALL mtr.add_suppression("innodb_open_files should not be greater than the open_files_limit.");
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
#
2+
# Performance Schema
3+
#
4+
# Verify that the Performance Schema correctly identifies normal and temporary
5+
# tables with non-standard names.
6+
7+
# The server uses the table name prefix "#sql" for temporary and intermediate
8+
# tables, however user-defined tables having the "#sql" prefix are also permitted.
9+
# Independent of the table name, temporary or intermediate tables always have the
10+
# "#sql" prefix in the filename. (For non-temporary tables starting with "#",
11+
# the "#" is encoded to @0023 in the filename.)
12+
#
13+
# Given the ambiguity with temporary table names, the Performance Schema identifies
14+
# temporary tables tables either by the table category or by the filename.
15+
#
16+
--source include/have_perfschema.inc
17+
--source include/not_embedded.inc
18+
19+
--echo
20+
--echo #
21+
--echo # TEST 1: Normal tables prefixed with "#sql" and "sql".
22+
--echo #
23+
USE test;
24+
CREATE TABLE `#sql_1` (a int, b text);
25+
# INSERT forces path through get_table_share()
26+
INSERT INTO `#sql_1` VALUES(1,'one');
27+
--echo
28+
CREATE TABLE `sql_1` (a int, b text);
29+
INSERT INTO `sql_1` VALUES(1,'one');
30+
--echo
31+
--echo # Verify that the tables are treated as normal tables .
32+
--echo
33+
SELECT object_type, object_schema, object_name
34+
FROM performance_schema.objects_summary_global_by_type
35+
WHERE object_schema="test";
36+
--echo
37+
--echo # Drop the tables, verify that the table objects are removed.
38+
--echo
39+
DROP TABLE `#sql_1`;
40+
DROP TABLE `sql_1`;
41+
--echo
42+
SELECT object_type, object_schema, object_name
43+
FROM performance_schema.objects_summary_global_by_type
44+
WHERE object_schema="test";
45+
46+
--echo
47+
--echo #
48+
--echo # TEST 2: Temporary tables, no special prefix.
49+
--echo #
50+
CREATE TEMPORARY TABLE sql_temp2_myisam (a int, b text) ENGINE=MYISAM;
51+
INSERT INTO sql_temp2_myisam VALUES(1,'one');
52+
--echo
53+
CREATE TEMPORARY TABLE sql_temp2_innodb (a int, b text) ENGINE=INNODB;
54+
INSERT INTO sql_temp2_innodb VALUES(1,'one');
55+
--echo
56+
--echo # Confirm that the temporary tables are ignored.
57+
--echo
58+
SELECT object_type, object_schema, object_name
59+
FROM performance_schema.objects_summary_global_by_type
60+
WHERE object_schema="test";
61+
--echo
62+
--echo # Drop the tables, verify that the table objects are not created.
63+
--echo
64+
DROP TABLE sql_temp2_myisam;
65+
DROP TABLE sql_temp2_innodb;
66+
--echo
67+
SELECT object_type, object_schema, object_name
68+
FROM performance_schema.objects_summary_global_by_type
69+
WHERE object_schema="test";
70+
71+
--echo
72+
--echo #
73+
--echo # TEST 3: Temporary tables with the "#sql" prefix.
74+
--echo #
75+
CREATE TEMPORARY TABLE `#sql_temp3_myisam` (a int, b text) ENGINE=MYISAM;
76+
CHECK TABLE `#sql_temp3_myisam`;
77+
INSERT INTO `#sql_temp3_myisam` VALUES(1,'one');
78+
--echo
79+
CREATE TEMPORARY TABLE `#sql_temp3_innodb` (a int, b text) ENGINE=INNODB;
80+
CHECK TABLE `#sql_temp3_innodb`;
81+
INSERT INTO `#sql_temp3_innodb` VALUES(1,'one');
82+
--echo
83+
--echo # Confirm that the temporary tables are ignored.
84+
--echo
85+
SELECT object_type, object_schema, object_name
86+
FROM performance_schema.objects_summary_global_by_type
87+
WHERE object_schema="test";
88+
--echo
89+
--echo # Drop the temporary tables.
90+
--echo
91+
DROP TABLE `#sql_temp3_myisam`;
92+
DROP TABLE `#sql_temp3_innodb`;
93+
--echo
94+
--echo # Confirm that the temporary tables are still ignored.
95+
--echo
96+
SELECT object_type, object_schema, object_name
97+
FROM performance_schema.objects_summary_global_by_type
98+
WHERE object_schema="test";
99+
100+
--echo
101+
--echo #
102+
--echo # TEST 4: Special case: MyISAM temporary tables are recreated as non-temporary
103+
--echo # when they are truncated.
104+
--echo #
105+
CREATE TEMPORARY TABLE `sql_temp4_myisam` (a int, b text) ENGINE=MYISAM;
106+
INSERT INTO `sql_temp4_myisam` VALUES(1,'one');
107+
--echo
108+
CREATE TEMPORARY TABLE `#sql_temp4_myisam` (a int, b text) ENGINE=MYISAM;
109+
INSERT INTO `#sql_temp4_myisam` VALUES(1,'one');
110+
--echo
111+
--echo # Confirm that the MyISAM temporary tables are ignored.
112+
--echo
113+
SELECT object_type, object_schema, object_name
114+
FROM performance_schema.objects_summary_global_by_type
115+
WHERE object_schema="test";
116+
--echo
117+
--echo # Truncate the MyISAM temporary tables, forcing them to be recreated as non-temporary.
118+
--echo
119+
TRUNCATE TABLE `sql_temp4_myisam`;
120+
TRUNCATE TABLE `#sql_temp4_myisam`;
121+
--echo
122+
--echo # Confirm that the recreated MyISAM tables are still regarded as temporary and ignored.
123+
--echo
124+
SELECT object_type, object_schema, object_name
125+
FROM performance_schema.objects_summary_global_by_type
126+
WHERE object_schema="test";
127+
--echo
128+
--echo # Drop the recreated MyISAM tables;
129+
--echo
130+
DROP TABLE `sql_temp4_myisam`;
131+
DROP TABLE `#sql_temp4_myisam`;
132+
--echo
133+
--echo # Confirm that the recreated temporary tables are still ignored.
134+
--echo
135+
SELECT object_type, object_schema, object_name
136+
FROM performance_schema.objects_summary_global_by_type
137+
WHERE object_schema="test";
138+
139+
--echo
140+
--echo #
141+
--echo # TEST 5: Generate temporary tables with ALTER MyISAM table.
142+
--echo #
143+
USE test;
144+
CREATE TABLE t1 (a int) ENGINE=MYISAM;
145+
INSERT INTO t1 VALUES (1), (2), (3);
146+
# Force a path throug mysql_alter_table() and ha_create_table().
147+
ALTER TABLE t1 ADD COLUMN (b int);
148+
--echo
149+
--echo # Confirm that the recreated temporary tables are still ignored.
150+
--echo
151+
SELECT object_type, object_schema, object_name
152+
FROM performance_schema.objects_summary_global_by_type
153+
WHERE object_schema="test";
154+
--echo
155+
--echo # Drop the MyISAM table
156+
--echo
157+
DROP TABLE t1;
158+
159+
--echo
160+
--echo # Confirm that no tables remain;
161+
--echo
162+
SELECT object_type, object_schema, object_name
163+
FROM performance_schema.objects_summary_global_by_type
164+
WHERE object_schema="test";

0 commit comments

Comments
 (0)