Debian Codegraph @

mysql-test/suite/innodb_gis/t/check_spatial_index.test

raw
1 --echo # CHECK TABLE for Spatial Index.
2
3 CREATE TABLE gis_geometry (
4 id INT PRIMARY KEY,
5 geo GEOMETRY NOT NULL SRID 0,
6 SPATIAL KEY `index_geo` (geo)
7 )ENGINE=InnoDB;
8
9 # Insert a geometry which covers the full range.
10 INSERT INTO gis_geometry VALUES (1, ST_GeomFromText("linestring(-1.7976931348623157E+308 -1.7976931348623157E+308, 1.7976931348623157E+308 1.7976931348623157E+308)", 0));
11
12 # Insert an empty geometry. (In the spatial index it is also stored as full range.)
13 INSERT INTO gis_geometry VALUES (2, ST_GeomFromText("GEOMETRYCOLLECTION EMPTY"));
14
15 # Insert geometry at the corner of full range.
16 INSERT INTO gis_geometry VALUES (3, ST_GeomFromText("linestring(1.7976931348623157E+308 1.7976931348623157E+308, 1.7976931348623157E+308 1.7976931348623157E+308)", 0));
17
18 # Insert geometry at the corner of full range.
19 INSERT INTO gis_geometry VALUES (4, ST_GeomFromText("linestring(-1.7976931348623157E+308 -1.7976931348623157E+308, -1.7976931348623157E+308 -1.7976931348623157E+308)", 0));
20
21 # Insert random geometry somewhere.
22 INSERT INTO gis_geometry VALUES (5, ST_GeomFromText("linestring(0 0, 10 10)", 0));
23
24 CHECK TABLE gis_geometry;
25
26 CHECK TABLE gis_geometry EXTENDED;
27
28 DROP TABLE gis_geometry;
29
30 CREATE TABLE gis_geometry (
31 id INT PRIMARY KEY,
32 geo GEOMETRY NOT NULL SRID 4326,
33 SPATIAL KEY `index_geo` (geo)
34 )ENGINE=InnoDB;
35
36 INSERT INTO gis_geometry VALUES (1, ST_GeomFromText("linestring(-90 -179.9999999999999999, 90 180)", 4326));
37
38 # Insert an empty geometry. (In the spatial index it is also stored as full range.)
39 INSERT INTO gis_geometry VALUES (2, ST_GeomFromText("GEOMETRYCOLLECTION EMPTY", 4326));
40
41 # Insert random geometry somewhere.
42 INSERT INTO gis_geometry VALUES (5, ST_GeomFromText("linestring(0 0, 10 10)", 4326));
43
44 CHECK TABLE gis_geometry;
45
46 CHECK TABLE gis_geometry EXTENDED;
47
48 DROP TABLE gis_geometry;