~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/r/status.result

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
set @old_concurrent_insert= @@global.concurrent_insert;
 
2
set @@global.concurrent_insert= 0;
 
3
SET @old_log_output = @@global.log_output;
 
4
SET GLOBAL LOG_OUTPUT = 'FILE';
 
5
flush status;
 
6
show status like 'Table_lock%';
 
7
Variable_name   Value
 
8
Table_locks_immediate   0
 
9
Table_locks_waited      0
 
10
select * from information_schema.session_status where variable_name like 'Table_lock%';
 
11
VARIABLE_NAME   VARIABLE_VALUE
 
12
TABLE_LOCKS_IMMEDIATE   0
 
13
TABLE_LOCKS_WAITED      0
 
14
# Switched to connection: con1
 
15
set sql_log_bin=0;
 
16
set @old_general_log = @@global.general_log;
 
17
set global general_log = 'OFF';
 
18
drop table if exists t1;
 
19
create table t1(n int) engine=myisam;
 
20
insert into t1 values(1);
 
21
select 1;
 
22
1
 
23
1
 
24
# Switched to connection: con2
 
25
lock tables t1 read;
 
26
unlock tables;
 
27
lock tables t1 read;
 
28
# Switched to connection: con1
 
29
update t1 set n = 3;
 
30
# Switched to connection: con2
 
31
unlock tables;
 
32
# Switched to connection: con1
 
33
show status like 'Table_locks_waited';
 
34
Variable_name   Value
 
35
Table_locks_waited      1
 
36
drop table t1;
 
37
set global general_log = @old_general_log;
 
38
# Switched to connection: default
 
39
select 1;
 
40
1
 
41
1
 
42
show status like 'last_query_cost';
 
43
Variable_name   Value
 
44
Last_query_cost 0.000000
 
45
create table t1 (a int);
 
46
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
 
47
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
 
48
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
 
49
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
 
50
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
 
51
select * from t1 where a=6;
 
52
a
 
53
6
 
54
6
 
55
6
 
56
6
 
57
6
 
58
show status like 'last_query_cost';
 
59
Variable_name   Value
 
60
Last_query_cost 12.084449
 
61
show status like 'last_query_cost';
 
62
Variable_name   Value
 
63
Last_query_cost 12.084449
 
64
select 1;
 
65
1
 
66
1
 
67
show status like 'last_query_cost';
 
68
Variable_name   Value
 
69
Last_query_cost 0.000000
 
70
drop table t1;
 
71
FLUSH STATUS;
 
72
SHOW STATUS LIKE 'max_used_connections';
 
73
Variable_name   Value
 
74
Max_used_connections    1
 
75
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
 
76
VARIABLE_NAME   VARIABLE_VALUE
 
77
MAX_USED_CONNECTIONS    1
 
78
SET @save_thread_cache_size=@@thread_cache_size;
 
79
SET GLOBAL thread_cache_size=3;
 
80
SHOW STATUS LIKE 'max_used_connections';
 
81
Variable_name   Value
 
82
Max_used_connections    3
 
83
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
 
84
VARIABLE_NAME   VARIABLE_VALUE
 
85
MAX_USED_CONNECTIONS    3
 
86
FLUSH STATUS;
 
87
SHOW STATUS LIKE 'max_used_connections';
 
88
Variable_name   Value
 
89
Max_used_connections    2
 
90
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
 
91
VARIABLE_NAME   VARIABLE_VALUE
 
92
MAX_USED_CONNECTIONS    2
 
93
SHOW STATUS LIKE 'max_used_connections';
 
94
Variable_name   Value
 
95
Max_used_connections    3
 
96
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
 
97
VARIABLE_NAME   VARIABLE_VALUE
 
98
MAX_USED_CONNECTIONS    3
 
99
SHOW STATUS LIKE 'max_used_connections';
 
100
Variable_name   Value
 
101
Max_used_connections    4
 
102
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
 
103
VARIABLE_NAME   VARIABLE_VALUE
 
104
MAX_USED_CONNECTIONS    4
 
105
SET GLOBAL thread_cache_size=@save_thread_cache_size;
 
106
CREATE TABLE t1 ( a INT );
 
107
INSERT INTO t1 VALUES (1), (2);
 
108
SELECT a FROM t1 LIMIT 1;
 
109
a
 
110
1
 
111
SHOW SESSION STATUS LIKE 'Last_query_cost';
 
112
Variable_name   Value
 
113
Last_query_cost 2.402418
 
114
EXPLAIN SELECT a FROM t1;
 
115
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
116
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    2       
 
117
SHOW SESSION STATUS LIKE 'Last_query_cost';
 
118
Variable_name   Value
 
119
Last_query_cost 2.402418
 
120
SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a;
 
121
a
 
122
1
 
123
2
 
124
SHOW SESSION STATUS LIKE 'Last_query_cost';
 
