~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/r/gis.result

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
 
2
CREATE TABLE gis_point  (fid INTEGER NOT NULL PRIMARY KEY, g POINT);
 
3
CREATE TABLE gis_line  (fid INTEGER NOT NULL PRIMARY KEY, g LINESTRING);
 
4
CREATE TABLE gis_polygon   (fid INTEGER NOT NULL PRIMARY KEY, g POLYGON);
 
5
CREATE TABLE gis_multi_point (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOINT);
 
6
CREATE TABLE gis_multi_line (fid INTEGER NOT NULL PRIMARY KEY, g MULTILINESTRING);
 
7
CREATE TABLE gis_multi_polygon  (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOLYGON);
 
8
CREATE TABLE gis_geometrycollection  (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRYCOLLECTION);
 
9
CREATE TABLE gis_geometry (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY);
 
10
SHOW FIELDS FROM gis_point;
 
11
Field   Type    Null    Key     Default Extra
 
12
fid     int(11) NO      PRI     NULL    
 
13
g       point   YES             NULL    
 
14
SHOW FIELDS FROM gis_line;
 
15
Field   Type    Null    Key     Default Extra
 
16
fid     int(11) NO      PRI     NULL    
 
17
g       linestring      YES             NULL    
 
18
SHOW FIELDS FROM gis_polygon;
 
19
Field   Type    Null    Key     Default Extra
 
20
fid     int(11) NO      PRI     NULL    
 
21
g       polygon YES             NULL    
 
22
SHOW FIELDS FROM gis_multi_point;
 
23
Field   Type    Null    Key     Default Extra
 
24
fid     int(11) NO      PRI     NULL    
 
25
g       multipoint      YES             NULL    
 
26
SHOW FIELDS FROM gis_multi_line;
 
27
Field   Type    Null    Key     Default Extra
 
28
fid     int(11) NO      PRI     NULL    
 
29
g       multilinestring YES             NULL    
 
30
SHOW FIELDS FROM gis_multi_polygon;
 
31
Field   Type    Null    Key     Default Extra
 
32
fid     int(11) NO      PRI     NULL    
 
33
g       multipolygon    YES             NULL    
 
34
SHOW FIELDS FROM gis_geometrycollection;
 
35
Field   Type    Null    Key     Default Extra
 
36
fid     int(11) NO      PRI     NULL    
 
37
g       geometrycollection      YES             NULL    
 
38
SHOW FIELDS FROM gis_geometry;
 
39
Field   Type    Null    Key     Default Extra
 
40
fid     int(11) NO      PRI     NULL    
 
41
g       geometry        YES             NULL    
 
42
INSERT INTO gis_point VALUES 
 
43
(101, PointFromText('POINT(10 10)')),
 
44
(102, PointFromText('POINT(20 10)')),
 
45
(103, PointFromText('POINT(20 20)')),
 
46
(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
 
47
INSERT INTO gis_line VALUES
 
48
(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
 
49
(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
 
50
(107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));
 
51
INSERT INTO gis_polygon VALUES
 
52
(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
 
53
(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
 
54
(110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0))))));
 
55
INSERT INTO gis_multi_point VALUES
 
56
(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
 
57
(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
 
58
(113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10)))));
 
59
INSERT INTO gis_multi_line VALUES
 
60
(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
 
61
(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
 
62
(116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7))))));
 
63
INSERT INTO gis_multi_polygon VALUES
 
64
(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
 
65
(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
 
66
(119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))));
 
67
INSERT INTO gis_geometrycollection VALUES
 
68
(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
 
69
(121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9))))));
 
70
INSERT into gis_geometry SELECT * FROM gis_point;
 
71
INSERT into gis_geometry SELECT * FROM gis_line;
 
72
INSERT into gis_geometry SELECT * FROM gis_polygon;
 
73
INSERT into gis_geometry SELECT * FROM gis_multi_point;
 
74
INSERT into gis_geometry SELECT * FROM gis_multi_line;
 
75
INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
 
76
INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
 
77
SELECT fid, AsText(g) FROM gis_point;
 
78
fid     AsText(g)
 
79
101     POINT(10 10)
 
80
102     POINT(20 10)
 
81
103     POINT(20 20)
 
82
104     POINT(10 20)
 
83
SELECT fid, AsText(g) FROM gis_line;
 
84
fid     AsText(g)
 
85
105     LINESTRING(0 0,0 10,10 0)
 
86
106     LINESTRING(10 10,20 10,20 20,10 20,10 10)
 
87
107     LINESTRING(10 10,40 10)
 
88
SELECT fid, AsText(g) FROM gis_polygon;
 
89
fid     AsText(g)
 
90
108     POLYGON((10 10,20 10,20 20,10 20,10 10))
 
91
109     POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
 
92
110     POLYGON((0 0,30 0,30 30,0 0))
 
93
SELECT fid, AsText(g) FROM gis_multi_point;
 
94
fid     AsText(g)
 
95
111     MULTIPOINT(0 0,10 10,10 20,20 20)
 
96
112     MULTIPOINT(1 1,11 11,11 21,21 21)
 
97
113     MULTIPOINT(3 6,4 10)
 
98
SELECT fid, AsText(g) FROM gis_multi_line;
 
99
fid     AsText(g)
 
100
114     MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
 
101
115     MULTILINESTRING((10 48,10 21,10 0))
 
102
116     MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
 
103
SELECT fid, AsText(g) FROM gis_multi_polygon;
 
104
fid     AsText(g)
 
105
117     MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
 
106
118     MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
 
107
119     MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
 
108
SELECT fid, AsText(g) FROM gis_geometrycollection;
 
109
fid     AsText(g)
 
110
120     GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
 
111
121     GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
 
112
SELECT fid, AsText(g) FROM gis_geometry;
 
113
fid     AsText(g)
 
114
101     POINT(10 10)
 
115
102     POINT(20 10)
 
116
103     POINT(20 20)
 
117
104     POINT(10 20)
 
118
105     LINESTRING(0 0,0 10,10 0)
 
119
106     LINESTRING(10 10,20 10,20 20,10 20,10 10)
 
120
107     LINESTRING(10 10,40 10)
 
121
108     POLYGON((10 10,20 10,20 20,10 20,10 10))
 
122
109     POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
 
123
110     POLYGON((0 0,30 0,30 30,0 0))
 
124
111     MULTIPOINT(0 0,10 10,10 20,20 20)
 
125
112     MULTIPOINT(1 1,11 11,11 21,21 21)
 
126
113     MULTIPOINT(3 6,4 10)
 
127
114     MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
 
128
115     MULTILINESTRING((10 48,10 21,10 0))
 
129
116     MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
 
130
117     MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
 
131
118     MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
 
132
119     MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
 
133
120     GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
 
134
121     GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
 
135
SELECT fid, Dimension(g) FROM gis_geometry;
 
136
fid     Dimension(g)
 
137
101     0
 
138
102     0
 
139
103     0
 
140
104     0
 
141
105     1
 
142
106     1
 
143
107     1
 
144
108     2
 
145
109     2
 
146
110     2
 
147
111     0
 
148
112     0
 
149
113     0
 
150
114     1
 
151
115     1
 
152
116     1
 
153
117     2
 
154
118     2
 
155
119     2
 
156
120     1
 
157
121     1
 
158
SELECT fid, GeometryType(g) FROM gis_geometry;
 
159
fid     GeometryType(g)
 
160
101     POINT
 
161
102     POINT
 
162
103     POINT
 
163
104     POINT
 
