Debian Codegraph @

mysql-test/suite/gis/t/wkt_geometry_representation.test

raw
1 ###############################################################################
2 # #
3 # This test is aimed at testing the modified ST_ASWKT/ST_ASTEXT #
4 # functions where they have been extended to accept two parameters: #
5 # a geometry and an optional argument to specify the axis ordering of #
6 # the returned WKT string. #
7 # #
8 # Creation Date: 2016-29-07 #
9 # Author : Hans H. Melby #
10 # #
11 ###############################################################################
12
13 --echo ##########################################################
14 --echo # Inserting testing SRS values in spatial reference table
15 --echo ##########################################################
16
17 --echo # Inserting geographical srs with long-lat ordering
18 CREATE SPATIAL REFERENCE SYSTEM 30400000 NAME 'TEST30400000' DEFINITION 'GEOGCS["SIRGAS 1995",DATUM["Sistema de Referencia Geocentrico para America del Sur 1995",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6170"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.017453292519943278,AUTHORITY["EPSG","9122"]],AXIS["LONG",EAST],AXIS["LAT",NORTH],AUTHORITY["EPSG","30400000"]]';
19
20 --echo # Inserting geographical srs with lat-long ordering
21 CREATE SPATIAL REFERENCE SYSTEM 30500000 NAME 'TEST30500000' DEFINITION 'GEOGCS["SIRGAS 1995",DATUM["Sistema de Referencia Geocentrico para America del Sur 1995",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6170"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.017453292519943278,AUTHORITY["EPSG","9122"]],AXIS["LAT",NORTH],AXIS["LONG",EAST],AUTHORITY["EPSG","30500000"]]';
22
23 --echo # Inserting projected srs with northing-easting ordering
24 CREATE SPATIAL REFERENCE SYSTEM 30600000 NAME 'TEST30600000' DEFINITION 'PROJCS["NAD83(NSRS2007) / Virginia Lambert",GEOGCS["NAD83(NSRS2007)",DATUM["NAD83 (National Spatial Reference System 2007)",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6759"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.017453292519943278,AUTHORITY["EPSG","9122"]],AXIS["Lat",NORTH],AXIS["Long",EAST],AUTHORITY["EPSG","4759"]],PROJECTION["Lambert Conic Conformal (2SP)",AUTHORITY["EPSG","9802"]],PARAMETER["Latitude of false origin",36,AUTHORITY["EPSG","8821"]],PARAMETER["Longitude of false origin",-79.5,AUTHORITY["EPSG","8822"]],PARAMETER["Latitude of 1st standard parallel",37,AUTHORITY["EPSG","8823"]],PARAMETER["Latitude of 2nd standard parallel",39.5,AUTHORITY["EPSG","8824"]],PARAMETER["Easting at false origin",0,AUTHORITY["EPSG","8826"]],PARAMETER["Northing at false origin",0,AUTHORITY["EPSG","8827"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",NORTH],AXIS["Y",EAST],AUTHORITY["EPSG","30600000"]]';
25
26 --echo # Inserting projected srs with easting-northing ordering
27 CREATE SPATIAL REFERENCE SYSTEM 30700000 NAME 'TEST30700000' DEFINITION 'PROJCS["NAD83(NSRS2007) / Virginia Lambert",GEOGCS["NAD83(NSRS2007)",DATUM["NAD83 (National Spatial Reference System 2007)",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6759"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.017453292519943278,AUTHORITY["EPSG","9122"]],AXIS["Lat",NORTH],AXIS["Long",EAST],AUTHORITY["EPSG","4759"]],PROJECTION["Lambert Conic Conformal (2SP)",AUTHORITY["EPSG","9802"]],PARAMETER["Latitude of false origin",36,AUTHORITY["EPSG","8821"]],PARAMETER["Longitude of false origin",-79.5,AUTHORITY["EPSG","8822"]],PARAMETER["Latitude of 1st standard parallel",37,AUTHORITY["EPSG","8823"]],PARAMETER["Latitude of 2nd standard parallel",39.5,AUTHORITY["EPSG","8824"]],PARAMETER["Easting at false origin",0,AUTHORITY["EPSG","8826"]],PARAMETER["Northing at false origin",0,AUTHORITY["EPSG","8827"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","30700000"]]';
28
29
30 ####################################
31 # Creating the spatial objects
32 ####################################
33
34 --echo # Creating the spatial objects
35
36 CREATE TABLE gis_point (fid INTEGER NOT NULL PRIMARY KEY, g POINT);
37 CREATE TABLE gis_linestring (fid INTEGER NOT NULL PRIMARY KEY, g LINESTRING);
38 CREATE TABLE gis_polygon (fid INTEGER NOT NULL PRIMARY KEY, g POLYGON);
39 CREATE TABLE gis_multi_point (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOINT);
40 CREATE TABLE gis_multi_linestring (fid INTEGER NOT NULL PRIMARY KEY, g MULTILINESTRING);
41 CREATE TABLE gis_multi_polygon (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOLYGON);
42 CREATE TABLE gis_geometrycollection (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRYCOLLECTION);
43
44 ######################################
45 # Inserting POINT Geometry values
46 ######################################
47
48 --echo # Inserting POINT Geometry Values with different SRID types
49
50 INSERT INTO gis_point VALUES
51 (101, ST_SRID(ST_POINTFROMTEXT('POINT(5 10)',0), 30400000)),
52 (102, ST_SRID(ST_POINTFROMTEXT('POINT(5 10)',0), 30500000)),
53 (103, ST_SRID(ST_POINTFROMTEXT('POINT(5 10)',0), 30600000)),
54 (104, ST_SRID(ST_POINTFROMTEXT('POINT(5 10)',0), 30700000)),
55 (105, ST_SRID(ST_POINTFROMTEXT('POINT(5 10)',0), 0));
56
57 ###########################################
58 # Inserting LINESTRING Geometry values
59 ###########################################
60
61 --echo # Inserting LINESTRING Geometry Values with different SRID types
62
63 INSERT INTO gis_linestring VALUES
64 (201, ST_SRID(ST_LINEFROMTEXT('LINESTRING(0 5,5 10,10 15)',0), 30400000)),
65 (202, ST_SRID(ST_LINEFROMTEXT('LINESTRING(0 5,5 10,10 15)',0), 30500000)),
66 (203, ST_SRID(ST_LINEFROMTEXT('LINESTRING(0 5,5 10,10 15)',0), 30600000)),
67 (204, ST_SRID(ST_LINEFROMTEXT('LINESTRING(0 5,5 10,10 15)',0), 30700000)),
68 (205, ST_SRID(ST_LINEFROMTEXT('LINESTRING(0 5,5 10,10 15)',0), 0));
69
70 ############################################
71 # Inserting POLYGON Geometry values
72 ############################################
73
74 --echo # Inserting POLYGON Geometry Values with different SRID types
75
76 INSERT INTO gis_polygon VALUES
77 (301, ST_SRID(ST_POLYFROMTEXT('POLYGON((0 0,5 0,5 5,0 5,0 0))',0), 30400000)),
78 (302, ST_SRID(ST_POLYFROMTEXT('POLYGON((0 0,5 0,5 5,0 5,0 0))',0), 30500000)),
79 (303, ST_SRID(ST_POLYFROMTEXT('POLYGON((0 0,5 0,5 5,0 5,0 0))',0), 30600000)),
80 (304, ST_SRID(ST_POLYFROMTEXT('POLYGON((0 0,5 0,5 5,0 5,0 0))',0), 30700000)),
81 (305, ST_SRID(ST_POLYFROMTEXT('POLYGON((0 0,5 0,5 5,0 5,0 0))',0), 0));
82
83 ############################################
84 # Inserting MULTIPOINT Geometry values
85 ############################################
86
87 --echo # Inserting MULTIPOINT Geometry Values with different SRID types
88
89 INSERT INTO gis_multi_point VALUES
90 (401, ST_SRID(ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2), (4 9))',0), 30400000)),
91 (402, ST_SRID(ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2), (4 9))',0), 30500000)),
92 (403, ST_SRID(ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2), (4 9))',0), 30600000)),
93 (404, ST_SRID(ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2), (4 9))',0), 30700000)),
94 (405, ST_SRID(ST_MPOINTFROMTEXT('MULTIPOINT((0 2), (5 7), (8 2), (4 9))',0), 0));
95
96 ################################################
97 # Inserting MULTILINESTRING Geometry values
98 ################################################
99
100 --echo # Inserting MULTILINESTRING Geometry Values with different SRID types
101
102 INSERT INTO gis_multi_linestring VALUES
103 (501, ST_SRID(ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),(8 11,11 14,14 17))',0), 30400000)),
104 (502, ST_SRID(ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),(8 11,11 14,14 17))',0), 30500000)),
105 (503, ST_SRID(ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),(8 11,11 14,14 17))',0), 30600000)),
106 (504, ST_SRID(ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),(8 11,11 14,14 17))',0), 30700000)),
107 (505, ST_SRID(ST_MLINEFROMTEXT('MULTILINESTRING((0 2,2 4,4 6),(8 11,11 14,14 17))',0), 0));
108
109 #############################################
110 # Inserting MULTIPOLYGON Geometry values
111 #############################################
112
113 --echo # Inserting MULTIPOLYGON Geometry Values with different SRID types
114
115 INSERT INTO gis_multi_polygon VALUES
116 (601, ST_SRID(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0)))',0), 30400000)),
117 (602, ST_SRID(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0)))',0), 30500000)),
118 (603, ST_SRID(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0)))',0), 30600000)),
119 (604, ST_SRID(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0)))',0), 30700000)),
120 (605, ST_SRID(ST_MPOLYFROMTEXT('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0)))',0), 0));
121
122 ##################################################
123 # Inserting GEOMETRYCOLLECTION Geometry values
124 ##################################################
125
126 --echo # Inserting GEOMETRYCOLLECTION Geometry Values with different SRID types
127
128 INSERT INTO gis_geometrycollection VALUES
129 (701, ST_SRID(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5), POLYGON((0 0,10 0,10 10,0 10,0 0)), MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0))))',0), 30400000)),
130 (702, ST_SRID(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5), POLYGON((0 0,10 0,10 10,0 10,0 0)), MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0))))',0), 30500000)),
131 (703, ST_SRID(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5), POLYGON((0 0,10 0,10 10,0 10,0 0)), MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0))))',0), 30600000)),
132 (704, ST_SRID(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5), POLYGON((0 0,10 0,10 10,0 10,0 0)), MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0))))',0), 30700000)),
133 (705, ST_SRID(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION(POINT(3 5), POLYGON((0 0,10 0,10 10,0 10,0 0)), MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0),(4 4,4 6,6 6,6 4, 4 4)),((0 0,-2 -2,0 -2, 0 0))))',0), 0));
134
135 --echo #####################################################################
136 --echo # Retrieving geometries with ST_ASTEXT with no parameter
137 --echo # (Should thus be retrieved with the SRID default axis ordering)
138 --echo #####################################################################
139
140 --echo # Retrieve all values from gis_point
141 SELECT ST_ASTEXT(g) FROM gis_point
142 ORDER BY fid;
143
144 --echo # Retrieve all values from gis_linestring
145 SELECT ST_ASTEXT(g) FROM gis_linestring
146 ORDER BY fid;
147
148 --echo # Retrieve all values from gis_polygon
149 SELECT ST_ASTEXT(g) FROM gis_polygon
150 ORDER BY fid;
151
152 --echo # Retrieve all values from gis_multi_point
153 SELECT ST_ASTEXT(g) FROM gis_multi_point
154 ORDER BY fid;
155
156 --echo # Retrieve all values from gis_multi_linestring
157 SELECT ST_ASTEXT(g) FROM gis_multi_linestring
158 ORDER BY fid;
159
160 --echo # Retrieve all values from gis_multi_polygon
161 SELECT ST_ASTEXT(g) FROM gis_multi_polygon
162 ORDER BY fid;
163
164 --echo # Retrieve all values from gis_geometrycollection
165 SELECT ST_ASTEXT(g) FROM gis_geometrycollection
166 ORDER BY fid;
167
168 --echo #####################################################################
169 --echo # Retrieving geometries with ST_ASTEXT with lat-long axis ordering
170 --echo # (Default SRID axis order should thus be overridden)
171 --echo #####################################################################
172
173 --echo # Retrieve all values from gis_point
174 SELECT ST_ASTEXT(g, 'axis-order=lat-long') FROM gis_point
175 ORDER BY fid;
176
177 --echo # Retrieve all values from gis_linestring
178 SELECT ST_ASTEXT(g, 'axis-order=lat-long') FROM gis_linestring ORDER BY fid;
179
180 --echo # Retrieve all values from gis_polygon
181 SELECT ST_ASTEXT(g, 'axis-order=lat-long') FROM gis_polygon
182 ORDER BY fid;
183
184 --echo # Retrieve all values from gis_multi_point
185 SELECT ST_ASTEXT(g, 'axis-order=lat-long') FROM gis_multi_point ORDER BY fid;
186
187 --echo # Retrieve all values from gis_multi_linestring
188 SELECT ST_ASTEXT(g, 'axis-order=lat-long') FROM gis_multi_linestring ORDER BY fid;
189
190 --echo # Retrieve all values from gis_multi_polygon
191 SELECT ST_ASTEXT(g, 'axis-order=lat-long') FROM gis_multi_polygon ORDER BY fid;
192
193 --echo # Retrieve all values from gis_geometrycollection
194 SELECT ST_ASTEXT(g, 'axis-order=lat-long') FROM gis_geometrycollection ORDER BY fid;
195
196 --echo #####################################################################
197 --echo # Retrieving geometries with ST_ASTEXT with long-lat axis ordering
198 --echo # (Default SRID axis order should thus be overridden)
199 --echo #####################################################################
200
201 --echo # Retrieve all values from gis_point
202 SELECT ST_ASTEXT(g, 'axis-order=long-lat') FROM gis_point
203 ORDER BY fid;
204
205 --echo # Retrieve all values from gis_linestring
206 SELECT ST_ASTEXT(g, 'axis-order=long-lat') FROM gis_linestring ORDER BY fid;
207
208 --echo # Retrieve all values from gis_polygon
209 SELECT ST_ASTEXT(g, 'axis-order=long-lat') FROM gis_polygon
210 ORDER BY fid;
211
212 --echo # Retrieve all values from gis_multi_point
213 SELECT ST_ASTEXT(g, 'axis-order=long-lat') FROM gis_multi_point ORDER BY fid;
214
215 --echo # Retrieve all values from gis_multi_linestring
216 SELECT ST_ASTEXT(g, 'axis-order=long-lat') FROM gis_multi_linestring ORDER BY fid;
217
218 --echo # Retrieve all values from gis_multi_polygon
219 SELECT ST_ASTEXT(g, 'axis-order=long-lat') FROM gis_multi_polygon ORDER BY fid;
220
221 --echo # Retrieve all values from gis_geometrycollection
222 SELECT ST_ASTEXT(g, 'axis-order=long-lat') FROM gis_geometrycollection ORDER BY fid;
223
224 --echo #####################################################################
225 --echo # Retrieving geometries with ST_ASTEXT with srid-default axis ordering
226 --echo # (Default SRID coordination should thus not be overridden)
227 --echo #####################################################################
228
229 --echo # Retrieve all values from gis_point
230 SELECT ST_ASTEXT(g, 'axis-order=srid-defined') FROM gis_point
231 ORDER BY fid;
232
233 --echo # Retrieve all values from gis_linestring
234 SELECT ST_ASTEXT(g, 'axis-order=srid-defined') FROM gis_linestring ORDER BY fid;
235
236 --echo # Retrieve all values from gis_polygon
237 SELECT ST_ASTEXT(g, 'axis-order=srid-defined') FROM gis_polygon ORDER BY fid;
238
239 --echo # Retrieve all values from gis_multi_point
240 SELECT ST_ASTEXT(g, 'axis-order=srid-defined') FROM gis_multi_point ORDER BY fid;
241
242 --echo # Retrieve all values from gis_multi_linestring
243 SELECT ST_ASTEXT(g, 'axis-order=srid-defined') FROM gis_multi_linestring ORDER BY fid;
244
245 --echo # Retrieve all values from gis_multi_polygon
246 SELECT ST_ASTEXT(g, 'axis-order=srid-defined') FROM gis_multi_polygon ORDER BY fid;
247
248 --echo # Retrieve all values from gis_geometrycollection
249 SELECT ST_ASTEXT(g, 'axis-order=srid-defined') FROM gis_geometrycollection ORDER BY fid;
250
251 --echo ##########################################################################
252 --echo # Retrieving geometries with ST_ASTEXT with empty axis ordering parameter
253 --echo # (Default SRID coordination should thus be used)
254 --echo ##########################################################################
255
256 --echo # Retrieve all values from gis_point
257 SELECT ST_ASTEXT(g, '') FROM gis_point
258 ORDER BY fid;
259
260 --echo # Retrieve all values from gis_linestring
261 SELECT ST_ASTEXT(g, '') FROM gis_linestring
262 ORDER BY fid;
263
264 --echo # Retrieve all values from gis_polygon
265 SELECT ST_ASTEXT(g, '') FROM gis_polygon
266 ORDER BY fid;
267
268 --echo # Retrieve all values from gis_multi_point
269 SELECT ST_ASTEXT(g, '') FROM gis_multi_point
270 ORDER BY fid;
271
272 --echo # Retrieve all values from gis_multi_linestring
273 SELECT ST_ASTEXT(g, '') FROM gis_multi_linestring
274 ORDER BY fid;
275
276 --echo # Retrieve all values from gis_multi_polygon
277 SELECT ST_ASTEXT(g, '') FROM gis_multi_polygon
278 ORDER BY fid;
279
280 --echo # Retrieve all values from gis_geometrycollection
281 SELECT ST_ASTEXT(g, '') FROM gis_geometrycollection
282 ORDER BY fid;
283
284
285 --echo ################################
286 --echo # Specific cases testing
287 --echo # ##############################
288
289 --echo # Test with combined lowercase and uppercase characters in optional parameter
290 SELECT ST_ASTEXT(g, 'aXIs-oRDer=sriD-dEFineD') FROM gis_geometrycollection ORDER BY fid;
291
292 --echo # Test with combined lowercase, uppercase and whitespaces in optional parameter
293 SELECT ST_ASTEXT(g, ' aXIs-oRDer=sriD-dEFineD ') FROM gis_geometrycollection ORDER BY fid;
294
295 --echo # Test with only whitespaces in optional parameter (Should return same as empty string)
296 SELECT ST_ASTEXT(g, ' ') FROM gis_geometrycollection
297 ORDER BY fid;
298
299 --echo ##########################
300 --echo # Error testing
301 --echo # ########################
302
303 --echo # Test with badly formed options string
304
305 --error ER_INVALID_OPTION_KEY_VALUE_PAIR
306 SELECT ST_ASTEXT(g, 'axis-order srid-defined') FROM gis_geometrycollection;
307 --error ER_INVALID_OPTION_START_CHARACTER
308 SELECT ST_ASTEXT(g, '=axis-order srid-defined') FROM gis_geometrycollection;
309 --error ER_DUPLICATE_OPTION_KEY
310 SELECT ST_ASWKT(g, 'axis-order=srid-defined, axis-order=lat-long') FROM gis_geometrycollection;
311
312
313 --echo # Test with too many options
314
315 --error ER_INVALID_OPTION_KEY
316 SELECT ST_ASTEXT(g, 'axis-order=srid-defined, axis-order2=lat-long') FROM gis_geometrycollection;
317
318 --echo # Test with invalid options value
319
320 --error ER_INVALID_OPTION_VALUE
321 SELECT ST_ASTEXT(g, 'axis-order=invalid-option') FROM gis_geometrycollection;
322
323 --echo # Test with too many function parameters
324
325 --error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
326 SELECT ST_ASTEXT(g, 'axis-order=long-lat', POINT(2, 4)) FROM gis_geometrycollection;
327
328 --echo # Test with too invalid start and end characters in substring
329
330 --error ER_INVALID_OPTION_START_CHARACTER
331 SELECT ST_ASTEXT(POINT(4, 2), 'axis-order=test,=long-lathello,=test');
332
333 --error ER_INVALID_OPTION_END_CHARACTER
334 SELECT ST_ASTEXT(POINT(4, 2), 'axis-order=long-lat=, axis-order=lat-long');
335
336 --echo # Test with both invalid option and invalid value
337
338 --error ER_INVALID_OPTION_KEY
339 SELECT ST_ASTEXT(g, 'invalid_option=invalid-value') FROM gis_geometrycollection;
340
341 --error ER_INVALID_OPTION_VALUE
342 SELECT ST_ASWKT(g, 'axis-order=invalid-option') FROM gis_geometrycollection;
343
344 --echo # Test with SRID value 0
345 SELECT ST_ASWKT(ST_POINTFROMTEXT('POINT(4 2)', 0));
346
347 --echo # NULL value testing: Should return NULL if either or both parameters of
348 --echo # ST_ASTEXT/ST_WKT is NULL
349
350 SELECT ST_ASTEXT(NULL, 'axis-order=srid-defined');
351 SELECT ST_ASTEXT(POINT(0, 0), NULL);
352 SELECT ST_ASTEXT(NULL, NULL);
353
354 DROP TABLE gis_point;
355 DROP TABLE gis_linestring;
356 DROP TABLE gis_polygon;
357 DROP TABLE gis_multi_point;
358 DROP TABLE gis_multi_linestring;
359 DROP TABLE gis_multi_polygon;
360 DROP TABLE gis_geometrycollection;
361
362 # Cleanup.
363 DROP SPATIAL REFERENCE SYSTEM 30400000;
364 DROP SPATIAL REFERENCE SYSTEM 30500000;
365 DROP SPATIAL REFERENCE SYSTEM 30600000;
366 DROP SPATIAL REFERENCE SYSTEM 30700000;