3
################## mysql-test\t\thread_handling_basic.test ####################
5
# Variable Name: thread_handling #
7
# Access Type: Static #
8
# Data Type: enumeration #
11
# Creation Date: 2008-02-07 #
12
# Author : Sharique Abdullah #
15
# Description:Test Cases of Dynamic System Variable thread_handling #
16
# that checks the behavior of this variable in the following ways #
20
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
21
# server-system-variables.html #
23
###############################################################################
25
--echo '#---------------------BS_STVARS_051_01----------------------#'
26
####################################################################
27
# Displaying default value #
28
####################################################################
29
SELECT COUNT(@@GLOBAL.thread_handling);
33
--echo '#---------------------BS_STVARS_051_02----------------------#'
35
# Test case for Bug #35433
37
####################################################################
38
# Check if Value can set #
39
####################################################################
42
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
43
SET @@GLOBAL.thread_handling=1;
45
--ECHO Expected error ER_INCORRECT_GLOBAL_LOCAL_VAR
47
SELECT COUNT(@@GLOBAL.thread_handling);
53
--echo '#---------------------BS_STVARS_051_03----------------------#'
54
#################################################################
55
# Check if the value in GLOBAL Table matches value in variable #
56
#################################################################
58
SELECT @@GLOBAL.thread_handling = VARIABLE_VALUE
59
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
60
WHERE VARIABLE_NAME='thread_handling';
63
SELECT COUNT(@@GLOBAL.thread_handling);
66
SELECT COUNT(VARIABLE_VALUE)
67
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
68
WHERE VARIABLE_NAME='thread_handling';
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;
82
--echo '#---------------------BS_STVARS_051_05----------------------#'
83
################################################################################
84
# Check if thread_handling can be accessed with and without @@ sign #
85
################################################################################
87
SELECT COUNT(@@thread_handling);
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'
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'
100
SELECT COUNT(@@GLOBAL.thread_handling);
103
--Error ER_BAD_FIELD_ERROR
104
SELECT thread_handling = @@SESSION.thread_handling;
105
--echo Expected error 'Readonly variable'