@@ -56,6 +56,7 @@ INSERT INTO t1 VALUES("left3", ST_GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1
56
56
SET @p = ST_GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))');
57
57
SELECT name, ST_AsText(square) from t1 where MBRContains(@p, square);
58
58
name ST_AsText(square)
59
+ small POLYGON((0 0,0 1,1 1,1 0,0 0))
59
60
SELECT name, ST_AsText(square) from t1 where MBRDisjoint(@p, square);
60
61
name ST_AsText(square)
61
62
up3 POLYGON((0 3,0 5,2 5,2 3,0 3))
@@ -90,6 +91,7 @@ down2 POLYGON((0 -2,0 0,2 0,2 -2,0 -2))
90
91
left2 POLYGON((-2 0,-2 2,0 2,0 0,-2 0))
91
92
SELECT name, ST_AsText(square) from t1 where MBRWithin(@p, square);
92
93
name ST_AsText(square)
94
+ big POLYGON((0 0,0 3,3 3,3 0,0 0))
93
95
SET @vert1 = ST_GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
94
96
SET @horiz1 = ST_GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
95
97
SET @horiz2 = ST_GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
@@ -217,7 +219,7 @@ SELECT COUNT(*)
217
219
FROM t1
218
220
WHERE ST_CONTAINS(ST_GeomFromText('POLYGON((2 2,4 2, 4 4, 2 4, 2 2))'),way);
219
221
COUNT(*)
220
- 0
222
+ 9
221
223
OPTIMIZE TABLE t1;
222
224
Table Op Msg_type Msg_text
223
225
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
@@ -226,7 +228,7 @@ SELECT COUNT(*)
226
228
FROM t1
227
229
WHERE ST_CONTAINS(ST_GeomFromText('POLYGON((2 2,4 2, 4 4, 2 4, 2 2))'),way);
228
230
COUNT(*)
229
- 0
231
+ 9
230
232
DROP TABLE t1;
231
233
CREATE TABLE t1( i INT, g GEOMETRY NOT NULL, SPATIAL INDEX (g)) ENGINE=InnoDB;
232
234
INSERT INTO t1 VALUES(1, LINESTRING(POINT(1,1), POINT(4, 4)));
0 commit comments