1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MariaDB adjustments to innodb_gis tests.

Some test are still disabled as they provide different results,
fail on different error or crash.

Fixes also MDEV-14060 InnoDB: Foreign key constraint to
geometry type does not work where test intentionally tried
incorrect cases.
This commit is contained in:
Jan Lindström
2017-10-12 17:21:04 +03:00
parent 42e3e57426
commit a6a4c25bf7
27 changed files with 697 additions and 52 deletions

View File

@ -16,6 +16,8 @@ SELECT COUNT(*) FROM tab;
COUNT(*)
1
"In connection 1"
connect con1,localhost,root,,;
connection con1;
SET GLOBAL TRANSACTION ISOLATION LEVEL REPEATABLE READ;
SELECT @@tx_isolation;
@@tx_isolation
@ -27,6 +29,8 @@ SELECT c1,ST_AsText(c2),ST_AsText(c3),ST_AsText(c4),ST_AsText(c5) FROM tab;
c1 ST_AsText(c2) ST_AsText(c3) ST_AsText(c4) ST_AsText(c5)
1 POINT(10 10) LINESTRING(5 5,20 20,30 30) POLYGON((30 30,40 40,50 50,30 50,30 40,30 30)) POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
"In connection 2"
connect con2,localhost,root,,;
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
SELECT @@tx_isolation;
@@tx_isolation
@ -41,6 +45,7 @@ SET @g2 = ST_GeomFromText('POINT(10 10)');
UPDATE tab SET C5 = ST_GeomFromText('POLYGON((300 300,400 400,500 500,300 500,300 400,300 300))')
WHERE MBREquals(tab.c4, @g1) AND MBREquals(tab.c2, @g2);
"In connection 1"
connection con1;
SET @g3 = ST_GeomFromText('POLYGON((40 50,40 70,50 100,70 100,80 80,70 50,40 50))');
SELECT c1,ST_AsText(c2),ST_AsText(c4),ST_AsText(c5) FROM tab WHERE MBREquals(tab.c5, @g3);
c1 ST_AsText(c2) ST_AsText(c4) ST_AsText(c5)
@ -52,11 +57,14 @@ SELECT COUNT(*) FROM tab;
COUNT(*)
1
"In connection 2"
connection con2;
SELECT COUNT(*) FROM tab;
COUNT(*)
2
COMMIT;
disconnect con2;
"In connection 1"
connection con1;
SELECT COUNT(*) FROM tab;
COUNT(*)
1
@ -74,6 +82,8 @@ SELECT c1,ST_AsText(c2),ST_AsText(c4),ST_AsText(c5) FROM tab;
c1 ST_AsText(c2) ST_AsText(c4) ST_AsText(c5)
1 POINT(10 10) POLYGON((30 30,40 40,50 50,30 50,30 40,30 30)) POLYGON((300 300,400 400,500 500,300 500,300 400,300 300))
2 POINT(20 20) POLYGON((40 50,40 70,50 100,70 100,80 80,70 50,40 50)) POLYGON((40 50,40 70,50 100,70 100,80 80,70 50,40 50))
disconnect con1;
connection default;
DROP TABLE tab;
CREATE TABLE tab(c1 int NOT NULL PRIMARY KEY,c2 POINT NOT NULL,
c3 LINESTRING NOT NULL,c4 POLYGON NOT NULL,c5 GEOMETRY NOT NULL)
@ -93,6 +103,8 @@ SELECT COUNT(*) FROM tab;
COUNT(*)
1
"In connection 1"
connect con1,localhost,root,,;
connection con1;
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
SELECT @@tx_isolation;
@@tx_isolation
@ -104,6 +116,8 @@ SELECT c1,ST_AsText(c2),ST_AsText(c3),ST_AsText(c4),ST_AsText(c5) FROM tab;
c1 ST_AsText(c2) ST_AsText(c3) ST_AsText(c4) ST_AsText(c5)
1 POINT(10 10) LINESTRING(5 5,20 20,30 30) POLYGON((30 30,40 40,50 50,30 50,30 40,30 30)) POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
"In connection 2"
connect con2,localhost,root,,;
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
SELECT @@tx_isolation;
@@tx_isolation
@ -118,6 +132,7 @@ SET @g2 = ST_GeomFromText('POINT(10 10)');
UPDATE tab SET C5 = ST_GeomFromText('POLYGON((300 300,400 400,500 500,300 500,300 400,300 300))')
WHERE MBREquals(tab.c4, @g1) AND MBREquals(tab.c2, @g2);
"In connection 1"
connection con1;
SET @g3 = ST_GeomFromText('POLYGON((40 50,40 70,50 100,70 100,80 80,70 50,40 50))');
SELECT c1,ST_AsText(c2),ST_AsText(c4),ST_AsText(c5) FROM tab WHERE MBREquals(tab.c5, @g3);
c1 ST_AsText(c2) ST_AsText(c4) ST_AsText(c5)
@ -129,11 +144,14 @@ SELECT COUNT(*) FROM tab;
COUNT(*)
1
"In connection 2"
connection con2;
SELECT COUNT(*) FROM tab;
COUNT(*)
2
COMMIT;
disconnect con2;
"In connection 1"
connection con1;
SELECT COUNT(*) FROM tab;
COUNT(*)
1
@ -151,4 +169,6 @@ SELECT c1,ST_AsText(c2),ST_AsText(c4),ST_AsText(c5) FROM tab;
c1 ST_AsText(c2) ST_AsText(c4) ST_AsText(c5)
1 POINT(10 10) POLYGON((30 30,40 40,50 50,30 50,30 40,30 30)) POLYGON((300 300,400 400,500 500,300 500,300 400,300 300))
2 POINT(20 20) POLYGON((40 50,40 70,50 100,70 100,80 80,70 50,40 50)) POLYGON((40 50,40 70,50 100,70 100,80 80,70 50,40 50))
disconnect con1;
connection default;
DROP TABLE tab;