| 1 |
set @save_query_cache_size=@@global.query_cache_size; |
| 2 |
set global query_cache_type=ON; |
| 3 |
set local query_cache_type=ON; |
| 4 |
set global query_cache_size=1355776; |
| 5 |
create table t1 (a int not null); |
| 6 |
insert into t1 values (1),(2),(3); |
| 7 |
select * from t1; |
| 8 |
a |
| 9 |
1 |
| 10 |
2 |
| 11 |
3 |
| 12 |
select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info; |
| 13 |
statement_schema statement_text result_blocks_count result_blocks_size |
| 14 |
test select * from t1 1 512 |
| 15 |
select @@time_zone into @time_zone; |
| 16 |
select @@default_week_format into @default_week_format; |
| 17 |
select @@character_set_client into @character_set_client; |
| 18 |
select @@character_set_results into @character_set_results; |
| 19 |
select @@sql_mode into @sql_mode; |
| 20 |
select @@div_precision_increment into @div_precision_increment; |
| 21 |
select @@lc_time_names into @lc_time_names; |
| 22 |
select @@max_sort_length into @max_sort_length; |
| 23 |
select @@autocommit into @autocommit; |
| 24 |
select @@group_concat_max_len into @group_concat_max_len; |
| 25 |
select Name into @new_time_zone from mysql.time_zone_name limit 1; |
| 26 |
set time_zone=@new_time_zone,default_week_format=4,character_set_client='binary',character_set_results='utf32',collation_connection='utf32_bin',sql_mode='STRICT_ALL_TABLES',div_precision_increment=7,lc_time_names='ar_SD',autocommit=0, group_concat_max_len=513, max_sort_length=1011; |
| 27 |
select * from t1; |
| 28 |
set time_zone= @time_zone, default_week_format= @default_week_format, character_set_client= @character_set_client,character_set_results= @character_set_results, sql_mode= @sql_mode, div_precision_increment= @div_precision_increment, lc_time_names= @lc_time_names, autocommit= @autocommit, group_concat_max_len= @group_concat_max_len, max_sort_length= @max_sort_length; |
| 29 |
select * from information_schema.query_cache_info; |
| 30 |
STATEMENT_SCHEMA STATEMENT_TEXT RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BLOCKS_SIZE_USED LIMIT MAX_SORT_LENGTH GROUP_CONCAT_MAX_LENGTH CHARACTER_SET_CLIENT CHARACTER_SET_RESULT COLLATION TIMEZONE DEFAULT_WEEK_FORMAT DIV_PRECISION_INCREMENT SQL_MODE LC_TIME_NAMES CLIENT_LONG_FLAG CLIENT_PROTOCOL_41 CLIENT_EXTENDED_METADATA PROTOCOL_TYPE MORE_RESULTS_EXISTS IN_TRANS AUTOCOMMIT PACKET_NUMBER HITS |
| 31 |
test select * from t1 1 512 # -1 1011 513 binary utf32 utf32_bin Europe/Moscow 4 7 STRICT_ALL_TABLES ar_SD 1 1 1 # 0 0 0 # 0 |
| 32 |
test select * from t1 1 512 # -1 1024 1048576 latin1 latin1 latin1_swedish_ci SYSTEM 0 4 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION en_US 1 1 1 # 0 0 1 # 0 |
| 33 |
create user mysqltest; |
| 34 |
grant select on test.* to mysqltest; |
| 35 |
connect conn1,localhost,mysqltest,,; |
| 36 |
connection conn1; |
| 37 |
select a from t1; |
| 38 |
a |
| 39 |
1 |
| 40 |
2 |
| 41 |
3 |
| 42 |
select count(*) from information_schema.query_cache_info; |
| 43 |
count(*) |
| 44 |
0 |
| 45 |
connection default; |
| 46 |
drop user mysqltest; |
| 47 |
drop table t1; |
| 48 |
set @@global.query_cache_size=@save_query_cache_size; |
| 49 |
set global query_cache_type=default; |