| 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 |
#################################################################### |
| 30 |
SELECT 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 |
| 44 |
SET @@GLOBAL.thread_handling=1; |
| 45 |
|
| 46 |
--ECHO Expected error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 47 |
|
| 48 |
SELECT 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 |
| 60 |
SELECT @@GLOBAL.thread_handling = VARIABLE_VALUE |
| 61 |
FROM performance_schema.global_variables |
| 62 |
WHERE VARIABLE_NAME='thread_handling'; |
| 63 |
--enable_warnings |
| 64 |
--echo 1 Expected |
| 65 |
|
| 66 |
SELECT COUNT(@@GLOBAL.thread_handling); |
| 67 |
--echo 1 Expected |
| 68 |
|
| 69 |
--disable_warnings |
| 70 |
SELECT COUNT(VARIABLE_VALUE) |
| 71 |
FROM performance_schema.global_variables |
| 72 |
WHERE 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 |
################################################################################ |
| 82 |
SELECT @@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 |
|
| 92 |
SELECT COUNT(@@thread_handling); |
| 93 |
--echo 1 Expected |
| 94 |
|
| 95 |
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 96 |
SELECT 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 |
| 101 |
SELECT 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 |
|
| 105 |
SELECT COUNT(@@GLOBAL.thread_handling); |
| 106 |
--echo 1 Expected |
| 107 |
|
| 108 |
--Error ER_BAD_FIELD_ERROR |
| 109 |
SELECT thread_handling; |
| 110 |
--echo Expected error 'Unknown column' |
| 111 |
|
| 112 |
|