164
105     LINESTRING
 
165
106     LINESTRING
 
166
107     LINESTRING
 
167
108     POLYGON
 
168
109     POLYGON
 
169
110     POLYGON
 
170
111     MULTIPOINT
 
171
112     MULTIPOINT
 
172
113     MULTIPOINT
 
173
114     MULTILINESTRING
 
174
115     MULTILINESTRING
 
175
116     MULTILINESTRING
 
176
117     MULTIPOLYGON
 
177
118     MULTIPOLYGON
 
178
119     MULTIPOLYGON
 
179
120     GEOMETRYCOLLECTION
 
180
121     GEOMETRYCOLLECTION
 
181
SELECT fid, IsEmpty(g) FROM gis_geometry;
 
182
fid     IsEmpty(g)
 
183
101     0
 
184
102     0
 
185
103     0
 
186
104     0
 
187
105     0
 
188
106     0
 
189
107     0
 
190
108     0
 
191
109     0
 
192
110     0
 
193
111     0
 
194
112     0
 
195
113     0
 
196
114     0
 
197
115     0
 
198
116     0
 
199
117     0
 
200
118     0
 
201
119     0
 
202
120     0
 
203
121     0
 
204
SELECT fid, AsText(Envelope(g)) FROM gis_geometry;
 
205
fid     AsText(Envelope(g))
 
206
101     POLYGON((10 10,10 10,10 10,10 10,10 10))
 
207
102     POLYGON((20 10,20 10,20 10,20 10,20 10))
 
208
103     POLYGON((20 20,20 20,20 20,20 20,20 20))
 
209
104     POLYGON((10 20,10 20,10 20,10 20,10 20))
 
210
105     POLYGON((0 0,10 0,10 10,0 10,0 0))
 
211
106     POLYGON((10 10,20 10,20 20,10 20,10 10))
 
212
107     POLYGON((10 10,40 10,40 10,10 10,10 10))
 
213
108     POLYGON((10 10,20 10,20 20,10 20,10 10))
 
214
109     POLYGON((0 0,50 0,50 50,0 50,0 0))
 
215
110     POLYGON((0 0,30 0,30 30,0 30,0 0))
 
216
111     POLYGON((0 0,20 0,20 20,0 20,0 0))
 
217
112     POLYGON((1 1,21 1,21 21,1 21,1 1))
 
218
113     POLYGON((3 6,4 6,4 10,3 10,3 6))
 
219
114     POLYGON((10 0,16 0,16 48,10 48,10 0))
 
220
115     POLYGON((10 0,10 0,10 48,10 48,10 0))
 
221
116     POLYGON((1 2,21 2,21 8,1 8,1 2))
 
222
117     POLYGON((28 0,84 0,84 42,28 42,28 0))
 
223
118     POLYGON((28 0,84 0,84 42,28 42,28 0))
 
224
119     POLYGON((0 0,3 0,3 3,0 3,0 0))
 
225
120     POLYGON((0 0,10 0,10 10,0 10,0 0))
 
226
121     POLYGON((3 6,44 6,44 9,3 9,3 6))
 
227
explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
 
228
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
 
229
1       SIMPLE  gis_geometry    ALL     NULL    NULL    NULL    NULL    21      100.00  
 
230
Warnings:
 
