| 1 |
##################### mysql-test\t\big_tables_basic.test ####################### |
| 2 |
# # |
| 3 |
# Variable Name: big_tables # |
| 4 |
# Scope: SESSION # |
| 5 |
# Access Type: Dynamic # |
| 6 |
# Data Type: Boolean # |
| 7 |
# Default Value: NA # |
| 8 |
# Range: NA # |
| 9 |
# # |
| 10 |
# # |
| 11 |
# Creation Date: 2008-02-07 # |
| 12 |
# Author: Salman Rawala # |
| 13 |
# # |
| 14 |
# Description: Test Cases of Dynamic System Variable "big_tables" # |
| 15 |
# that checks behavior of this variable in the following ways # |
| 16 |
# * Default Value # |
| 17 |
# * Valid & Invalid values # |
| 18 |
# * Scope & Access method # |
| 19 |
# * Data Integrity . # |
| 20 |
# # |
| 21 |
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # |
| 22 |
# server-options.html#option_mysqld_big-tables # |
| 23 |
# # |
| 24 |
################################################################################ |
| 25 |
|
| 26 |
--source include/load_sysvars.inc |
| 27 |
|
| 28 |
########################################################## |
| 29 |
# START OF big_tables TESTS # |
| 30 |
########################################################## |
| 31 |
|
| 32 |
|
| 33 |
################################################################## |
| 34 |
# Saving initial value of big_tables in a temporary variable # |
| 35 |
################################################################## |
| 36 |
|
| 37 |
SET @start_value = @@big_tables; |
| 38 |
SELECT @start_value; |
| 39 |
|
| 40 |
--echo '#--------------------FN_DYNVARS_005_01------------------------#' |
| 41 |
############################################################# |
| 42 |
# Display the DEFAULT value of big_tables # |
| 43 |
############################################################# |
| 44 |
|
| 45 |
SET @@big_tables = 1; |
| 46 |
SET @@big_tables = DEFAULT; |
| 47 |
SELECT @@big_tables; |
| 48 |
|
| 49 |
|
| 50 |
--echo '#--------------------FN_DYNVARS_005_02------------------------#' |
| 51 |
############################################################# |
| 52 |
# Change the value of big_tables to a valid value # |
| 53 |
############################################################# |
| 54 |
|
| 55 |
SET @@big_tables = 0; |
| 56 |
SELECT @@big_tables; |
| 57 |
SET @@big_tables = 1; |
| 58 |
SELECT @@big_tables; |
| 59 |
|
| 60 |
|
| 61 |
--echo '#--------------------FN_DYNVARS_005_03-------------------------#' |
| 62 |
########################################################################### |
| 63 |
# Change the value of big_tables to invalid value # |
| 64 |
########################################################################### |
| 65 |
|
| 66 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 67 |
SET @@big_tables = 2; |
| 68 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 69 |
SET @@big_tables = -1; |
| 70 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 71 |
SET @@big_tables = TRUEF; |
| 72 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 73 |
SET @@big_tables = TRUE_F; |
| 74 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 75 |
SET @@big_tables = FALSE0; |
| 76 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 77 |
SET @@big_tables = OON; |
| 78 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 79 |
SET @@big_tables = ONN; |
| 80 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 81 |
SET @@big_tables = OOFF; |
| 82 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 83 |
SET @@big_tables = 0FF; |
| 84 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 85 |
SET @@big_tables = ' '; |
| 86 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 87 |
SET @@big_tables = " "; |
| 88 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 89 |
SET @@big_tables = ''; |
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
--echo '#-------------------FN_DYNVARS_005_04----------------------------#' |
| 94 |
########################################################################### |
| 95 |
# Test if accessing global big_tables gives error # |
| 96 |
########################################################################### |
| 97 |
|
| 98 |
SET @@global.big_tables = 1-@@global.big_tables; |
| 99 |
SELECT @@global.big_tables; |
| 100 |
SET @@global.big_tables = 1-@@global.big_tables; |
| 101 |
|
| 102 |
--echo '#----------------------FN_DYNVARS_005_05------------------------#' |
| 103 |
############################################################################## |
| 104 |
# Check if the value in SESSION Tables matches values in variable # |
| 105 |
############################################################################## |
| 106 |
|
| 107 |
--disable_warnings |
| 108 |
SELECT IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE |
| 109 |
FROM performance_schema.session_variables |
| 110 |
WHERE VARIABLE_NAME='big_tables'; |
| 111 |
--enable_warnings |
| 112 |
|
| 113 |
|
| 114 |
--echo '#---------------------FN_DYNVARS_005_06----------------------#' |
| 115 |
################################################################### |
| 116 |
# Check if ON and OFF values can be used on variable # |
| 117 |
################################################################### |
| 118 |
|
| 119 |
SET @@big_tables = OFF; |
| 120 |
SELECT @@big_tables; |
| 121 |
SET @@big_tables = ON; |
| 122 |
SELECT @@big_tables; |
| 123 |
|
| 124 |
--echo '#---------------------FN_DYNVARS_005_07----------------------#' |
| 125 |
################################################################### |
| 126 |
# Check if TRUE and FALSE values can be used on variable # |
| 127 |
################################################################### |
| 128 |
|
| 129 |
SET @@big_tables = TRUE; |
| 130 |
SELECT @@big_tables; |
| 131 |
SET @@big_tables = FALSE; |
| 132 |
SELECT @@big_tables; |
| 133 |
|
| 134 |
|
| 135 |
--echo '#---------------------FN_DYNVARS_005_08----------------------#' |
| 136 |
############################################################################## |
| 137 |
# Check if accessing variable with SESSION,LOCAL and without SCOPE points # |
| 138 |
# to same session variable # |
| 139 |
############################################################################## |
| 140 |
|
| 141 |
SET @@big_tables = 0; |
| 142 |
SELECT @@big_tables = @@session.big_tables; |
| 143 |
SET @@big_tables = 1; |
| 144 |
SELECT @@big_tables = @@local.big_tables and @@local.big_tables = @@session.big_tables; |
| 145 |
|
| 146 |
--echo '#---------------------FN_DYNVARS_005_09----------------------#' |
| 147 |
########################################################################## |
| 148 |
# Check if big_tables can be accessed with and without @@ sign # |
| 149 |
########################################################################## |
| 150 |
|
| 151 |
SET big_tables = 1; |
| 152 |
SELECT @@big_tables; |
| 153 |
--Error ER_PARSE_ERROR |
| 154 |
SET local.big_tables = 1; |
| 155 |
--Error ER_UNKNOWN_TABLE |
| 156 |
SELECT local.big_tables; |
| 157 |
--Error ER_PARSE_ERROR |
| 158 |
SET session.big_tables = 1; |
| 159 |
--Error ER_UNKNOWN_TABLE |
| 160 |
SELECT session.big_tables; |
| 161 |
--Error ER_BAD_FIELD_ERROR |
| 162 |
select big_tables; |
| 163 |
|
| 164 |
|
| 165 |
############################## |
| 166 |
# Restore initial value # |
| 167 |
############################## |
| 168 |
|
| 169 |
SET @@big_tables = @start_value; |
| 170 |
SELECT @@big_tables; |
| 171 |
|
| 172 |
|
| 173 |
####################################################### |
| 174 |
# END OF big_tables TESTS # |
| 175 |
####################################################### |
| 176 |
|
| 177 |
|