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
26--echo '#---------------------BS_STVARS_051_01----------------------#'
27####################################################################
28#   Displaying default value                                       #
29####################################################################
30SELECT COUNT(@@GLOBAL.thread_handling);
31--echo 1 Expected
32
33
34--echo '#---------------------BS_STVARS_051_02----------------------#'
35#
36# Test case for Bug #35433
37#
38####################################################################
39#   Check if Value can set                                         #
40####################################################################
41
42
43--error ER_INCORRECT_GLOBAL_LOCAL_VAR
44SET @@GLOBAL.thread_handling=1;
45
46--ECHO Expected error  ER_INCORRECT_GLOBAL_LOCAL_VAR
47
48SELECT COUNT(@@GLOBAL.thread_handling);
49--echo 1 Expected
50
51
52
53
54--echo '#---------------------BS_STVARS_051_03----------------------#'
55#################################################################
56# Check if the value in GLOBAL Table matches value in variable  #
57#################################################################
58
59--disable_warnings
60SELECT @@GLOBAL.thread_handling = VARIABLE_VALUE
61FROM performance_schema.global_variables
62WHERE VARIABLE_NAME='thread_handling';
63--enable_warnings
64--echo 1 Expected
65
66SELECT COUNT(@@GLOBAL.thread_handling);
67--echo 1 Expected
68
69--disable_warnings
70SELECT COUNT(VARIABLE_VALUE)
71FROM performance_schema.global_variables
72WHERE VARIABLE_NAME='thread_handling';
73--enable_warnings
74--echo 1 Expected
75
76
77
78--echo '#---------------------BS_STVARS_051_04----------------------#'
79################################################################################
80#  Check if accessing variable with and without GLOBAL point to same variable  #
81################################################################################
82SELECT @@thread_handling = @@GLOBAL.thread_handling;
83--echo 1 Expected
84
85
86
87--echo '#---------------------BS_STVARS_051_05----------------------#'
88################################################################################
89#   Check if thread_handling can be accessed with and without @@ sign          #
90################################################################################
91
92SELECT COUNT(@@thread_handling);
93--echo 1 Expected
94
95--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
96SELECT COUNT(@@local.thread_handling);
97--echo Bug:Variable is global so it can not be accessed by local there should be error ER_INCORRECT_GLOBAL_LOCAL_VAR
98--echo Expected error 'Variable is a GLOBAL variable'
99
100--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
101SELECT COUNT(@@SESSION.thread_handling);
102--ECHO Bug:Variable is global so it can not be accessed by session there should be error ER_INCORRECT_GLOBAL_LOCAL_VAR
103--echo Expected error 'Variable is a GLOBAL variable'
104
105SELECT COUNT(@@GLOBAL.thread_handling);
106--echo 1 Expected
107
108--Error ER_BAD_FIELD_ERROR
109SELECT thread_handling = @@SESSION.thread_handling;
110--echo Expected error 'Readonly variable'
111
112
113