231
Note    1003    select dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,astext(envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry`
 
232
SELECT fid, X(g) FROM gis_point;
 
233
fid     X(g)
 
234
101     10
 
235
102     20
 
236
103     20
 
237
104     10
 
238
SELECT fid, Y(g) FROM gis_point;
 
239
fid     Y(g)
 
240
101     10
 
241
102     10
 
242
103     20
 
243
104     20
 
244
explain extended select X(g),Y(g) FROM gis_point;
 
245
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
 
246
1       SIMPLE  gis_point       ALL     NULL    NULL    NULL    NULL    4       100.00  
 
247
Warnings:
 
248
Note    1003    select x(`test`.`gis_point`.`g`) AS `X(g)`,y(`test`.`gis_point`.`g`) AS `Y(g)` from `test`.`gis_point`
 
249
SELECT fid, AsText(StartPoint(g)) FROM gis_line;
 
250
fid     AsText(StartPoint(g))
 
251
105     POINT(0 0)
 
252
106     POINT(10 10)
 
253
107     POINT(10 10)
 
254
SELECT fid, AsText(EndPoint(g)) FROM gis_line;
 
255
fid     AsText(EndPoint(g))
 
256
105     POINT(10 0)
 
257
106     POINT(10 10)
 
258
107     POINT(40 10)
 
259
SELECT fid, GLength(g) FROM gis_line;
 
260
fid     GLength(g)
 
261
105     24.142135623731
 
262
106     40
 
263
107     30
 
264
SELECT fid, NumPoints(g) FROM gis_line;
 
265
fid     NumPoints(g)
 
266
105     3
 
267
106     5
 
268
107     2
 
269
SELECT fid, AsText(PointN(g, 2)) FROM gis_line;
 
270
fid     AsText(PointN(g, 2))
 
271
105     POINT(0 10)
 
272
106     POINT(20 10)
 
273
107     POINT(40 10)
 
274
SELECT fid, IsClosed(g) FROM gis_line;
 
275
fid     IsClosed(g)
 
276
105     0
 
277
106     1
 
278
107     0
 
279
explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
 
280
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
 
281
1       SIMPLE  gis_line        ALL     NULL    NULL    NULL    NULL    3       100.00  
 
282
Warnings:
 
283
Note    1003    select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint(g))`,astext(endpoint(`test`.`gis_line`.`g`)) AS `AsText(EndPoint(g))`,glength(`test`.`gis_line`.`g`) AS `GLength(g)`,numpoints(`test`.`gis_line`.`g`) AS `NumPoints(g)`,astext(pointn(`test`.`gis_line`.`g`,2)) AS `AsText(PointN(g, 2))`,isclosed(`test`.`gis_line`.`g`) AS `IsClosed(g)` from `test`.`gis_line`
 
284
SELECT fid, AsText(Centroid(g)) FROM gis_polygon;
 
285
fid     AsText(Centroid(g))
 
286
108     POINT(15 15)
 
287
109     POINT(25.4166666666667 25.4166666666667)
 
288
110     POINT(20 10)
 
289
SELECT fid, Area(g) FROM gis_polygon;
 
290
fid     Area(g)
 
291
108     100
 
292
109     2400
 
293
110     450
 
294
SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon;
 
295
fid     AsText(ExteriorRing(g))
 
296
108     LINESTRING(10 10,20 10,20 20,10 20,10 10)
 
297
109     LINESTRING(0 0,50 0,50 50,0 50,0 0)
 
298
110     LINESTRING(0 0,30 0,30 30,0 0)
 
299
SELECT fid, NumInteriorRings(g) FROM gis_polygon;
 
300
fid     NumInteriorRings(g)
 
301
108     0
 
302
109     1
 
303
110     0
 
304
SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon;
 
305
fid     AsText(InteriorRingN(g, 1))
 
306
108     NULL
 
307
109     LINESTRING(10 10,20 10,20 20,10 20,10 10)
 
308
110     NULL
 
309
explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
 
310
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
 
311
1       SIMPLE  gis_polygon     ALL     NULL    NULL    NULL    NULL    3       100.00  
 
312
Warnings:
 
313
Note    1003    select astext(centroid(`test`.`gis_polygon`.`g`)) AS `AsText(Centroid(g))`,area(`test`.`gis_polygon`.`g`) AS `Area(g)`,astext(exteriorring(`test`.`gis_polygon`.`g`)) AS `AsText(ExteriorRing(g))`,numinteriorrings(`test`.`gis_polygon`.`g`) AS `NumInteriorRings(g)`,astext(interiorringn(`test`.`gis_polygon`.`g`,1)) AS `AsText(InteriorRingN(g, 1))` from `test`.`gis_polygon`
 
314
SELECT fid, IsClosed(g) FROM gis_multi_line;
 
315
fid     IsClosed(g)
 
316
114     0
 
317
115     0
 
318
116     0
 
319
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon;
 
320
fid     AsText(Centroid(g))
 
321
117     POINT(55.5885277530424 17.426536064114)
 
322
118     POINT(55.5885277530424 17.426536064114)
 
323
119     POINT(2 2)
 
324
SELECT fid, Area(g) FROM gis_multi_polygon;
 
325
fid     Area(g)
 
326
117     1684.5
 
327
118     1684.5
 
328
119     4.5
 
329
SELECT fid, NumGeometries(g) from gis_multi_point;
 
330
fid     NumGeometries(g)
 
331
111     4
 
332
112     4
 
333
113     2
 
334
SELECT fid, NumGeometries(g) from gis_multi_line;
 
335
fid     NumGeometries(g)
 
336
114     2
 
337
115     1
 
338
116     2
 
339
SELECT fid, NumGeometries(g) from gis_multi_polygon;
 
340
fid     NumGeometries(g)
 
341
117     2
 
342
118     2
 
343
119     1
 
344
SELECT fid, NumGeometries(g) from gis_geometrycollection;
 
345
fid     NumGeometries(g)
 
346
120     2
 
347
121     2
 
348
explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
 
349
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
 
350
1       SIMPLE  gis_multi_point ALL     NULL    NULL    NULL    NULL    3       100.00  
 
351
Warnings:
 
352
Note    1003    select `test`.`gis_multi_point`.`fid` AS `fid`,numgeometries(`test`.`gis_multi_point`.`g`) AS `NumGeometries(g)` from `test`.`gis_multi_point`
 
353
SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
 
354
fid     AsText(GeometryN(g, 2))
 
355
111     POINT(10 10)
 
356
112     POINT(11 11)
 
357
113     POINT(4 10)
 
358
SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line;
 
359
fid     AsText(GeometryN(g, 2))
 
360
114     LINESTRING(16 0,16 23,16 48)
 
361
115     NULL
 
362
116     LINESTRING(2 5,5 8,21 7)
 
363
SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon;
 
364
fid     AsText(GeometryN(g, 2))
 
365
117     POLYGON((59 18,67 18,67 13,59 13,59 18))
 
366
118     POLYGON((59 18,67 18,67 13,59 13,59 18))
 
367
119     NULL
 
368
SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection;
 
369
fid     AsText(GeometryN(g, 2))
 
370
120     LINESTRING(0 0,10 10)
 
371
121     LINESTRING(3 6,7 9)
 
372
SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection;
 
373
fid     AsText(GeometryN(g, 1))
 
374
120     POINT(0 0)
 
375
121     POINT(44 6)
 
376
explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
 
377
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
 
378
1       SIMPLE  gis_multi_point ALL     NULL    NULL    NULL    NULL    3       100.00  
 
379
Warnings:
 
380
Note    1003    select `test`.`gis_multi_point`.`fid` AS `fid`,astext(geometryn(`test`.`gis_multi_point`.`g`,2)) AS `AsText(GeometryN(g, 2))` from `test`.`gis_multi_point`
 
381
SELECT g1.fid as first, g2.fid as second,
 
382
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
 
383
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
 
384
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
 
385
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
 
386
first   second  w       c       o       e       d       t       i       r
 
387
120     120     1       1       0       1       0       0       1       0
 
388
120     121     0       0       1       0       0       0       1       0
 
389
121     120     0       0       1       0       0       0       1       0
 
390
121     121     1       1       0       1       0       0       1       0
 
391
explain extended SELECT g1.fid as first, g2.fid as second,
 
392
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
 
393
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
 
394
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
 
395
FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
 
396
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
 
397
1       SIMPLE  g1      ALL     NULL    NULL    NULL    NULL    2       100.00  Using temporary; Using filesort
 
398
1       SIMPLE  g2      ALL     NULL    NULL    NULL    NULL    2       100.00  Using join buffer
 
399
Warnings:
 
400
Note    1003    select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
 
401
DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
 
402
CREATE TABLE t1 (
 
403
gp  point,
 
404
ln  linestring,
 
405
pg  polygon,
 
406
mp  multipoint,
 
407
mln multilinestring,
 
408
mpg multipolygon,
 
409
gc  geometrycollection,
 
410
gm  geometry
 
411
);
 
412
SHOW FIELDS FROM t1;
 
413
Field   Type    Null    Key     Default Extra
 
414
gp      point   YES             NULL    
 
415
ln      linestring      YES             NULL    
 
416
pg      polygon YES             NULL    
 
417
mp      multipoint      YES             NULL    
 
418
mln     multilinestring YES             NULL    
 
419
mpg     multipolygon    YES             NULL    
 
420
gc      geometrycollection      YES             NULL    
 
421
gm      geometry        YES             NULL    
 
422
ALTER TABLE t1 ADD fid INT NOT NULL;
 
423
SHOW FIELDS FROM t1;
 
424
Field   Type    Null    Key     Default Extra
 
425
gp      point   YES             NULL    
 
426
ln      linestring      YES             NULL    
 
427
pg      polygon YES             NULL    
 
428
mp      multipoint      YES             NULL    
 
429
mln     multilinestring YES             NULL    
 
430
mpg     multipolygon    YES             NULL    
 
431
gc      geometrycollection      YES             NULL    
 
432
gm      geometry        YES             NULL    
 
433
fid     int(11) NO              NULL    
 
434
DROP TABLE t1;
 
435
SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))));
 
436
AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))))
 
437
POINT(1 4)
 
438
explain extended SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))));
 
439
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
 
440
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
 
441
Warnings:
 
