| 1 |
--source include/load_sysvars.inc |
| 2 |
|
| 3 |
########################################################## |
| 4 |
# START OF select_into_disk_sync TESTS # |
| 5 |
########################################################## |
| 6 |
|
| 7 |
|
| 8 |
################################################################## |
| 9 |
# Saving initial value of select_into_disk_sync in a temporary variable # |
| 10 |
################################################################## |
| 11 |
|
| 12 |
SET @start_value = @@select_into_disk_sync; |
| 13 |
SELECT @start_value; |
| 14 |
|
| 15 |
--echo '#--------------------FN_DYNVARS_005_01------------------------#' |
| 16 |
############################################################# |
| 17 |
# Display the DEFAULT value of select_into_disk_sync # |
| 18 |
############################################################# |
| 19 |
|
| 20 |
SET @@select_into_disk_sync = 1; |
| 21 |
SET @@select_into_disk_sync = DEFAULT; |
| 22 |
SELECT @@select_into_disk_sync; |
| 23 |
|
| 24 |
|
| 25 |
--echo '#--------------------FN_DYNVARS_005_02------------------------#' |
| 26 |
############################################################# |
| 27 |
# Change the value of select_into_disk_sync to a valid value # |
| 28 |
############################################################# |
| 29 |
|
| 30 |
SET @@select_into_disk_sync = 0; |
| 31 |
SELECT @@select_into_disk_sync; |
| 32 |
SET @@select_into_disk_sync = 1; |
| 33 |
SELECT @@select_into_disk_sync; |
| 34 |
|
| 35 |
|
| 36 |
--echo '#--------------------FN_DYNVARS_005_03-------------------------#' |
| 37 |
########################################################################### |
| 38 |
# Change the value of select_into_disk_sync to invalid value # |
| 39 |
########################################################################### |
| 40 |
|
| 41 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 42 |
SET @@select_into_disk_sync = 2; |
| 43 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 44 |
SET @@select_into_disk_sync = -1; |
| 45 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 46 |
SET @@select_into_disk_sync = TRUEF; |
| 47 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 48 |
SET @@select_into_disk_sync = TRUE_F; |
| 49 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 50 |
SET @@select_into_disk_sync = FALSE0; |
| 51 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 52 |
SET @@select_into_disk_sync = OON; |
| 53 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 54 |
SET @@select_into_disk_sync = ONN; |
| 55 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 56 |
SET @@select_into_disk_sync = OOFF; |
| 57 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 58 |
SET @@select_into_disk_sync = 0FF; |
| 59 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 60 |
SET @@select_into_disk_sync = ' '; |
| 61 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 62 |
SET @@select_into_disk_sync = " "; |
| 63 |
--Error ER_WRONG_VALUE_FOR_VAR |
| 64 |
SET @@select_into_disk_sync = ''; |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
--echo '#-------------------FN_DYNVARS_005_04----------------------------#' |
| 69 |
########################################################################### |
| 70 |
# Test if accessing global select_into_disk_sync gives error # |
| 71 |
########################################################################### |
| 72 |
|
| 73 |
SET @@global.select_into_disk_sync = 1-@@global.select_into_disk_sync; |
| 74 |
SELECT @@global.select_into_disk_sync; |
| 75 |
SET @@global.select_into_disk_sync = 1-@@global.select_into_disk_sync; |
| 76 |
|
| 77 |
--echo '#----------------------FN_DYNVARS_005_05------------------------#' |
| 78 |
############################################################################## |
| 79 |
# Check if the value in SESSION Tables matches values in variable # |
| 80 |
############################################################################## |
| 81 |
|
| 82 |
--disable_warnings |
| 83 |
SELECT IF(@@select_into_disk_sync, "ON", "OFF") = VARIABLE_VALUE |
| 84 |
FROM performance_schema.session_variables |
| 85 |
WHERE VARIABLE_NAME='select_into_disk_sync'; |
| 86 |
--enable_warnings |
| 87 |
|
| 88 |
|
| 89 |
--echo '#---------------------FN_DYNVARS_005_06----------------------#' |
| 90 |
################################################################### |
| 91 |
# Check if ON and OFF values can be used on variable # |
| 92 |
################################################################### |
| 93 |
|
| 94 |
SET @@select_into_disk_sync = OFF; |
| 95 |
SELECT @@select_into_disk_sync; |
| 96 |
SET @@select_into_disk_sync = ON; |
| 97 |
SELECT @@select_into_disk_sync; |
| 98 |
|
| 99 |
--echo '#---------------------FN_DYNVARS_005_07----------------------#' |
| 100 |
################################################################### |
| 101 |
# Check if TRUE and FALSE values can be used on variable # |
| 102 |
################################################################### |
| 103 |
|
| 104 |
SET @@select_into_disk_sync = TRUE; |
| 105 |
SELECT @@select_into_disk_sync; |
| 106 |
SET @@select_into_disk_sync = FALSE; |
| 107 |
SELECT @@select_into_disk_sync; |
| 108 |
|
| 109 |
|
| 110 |
--echo '#---------------------FN_DYNVARS_005_08----------------------#' |
| 111 |
############################################################################## |
| 112 |
# Check if accessing variable with SESSION,LOCAL and without SCOPE points # |
| 113 |
# to same session variable # |
| 114 |
############################################################################## |
| 115 |
|
| 116 |
SET @@select_into_disk_sync = 0; |
| 117 |
SELECT @@select_into_disk_sync = @@session.select_into_disk_sync; |
| 118 |
SET @@select_into_disk_sync = 1; |
| 119 |
SELECT @@select_into_disk_sync = @@local.select_into_disk_sync and @@local.select_into_disk_sync = @@session.select_into_disk_sync; |
| 120 |
|
| 121 |
--echo '#---------------------FN_DYNVARS_005_09----------------------#' |
| 122 |
########################################################################## |
| 123 |
# Check if select_into_disk_sync can be accessed with and without @@ sign # |
| 124 |
########################################################################## |
| 125 |
|
| 126 |
SET select_into_disk_sync = 1; |
| 127 |
SELECT @@select_into_disk_sync; |
| 128 |
--Error ER_PARSE_ERROR |
| 129 |
SET local.select_into_disk_sync = 1; |
| 130 |
--Error ER_UNKNOWN_TABLE |
| 131 |
SELECT local.select_into_disk_sync; |
| 132 |
--Error ER_PARSE_ERROR |
| 133 |
SET session.select_into_disk_sync = 1; |
| 134 |
--Error ER_UNKNOWN_TABLE |
| 135 |
SELECT session.select_into_disk_sync; |
| 136 |
--Error ER_BAD_FIELD_ERROR |
| 137 |
select select_into_disk_sync; |
| 138 |
|
| 139 |
|
| 140 |
############################## |
| 141 |
# Restore initial value # |
| 142 |
############################## |
| 143 |
|
| 144 |
SET @@select_into_disk_sync = @start_value; |
| 145 |
SELECT @@select_into_disk_sync; |
| 146 |
|
| 147 |
|
| 148 |
####################################################### |
| 149 |
# END OF select_into_disk_sync TESTS # |
| 150 |
####################################################### |