1
diff -ruN a/mysql-test/r/show_temp_tables.result b/mysql-test/r/show_temp_tables.result
2
--- /dev/null 1970-01-01 09:00:00.000000000 +0900
3
+++ b/mysql-test/r/show_temp_tables.result 2010-04-30 19:46:32.000000000 +0900
5
+drop table if exists t1,t2,t3;
6
+drop database if exists showtemp;
7
+create database if not exists showtemp;
9
+create temporary table t1(id int);
10
+create temporary table t2(id int);
11
+create temporary table showtemp.t3(id int);
12
+insert into t1 values(10),(20),(30),(40);
13
+insert into showtemp.t3 values(999);
14
+show temporary tables;
18
+show temporary tables from test;
22
+show temporary tables in showtemp;
23
+Temp_tables_in_showtemp
25
+select table_schema, table_name, engine, table_rows from Information_schema.temporary_tables;
26
+table_schema table_name engine table_rows
30
+select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
31
+table_schema table_name engine table_rows
35
+select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables where table_schema='showtemp';
36
+table_schema table_name engine table_rows
38
+select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables where table_schema='temp';
39
+table_schema table_name engine table_rows
40
+drop table if exists showtemp.t2;
41
+create temporary table t1(id int);
42
+create temporary table showtemp.t2(id int);
43
+show temporary tables;
46
+select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
47
+table_schema table_name engine table_rows
53
+drop table showtemp.t2;
55
+select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
56
+table_schema table_name engine table_rows
61
+drop table showtemp.t3;
62
+drop database showtemp;
63
diff -ruN a/mysql-test/t/show_temp_tables.test b/mysql-test/t/show_temp_tables.test
64
--- /dev/null 1970-01-01 09:00:00.000000000 +0900
65
+++ b/mysql-test/t/show_temp_tables.test 2010-04-30 19:46:32.000000000 +0900
67
+# Uses GRANT commands that usually disabled in embedded server
68
+-- source include/not_embedded.inc
70
+# Save the initial number of concurrent sessions
71
+--source include/count_sessions.inc
74
+# Test of SHOW [GLOBAL] TEMPORARY TABLES [FROM/IN] DB and
75
+# Information_schema.temporary_tables and global_temporary_tables
78
+connect(stcon1,localhost,root,,test);
79
+connect(stcon2,localhost,root,,test);
84
+drop table if exists t1,t2,t3;
85
+drop database if exists showtemp;
86
+create database if not exists showtemp;
90
+create temporary table t1(id int);
91
+create temporary table t2(id int);
92
+create temporary table showtemp.t3(id int);
93
+insert into t1 values(10),(20),(30),(40);
94
+insert into showtemp.t3 values(999);
96
+show temporary tables;
97
+# "Session" is not same value always. mysql-test cannot test it always.
98
+#show global temporary tables;
99
+show temporary tables from test;
100
+show temporary tables in showtemp;
101
+select table_schema, table_name, engine, table_rows from Information_schema.temporary_tables;
102
+select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
103
+select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables where table_schema='showtemp';
104
+select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables where table_schema='temp';
109
+drop table if exists showtemp.t2;
111
+create temporary table t1(id int);
112
+create temporary table showtemp.t2(id int);
113
+show temporary tables;
114
+select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
115
+drop table showtemp.t2;
121
+select table_schema, table_name, engine, table_rows from Information_schema.global_temporary_tables;
124
+drop table showtemp.t3;
125
+drop database showtemp;
130
+# Wait till all disconnects are completed
131
+--source include/wait_until_count_sessions.inc
132
1
diff -ruN a/sql/mysqld.cc b/sql/mysqld.cc
133
2
--- a/sql/mysqld.cc 2010-04-30 19:37:14.000000000 +0900
134
3
+++ b/sql/mysqld.cc 2010-04-30 19:46:32.000000000 +0900