442
Note    1003    select astext(geometryfromwkb(aswkb(geometryfromtext('POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))))`
 
443
explain extended SELECT AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)'))));
 
444
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
 
445
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
 
446
Warnings:
 
447
Note    1003    select astext(geometryfromwkb(aswkb(geometryfromtext('POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)'))))`
 
448
SELECT SRID(GeomFromText('LineString(1 1,2 2)',101));
 
449
SRID(GeomFromText('LineString(1 1,2 2)',101))
 
450
101
 
451
explain extended SELECT SRID(GeomFromText('LineString(1 1,2 2)',101));
 
452
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
 
453
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
 
454
Warnings:
 
455
Note    1003    select srid(geometryfromtext('LineString(1 1,2 2)',101)) AS `SRID(GeomFromText('LineString(1 1,2 2)',101))`
 
456
explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimple(Point(3, 6));
 
457
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
 
458
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
 
459
Warnings:
 
460
Note    1003    select issimple(multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,issimple(point(3,6)) AS `issimple(Point(3, 6))`
 
461
create table t1 (a geometry not null);
 
462
insert into t1 values (GeomFromText('Point(1 2)'));
 
463
insert into t1 values ('Garbage');
 
464
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
 
465
insert IGNORE into t1 values ('Garbage');
 
466
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
 
467
alter table t1 add spatial index(a);
 
468
drop table t1;
 
469
create table t1(a geometry not null, spatial index(a));
 
470
insert into t1 values
 
471
(GeomFromText('POINT(1 1)')), (GeomFromText('POINT(3 3)')), 
 
472
(GeomFromText('POINT(4 4)')), (GeomFromText('POINT(6 6)'));
 
473
select AsText(a) from t1 where
 
474
MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
 
475
or
 
476
MBRContains(GeomFromText('Polygon((2 2, 2 5, 5 5, 5 2, 2 2))'), a);
 
477
AsText(a)
 
478
POINT(1 1)
 
479
POINT(3 3)
 
480
POINT(4 4)
 
481
select AsText(a) from t1 where
 
482
MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
 
483
and
 
484
MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a);
 
485
AsText(a)
 
486
POINT(1 1)
 
487
drop table t1;
 
488
CREATE TABLE t1 (Coordinates POINT NOT NULL, SPATIAL INDEX(Coordinates));
 
489
INSERT INTO t1 VALUES(GeomFromText('POINT(383293632 1754448)'));
 
490
INSERT INTO t1 VALUES(GeomFromText('POINT(564952612 157516260)'));
 
491
INSERT INTO t1 VALUES(GeomFromText('POINT(903994614 180726515)'));
 
492
INSERT INTO t1 VALUES(GeomFromText('POINT(98128178 141127631)'));
 
493
INSERT INTO t1 VALUES(GeomFromText('POINT(862547902 799334546)'));
 
494
INSERT INTO t1 VALUES(GeomFromText('POINT(341989013 850270906)'));
 
495
INSERT INTO t1 VALUES(GeomFromText('POINT(803302376 93039099)'));
 
496
INSERT INTO t1 VALUES(GeomFromText('POINT(857439153 817431356)'));
 
497
INSERT INTO t1 VALUES(GeomFromText('POINT(319757546 343162742)'));
 
498
INSERT INTO t1 VALUES(GeomFromText('POINT(826341972 717484432)'));
 
499
INSERT INTO t1 VALUES(GeomFromText('POINT(305066789 201736238)'));
 
500
INSERT INTO t1 VALUES(GeomFromText('POINT(626068992 616241497)'));
 
501
INSERT INTO t1 VALUES(GeomFromText('POINT(55789424 755830108)'));
 
502
INSERT INTO t1 VALUES(GeomFromText('POINT(802874458 312435220)'));
 
503
INSERT INTO t1 VALUES(GeomFromText('POINT(153795660 551723671)'));
 
504
INSERT INTO t1 VALUES(GeomFromText('POINT(242207428 537089292)'));
 
505
INSERT INTO t1 VALUES(GeomFromText('POINT(553478119 807160039)'));
 
506
INSERT INTO t1 VALUES(GeomFromText('POINT(694605552 457472733)'));
 
507
INSERT INTO t1 VALUES(GeomFromText('POINT(987886554 792733729)'));
 
508
INSERT INTO t1 VALUES(GeomFromText('POINT(598600363 850434457)'));
 
509
INSERT INTO t1 VALUES(GeomFromText('POINT(592068275 940589376)'));
 
510
INSERT INTO t1 VALUES(GeomFromText('POINT(700705362 395370650)'));
 
511
INSERT INTO t1 VALUES(GeomFromText('POINT(33628474 558144514)'));
 
512
INSERT INTO t1 VALUES(GeomFromText('POINT(212802006 353386020)'));
 
513
INSERT INTO t1 VALUES(GeomFromText('POINT(901307256 39143977)'));
 
514
INSERT INTO t1 VALUES(GeomFromText('POINT(70870451 206374045)'));
 
515
INSERT INTO t1 VALUES(GeomFromText('POINT(240880214 696939443)'));
 
516
INSERT INTO t1 VALUES(GeomFromText('POINT(822615542 296669638)'));
 
517
INSERT INTO t1 VALUES(GeomFromText('POINT(452769551 625489999)'));
 
518
INSERT INTO t1 VALUES(GeomFromText('POINT(609104858 606565210)'));
 
519
INSERT INTO t1 VALUES(GeomFromText('POINT(177213669 851312285)'));
 
520
INSERT INTO t1 VALUES(GeomFromText('POINT(143654501 730691787)'));
 
521
INSERT INTO t1 VALUES(GeomFromText('POINT(658472325 838260052)'));
 
522
INSERT INTO t1 VALUES(GeomFromText('POINT(188164520 646358878)'));
 
523
INSERT INTO t1 VALUES(GeomFromText('POINT(630993781 786764883)'));
 
524
INSERT INTO t1 VALUES(GeomFromText('POINT(496793334 223062055)'));
 
525
INSERT INTO t1 VALUES(GeomFromText('POINT(727354258 197498696)'));
 
526
INSERT INTO t1 VALUES(GeomFromText('POINT(618432704 760982731)'));
 
527
INSERT INTO t1 VALUES(GeomFromText('POINT(755643210 831234710)'));
 
528
INSERT INTO t1 VALUES(GeomFromText('POINT(114368751 656950466)'));
 
529
INSERT INTO t1 VALUES(GeomFromText('POINT(870378686 185239202)'));
 
530
INSERT INTO t1 VALUES(GeomFromText('POINT(863324511 111258900)'));
 
531
INSERT INTO t1 VALUES(GeomFromText('POINT(882178645 685940052)'));
 
532
INSERT INTO t1 VALUES(GeomFromText('POINT(407928538 334948195)'));
 
533
INSERT INTO t1 VALUES(GeomFromText('POINT(311430051 17033395)'));
 
534
INSERT INTO t1 VALUES(GeomFromText('POINT(941513405 488643719)'));
 
535
INSERT INTO t1 VALUES(GeomFromText('POINT(868345680 85167906)'));
 
536
INSERT INTO t1 VALUES(GeomFromText('POINT(219335507 526818004)'));
 
537
INSERT INTO t1 VALUES(GeomFromText('POINT(923427958 407500026)'));
 
538
INSERT INTO t1 VALUES(GeomFromText('POINT(173176882 554421738)'));
 
539
INSERT INTO t1 VALUES(GeomFromText('POINT(194264908 669970217)'));
 
540
INSERT INTO t1 VALUES(GeomFromText('POINT(777483793 921619165)'));
 
541
INSERT INTO t1 VALUES(GeomFromText('POINT(867468912 395916497)'));
 
542
INSERT INTO t1 VALUES(GeomFromText('POINT(682601897 623112122)'));
 
543
INSERT INTO t1 VALUES(GeomFromText('POINT(227151206 796970647)'));
 
544
INSERT INTO t1 VALUES(GeomFromText('POINT(280062588 97529892)'));
 
545
INSERT INTO t1 VALUES(GeomFromText('POINT(982209849 143387099)'));
 
546
INSERT INTO t1 VALUES(GeomFromText('POINT(208788792 864388493)'));
 
547
INSERT INTO t1 VALUES(GeomFromText('POINT(829327151 616717329)'));
 
548
INSERT INTO t1 VALUES(GeomFromText('POINT(199336688 140757201)'));
 
549
INSERT INTO t1 VALUES(GeomFromText('POINT(633750724 140850093)'));
 
550
INSERT INTO t1 VALUES(GeomFromText('POINT(629400920 502096404)'));
 
551
INSERT INTO t1 VALUES(GeomFromText('POINT(226017998 848736426)'));
 
552
INSERT INTO t1 VALUES(GeomFromText('POINT(28914408 149445955)'));
 
553
INSERT INTO t1 VALUES(GeomFromText('POINT(256236452 202091290)'));
 
554
INSERT INTO t1 VALUES(GeomFromText('POINT(703867693 450501360)'));
 
555
INSERT INTO t1 VALUES(GeomFromText('POINT(872061506 481351486)'));
 
556
INSERT INTO t1 VALUES(GeomFromText('POINT(372120524 739530418)'));
 
557
INSERT INTO t1 VALUES(GeomFromText('POINT(877267982 54722420)'));
 
558
INSERT INTO t1 VALUES(GeomFromText('POINT(362642540 104419188)'));
 
559
INSERT INTO t1 VALUES(GeomFromText('POINT(851693067 642705127)'));
 
560
INSERT INTO t1 VALUES(GeomFromText('POINT(201949080 833902916)'));
 
561
INSERT INTO t1 VALUES(GeomFromText('POINT(786092225 410737872)'));
 
562
INSERT INTO t1 VALUES(GeomFromText('POINT(698291409 615419376)'));
 
563
INSERT INTO t1 VALUES(GeomFromText('POINT(27455201 897628096)'));
 
564
INSERT INTO t1 VALUES(GeomFromText('POINT(756176576 661205925)'));
 
565
INSERT INTO t1 VALUES(GeomFromText('POINT(38478189 385577496)'));
 
566
INSERT INTO t1 VALUES(GeomFromText('POINT(163302328 264496186)'));
 
567
INSERT INTO t1 VALUES(GeomFromText('POINT(234313922 192216735)'));
 
568
INSERT INTO t1 VALUES(GeomFromText('POINT(413942141 490550373)'));
 
569
INSERT INTO t1 VALUES(GeomFromText('POINT(394308025 117809834)'));
 
570
INSERT INTO t1 VALUES(GeomFromText('POINT(941051732 266369530)'));
 
571
INSERT INTO t1 VALUES(GeomFromText('POINT(599161319 313172256)'));
 
572
INSERT INTO t1 VALUES(GeomFromText('POINT(5899948 476429301)'));
 
573
INSERT INTO t1 VALUES(GeomFromText('POINT(367894677 368542487)'));
 
574
INSERT INTO t1 VALUES(GeomFromText('POINT(580848489 219587743)'));
 
575
INSERT INTO t1 VALUES(GeomFromText('POINT(11247614 782797569)'));
 
576
drop table t1;
 
577
create table t1 select GeomFromWKB(POINT(1,3));
 
578
show create table t1;
 
579
Table   Create Table
 
580
t1      CREATE TABLE `t1` (
 
581
  `GeomFromWKB(POINT(1,3))` geometry DEFAULT NULL
 
582
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
583
drop table t1;
 
584
CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo`
 
585
geometry NOT NULL default '') ENGINE=MyISAM ;
 
586
Warnings:
 
587
Warning 1101    BLOB/TEXT column 'geo' can't have a default value
 
588
insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363
 
589
36.305435,-114.992394 36.305202,-114.991219 36.305975,-114.991163
 
590
36.306845,-114.989432 36.309452,-114.978275 36.312642,-114.977363
 
591
36.311978,-114.975327 36.312344,-114.96502 36.31597,-114.963364
 
592
36.313629,-114.961723 36.313721,-114.956398 36.316057,-114.951882
 
593
36.320979,-114.947073 36.323475,-114.945207 36.326451,-114.945207
 
594
36.326451,-114.944132 36.326061,-114.94003 36.326588,-114.924017
 
595
36.334484,-114.923281 36.334146,-114.92564 36.331504,-114.94072
 
596
36.319282,-114.945348 36.314812,-114.948091 36.314762,-114.951755
 
597
36.316211,-114.952446 36.313883,-114.952644 36.309488,-114.944725
 
598
36.313083,-114.93706 36.32043,-114.932478 36.323497,-114.924556
 
599
36.327708,-114.922608 36.329715,-114.92009 36.328695,-114.912105
 
600
36.323566,-114.901647 36.317952,-114.897436 36.313968,-114.895344
 
601
36.309573,-114.891699 36.304398,-114.890569 36.303551,-114.886356
 
602
36.302702,-114.885141 36.301351,-114.885709 36.297391,-114.892499
 
603
36.290893,-114.902142 36.288974,-114.904941 36.288838,-114.905308
 
604
36.289845,-114.906325 36.290395,-114.909916 36.289549,-114.914527
 
605
36.287535,-114.918797 36.284423,-114.922982 36.279731,-114.924113
 
606
36.277282,-114.924057 36.275817,-114.927733 36.27053,-114.929354
 
607
36.269029,-114.929354 36.269029,-114.950856 36.268715,-114.950768
 
608
36.264324,-114.960206 36.264293,-114.960301 36.268943,-115.006662
 
609
36.268929,-115.008583 36.265619,-115.00665 36.264247,-115.006659
 
610
36.246873,-115.006659 36.246873,-115.006838 36.247697,-115.010764
 
611
36.247774,-115.015609 36.25113,-115.015765 36.254505,-115.029517
 
612
36.254619,-115.038573 36.249317,-115.038573 36.249317,-115.023403
 
613
36.25841,-115.023873 36.258994,-115.031845 36.259829,-115.03183
 
614
36.261053,-115.025561 36.261095,-115.036417 36.274632,-115.033729
 
615
36.276041,-115.032217 36.274851,-115.029845 36.273959,-115.029934
 
616
36.274966,-115.025763 36.274896,-115.025406 36.281044,-115.028731
 
617
36.284471,-115.036497 36.290377,-115.042071 36.291039,-115.026759
 
618
36.298478,-115.008995 36.301966,-115.006363 36.305435),(-115.079835
 
619
36.244369,-115.079735 36.260186,-115.076435 36.262369,-115.069758
 
620
36.265,-115.070235 36.268757,-115.064542 36.268655,-115.061843
 
621
36.269857,-115.062676 36.270693,-115.06305 36.272344,-115.059051
 
622
36.281023,-115.05918 36.283008,-115.060591 36.285246,-115.061913
 
623
36.290022,-115.062499 36.306353,-115.062499 36.306353,-115.060918
 
624
36.30642,-115.06112 36.289779,-115.05713 36.2825,-115.057314
 
625
36.279446,-115.060779 36.274659,-115.061366 36.27209,-115.057858
 
626
36.26557,-115.055805 36.262883,-115.054688 36.262874,-115.047335
 
627
36.25037,-115.044234 36.24637,-115.052434 36.24047,-115.061734
 
628
36.23507,-115.061934 36.22677,-115.061934 36.22677,-115.061491
 
629
36.225267,-115.062024 36.218194,-115.060134 36.218278,-115.060133
 
630
36.210771,-115.057833 36.210771,-115.057433 36.196271,-115.062233
 
631
36.196271,-115.062233 36.190371,-115.062233 36.190371,-115.065533
 
632
36.190371,-115.071333 36.188571,-115.098331 36.188275,-115.098331
 
633
36.188275,-115.098435 36.237569,-115.097535 36.240369,-115.097535
 
634
36.240369,-115.093235 36.240369,-115.089135 36.240469,-115.083135
 
635
36.240569,-115.083135 36.240569,-115.079835
 
636
36.244369)))')),('85998',GeomFromText('MULTIPOLYGON(((-115.333107
 
637
36.264587,-115.333168 36.280638,-115.333168 36.280638,-115.32226
 
638
36.280643,-115.322538 36.274311,-115.327222 36.274258,-115.32733
 
639
36.263026,-115.330675 36.262984,-115.332132 36.264673,-115.333107
 
640
36.264587),(-115.247239 36.247066,-115.247438 36.218267,-115.247438
 
641
36.218267,-115.278525 36.219263,-115.278525 36.219263,-115.301545
 
642
36.219559,-115.332748 36.219197,-115.332757 36.220041,-115.332757
 
643
36.220041,-115.332895 36.233514,-115.349023 36.233479,-115.351489
 
644
36.234475,-115.353681 36.237021,-115.357106 36.239789,-115.36519
 
645
36.243331,-115.368156 36.243487,-115.367389 36.244902,-115.364553
 
646
36.246014,-115.359219 36.24616,-115.356186 36.248025,-115.353347
 
647
36.248004,-115.350813 36.249507,-115.339673 36.25387,-115.333069
 
648
36.255018,-115.333069 36.255018,-115.333042 36.247767,-115.279039
 
649
36.248666,-115.263639 36.247466,-115.263839 36.252766,-115.261439
 
650
36.252666,-115.261439 36.247366,-115.247239 36.247066)))'));
 
