mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
387b92df97
--debug is supported by allmost all our other binaries and we should keep it also in the server to keep option names similar.
31 lines
1.5 KiB
Text
31 lines
1.5 KiB
Text
CREATE TABLE t1 (c1 INT, c2 GEOMETRY NOT NULL, c3 GEOMETRY NOT NULL) ENGINE=INNODB;
|
|
CREATE TEMPORARY TABLE t LIKE t1;
|
|
INSERT INTO t VALUES
|
|
(1, Point(1,1), ST_GeomFromText('POLYGON (( 0 -1, 0 1, 2 1, 2 -1, 0 -1))')),
|
|
(2, Point(2,2), ST_GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))')),
|
|
(3, Point(3,3), ST_GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))')),
|
|
(4, Point(4,4), ST_GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))')),
|
|
(5, Point(5,5), ST_GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')),
|
|
(6, Point(6,6), ST_GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))')),
|
|
(7, Point(7,7), ST_GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))')),
|
|
(8, Point(8,8), ST_GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))')),
|
|
(9, Point(9,9), ST_GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
|
|
INSERT INTO t1 SELECT t.* FROM t, seq_1_to_512;
|
|
DROP TEMPORARY TABLE t;
|
|
CREATE SPATIAL INDEX idx ON t1(c2);
|
|
SELECT COUNT(*) FROM t1;
|
|
COUNT(*)
|
|
4608
|
|
SET @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
|
|
SELECT COUNT(*) FROM t1 WHERE MBRWithin(t1.c2, @g1);
|
|
COUNT(*)
|
|
4608
|
|
SET @g1 = ST_GeomFromText('Polygon((10 10,10 800,800 800,800 10,10 10))');
|
|
SELECT COUNT(*) FROM t1 WHERE MBRWithin(t1.c2, @g1);
|
|
COUNT(*)
|
|
0
|
|
ALTER TABLE t1 DROP INDEX idx, ADD SPATIAL INDEX idx3(c2);
|
|
SET debug_dbug='+d,row_merge_instrument_log_check_flush';
|
|
ALTER TABLE t1 DROP INDEX idx3, ADD SPATIAL INDEX idx4(c2), ADD SPATIAL INDEX idx5(c3);
|
|
ALTER TABLE t1 FORCE;
|
|
DROP TABLE t1;
|