Debian Codegraph @

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

raw
1 ############### mysql-test/t/max_points_in_geometry_basic.test ################
2 # #
3 # Variable Name: max_points_in_geometry #
4 # Scope: SESSION #
5 # Access Type: Dynamic #
6 # Data Type: ulong #
7 # Default Value: 65536 #
8 # Range: [3-64*1024*1024] #
9 # #
10 # #
11 # Creation Date: 2015-04-16 #
12 # Author: David Zhao #
13 # #
14 # Description: Test Cases of Dynamic System Variable max_points_in_geometry #
15 # that checks the 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: #
22 # 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 max_points_in_geometry TESTS #
30 #######################################################################
31
32
33 #######################################################################
34 # Saving initial value of max_points_in_geometry in a temporary #
35 # variable #
36 #######################################################################
37
38 SET @session_start_value = @@session.max_points_in_geometry;
39 SET @global_start_value = @@global.max_points_in_geometry;
40
41 --echo '#--------------------FN_DYNVARS_001_01------------------------#'
42 ########################################################################
43 # Display the DEFAULT value of max_points_in_geometry#
44 ########################################################################
45
46
47 SET @@max_points_in_geometry = DEFAULT;
48 SELECT @@max_points_in_geometry = 65536;
49
50 --echo '#---------------------FN_DYNVARS_001_02-------------------------#'
51 ##############################################################
52 # see if accessable using global scope #
53 ##############################################################
54
55 SET @@global.max_points_in_geometry = 1000;
56 select @@global.max_points_in_geometry = @@session.max_points_in_geometry;
57
58 SET @@session.max_points_in_geometry = 1000;
59 select @@global.max_points_in_geometry = @@session.max_points_in_geometry;
60
61 --echo '#--------------------FN_DYNVARS_001_03------------------------#'
62 ##########################################################################
63 # Change the value of max_points_in_geometry to a valid value#
64 ##########################################################################
65
66 SET @@max_points_in_geometry = 10;
67 SELECT @@max_points_in_geometry, @@session.max_points_in_geometry,
68 @@max_points_in_geometry=@@session.max_points_in_geometry;
69
70 SELECT @@max_points_in_geometry, @@global.max_points_in_geometry,
71 @@max_points_in_geometry=@@global.max_points_in_geometry;
72
73 --echo '#--------------------FN_DYNVARS_001_04-------------------------#'
74 ###########################################################################
75 # Change the value of max_points_in_geometry to invalid value#
76 ###########################################################################
77
78 # for session scope
79 --Error ER_WRONG_TYPE_FOR_VAR
80 SET @@max_points_in_geometry = "1";
81
82 --Error ER_WRONG_TYPE_FOR_VAR
83 SET @@max_points_in_geometry = " ";
84
85 --Error ER_WRONG_TYPE_FOR_VAR
86 SET @@max_points_in_geometry = 'abc';
87
88 --Error ER_WRONG_TYPE_FOR_VAR
89 SET @@max_points_in_geometry = NULL;
90
91 SET @@max_points_in_geometry = 1;
92 SELECT @@max_points_in_geometry;
93
94 SET @@max_points_in_geometry = 67108865;
95 SELECT @@max_points_in_geometry;
96
97 --echo '#----------------------FN_DYNVARS_001_06------------------------#'
98 #########################################################################
99 # Check if the value in SESSION Table matches value in variable #
100 #########################################################################
101
102 --disable_warnings
103 SELECT @@max_points_in_geometry = VARIABLE_VALUE
104 FROM performance_schema.session_variables
105 WHERE VARIABLE_NAME='max_points_in_geometry';
106 --enable_warnings
107
108 --echo '#---------------------FN_DYNVARS_001_08-------------------------#'
109 #############################################################################
110 # Check if ON, OFF, TRUE and FALSE values can be used on variable #
111 #############################################################################
112 --Error ER_WRONG_TYPE_FOR_VAR
113 SET @@max_points_in_geometry = OFF;
114
115 --Error ER_WRONG_TYPE_FOR_VAR
116 SET @@max_points_in_geometry = ON;
117
118 SET @@max_points_in_geometry = TRUE;
119 SELECT @@max_points_in_geometry;
120
121 SET @@max_points_in_geometry = FALSE;
122 SELECT @@max_points_in_geometry;
123
124
125
126 --echo '#---------------------FN_DYNVARS_001_10----------------------#'
127 #############################################################################
128 # Check if accessing variable with SESSION,LOCAL and without SCOPE points
129 # to same session variable
130 #############################################################################
131
132 SET @@max_points_in_geometry = 123456;
133 SELECT @@max_points_in_geometry = @@local.max_points_in_geometry and
134 @@max_points_in_geometry = @@session.max_points_in_geometry;
135 SET @@max_points_in_geometry = 654321;
136 SELECT @@max_points_in_geometry = @@local.max_points_in_geometry and
137 @@max_points_in_geometry = @@session.max_points_in_geometry;
138
139
140 --echo '#---------------------FN_DYNVARS_001_11----------------------#'
141 ############################################################################
142 # Check if max_points_in_geometry can be accessed with and without @@ sign#
143 ############################################################################
144
145 SET max_points_in_geometry = 100;
146 SELECT @@max_points_in_geometry=100;
147 --Error ER_UNKNOWN_TABLE
148 SELECT local.max_points_in_geometry;
149 --Error ER_UNKNOWN_TABLE
150 SELECT session.max_points_in_geometry;
151 --Error ER_BAD_FIELD_ERROR
152 SELECT max_points_in_geometry = @@session.max_points_in_geometry;
153
154 ##############################
155 # Restore initial value #
156 ##############################
157
158 SET @@max_points_in_geometry = @session_start_value;
159 SET @@global.max_points_in_geometry = @global_start_value;
160
161 ############################################################################
162 # END OF max_points_in_geometry TESTS #
163 ############################################################################
164