Debian Codegraph @

mysql-test/suite/sys_vars/t/delayed_insert_timeout_basic.test

raw
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
83 --Error ER_WRONG_TYPE_FOR_VAR
84 SET @@global.delayed_insert_timeout = 429496729.5;
85 SELECT @@global.delayed_insert_timeout;
86 --Error ER_WRONG_TYPE_FOR_VAR
87 SET @@global.delayed_insert_timeout = ON;
88 SELECT @@global.delayed_insert_timeout;
89
90
91 --echo '#-------------------FN_DYNVARS_025_05----------------------------#'
92 #################################################################################
93 # Test if accessing session delayed_insert_timeout gives error #
94 #################################################################################
95
96 --Error 1229
97 SET @@session.delayed_insert_timeout = 0;
98 --Error 1193
99 SELECT @@session.dalayed_insert_timeout;
100
101 --echo '#----------------------FN_DYNVARS_025_06------------------------#'
102 ##############################################################################
103 # Check if the value in GLOBAL & SESSION Tables matches values in variable #
104 ##############################################################################
105
106 SELECT @@global.delayed_insert_timeout = VARIABLE_VALUE
107 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
108 WHERE VARIABLE_NAME='delayed_insert_timeout';
109
110 SELECT @@delayed_insert_timeout = VARIABLE_VALUE
111 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
112 WHERE VARIABLE_NAME='delayed_insert_timeout';
113
114
115 --echo '#---------------------FN_DYNVARS_025_07----------------------#'
116 ###################################################################
117 # Check if TRUE and FALSE values can be used on variable #
118 ###################################################################
119
120 SET @@global.delayed_insert_timeout = TRUE;
121 SELECT @@global.delayed_insert_timeout;
122 SET @@global.delayed_insert_timeout = FALSE;
123 SELECT @@global.delayed_insert_timeout;
124
125
126 --echo '#---------------------FN_DYNVARS_025_08----------------------#'
127 ########################################################################################################
128 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
129 ########################################################################################################
130
131 SET @@global.delayed_insert_timeout = 1;
132 SELECT @@delayed_insert_timeout = @@global.delayed_insert_timeout;
133
134
135 --echo '#---------------------FN_DYNVARS_025_09----------------------#'
136 ################################################################################
137 # Check if delayed_insert_timeout can be accessed with and without @@ sign #
138 ################################################################################
139
140 --Error 1229
141 SET delayed_insert_timeout = 1;
142 SELECT @@delayed_insert_timeout;
143 --Error 1109
144 SELECT local.delayed_insert_timeout;
145 --Error 1109
146 SELECT global.delayed_insert_timeout;
147 --Error 1054
148 SELECT delayed_insert_timeout = @@session.delayed_insert_timeout;
149 # Restore initial value
150 SET @@global.delayed_insert_timeout = @start_value;
151 SELECT @@global.delayed_insert_timeout;
152
153
154 ##############################
155 # Restore initial value #
156 ##############################
157
158 SET @@global.delayed_insert_timeout = @start_value;
159 SELECT @@global.delayed_insert_timeout;
160
161
162 ################################################################
163 # END OF delayed_insert_timeout TESTS #
164 ################################################################
165