651
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
 
652
t1 where object_id=85998;
 
653
object_id       geometrytype(geo)       ISSIMPLE(GEO)   ASTEXT(centroid(geo))
 
654
85998   MULTIPOLYGON    0       POINT(115.318773152032 -36.2374728210215)
 
655
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
 
656
t1 where object_id=85984;
 
657
object_id       geometrytype(geo)       ISSIMPLE(GEO)   ASTEXT(centroid(geo))
 
658
85984   MULTIPOLYGON    0       POINT(-114.877871869233 36.3310176346905)
 
659
drop table t1;
 
660
create table t1 (fl geometry not null);
 
661
insert into t1 values (1);
 
662
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
 
663
insert into t1 values (1.11);
 
664
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
 
665
insert into t1 values ("qwerty");
 
666
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
 
667
insert into t1 values (pointfromtext('point(1,1)'));
 
668
ERROR 23000: Column 'fl' cannot be null
 
669
drop table t1;
 
670
select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000))));
 
671
(asWKT(geomfromwkb((0x000000000140240000000000004024000000000000))))
 
672
POINT(10 10)
 
673
select (asWKT(geomfromwkb((0x010100000000000000000024400000000000002440))));
 
674
(asWKT(geomfromwkb((0x010100000000000000000024400000000000002440))))
 
