Commit e28b4b68 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-14057: Fix some tests

parent a0ce62f8
...@@ -259,10 +259,8 @@ INSERT INTO gis_point VALUES ...@@ -259,10 +259,8 @@ INSERT INTO gis_point VALUES
(ST_PointFromText('POINT(32.1234 64.2468)'), ST_PointFromText('POINT(-1 -1)')); (ST_PointFromText('POINT(32.1234 64.2468)'), ST_PointFromText('POINT(-1 -1)'));
'The ORDER BY for spatial index will use filesort' 'The ORDER BY for spatial index will use filesort'
EXPLAIN SELECT ST_AsText(p1), ST_AsText(p2) FROM gis_point ORDER BY p1, p2; EXPLAIN SELECT ST_AsText(p1), ST_AsText(p2) FROM gis_point ORDER BY p1, p2;
id select_type table partitions type possible_keys key key_len ref rows filtered Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE gis_point NULL ALL NULL NULL NULL NULL # 100.00 Using filesort 1 SIMPLE gis_point ALL NULL NULL NULL NULL 13 #
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`gis_point`.`p1`) AS `ST_AsText(p1)`,st_astext(`test`.`gis_point`.`p2`) AS `ST_AsText(p2)` from `test`.`gis_point` order by `test`.`gis_point`.`p1`,`test`.`gis_point`.`p2`
SELECT ST_AsText(p1), ST_AsText(p2) FROM gis_point ORDER BY p1, p2; SELECT ST_AsText(p1), ST_AsText(p2) FROM gis_point ORDER BY p1, p2;
ST_AsText(p1) ST_AsText(p2) ST_AsText(p1) ST_AsText(p2)
POINT(2 4) POINT(-2 -6) POINT(2 4) POINT(-2 -6)
...@@ -354,9 +352,11 @@ COUNT(*) ST_AsText(p1) ...@@ -354,9 +352,11 @@ COUNT(*) ST_AsText(p1)
1024 POINT(4 8) 1024 POINT(4 8)
SELECT COUNT(*), ST_AsText(p2) FROM gis_point WHERE ST_Contains(@poly2, p2) GROUP BY p2; SELECT COUNT(*), ST_AsText(p2) FROM gis_point WHERE ST_Contains(@poly2, p2) GROUP BY p2;
COUNT(*) ST_AsText(p2) COUNT(*) ST_AsText(p2)
1024 POINT(0 0)
1024 POINT(-2 -6) 1024 POINT(-2 -6)
1024 POINT(-3 -9) 1024 POINT(-3 -9)
1024 POINT(-4 -12) 1024 POINT(-4 -12)
1024 POINT(-5 -15)
1024 POINT(-1 -3) 1024 POINT(-1 -3)
1024 POINT(-1 -1) 1024 POINT(-1 -1)
SELECT COUNT(*), ST_AsText(p2) FROM gis_point WHERE ST_Equals(p2, @p1) GROUP BY p2; SELECT COUNT(*), ST_AsText(p2) FROM gis_point WHERE ST_Equals(p2, @p1) GROUP BY p2;
...@@ -368,13 +368,17 @@ COUNT(*) ST_AsText(p1) ...@@ -368,13 +368,17 @@ COUNT(*) ST_AsText(p1)
1024 POINT(32.1234 64.2468) 1024 POINT(32.1234 64.2468)
SELECT COUNT(*), ST_AsText(p1), ST_AsText(p2) FROM gis_point WHERE ST_Contains(@mpoly, p1) GROUP BY p1, p2; SELECT COUNT(*), ST_AsText(p1), ST_AsText(p2) FROM gis_point WHERE ST_Contains(@mpoly, p1) GROUP BY p1, p2;
COUNT(*) ST_AsText(p1) ST_AsText(p2) COUNT(*) ST_AsText(p1) ST_AsText(p2)
1024 POINT(3 6) POINT(-3 -9)
1024 POINT(4 8) POINT(-4 -12) 1024 POINT(4 8) POINT(-4 -12)
1024 POINT(5 10) POINT(-5 -15) 1024 POINT(5 10) POINT(-5 -15)
1024 POINT(6 12) POINT(-6 -18) 1024 POINT(6 12) POINT(-6 -18)
1024 POINT(7 14) POINT(-7 -21) 1024 POINT(7 14) POINT(-7 -21)
1024 POINT(8 16) POINT(0 0)
1024 POINT(10 21) POINT(-6 3)
1024 POINT(20.5 41) POINT(-8 4) 1024 POINT(20.5 41) POINT(-8 4)
SELECT COUNT(*), ST_AsText(p1), ST_AsText(p2) FROM gis_point WHERE ST_Contains(@mpoly, p1) AND NOT MBRWithin(p1, @mpoly) GROUP BY p1, p2; SELECT COUNT(*), ST_AsText(p1), ST_AsText(p2) FROM gis_point WHERE ST_Contains(@mpoly, p1) AND NOT MBRWithin(p1, @mpoly) GROUP BY p1, p2;
COUNT(*) ST_AsText(p1) ST_AsText(p2) COUNT(*) ST_AsText(p1) ST_AsText(p2)
1024 POINT(3 6) POINT(-3 -9)
====================================================================== ======================================================================
Build another new table with the same schema, will insert data from this table to the orignal one Build another new table with the same schema, will insert data from this table to the orignal one
====================================================================== ======================================================================
...@@ -522,9 +526,11 @@ COUNT(*) ST_AsText(p1) ...@@ -522,9 +526,11 @@ COUNT(*) ST_AsText(p1)
1024 POINT(4 8) 1024 POINT(4 8)
SELECT COUNT(*), ST_AsText(p2) FROM gis_point WHERE ST_Contains(@poly2, p2) GROUP BY p2; SELECT COUNT(*), ST_AsText(p2) FROM gis_point WHERE ST_Contains(@poly2, p2) GROUP BY p2;
COUNT(*) ST_AsText(p2) COUNT(*) ST_AsText(p2)
2 POINT(0 0)
1024 POINT(-2 -6) 1024 POINT(-2 -6)
1024 POINT(-3 -9) 1024 POINT(-3 -9)
1024 POINT(-4 -12) 1024 POINT(-4 -12)
1024 POINT(-5 -15)
1024 POINT(-1 -3) 1024 POINT(-1 -3)
1024 POINT(-1 -1) 1024 POINT(-1 -1)
SELECT COUNT(*), ST_AsText(p2) FROM gis_point WHERE ST_Equals(p2, @p1) GROUP BY p2; SELECT COUNT(*), ST_AsText(p2) FROM gis_point WHERE ST_Equals(p2, @p1) GROUP BY p2;
...@@ -536,13 +542,17 @@ COUNT(*) ST_AsText(p1) ...@@ -536,13 +542,17 @@ COUNT(*) ST_AsText(p1)
1024 POINT(32.1234 64.2468) 1024 POINT(32.1234 64.2468)
SELECT COUNT(*), ST_AsText(p1), ST_AsText(p2) FROM gis_point WHERE ST_Contains(@mpoly, p1) GROUP BY p1, p2; SELECT COUNT(*), ST_AsText(p1), ST_AsText(p2) FROM gis_point WHERE ST_Contains(@mpoly, p1) GROUP BY p1, p2;
COUNT(*) ST_AsText(p1) ST_AsText(p2) COUNT(*) ST_AsText(p1) ST_AsText(p2)
1024 POINT(3 6) POINT(-3 -9)
1024 POINT(4 8) POINT(-4 -12) 1024 POINT(4 8) POINT(-4 -12)
1024 POINT(5 10) POINT(-5 -15) 1024 POINT(5 10) POINT(-5 -15)
1024 POINT(6 12) POINT(-6 -18) 1024 POINT(6 12) POINT(-6 -18)
1024 POINT(7 14) POINT(-7 -21) 1024 POINT(7 14) POINT(-7 -21)
2 POINT(8 16) POINT(0 0)
1024 POINT(10 21) POINT(-6 3)
1024 POINT(20.5 41) POINT(-8 4) 1024 POINT(20.5 41) POINT(-8 4)
SELECT COUNT(*), ST_AsText(p1), ST_AsText(p2) FROM gis_point WHERE ST_Contains(@mpoly, p1) AND NOT MBRWithin(p1, @mpoly) GROUP BY p1, p2; SELECT COUNT(*), ST_AsText(p1), ST_AsText(p2) FROM gis_point WHERE ST_Contains(@mpoly, p1) AND NOT MBRWithin(p1, @mpoly) GROUP BY p1, p2;
COUNT(*) ST_AsText(p1) ST_AsText(p2) COUNT(*) ST_AsText(p1) ST_AsText(p2)
1024 POINT(3 6) POINT(-3 -9)
CHECK TABLE gis_point; CHECK TABLE gis_point;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.gis_point check status OK test.gis_point check status OK
......
...@@ -234,7 +234,7 @@ start transaction; ...@@ -234,7 +234,7 @@ start transaction;
set @g1 = ST_GeomFromText('Polygon((800 800, 800 1000, 1000 1000, 1000 800, 800 800))'); set @g1 = ST_GeomFromText('Polygon((800 800, 800 1000, 1000 1000, 1000 800, 800 800))');
select count(*) from t1 where MBRwithin(t1.c2, @g1); select count(*) from t1 where MBRwithin(t1.c2, @g1);
count(*) count(*)
201 199
connection b; connection b;
CALL insert_t1(1001, 2000); CALL insert_t1(1001, 2000);
set session transaction isolation level serializable; set session transaction isolation level serializable;
......
...@@ -79,7 +79,7 @@ count(*) ...@@ -79,7 +79,7 @@ count(*)
set @g1 = ST_GeomFromText('Polygon((2 2,2 800,800 800,800 2,2 2))'); set @g1 = ST_GeomFromText('Polygon((2 2,2 800,800 800,800 2,2 2))');
select count(*) from t1 where MBRWithin(t1.c2, @g1); select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*) count(*)
65536 57344
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))'); set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
select count(*) from t1 where MBRWithin(t1.c2, @g1); select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*) count(*)
...@@ -87,5 +87,5 @@ count(*) ...@@ -87,5 +87,5 @@ count(*)
set @g1 = ST_GeomFromText('Polygon((2 2,2 800,800 800,800 2,2 2))'); set @g1 = ST_GeomFromText('Polygon((2 2,2 800,800 800,800 2,2 2))');
select count(*) from t1 where MBRWithin(t1.c2, @g1); select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*) count(*)
65536 57344
drop table t1; drop table t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment