mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01:00
42e3e57426
Add missing innodb_gis tests.
49 lines
2 KiB
Text
49 lines
2 KiB
Text
# This is to test create GIS index with algorithm=inplace.
|
|
|
|
--source include/have_innodb.inc
|
|
--source include/have_debug.inc
|
|
--source include/no_valgrind_without_big.inc
|
|
|
|
# Create table with geometry column
|
|
CREATE TABLE t1 (c1 INT, c2 GEOMETRY NOT NULL, c3 GEOMETRY NOT NULL) ENGINE=INNODB;
|
|
|
|
# Insert enough values
|
|
INSERT INTO t1 VALUES(1, Point(1,1), ST_GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))'));
|
|
INSERT INTO t1 VALUES(2, Point(2,2), ST_GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
|
|
INSERT INTO t1 VALUES(3, Point(3,3), ST_GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
|
|
INSERT INTO t1 VALUES(4, Point(4,4), ST_GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
|
|
INSERT INTO t1 VALUES(5, Point(5,5), ST_GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
|
|
INSERT INTO t1 VALUES(6, Point(6,6), ST_GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
|
|
INSERT INTO t1 VALUES(7, Point(7,7), ST_GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
|
|
INSERT INTO t1 VALUES(8, Point(8,8), ST_GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
|
|
INSERT INTO t1 VALUES(9, Point(9,9), ST_GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
|
|
|
|
INSERT INTO t1 SELECT * FROM t1;
|
|
INSERT INTO t1 SELECT * FROM t1;
|
|
INSERT INTO t1 SELECT * FROM t1;
|
|
INSERT INTO t1 SELECT * FROM t1;
|
|
|
|
INSERT INTO t1 SELECT * FROM t1;
|
|
INSERT INTO t1 SELECT * FROM t1;
|
|
INSERT INTO t1 SELECT * FROM t1;
|
|
INSERT INTO t1 SELECT * FROM t1;
|
|
INSERT INTO t1 SELECT * FROM t1;
|
|
|
|
# create spatial index
|
|
CREATE SPATIAL INDEX idx ON t1(c2);
|
|
|
|
SELECT COUNT(*) FROM t1;
|
|
|
|
SET @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
|
|
SELECT COUNT(*) FROM t1 WHERE MBRWithin(t1.c2, @g1);
|
|
|
|
SET @g1 = ST_GeomFromText('Polygon((10 10,10 800,800 800,800 10,10 10))');
|
|
SELECT COUNT(*) FROM t1 WHERE MBRWithin(t1.c2, @g1);
|
|
|
|
ALTER TABLE t1 DROP INDEX idx, ADD SPATIAL INDEX idx3(c2);
|
|
|
|
SET SESSION debug="+d,row_merge_instrument_log_check_flush";
|
|
ALTER TABLE t1 DROP INDEX idx3, ADD SPATIAL INDEX idx4(c2), ADD SPATIAL INDEX idx5(c3);
|
|
|
|
# Clean up.
|
|
DROP TABLE t1;
|