Debian Codegraph @

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

raw
1
2
3 ################## mysql-test\t\thread_handling_basic.test ####################
4 # #
5 # Variable Name: thread_handling #
6 # Scope: Global #
7 # Access Type: Static #
8 # Data Type: enumeration #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author : Sharique Abdullah #
13 # #
14 # #
15 # Description:Test Cases of Dynamic System Variable thread_handling #
16 # that checks the behavior of this variable in the following ways #
17 # * Value Check #
18 # * Scope Check #
19 # #
20 # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
21 # server-system-variables.html #
22 # #
23 ###############################################################################
24
25 --echo '#---------------------BS_STVARS_051_01----------------------#'
26 ####################################################################
27 # Displaying default value #
28 ####################################################################
29 SELECT COUNT(@@GLOBAL.thread_handling);
30 --echo 1 Expected
31
32
33 --echo '#---------------------BS_STVARS_051_02----------------------#'
34 #
35 # Test case for Bug #35433
36 #
37 ####################################################################
38 # Check if Value can set #
39 ####################################################################
40
41
42 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
43 SET @@GLOBAL.thread_handling=1;
44
45 --ECHO Expected error ER_INCORRECT_GLOBAL_LOCAL_VAR
46
47 SELECT COUNT(@@GLOBAL.thread_handling);
48 --echo 1 Expected
49
50
51
52
53 --echo '#---------------------BS_STVARS_051_03----------------------#'
54 #################################################################
55 # Check if the value in GLOBAL Table matches value in variable #
56 #################################################################
57
58 SELECT @@GLOBAL.thread_handling = VARIABLE_VALUE
59 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
60 WHERE VARIABLE_NAME='thread_handling';
61 --echo 1 Expected
62
63 SELECT COUNT(@@GLOBAL.thread_handling);
64 --echo 1 Expected
65
66 SELECT COUNT(VARIABLE_VALUE)
67 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
68 WHERE VARIABLE_NAME='thread_handling';
69 --echo 1 Expected
70
71
72
73 --echo '#---------------------BS_STVARS_051_04----------------------#'
74 ################################################################################
75 # Check if accessing variable with and without GLOBAL point to same variable #
76 ################################################################################
77 SELECT @@thread_handling = @@GLOBAL.thread_handling;
78 --echo 1 Expected
79
80
81
82 --echo '#---------------------BS_STVARS_051_05----------------------#'
83 ################################################################################
84 # Check if thread_handling can be accessed with and without @@ sign #
85 ################################################################################
86
87 SELECT COUNT(@@thread_handling);
88 --echo 1 Expected
89
90 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
91 SELECT COUNT(@@local.thread_handling);
92 --echo Bug:Variable is global so it can not be accessed by local there should be error ER_INCORRECT_GLOBAL_LOCAL_VAR
93 --echo Expected error 'Variable is a GLOBAL variable'
94
95 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
96 SELECT COUNT(@@SESSION.thread_handling);
97 --ECHO Bug:Variable is global so it can not be accessed by session there should be error ER_INCORRECT_GLOBAL_LOCAL_VAR
98 --echo Expected error 'Variable is a GLOBAL variable'
99
100 SELECT COUNT(@@GLOBAL.thread_handling);
101 --echo 1 Expected
102
103 --Error ER_BAD_FIELD_ERROR
104 SELECT thread_handling = @@SESSION.thread_handling;
105 --echo Expected error 'Readonly variable'
106
107