MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
delayed_insert_limit_basic.inc
1 ############### mysql-test\t\delayed_insert_limit_basic.test ###################
2 # #
3 # Variable Name: delayed_insert_limit #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: Numeric #
7 # Default Value: 100 #
8 # Range: 1 - 4294967295 #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Salman Rawala #
13 # #
14 # Description: Test Cases of Dynamic System Variable "delayed_insert_limit" #
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_limit #
23 # #
24 ################################################################################
25 
26 --source include/load_sysvars.inc
27 
28 #################################################################
29 # START OF delayed_insert_limit TESTS #
30 #################################################################
31 
32 #########################################################################
33 # Saving initial value of delayed_insert_limit in a temporary variable #
34 #########################################################################
35 
36 SET @start_value = @@global.delayed_insert_limit;
37 SELECT @start_value;
38 
39 --echo '#--------------------FN_DYNVARS_024_01------------------------#'
40 #########################################################################
41 # Display the DEFAULT value of delayed_insert_limit #
42 #########################################################################
43 
44 SET @@global.delayed_insert_limit = 100;
45 SET @@global.delayed_insert_limit = DEFAULT;
46 SELECT @@global.delayed_insert_limit;
47 
48 
49 --echo '#---------------------FN_DYNVARS_024_02-------------------------#'
50 ###############################################
51 # Verify default value of variable #
52 ###############################################
53 
54 SET @@global.delayed_insert_limit = @start_value;
55 SELECT @@global.delayed_insert_limit = 100;
56 
57 
58 --echo '#--------------------FN_DYNVARS_024_03------------------------#'
59 #########################################################################
60 # Change the value of delayed_insert_limit to a valid value #
61 #########################################################################
62 
63 SET @@global.delayed_insert_limit = 10000;
64 SELECT @@global.delayed_insert_limit;
65 SET @@global.delayed_insert_limit = 4294967295;
66 SELECT @@global.delayed_insert_limit;
67 SET @@global.delayed_insert_limit = 1;
68 SELECT @@global.delayed_insert_limit;
69 
70 
71 --echo '#--------------------FN_DYNVARS_024_04-------------------------#'
72 ############################################################################
73 # Change the value of delayed_insert_limit to invalid value #
74 ############################################################################
75 
76 SET @@global.delayed_insert_limit = 0;
77 SELECT @@global.delayed_insert_limit;
78 SET @@global.delayed_insert_limit = -1024;
79 SELECT @@global.delayed_insert_limit;
80 SET @@global.delayed_insert_limit = 42949672950;
81 SELECT @@global.delayed_insert_limit;
82 
83 --Error ER_WRONG_TYPE_FOR_VAR
84 SET @@global.delayed_insert_limit = 429496729.5;
85 SELECT @@global.delayed_insert_limit;
86 --Error ER_WRONG_TYPE_FOR_VAR
87 SET @@global.delayed_insert_limit = ON;
88 SELECT @@global.delayed_insert_limit;
89 
90 
91 
92 --echo '#-------------------FN_DYNVARS_024_05----------------------------#'
93 ############################################################################
94 # Test if accessing session delayed_insert_limit gives error #
95 ############################################################################
96 
97 --Error ER_GLOBAL_VARIABLE
98 SET @@session.delayed_insert_limit = 0;
99 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
100 SELECT @@Session.delayed_insert_limit;
101 
102 
103 --echo '#----------------------FN_DYNVARS_024_06------------------------#'
104 ##############################################################################
105 # Check if the value in GLOBAL & SESSION Tables matches values in variable #
106 ##############################################################################
107 
108 SELECT @@global.delayed_insert_limit =
109  VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
110  WHERE VARIABLE_NAME='delayed_insert_limit';
111 
112 SELECT @@delayed_insert_limit =
113  VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES
114  WHERE VARIABLE_NAME='delayed_insert_limit';
115 
116 
117 --echo '#---------------------FN_DYNVARS_024_07----------------------#'
118 ###################################################################
119 # Check if TRUE and FALSE values can be used on variable #
120 ###################################################################
121 
122 SET @@global.delayed_insert_limit = TRUE;
123 SELECT @@global.delayed_insert_limit;
124 SET @@global.delayed_insert_limit = FALSE;
125 SELECT @@global.delayed_insert_limit;
126 
127 --echo '#---------------------FN_DYNVARS_024_08----------------------#'
128 ########################################################################################################
129 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
130 ########################################################################################################
131 
132 SET @@global.delayed_insert_limit = 1;
133 SELECT @@delayed_insert_limit = @@global.delayed_insert_limit;
134 
135 
136 --echo '#---------------------FN_DYNVARS_024_09----------------------#'
137 ##############################################################################
138 # Check if delayed_insert_limit can be accessed with and without @@ sign #
139 ##############################################################################
140 
141 --Error ER_GLOBAL_VARIABLE
142 SET delayed_insert_limit = 1;
143 SELECT @@delayed_insert_limit;
144 --Error ER_PARSE_ERROR
145 SET local.delayed_insert_limit = 1;
146 --Error ER_UNKNOWN_TABLE
147 SELECT local.delayed_insert_limit;
148 --Error ER_PARSE_ERROR
149 SET global.delayed_insert_limit = 1;
150 --Error ER_UNKNOWN_TABLE
151 SELECT global.delayed_insert_limit;
152 --Error ER_BAD_FIELD_ERROR
153 SELECT delayed_insert_limit = @@session.delayed_insert_limit;
154 
155 ##############################
156 # Restore initial value #
157 ##############################
158 
159 SET @@global.delayed_insert_limit = @start_value;
160 SELECT @@global.delayed_insert_limit;
161 
162 
163 ###########################################################
164 # END OF delayed_insert_limit TESTS #
165 ###########################################################
166