675
POINT(10 10)
 
676
create table t1 (g GEOMETRY);
 
677
select * from t1;
 
678
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
 
679
def     test    t1      t1      g       g       255     4294967295      0       Y       144     0       63
 
680
g
 
681
select asbinary(g) from t1;
 
682
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr
 
683
def                                     asbinary(g)     252     4294967295      0       Y       128     0       63
 
684
asbinary(g)
 
685
drop table t1;
 
686
create table t1 (a TEXT, b GEOMETRY NOT NULL, SPATIAL KEY(b));
 
687
alter table t1 disable keys;
 
688
load data infile '../../std_data/bad_gis_data.dat' into table t1;
 
689
ERROR 22004: Column set to default value; NULL supplied to NOT NULL column 'b' at row 1
 
690
alter table t1 enable keys;
 
691
drop table t1;
 
692
create table t1 (a int, b blob);
 
693
insert into t1 values (1, ''), (2, NULL), (3, '1');
 
694
select * from t1;
 
695
a       b
 
696
1       
 
697
2       NULL
 
698
3       1
 
699
select
 
700
geometryfromtext(b) IS NULL, geometryfromwkb(b) IS NULL, astext(b) IS NULL, 
 
701
aswkb(b) IS NULL, geometrytype(b) IS NULL, centroid(b) IS NULL,
 
702
envelope(b) IS NULL, startpoint(b) IS NULL, endpoint(b) IS NULL,
 
703
exteriorring(b) IS NULL, pointn(b, 1) IS NULL, geometryn(b, 1) IS NULL,
 
704
interiorringn(b, 1) IS NULL, multipoint(b) IS NULL, isempty(b) IS NULL,
 
705
issimple(b) IS NULL, isclosed(b) IS NULL, dimension(b) IS NULL,
 
706
numgeometries(b) IS NULL, numinteriorrings(b) IS NULL, numpoints(b) IS NULL,
 
707
area(b) IS NULL, glength(b) IS NULL, srid(b) IS NULL, x(b) IS NULL, 
 
708
y(b) IS NULL
 
709
from t1;
 
710
geometryfromtext(b) IS NULL     geometryfromwkb(b) IS NULL      astext(b) IS NULL       aswkb(b) IS NULL        geometrytype(b) IS NULL centroid(b) IS NULL     envelope(b) IS NULL     startpoint(b) IS NULL   endpoint(b) IS NULL     exteriorring(b) IS NULL pointn(b, 1) IS NULL    geometryn(b, 1) IS NULL interiorringn(b, 1) IS NULL     multipoint(b) IS NULL   isempty(b) IS NULL      issimple(b) IS NULL     isclosed(b) IS NULL     dimension(b) IS NULL    numgeometries(b) IS NULL        numinteriorrings(b) IS NULL     numpoints(b) IS NULL    area(b) IS NULL glength(b) IS NULL      srid(b) IS NULL x(b) IS NULL    y(b) IS NULL
 
711
1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1
 
712
1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1
 
713
1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1       1
 
714
select 
 
715
within(b, b) IS NULL, contains(b, b) IS NULL, overlaps(b, b) IS NULL, 
 
716
equals(b, b) IS NULL, disjoint(b, b) IS NULL, touches(b, b) IS NULL, 
 
717
intersects(b, b) IS NULL, crosses(b, b) IS NULL
 
718
from t1;
 
719
within(b, b) IS NULL    contains(b, b) IS NULL  overlaps(b, b) IS NULL  equals(b, b) IS NULL    disjoint(b, b) IS NULL  touches(b, b) IS NULL   intersects(b, b) IS NULL        crosses(b, b) IS NULL
 
720
1       1       1       1       1       1       1       1
 
721
1       1       1       1       1       1       1       1
 
722
1       1       1       1       1       1       1       1
 
723
select 
 
724
point(b, b) IS NULL, linestring(b) IS NULL, polygon(b) IS NULL, multipoint(b) IS NULL, 
 
725
multilinestring(b) IS NULL, multipolygon(b) IS NULL, 
 
726
geometrycollection(b) IS NULL
 
727
from t1;
 
728
point(b, b) IS NULL     linestring(b) IS NULL   polygon(b) IS NULL      multipoint(b) IS NULL   multilinestring(b) IS NULL      multipolygon(b) IS NULL geometrycollection(b) IS NULL
 
729
0       1       1       1       1       1       1
 
730
1       1       1       1       1       1       1
 
731
0       1       1       1       1       1       1
 
732
drop table t1;
 
733
CREATE TABLE t1(a POINT) ENGINE=MyISAM;
 
734
INSERT INTO t1 VALUES (NULL);
 
735
SELECT * FROM t1;
 
736
a
 
737
NULL
 
738
DROP TABLE t1;
 
739
CREATE TABLE `t1` ( `col9` set('a'), `col89` date);
 
740
INSERT INTO `t1` VALUES ('','0000-00-00');
 
741
select geomfromtext(col9,col89) as a from t1;
 
742
a
 
743
NULL
 
744
DROP TABLE t1;
 
745
CREATE TABLE t1 (
 
746
geomdata polygon NOT NULL,
 
747
SPATIAL KEY index_geom (geomdata)
 
748
) ENGINE=MyISAM DEFAULT CHARSET=latin2 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED;
 
