| 1 |
################# mysql-test\t\delayed_insert_timeout_basic.test ############### |
| 2 |
# # |
| 3 |
# Variable Name: delayed_insert_timeout # |
| 4 |
# Scope: GLOBAL # |
| 5 |
# Access Type: Dynamic # |
| 6 |
# Data Type: Numeric # |
| 7 |
# Default Value: 300 # |
| 8 |
# Range: 1 - 4294967286 # |
| 9 |
# # |
| 10 |
# # |
| 11 |
# Creation Date: 2008-02-07 # |
| 12 |
# Author: Salman Rawala # |
| 13 |
# # |
| 14 |
# Description: Test Cases of Dynamic System Variable "delayed_insert_timeout" # |
| 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-system-variables.html#option_mysqld_delayed_insert_timeout # |
| 23 |
# # |
| 24 |
################################################################################ |
| 25 |
|
| 26 |
--source include/load_sysvars.inc |
| 27 |
|
| 28 |
################################################################# |
| 29 |
# START OF delayed_insert_timeout TESTS # |
| 30 |
################################################################# |
| 31 |
|
| 32 |
############################################################################## |
| 33 |
# Saving initial value of delayed_insert_timeout in a temporary variable # |
| 34 |
############################################################################## |
| 35 |
|
| 36 |
SET @start_value = @@global.delayed_insert_timeout; |
| 37 |
SELECT @start_value; |
| 38 |
|
| 39 |
--echo '#--------------------FN_DYNVARS_025_01------------------------#' |
| 40 |
############################################################################## |
| 41 |
# Display the DEFAULT value of delayed_insert_timeout # |
| 42 |
############################################################################## |
| 43 |
|
| 44 |
SET @@global.delayed_insert_timeout = 100; |
| 45 |
SET @@global.delayed_insert_timeout = DEFAULT; |
| 46 |
SELECT @@global.delayed_insert_timeout; |
| 47 |
|
| 48 |
|
| 49 |
--echo '#---------------------FN_DYNVARS_025_02-------------------------#' |
| 50 |
############################################### |
| 51 |
# Verify default value of variable # |
| 52 |
############################################### |
| 53 |
|
| 54 |
SET @@global.delayed_insert_timeout = @start_value; |
| 55 |
SELECT @@global.delayed_insert_timeout = 300; |
| 56 |
|
| 57 |
|
| 58 |
--echo '#--------------------FN_DYNVARS_025_03------------------------#' |
| 59 |
############################################################################## |
| 60 |
# Change the value of delayed_insert_timeout to a valid value # |
| 61 |
############################################################################## |
| 62 |
|
| 63 |
SET @@global.delayed_insert_timeout = 10000; |
| 64 |
SELECT @@global.delayed_insert_timeout; |
| 65 |
SET @@global.delayed_insert_timeout = 429; |
| 66 |
SELECT @@global.delayed_insert_timeout; |
| 67 |
SET @@global.delayed_insert_timeout = 1; |
| 68 |
SELECT @@global.delayed_insert_timeout; |
| 69 |
|
| 70 |
|
| 71 |
--echo '#--------------------FN_DYNVARS_025_04-------------------------#' |
| 72 |
################################################################################# |
| 73 |
# Change the value of delayed_insert_timeout to invalid value # |
| 74 |
################################################################################# |
| 75 |
|
| 76 |
SET @@global.delayed_insert_timeout = 0; |
| 77 |
SELECT @@global.delayed_insert_timeout; |
| 78 |
SET @@global.delayed_insert_timeout = -1024; |
| 79 |
SELECT @@global.delayed_insert_timeout; |
| 80 |
SET @@global.delayed_insert_timeout = 42949672950; |
| 81 |
SELECT @@global.delayed_insert_timeout; |
| 82 |
SET @@global.delayed_insert_timeout = 4294967287; |
| 83 |
SELECT @@global.delayed_insert_timeout; |
| 84 |
|
| 85 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 86 |
SET @@global.delayed_insert_timeout = 429496729.5; |
| 87 |
SELECT @@global.delayed_insert_timeout; |
| 88 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 89 |
SET @@global.delayed_insert_timeout = ON; |
| 90 |
SELECT @@global.delayed_insert_timeout; |
| 91 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 92 |
SET @@global.delayed_insert_timeout = " "; |
| 93 |
SELECT @@global.delayed_insert_timeout; |
| 94 |
--Error ER_WRONG_TYPE_FOR_VAR |
| 95 |
SET @@global.delayed_insert_timeout = ' '; |
| 96 |
SELECT @@global.delayed_insert_timeout; |
| 97 |
|
| 98 |
|
| 99 |
--echo '#-------------------FN_DYNVARS_025_05----------------------------#' |
| 100 |
################################################################################# |
| 101 |
# Test if accessing session delayed_insert_timeout gives error # |
| 102 |
################################################################################# |
| 103 |
|
| 104 |
--Error ER_GLOBAL_VARIABLE |
| 105 |
SET @@session.delayed_insert_timeout = 0; |
| 106 |
--Error ER_UNKNOWN_SYSTEM_VARIABLE |
| 107 |
SELECT @@session.dalayed_insert_timeout; |
| 108 |
|
| 109 |
--echo '#----------------------FN_DYNVARS_025_06------------------------#' |
| 110 |
############################################################################## |
| 111 |
# Check if the value in GLOBAL & SESSION Tables matches values in variable # |
| 112 |
############################################################################## |
| 113 |
|
| 114 |
--disable_warnings |
| 115 |
SELECT VARIABLE_VALUE |
| 116 |
FROM performance_schema.global_variables |
| 117 |
WHERE VARIABLE_NAME='delayed_insert_timeout' |
| 118 |
into @tmp; |
| 119 |
--enable_warnings |
| 120 |
|
| 121 |
SELECT @@global.delayed_insert_timeout = @tmp; |
| 122 |
|
| 123 |
--disable_warnings |
| 124 |
SELECT VARIABLE_VALUE |
| 125 |
FROM performance_schema.session_variables |
| 126 |
WHERE VARIABLE_NAME='delayed_insert_timeout' |
| 127 |
into @tmp; |
| 128 |
--enable_warnings |
| 129 |
|
| 130 |
SELECT @@delayed_insert_timeout = @tmp; |
| 131 |
|
| 132 |
--echo '#---------------------FN_DYNVARS_025_07----------------------#' |
| 133 |
################################################################### |
| 134 |
# Check if TRUE and FALSE values can be used on variable # |
| 135 |
################################################################### |
| 136 |
|
| 137 |
SET @@global.delayed_insert_timeout = TRUE; |
| 138 |
SELECT @@global.delayed_insert_timeout; |
| 139 |
SET @@global.delayed_insert_timeout = FALSE; |
| 140 |
SELECT @@global.delayed_insert_timeout; |
| 141 |
|
| 142 |
|
| 143 |
--echo '#---------------------FN_DYNVARS_025_08----------------------#' |
| 144 |
######################################################################################################## |
| 145 |
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # |
| 146 |
######################################################################################################## |
| 147 |
|
| 148 |
SET @@global.delayed_insert_timeout = 1; |
| 149 |
SELECT @@delayed_insert_timeout = @@global.delayed_insert_timeout; |
| 150 |
|
| 151 |
|
| 152 |
--echo '#---------------------FN_DYNVARS_025_09----------------------#' |
| 153 |
################################################################################ |
| 154 |
# Check if delayed_insert_timeout can be accessed with and without @@ sign # |
| 155 |
################################################################################ |
| 156 |
|
| 157 |
--Error ER_GLOBAL_VARIABLE |
| 158 |
SET delayed_insert_timeout = 1; |
| 159 |
SELECT @@delayed_insert_timeout; |
| 160 |
--Error ER_PARSE_ERROR |
| 161 |
SET local.delayed_insert_timeout = 1; |
| 162 |
--Error ER_UNKNOWN_TABLE |
| 163 |
SELECT local.delayed_insert_timeout; |
| 164 |
--Error ER_PARSE_ERROR |
| 165 |
SET global.delayed_insert_timeout = 1; |
| 166 |
--Error ER_UNKNOWN_TABLE |
| 167 |
SELECT global.delayed_insert_timeout; |
| 168 |
--Error ER_BAD_FIELD_ERROR |
| 169 |
SELECT delayed_insert_timeout; |
| 170 |
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR |
| 171 |
SELECT @@session.delayed_insert_timeout; |
| 172 |
# Restore initial value |
| 173 |
SET @@global.delayed_insert_timeout = @start_value; |
| 174 |
SELECT @@global.delayed_insert_timeout; |
| 175 |
|
| 176 |
|
| 177 |
############################## |
| 178 |
# Restore initial value # |
| 179 |
############################## |
| 180 |
|
| 181 |
SET @@global.delayed_insert_timeout = @start_value; |
| 182 |
SELECT @@global.delayed_insert_timeout; |
| 183 |
|
| 184 |
|
| 185 |
################################################################ |
| 186 |
# END OF delayed_insert_timeout TESTS # |
| 187 |
################################################################ |
| 188 |
|