Debian Codegraph @

mysql-test/suite/sys_vars/t/thread_cache_size_basic.test

raw
1
2 #
3 # 2010-01-20 OBN - Added check of I_S values after variable value change
4 #
5
6 SET @start_global_value = @@global.thread_cache_size;
7 SELECT @start_global_value;
8
9 #
10 # exists as global only
11 #
12 select @@global.thread_cache_size;
13 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
14 select @@session.thread_cache_size;
15 show global variables like 'thread_cache_size';
16 show session variables like 'thread_cache_size';
17 --disable_warnings
18 select * from performance_schema.global_variables where variable_name='thread_cache_size';
19 select * from performance_schema.session_variables where variable_name='thread_cache_size';
20 --enable_warnings
21
22 #
23 # show that it's writable
24 #
25 set global thread_cache_size=1;
26 select @@global.thread_cache_size;
27 --disable_warnings
28 select * from performance_schema.global_variables where variable_name='thread_cache_size';
29 select * from performance_schema.session_variables where variable_name='thread_cache_size';
30 --enable_warnings
31 --error ER_GLOBAL_VARIABLE
32 set session thread_cache_size=1;
33 #
34 #check the default value #
35 #
36 SET @@global.thread_cache_size = DEFAULT;
37 SELECT @@global.thread_cache_size ;
38
39 #
40 # invalid values
41 #
42 SET @@global.thread_cache_size=-1;
43 SELECT @@global.thread_cache_size;
44 SET @@global.thread_cache_size=16385;
45 SELECT @@global.thread_cache_size;
46 SET @@global.thread_cache_size=163856;
47 SELECT @@global.thread_cache_size;
48 SET @@global.thread_cache_size=-1635;
49 SELECT @@global.thread_cache_size;
50
51 --error ER_WRONG_TYPE_FOR_VAR
52 SET @@global.thread_cache_size=' ';
53 SELECT @@global.thread_cache_size;
54 --error ER_WRONG_TYPE_FOR_VAR
55 SET @@global.thread_cache_size=255.2;
56 SELECT @@global.thread_cache_size;
57
58 #
59 # incorrect types
60 #
61 --error ER_WRONG_TYPE_FOR_VAR
62 set global thread_cache_size=1.1;
63 --error ER_WRONG_TYPE_FOR_VAR
64 set global thread_cache_size=1e1;
65 --error ER_WRONG_TYPE_FOR_VAR
66 set global thread_cache_size="foo";
67
68 #
69 # min/max values
70 #
71 set global thread_cache_size=0;
72 select @@global.thread_cache_size;
73 set global thread_cache_size=cast(-1 as unsigned int);
74 select @@global.thread_cache_size;
75
76 SET @@global.thread_cache_size = @start_global_value;
77 SELECT @@global.thread_cache_size;