1
- DROP TABLE IF EXISTS t1, t2;
2
1
CREATE TABLE t1 (
3
- fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
2
+ fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
4
3
g GEOMETRY NOT NULL,
5
4
SPATIAL KEY(g)
6
- ) ENGINE=MyISAM ;
5
+ );
7
6
SHOW CREATE TABLE t1;
8
7
Table Create Table
9
8
t1 CREATE TABLE `t1` (
@@ -183,9 +182,9 @@ fid AsText(g)
183
182
2 LINESTRING(149 149,151 151)
184
183
DROP TABLE t1;
185
184
CREATE TABLE t2 (
186
- fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
185
+ fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
187
186
g GEOMETRY NOT NULL
188
- ) ENGINE=MyISAM ;
187
+ );
189
188
INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10)));
190
189
INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10)));
191
190
INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10)));
@@ -298,11 +297,11 @@ t2 CREATE TABLE `t2` (
298
297
SELECT count(*) FROM t2;
299
298
count(*)
300
299
100
301
- EXPLAIN SELECT fid, AsText(g) FROM t2 WHERE Within(g,
300
+ EXPLAIN SELECT fid, AsText(g) FROM t2 WHERE Within(g,
302
301
GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
303
302
id select_type table type possible_keys key key_len ref rows Extra
304
303
1 SIMPLE t2 range g g 34 NULL 4 Using where
305
- SELECT fid, AsText(g) FROM t2 WHERE Within(g,
304
+ SELECT fid, AsText(g) FROM t2 WHERE Within(g,
306
305
GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
307
306
fid AsText(g)
308
307
46 LINESTRING(51 41,60 50)
@@ -710,9 +709,6 @@ SELECT count(*) FROM t2;
710
709
count(*)
711
710
100
712
711
DROP TABLE t2;
713
- drop table if exists t1;
714
- Warnings:
715
- Note 1051 Unknown table 'test.t1'
716
712
CREATE TABLE t1 (a geometry NOT NULL, SPATIAL (a));
717
713
INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
718
714
INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
@@ -751,20 +747,20 @@ Table Op Msg_type Msg_text
751
747
test.t1 analyze status OK
752
748
drop table t1;
753
749
CREATE TABLE t1 (
754
- fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
750
+ fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
755
751
g GEOMETRY NOT NULL,
756
752
SPATIAL KEY(g)
757
- ) ENGINE=MyISAM ;
753
+ );
758
754
INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)'));
759
755
drop table t1;
760
756
CREATE TABLE t1 (
761
757
line GEOMETRY NOT NULL,
762
758
kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
763
759
name VARCHAR(32),
764
760
SPATIAL KEY (line)
765
- ) engine=myisam ;
761
+ );
766
762
ALTER TABLE t1 DISABLE KEYS;
767
- INSERT INTO t1 (name, kind, line) VALUES
763
+ INSERT INTO t1 (name, kind, line) VALUES
768
764
("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")),
769
765
("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")),
770
766
("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")),
@@ -803,7 +799,7 @@ CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
803
799
INSERT IGNORE INTO t2 SELECT GeomFromText(st) FROM t1;
804
800
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
805
801
drop table t1, t2;
806
- CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
802
+ CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`)) DEFAULT CHARSET=latin1;
807
803
INSERT INTO t1 (geometry) VALUES
808
804
(PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000
809
805
-66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999,
@@ -819,7 +815,7 @@ drop table t1;
819
815
CREATE TABLE t1 (
820
816
c1 geometry NOT NULL default '',
821
817
SPATIAL KEY i1 (c1)
822
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
818
+ ) DEFAULT CHARSET=latin1;
823
819
INSERT INTO t1 (c1) VALUES (
824
820
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
825
821
-18.6055555000 -66.8158332999,
@@ -833,7 +829,7 @@ DROP TABLE t1;
833
829
CREATE TABLE t1 (
834
830
c1 geometry NOT NULL default '',
835
831
SPATIAL KEY i1 (c1)
836
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
832
+ ) DEFAULT CHARSET=latin1;
837
833
INSERT INTO t1 (c1) VALUES (
838
834
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
839
835
-18.6055555000 -66.8158332999,
@@ -874,7 +870,7 @@ c3 varchar(10) collate utf8_bin default NULL,
874
870
spatial_point point NOT NULL,
875
871
PRIMARY KEY(id),
876
872
SPATIAL KEY (spatial_point)
877
- )ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
873
+ ) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
878
874
INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
879
875
('y', 's', 'j', GeomFromText('POINT(167 74)')),
880
876
('r', 'n', 'd', GeomFromText('POINT(215 118)')),
@@ -1544,11 +1540,11 @@ HANDLER t1 CLOSE;
1544
1540
DROP TABLE t1;
1545
1541
End of 5.0 tests.
1546
1542
#
1547
- # Bug #57323/11764487: myisam corruption with insert ignore
1543
+ # Bug #57323/11764487: myisam corruption with insert ignore
1548
1544
# and invalid spatial data
1549
1545
#
1550
1546
CREATE TABLE t1(a POINT NOT NULL, b GEOMETRY NOT NULL,
1551
- SPATIAL KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM ;
1547
+ SPATIAL KEY(a), SPATIAL KEY(b));
1552
1548
INSERT INTO t1 VALUES(GEOMFROMTEXT("point (0 0)"), GEOMFROMTEXT("point (1 1)"));
1553
1549
INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=GEOMFROMTEXT("error");
1554
1550
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
@@ -1559,7 +1555,7 @@ ASTEXT(a) ASTEXT(b)
1559
1555
POINT(0 0) POINT(1 1)
1560
1556
DROP TABLE t1;
1561
1557
CREATE TABLE t1(a INT NOT NULL, b GEOMETRY NOT NULL,
1562
- KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM ;
1558
+ KEY(a), SPATIAL KEY(b));
1563
1559
INSERT INTO t1 VALUES(0, GEOMFROMTEXT("point (1 1)"));
1564
1560
INSERT IGNORE INTO t1 SET a=0, b=GEOMFROMTEXT("error");
1565
1561
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
@@ -1573,7 +1569,7 @@ End of 5.1 tests
1573
1569
CREATE TABLE t1 (
1574
1570
l LINESTRING NOT NULL,
1575
1571
SPATIAL KEY(l)
1576
- ) ENGINE = myisam ;
1572
+ );
1577
1573
INSERT INTO t1 VALUES(GeomFromText('LINESTRING(0 0, 1 1)'));
1578
1574
INSERT INTO t1 VALUES(GeomFromText('LINESTRING(1 1, 2 2)'));
1579
1575
INSERT INTO t1 VALUES(GeomFromText('LINESTRING(2 2, 3 3)'));
@@ -1596,7 +1592,7 @@ DROP TABLE t1;
1596
1592
#
1597
1593
# MDEV-8239 Reverse spatial operations OP(const, field) do not get optimized
1598
1594
#
1599
- CREATE TABLE t1 (a GEOMETRY NOT NULL, SPATIAL KEY(a)) ENGINE=MyISAM ;
1595
+ CREATE TABLE t1 (a GEOMETRY NOT NULL, SPATIAL KEY(a));
1600
1596
INSERT INTO t1 VALUES (Point(1,2)),(Point(1,3));
1601
1597
EXPLAIN SELECT * FROM t1 WHERE MBRINTERSECTS(a,Point(1,2));
1602
1598
id select_type table type possible_keys key key_len ref rows Extra
@@ -1614,7 +1610,7 @@ DROP TABLE t1;
1614
1610
#
1615
1611
# MDEV-8610 "WHERE CONTAINS(indexed_geometry_column,1)" causes full table scan
1616
1612
#
1617
- CREATE TABLE t1 (a GEOMETRY NOT NULL, SPATIAL KEY(a)) ENGINE=MyISAM ;
1613
+ CREATE TABLE t1 (a GEOMETRY NOT NULL, SPATIAL KEY(a));
1618
1614
INSERT INTO t1 VALUES (Point(1,1)),(Point(2,2)),(Point(3,3));
1619
1615
EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,1);
1620
1616
id select_type table type possible_keys key key_len ref rows Extra
0 commit comments