| 1 |
################# mysql-test\t\innodb_autoextend_increment _basic.test ########### |
| 2 |
# # |
| 3 |
# Variable Name: innodb_autoextend_increment # |
| 4 |
# Scope: GLOBAL # |
| 5 |
# Access Type: Dynamic # |
| 6 |
# Data Type: Numeric # |
| 7 |
# Default Value: 64 # |
| 8 |
# Range: 0,1 # |
| 9 |
# # |
| 10 |
# # |
| 11 |
# Creation Date: 2008-02-07 # |
| 12 |
# Author: Rizwan # |
| 13 |
# # |
| 14 |
# Description: # |
| 15 |
# Test Cases of Dynamic System Variable innodb_autoextend_increment that # |
| 16 |
# checks the behavior of this variable in the following ways # |
| 17 |
# * Default Value # |
| 18 |
# * Valid & Invalid values # |
| 19 |
# * Scope & Access method # |
| 20 |
# * Data Integrity # |
| 21 |
# # |
| 22 |
# Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # |
| 23 |
# # |
| 24 |
################################################################################## |
| 25 |
|
| 26 |
--source include/load_sysvars.inc |
| 27 |
|
| 28 |
######################################################################## |
| 29 |
# START OF innodb_autoextend_increment TESTS # |
| 30 |
######################################################################## |
| 31 |
|
| 32 |
|
| 33 |
############################################################################### |
| 34 |
# Saving initial value of innodb_autoextend_increment in a temporary variable # |
| 35 |
############################################################################### |
| 36 |
|
| 37 |
|
| 38 |
SET @global_start_value = @@global.innodb_autoextend_increment ; |
| 39 |
|
| 40 |
--echo '#--------------------FN_DYNVARS_046_01------------------------#' |
| 41 |
######################################################################## |
| 42 |
# Display the DEFAULT value of innodb_autoextend_increment # |
| 43 |
######################################################################## |
| 44 |
|
| 45 |
SET @@global.innodb_autoextend_increment = 0; |
| 46 |
SET @@global.innodb_autoextend_increment = DEFAULT; |
| 47 |
SELECT @@global.innodb_autoextend_increment ; |
| 48 |
|
| 49 |
--echo '#---------------------FN_DYNVARS_046_02-------------------------#' |
| 50 |
#################################################################################### |
| 51 |
# Check if innodb_autoextend_increment can be accessed with and without @@ sign # |
| 52 |
#################################################################################### |
| 53 |
|
| 54 |
--Error ER_GLOBAL_VARIABLE |
| 55 |
SET innodb_autoextend_increment = 1; |
| 56 |
SELECT @@innodb_autoextend_increment ; |
| 57 |
|
| 58 |
--Error ER_UNKNOWN_TABLE |
| 59 |
SELECT local.innodb_autoextend_increment ; |
| 60 |
|
| 61 |
SET global innodb_autoextend_increment = 0; |
| 62 |
SELECT @@global.innodb_autoextend_increment ; |
| 63 |
|
| 64 |
|
| 65 |
--echo '#--------------------FN_DYNVARS_046_03------------------------#' |
| 66 |
########################################################################## |
| 67 |
# change the value of innodb_autoextend_increment to a valid value # |
| 68 |
########################################################################## |
| 69 |
|
| 70 |
SET @@global.innodb_autoextend_increment = 1; |
| 71 |
SELECT @@global.innodb_autoextend_increment ; |
| 72 |
SET @@global.innodb_autoextend_increment = 1000; |
| 73 |
SELECT @@global.innodb_autoextend_increment ; |
| 74 |
|
| 75 |
|
| 76 |
--echo '#--------------------FN_DYNVARS_046_04-------------------------#' |
| 77 |
########################################################################### |
| 78 |
# Change the value of innodb_autoextend_increment to invalid value # |
| 79 |
########################################################################### |
| 80 |
|
| 81 |
SET @@global.innodb_autoextend_increment = -1; |
| 82 |
SELECT @@global.innodb_autoextend_increment; |
| 83 |
|
| 84 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 85 |
SET @@global.innodb_autoextend_increment = "T"; |
| 86 |
SELECT @@global.innodb_autoextend_increment; |
| 87 |
|
| 88 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 89 |
SET @@global.innodb_autoextend_increment = "Y"; |
| 90 |
SELECT @@global.innodb_autoextend_increment; |
| 91 |
|
| 92 |
SET @@global.innodb_autoextend_increment = 1001; |
| 93 |
SELECT @@global.innodb_autoextend_increment; |
| 94 |
|
| 95 |
|
| 96 |
SET @@global.innodb_autoextend_increment = 2000 ; |
| 97 |
SELECT @@global.innodb_autoextend_increment; |
| 98 |
|
| 99 |
--echo '#----------------------FN_DYNVARS_046_05------------------------#' |
| 100 |
######################################################################### |
| 101 |
# Check if the value in GLOBAL Table matches value in variable # |
| 102 |
######################################################################### |
| 103 |
|
| 104 |
--disable_warnings |
| 105 |
SELECT @@global.innodb_autoextend_increment = VARIABLE_VALUE |
| 106 |
FROM performance_schema.global_variables |
| 107 |
WHERE VARIABLE_NAME='innodb_autoextend_increment'; |
| 108 |
--enable_warnings |
| 109 |
SELECT @@global.innodb_autoextend_increment ; |
| 110 |
--disable_warnings |
| 111 |
SELECT VARIABLE_VALUE |
| 112 |
FROM performance_schema.global_variables |
| 113 |
WHERE VARIABLE_NAME='innodb_autoextend_increment'; |
| 114 |
--enable_warnings |
| 115 |
|
| 116 |
|
| 117 |
--echo '#---------------------FN_DYNVARS_046_06-------------------------#' |
| 118 |
################################################################### |
| 119 |
# Check if ON and OFF values can be used on variable # |
| 120 |
################################################################### |
| 121 |
|
| 122 |
--ERROR ER_WRONG_TYPE_FOR_VAR |
| 123 |
SET @@global.innodb_autoextend_increment = OFF; |
| 124 |
SELECT @@global.innodb_autoextend_increment ; |
| 125 |
|
| 126 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 127 |
SET @@global.innodb_autoextend_increment = ON; |
| 128 |
SELECT @@global.innodb_autoextend_increment ; |
| 129 |
|
| 130 |
|
| 131 |
--echo '#---------------------FN_DYNVARS_046_07----------------------#' |
| 132 |
################################################################### |
| 133 |
# Check if TRUE and FALSE values can be used on variable # |
| 134 |
################################################################### |
| 135 |
|
| 136 |
SET @@global.innodb_autoextend_increment = TRUE; |
| 137 |
SELECT @@global.innodb_autoextend_increment ; |
| 138 |
SET @@global.innodb_autoextend_increment = FALSE; |
| 139 |
SELECT @@global.innodb_autoextend_increment ; |
| 140 |
|
| 141 |
|
| 142 |
############################## |
| 143 |
# Restore initial value # |
| 144 |
############################## |
| 145 |
|
| 146 |
SET @@global.innodb_autoextend_increment = @global_start_value; |
| 147 |
|
| 148 |
############################################################### |
| 149 |
# END OF innodb_autoextend_increment TESTS # |
| 150 |
############################################################### |
| 151 |
|