749
CREATE TABLE t2 (
 
750
geomdata polygon NOT NULL,
 
751
SPATIAL KEY index_geom (geomdata)
 
752
) ENGINE=MyISAM DEFAULT CHARSET=latin2 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED;
 
753
CREATE TABLE t3
 
754
select 
 
755
aswkb(ws.geomdata) AS geomdatawkb 
 
756
from 
 
757
t1 ws
 
758
union 
 
759
select 
 
760
aswkb(ws.geomdata) AS geomdatawkb 
 
761
from 
 
762
t2 ws;
 
763
describe t3;
 
764
Field   Type    Null    Key     Default Extra
 
765
geomdatawkb     longblob        YES             NULL    
 
766
drop table t1;
 
767
drop table t2;
 
768
drop table t3;
 
769
create table t1(col1 geometry default null,col15 geometrycollection not
 
770
null,spatial index(col15),index(col1(15)))engine=myisam;
 
771
insert into t1 set col15 = GeomFromText('POINT(6 5)');
 
772
insert into t1 set col15 = GeomFromText('POINT(6 5)');
 
773
check table t1 extended;
 
774
Table   Op      Msg_type        Msg_text
 
775
test.t1 check   status  OK
 
776
drop table t1;
 
777
End of 4.1 tests
 
778
create table t1 (s1 geometry not null,s2 char(100));
 
779
create trigger t1_bu before update on t1 for each row set new.s1 = null;
 
780
insert into t1 values (null,null);
 
781
ERROR 23000: Column 's1' cannot be null
 
782
drop table t1;
 
783
drop procedure if exists fn3;
 
784
create function fn3 () returns point deterministic return GeomFromText("point(1 1)");
 
785
show create function fn3;
 
786
Function        sql_mode        Create Function character_set_client    collation_connection    Database Collation
 
787
fn3             CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS point
 
788
    DETERMINISTIC
 
789
return GeomFromText("point(1 1)")       latin1  latin1_swedish_ci       latin1_swedish_ci
 
790
select astext(fn3());
 
791
astext(fn3())
 
792
POINT(1 1)
 
793
drop function fn3;
 
794
create table t1(pt POINT);
 
795
alter table t1 add primary key pti(pt);
 
796
drop table t1;
 
797
create table t1(pt GEOMETRY);
 
798
alter table t1 add primary key pti(pt);
 
799
ERROR 42000: BLOB/TEXT column 'pt' used in key specification without a key length
 
800
alter table t1 add primary key pti(pt(20));
 
801
drop table t1;
 
802
create table t1 select GeomFromText('point(1 1)');
 
803
desc t1;
 
804
Field   Type    Null    Key     Default Extra
 
805
GeomFromText('point(1 1)')      geometry        YES             NULL    
 
806
drop table t1;
 
807
create table t1 (g geometry not null);
 
808
insert into t1 values(default);
 
809
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
 
810
drop table t1;
 
811
CREATE TABLE t1 (a GEOMETRY);
 
812
CREATE VIEW v1 AS SELECT GeomFromwkb(ASBINARY(a)) FROM t1;
 
813
CREATE VIEW v2 AS SELECT a FROM t1;
 
814
DESCRIBE v1;
 
815
Field   Type    Null    Key     Default Extra
 
816
GeomFromwkb(ASBINARY(a))        geometry        YES             NULL    
 
817
DESCRIBE v2;
 
818
Field   Type    Null    Key     Default Extra
 
819
a       geometry        YES             NULL    
 
820
DROP VIEW v1,v2;
 
821
DROP TABLE t1;
 
822
create table t1 (name VARCHAR(100), square GEOMETRY);
 
823
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
 
824
INSERT INTO t1 VALUES("small",  GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
 
825
INSERT INTO t1 VALUES("big",    GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
 
826
INSERT INTO t1 VALUES("up",     GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
 
827
INSERT INTO t1 VALUES("up2",    GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
 
828
INSERT INTO t1 VALUES("up3",    GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
 
829
INSERT INTO t1 VALUES("down",   GeomFromText('POLYGON (( 0 -1, 0  1, 2  1, 2 -1, 0 -1))'));
 
830
INSERT INTO t1 VALUES("down2",  GeomFromText('POLYGON (( 0 -2, 0  0, 2  0, 2 -2, 0 -2))'));
 
831
INSERT INTO t1 VALUES("down3",  GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
 
832
INSERT INTO t1 VALUES("right",  GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
 
833
INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
 
834
INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
 
835
INSERT INTO t1 VALUES("left",   GeomFromText('POLYGON (( -1 0, -1 2,  1 2,  1 0, -1 0))'));
 
836
INSERT INTO t1 VALUES("left2",  GeomFromText('POLYGON (( -2 0, -2 2,  0 2,  0 0, -2 0))'));
 
837
INSERT INTO t1 VALUES("left3",  GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
 
838
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains  FROM t1 a1 JOIN t1 a2 ON MBRContains(   a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
 
839
mbrcontains
 
840
center,small
 
841
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint  FROM t1 a1 JOIN t1 a2 ON MBRDisjoint(   a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
 
842
mbrdisjoint
 
843
down3,left3,right3,up3
 
844
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal     FROM t1 a1 JOIN t1 a2 ON MBREqual(      a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
 
845
mbrequal
 
846
center
 
847
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
 
848
mbrintersect
 
849
big,center,down,down2,left,left2,right,right2,small,up,up2
 
850
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps  FROM t1 a1 JOIN t1 a2 ON MBROverlaps(   a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
 
851
mbroverlaps
 
852
down,left,right,up
 
853
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches   FROM t1 a1 JOIN t1 a2 ON MBRTouches(    a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
 
854
mbrtouches
 
855
down2,left2,right2,up2
 
856
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin    FROM t1 a1 JOIN t1 a2 ON MBRWithin(     a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
 
857
mbrwithin
 
858
big,center
 
859
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains     FROM t1 a1 JOIN t1 a2 ON Contains(      a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
 
860
contains
 
861
center,small
 
862
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint     FROM t1 a1 JOIN t1 a2 ON Disjoint(      a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
 
863
disjoint
 
864
down3,left3,right3,up3
 
865
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals       FROM t1 a1 JOIN t1 a2 ON Equals(        a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
 
866
equals
 
867
center
 
868
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect    FROM t1 a1 JOIN t1 a2 ON Intersects(    a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
 
869
intersect
 
870
big,center,down,down2,left,left2,right,right2,small,up,up2
 
871
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps     FROM t1 a1 JOIN t1 a2 ON Overlaps(      a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
 
872
overlaps
 
873
down,left,right,up
 
874
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches      FROM t1 a1 JOIN t1 a2 ON Touches(       a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
 
875
touches
 
876
down2,left2,right2,up2
 
877
SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within       FROM t1 a1 JOIN t1 a2 ON Within(        a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
 
878
within
 
879
big,center
 
880
SET @vert1   = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
 
881
SET @horiz1  = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
 
882
SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
 
883
SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))');
 
884
SET @point1 = GeomFromText('POLYGON ((0 0))');
 
885
SET @point2 = GeomFromText('POLYGON ((-2 0))');
 
886
SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name;
 
887
overlaps
 
888
SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name;
 
889
overlaps
 
890
SELECT Overlaps(@horiz1, @vert1) FROM DUAL;
 
891
Overlaps(@horiz1, @vert1)
 
892
0
 
893
SELECT Overlaps(@horiz1, @horiz2) FROM DUAL;
 
894
Overlaps(@horiz1, @horiz2)
 
895
1
 
896
SELECT Overlaps(@horiz1, @horiz3) FROM DUAL;
 
897
Overlaps(@horiz1, @horiz3)
 
898
0
 
899
SELECT Overlaps(@horiz1, @point1) FROM DUAL;
 
900
Overlaps(@horiz1, @point1)
 
901
0
 
902
SELECT Overlaps(@horiz1, @point2) FROM DUAL;
 
903
Overlaps(@horiz1, @point2)
 
904
0
 
905
DROP TABLE t1;
 
906
create table t1(f1 geometry, f2 point, f3 linestring);
 
907
select f1 from t1 union select f1 from t1;
 
908
f1
 
909
insert into t1 (f2,f3) values (GeomFromText('POINT(1 1)'),
 
910
GeomFromText('LINESTRING(0 0,1 1,2 2)'));
 
911
select AsText(f2),AsText(f3) from t1;
 
912
AsText(f2)      AsText(f3)
 
913
POINT(1 1)      LINESTRING(0 0,1 1,2 2)
 
914
select AsText(a) from (select f2 as a from t1 union select f3 from t1) t;
 
915
AsText(a)
 
916
POINT(1 1)
 
917
LINESTRING(0 0,1 1,2 2)
 
918
create table t2 as select f2 as a from t1 union select f3 from t1;
 
919
desc t2;
 
920
Field   Type    Null    Key     Default Extra
 
921
a       point   YES             NULL    
 
922
select AsText(a) from t2;
 
923
AsText(a)
 
924
POINT(1 1)
 
925
LINESTRING(0 0,1 1,2 2)
 
926
drop table t1, t2;
 
927
SELECT 1;
 
928
1
 
929
1
 
930
CREATE TABLE t1 (p POINT);
 
931
CREATE TABLE t2 (p POINT, INDEX(p));
 
932
INSERT INTO t1 VALUES (POINTFROMTEXT('POINT(1 2)'));
 
933
INSERT INTO t2 VALUES (POINTFROMTEXT('POINT(1 2)'));
 
934
SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
 
935
COUNT(*)
 
936
1
 
937
EXPLAIN 
 
938
SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
 
939
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
940
1       SIMPLE  t2      system  p       NULL    NULL    NULL    1       
 
941
SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
 
942
COUNT(*)
 
943
1
 
944
INSERT INTO t1 VALUES (POINTFROMTEXT('POINT(1 2)'));
 
945
INSERT INTO t2 VALUES (POINTFROMTEXT('POINT(1 2)'));
 
946
EXPLAIN 
 
947
SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
 
948
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
949
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    2       Using where
 
950
SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
 
951
COUNT(*)
 
952
2
 
953
EXPLAIN 
 
954
SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
 
955
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
956
1       SIMPLE  t2      ref     p       p       28      const   1       Using where
 
957
SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
 
958
COUNT(*)
 
959
2
 
960
EXPLAIN 
 
961
SELECT COUNT(*) FROM t2 IGNORE INDEX(p) WHERE p=POINTFROMTEXT('POINT(1 2)');
 
962
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
963
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    2       Using where
 
964
SELECT COUNT(*) FROM t2 IGNORE INDEX(p) WHERE p=POINTFROMTEXT('POINT(1 2)');
 
965
COUNT(*)
 
966
2
 
967
DROP TABLE t1, t2;
 
968
End of 5.0 tests
 
969
create table `t1` (`col002` point)engine=myisam;
 
970
insert into t1 values (),(),();
 
971
select min(`col002`) from t1 union select `col002` from t1;
 
972
min(`col002`)
 
973
NULL
 
974
drop table t1;
 
975
#
 
976
# Bug #47780: crash when comparing GIS items from subquery
 
977
#
 
978
CREATE TABLE t1(a INT, b MULTIPOLYGON);
 
979
INSERT INTO t1 VALUES 
 
980
(0,
 
981
GEOMFROMTEXT(
 
982
'multipolygon(((1 2,3 4,5 6,7 8,9 8),(7 6,5 4,3 2,1 2,3 4)))'));
 
983
# must not crash
 
984
SELECT 1 FROM t1 WHERE a <> (SELECT GEOMETRYCOLLECTIONFROMWKB(b) FROM t1);
 
985
1
 
986
DROP TABLE t1;
 
987
#
 
988
# Bug #49250 : spatial btree index corruption and crash
 
989
# Part one : spatial syntax check
 
990
#
 
991
CREATE TABLE t1(col1 MULTIPOLYGON NOT NULL,
 
992
SPATIAL INDEX USING BTREE (col1));
 
993
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE (col1))' at line 2
 
994
CREATE TABLE t2(col1 MULTIPOLYGON NOT NULL);
 
995
CREATE SPATIAL INDEX USING BTREE ON t2(col);
 
996
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE ON t2(col)' at line 1
 
997
ALTER TABLE t2 ADD SPATIAL INDEX USING BTREE (col1);
 
998
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE (col1)' at line 1
 
999
DROP TABLE t2;
 
1000
End of 5.0 tests
 
1001
create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
 
1002
create view v1 as select * from t1;
 
1003
desc v1;
 
1004
Field   Type    Null    Key     Default Extra
 
1005
f1      tinyint(1)      YES             NULL    
 
1006
f2      char(1) YES             NULL    
 
1007
f3      varchar(1)      YES             NULL    
 
1008
f4      geometry        YES             NULL    
 
1009
f5      datetime        YES             NULL    
 
1010
drop view v1;
 
1011
drop table t1;
 
1012
SELECT MultiPoint(12345,'');
 
1013
MultiPoint(12345,'')
 
1014
NULL
 
1015
SELECT MultiPoint(123451,'');
 
1016
MultiPoint(123451,'')
 
1017
NULL
 
1018
SELECT MultiPoint(1234512,'');
 
1019
MultiPoint(1234512,'')
 
1020
NULL
 
1021
SELECT MultiPoint(12345123,'');
 
1022
MultiPoint(12345123,'')
 
1023
NULL
 
1024
SELECT MultiLineString(12345,'');
 
1025
MultiLineString(12345,'')
 
1026
NULL
 
1027
SELECT MultiLineString(123451,'');
 
1028
MultiLineString(123451,'')
 
1029
NULL
 
1030
SELECT MultiLineString(1234512,'');
 
1031
MultiLineString(1234512,'')
 
1032
NULL
 
1033
SELECT MultiLineString(12345123,'');
 
1034
MultiLineString(12345123,'')
 
1035
NULL
 
1036
SELECT LineString(12345,'');
 
1037
LineString(12345,'')
 
1038
NULL
 
1039
SELECT LineString(123451,'');
 
1040
LineString(123451,'')
 
1041
NULL
 
1042
SELECT LineString(1234512,'');
 
1043
LineString(1234512,'')
 
1044
NULL
 
1045
SELECT LineString(12345123,'');
 
1046
LineString(12345123,'')
 
1047
NULL
 
1048
SELECT Polygon(12345,'');
 
1049
Polygon(12345,'')
 
1050
NULL
 
1051
SELECT Polygon(123451,'');
 
1052
Polygon(123451,'')
 
1053
NULL
 
1054
SELECT Polygon(1234512,'');
 
1055
Polygon(1234512,'')
 
1056
NULL
 
1057
SELECT Polygon(12345123,'');
 
1058
Polygon(12345123,'')
 
1059
NULL
 
1060
End of 5.1 tests