| 1 |
|
| 2 |
|
| 3 |
################## mysql-test\t\version_compile_machine_basic.test ############ |
| 4 |
# # |
| 5 |
# Variable Name: version_compile_machine # |
| 6 |
# Scope: Global # |
| 7 |
# Access Type: Static # |
| 8 |
# Data Type: String # |
| 9 |
# # |
| 10 |
# # |
| 11 |
# Creation Date: 2008-02-07 # |
| 12 |
# Author : Sharique Abdullah # |
| 13 |
# # |
| 14 |
# # |
| 15 |
# Description:Test Cases of Dynamic System Variable version_compile_machine # |
| 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_055_01----------------------#' |
| 26 |
#################################################################### |
| 27 |
# Displaying default value # |
| 28 |
#################################################################### |
| 29 |
SELECT COUNT(@@GLOBAL.version_compile_machine); |
| 30 |
--echo 1 Expected |
| 31 |
|
| 32 |
|
| 33 |
--echo '#---------------------BS_STVARS_055_02----------------------#' |
| 34 |
#################################################################### |
| 35 |
# Check if Value can set # |
| 36 |
#################################################################### |
| 37 |
|
| 38 |
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 39 |
SET @@GLOBAL.version_compile_machine=1; |
| 40 |
--echo Expected error 'Read only variable' |
| 41 |
|
| 42 |
SELECT COUNT(@@GLOBAL.version_compile_machine); |
| 43 |
--echo 1 Expected |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
--echo '#---------------------BS_STVARS_055_03----------------------#' |
| 49 |
################################################################# |
| 50 |
# Check if the value in GLOBAL Table matches value in variable # |
| 51 |
################################################################# |
| 52 |
|
| 53 |
--disable_warnings |
| 54 |
SELECT @@GLOBAL.version_compile_machine = VARIABLE_VALUE |
| 55 |
FROM performance_schema.global_variables |
| 56 |
WHERE VARIABLE_NAME='version_compile_machine'; |
| 57 |
--enable_warnings |
| 58 |
--echo 1 Expected |
| 59 |
|
| 60 |
SELECT COUNT(@@GLOBAL.version_compile_machine); |
| 61 |
--echo 1 Expected |
| 62 |
|
| 63 |
--disable_warnings |
| 64 |
SELECT COUNT(VARIABLE_VALUE) |
| 65 |
FROM performance_schema.global_variables |
| 66 |
WHERE VARIABLE_NAME='version_compile_machine'; |
| 67 |
--enable_warnings |
| 68 |
--echo 1 Expected |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
--echo '#---------------------BS_STVARS_055_04----------------------#' |
| 73 |
################################################################################ |
| 74 |
# Check if accessing variable with and without GLOBAL point to same variable # |
| 75 |
################################################################################ |
| 76 |
SELECT @@version_compile_machine = @@GLOBAL.version_compile_machine; |
| 77 |
--echo 1 Expected |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
--echo '#---------------------BS_STVARS_055_05----------------------#' |
| 82 |
################################################################################ |
| 83 |
# Check if version_compile_machine can be accessed with and without @@ sign # |
| 84 |
################################################################################ |
| 85 |
|
| 86 |
SELECT COUNT(@@version_compile_machine); |
| 87 |
--echo 1 Expected |
| 88 |
|
| 89 |
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 90 |
SELECT COUNT(@@local.version_compile_machine); |
| 91 |
--echo Expected error 'Variable is a GLOBAL variable' |
| 92 |
|
| 93 |
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 94 |
SELECT COUNT(@@SESSION.version_compile_machine); |
| 95 |
--echo Expected error 'Variable is a GLOBAL variable' |
| 96 |
|
| 97 |
SELECT COUNT(@@GLOBAL.version_compile_machine); |
| 98 |
--echo 1 Expected |
| 99 |
|
| 100 |
--Error ER_BAD_FIELD_ERROR |
| 101 |
SELECT version_compile_machine; |
| 102 |
--echo Expected error 'Unknown column' |
| 103 |
|
| 104 |
|