125
Variable_name   Value
 
126
Last_query_cost 0.000000
 
127
EXPLAIN SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a;
 
128
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
129
1       PRIMARY t1      ALL     NULL    NULL    NULL    NULL    2       
 
130
2       UNION   t1      ALL     NULL    NULL    NULL    NULL    2       
 
131
NULL    UNION RESULT    <union1,2>      ALL     NULL    NULL    NULL    NULL    NULL    Using filesort
 
132
SHOW SESSION STATUS LIKE 'Last_query_cost';
 
133
Variable_name   Value
 
134
Last_query_cost 0.000000
 
135
SELECT a IN (SELECT a FROM t1) FROM t1 LIMIT 1;
 
136
a IN (SELECT a FROM t1)
 
137
1
 
138
SHOW SESSION STATUS LIKE 'Last_query_cost';
 
139
Variable_name   Value
 
140
Last_query_cost 0.000000
 
141
SELECT (SELECT a FROM t1 LIMIT 1) x FROM t1 LIMIT 1;
 
142
x
 
143
1
 
144
SHOW SESSION STATUS LIKE 'Last_query_cost';
 
145
Variable_name   Value
 
146
Last_query_cost 0.000000
 
147
SELECT * FROM t1 a, t1 b LIMIT 1;
 
148
a       a
 
149
1       1
 
150
SHOW SESSION STATUS LIKE 'Last_query_cost';
 
151
Variable_name   Value
 
152
Last_query_cost 4.805836
 
153
DROP TABLE t1;
 
154
show status like 'com_show_status';
 
155
Variable_name   Value
 
156
Com_show_status 3
 
157
show status like 'hand%write%';
 
158
Variable_name   Value
 
159
Handler_write   0
 
160
show status like '%tmp%';
 
161
Variable_name   Value
 
162
Created_tmp_disk_tables 0
 
163
Created_tmp_files       0
 
164
Created_tmp_tables      0
 
165
show status like 'hand%write%';
 
166
Variable_name   Value
 
167
Handler_write   0
 
168
show status like '%tmp%';
 
169
Variable_name   Value
 
170
Created_tmp_disk_tables 0
 
171
Created_tmp_files       0
 
172
Created_tmp_tables      0
 
173
show status like 'com_show_status';
 
174
Variable_name   Value
 
175
Com_show_status 8
 
176
rnd_diff        tmp_table_diff
 
177
20      8
 
178
flush status;
 
179
show status like 'Com%function';
 
180
Variable_name   Value
 
181
Com_alter_function      0
 
182
Com_create_function     0
 
183
Com_drop_function       0
 
184
create function f1 (x INTEGER) returns integer
 
185
begin
 
186
declare ret integer;
 
187
set ret = x * 10;
 
188
return ret;
 
189
end //
 
190
drop function f1;
 
191
show status like 'Com%function';
 
192
Variable_name   Value
 
193
Com_alter_function      0
 
194
Com_create_function     1
 
195
Com_drop_function       1
 
196
create database db37908;
 
197
create table db37908.t1(f1 int);
 
198
insert into db37908.t1 values(1);
 
199
grant usage,execute on test.* to mysqltest_1@localhost;
 
200
create procedure proc37908() begin select 1; end |
 
201
create function func37908() returns int sql security invoker
 
202
return (select * from db37908.t1 limit 1)|
 
203
select * from db37908.t1;
 
204
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't1'
 
205
show status where variable_name ='uptime' and 2 in (select * from db37908.t1);
 
206
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't1'
 
207
show procedure status where name ='proc37908' and 1 in (select f1 from db37908.t1);
 
208
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't1'
 
209
show function status where name ='func37908' and 1 in (select func37908());
 
210
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't1'
 
211
drop database db37908;
 
212
drop procedure proc37908;
 
213
drop function func37908;
 
214
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
 
215
DROP USER mysqltest_1@localhost;
 
216
DROP PROCEDURE IF EXISTS p1;
 
217
DROP FUNCTION IF EXISTS f1;
 
218
CREATE FUNCTION f1() RETURNS INTEGER
 
219
BEGIN
 
220
DECLARE foo INTEGER;
 
221
DECLARE bar INTEGER;
 
222
SET foo=1;
 
223
SET bar=2;
 
224
RETURN foo;
 
225
END $$
 
226
CREATE PROCEDURE p1()
 
227
BEGIN
 
228
SELECT 1;
 
229
END $$
 
230
SELECT f1();
 
231
f1()
 
232
1
 
233
CALL p1();
 
234
1
 
235
1
 
236
SELECT 9;
 
237
9
 
238
9
 
239
DROP PROCEDURE p1;
 
240
DROP FUNCTION f1;
 
241
set @@global.concurrent_insert= @old_concurrent_insert;
 
242
SET GLOBAL log_output = @old_log_output;