Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
ba6646f7
Commit
ba6646f7
authored
Jun 09, 2016
by
Alexander Barkov
Committed by
Sergei Golubchik
Jun 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More tests for MDEV-7563 Support CHECK constraint:
GIS functions
parent
3f32bf62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
275 additions
and
0 deletions
+275
-0
mysql-test/r/gis.result
mysql-test/r/gis.result
+150
-0
mysql-test/t/gis.test
mysql-test/t/gis.test
+125
-0
No files found.
mysql-test/r/gis.result
View file @
ba6646f7
...
...
@@ -1859,6 +1859,156 @@ SELECT distance FROM t1;
distance
1
DROP TABLE t1;
CREATE TABLE t1 (a TEXT, g GEOMETRY DEFAULT GeomFromText(a));
INSERT INTO t1 (a) VALUES ('point(1 1)');
SELECT AsText(g) FROM t1;
AsText(g)
POINT(1 1)
DROP TABLE t1;
CREATE TABLE t1 (x INT, y INT, g GEOMETRY DEFAULT POINT(x,y));
INSERT INTO t1 (x,y) VALUES (10,20);
SELECT AsText(g) FROM t1;
AsText(g)
POINT(10 20)
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT PointN(a,2));
INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,2 2,3 3)'));
SELECT AsText(b) FROM t1;
AsText(b)
POINT(2 2)
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT StartPoint(a));
INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,2 2,3 3)'));
SELECT AsText(b) FROM t1;
AsText(b)
POINT(1 1)
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c GEOMETRY DEFAULT GeometryCollection(a,b));
INSERT INTO t1 (a,b) VALUES (Point(1,1), Point(2,2));
SELECT AsText(c) FROM t1;
AsText(c)
GEOMETRYCOLLECTION(POINT(1 1),POINT(2 2))
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT GeomFromWKB(AsBinary(a),20));
INSERT INTO t1 (a) VALUES (GeomFromText('POINT(1 1)', 10));
SELECT AsText(a), SRID(a), AsText(b), SRID(b) FROM t1;
AsText(a) SRID(a) AsText(b) SRID(b)
POINT(1 1) 10 POINT(1 1) 20
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT BOUNDARY(a));
INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'));
SELECT AsText(b) FROM t1;
AsText(b)
LINESTRING(10 10,10 20,20 20,20 10,10 10)
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT BUFFER(a,10));
INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'));
SELECT GeometryType(b) FROM t1;
GeometryType(b)
POLYGON
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT CENTROID(a));
INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'));
SELECT AsText(b) FROM t1;
AsText(b)
POINT(15 15)
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT ENVELOPE(a));
INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,4 4)'));
SELECT AsText(b) FROM t1;
AsText(b)
POLYGON((1 1,4 1,4 4,1 4,1 1))
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT PointOnSurface(a));
INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'));
SELECT GeometryType(b) FROM t1;
GeometryType(b)
POINT
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT Point(1,1), c GEOMETRY DEFAULT ST_UNION(a,b));
INSERT INTO t1 (a) VALUES (Point(0,0));
SELECT AsText(c) FROM t1;
AsText(c)
MULTIPOINT(0 0,1 1)
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b VARCHAR(20) DEFAULT GeometryType(a));
INSERT INTO t1 (a) VALUES (Point(0, 0));
SELECT b FROM t1;
b
POINT
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsSimple(a));
INSERT INTO t1 (a) VALUES (Point(0, 0));
SELECT b FROM t1;
b
1
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsEmpty(a));
INSERT INTO t1 (a) VALUES (Point(0, 0));
SELECT b FROM t1;
b
0
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsRing(a));
INSERT INTO t1 (a) VALUES (GeomFromText('LineString(0 0,0 1,1 1,1 0,0 0)'));
SELECT b FROM t1;
b
1
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsClosed(a));
INSERT INTO t1 (a) VALUES (GeomFromText('LineString(0 0,0 1,1 1,1 0,0 0)'));
SELECT b FROM t1;
b
1
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT Dimension(a));
INSERT INTO t1 (a) VALUES (Buffer(Point(1,1),1));
SELECT b FROM t1;
b
2
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT NumGeometries(a));
INSERT INTO t1 (a) VALUES (ST_UNION(Point(1,1),Point(0,0)));
SELECT b FROM t1;
b
2
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT NumInteriorRings(a));
INSERT INTO t1 (a) VALUES (GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))'));
SELECT b FROM t1;
b
1
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT NumPoints(a));
INSERT INTO t1 (a) VALUES (LineString(Point(1,1),Point(0,0)));
SELECT b FROM t1;
b
2
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT SRID(a));
INSERT INTO t1 (a) VALUES (GeomFromText('Point(1 1)', 100));
SELECT b FROM t1;
b
100
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c INT DEFAULT MBRDisjoint(a,b));
INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1));
SELECT c FROM t1;
c
0
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c INT DEFAULT ST_Disjoint(a,b));
INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1));
SELECT c FROM t1;
c
0
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c INT DEFAULT ST_Relate(a,b,'T*F**FFF*'));
INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1));
SELECT c FROM t1;
c
1
DROP TABLE t1;
#
# End of 10.2 tests
#
mysql-test/t/gis.test
View file @
ba6646f7
...
...
@@ -1554,6 +1554,131 @@ INSERT INTO t1 (g) VALUES (Point(1,0));
SELECT
distance
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
TEXT
,
g
GEOMETRY
DEFAULT
GeomFromText
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
'point(1 1)'
);
SELECT
AsText
(
g
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
x
INT
,
y
INT
,
g
GEOMETRY
DEFAULT
POINT
(
x
,
y
));
INSERT
INTO
t1
(
x
,
y
)
VALUES
(
10
,
20
);
SELECT
AsText
(
g
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
GEOMETRY
DEFAULT
PointN
(
a
,
2
));
INSERT
INTO
t1
(
a
)
VALUES
(
GeomFromText
(
'LineString(1 1,2 2,3 3)'
));
SELECT
AsText
(
b
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
GEOMETRY
DEFAULT
StartPoint
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
GeomFromText
(
'LineString(1 1,2 2,3 3)'
));
SELECT
AsText
(
b
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
GEOMETRY
,
c
GEOMETRY
DEFAULT
GeometryCollection
(
a
,
b
));
INSERT
INTO
t1
(
a
,
b
)
VALUES
(
Point
(
1
,
1
),
Point
(
2
,
2
));
SELECT
AsText
(
c
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
GEOMETRY
DEFAULT
GeomFromWKB
(
AsBinary
(
a
),
20
));
INSERT
INTO
t1
(
a
)
VALUES
(
GeomFromText
(
'POINT(1 1)'
,
10
));
SELECT
AsText
(
a
),
SRID
(
a
),
AsText
(
b
),
SRID
(
b
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
GEOMETRY
DEFAULT
BOUNDARY
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
GeomFromText
(
'POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'
));
SELECT
AsText
(
b
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
GEOMETRY
DEFAULT
BUFFER
(
a
,
10
));
INSERT
INTO
t1
(
a
)
VALUES
(
GeomFromText
(
'POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'
));
SELECT
GeometryType
(
b
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
GEOMETRY
DEFAULT
CENTROID
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
GeomFromText
(
'POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'
));
SELECT
AsText
(
b
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
GEOMETRY
DEFAULT
ENVELOPE
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
GeomFromText
(
'LineString(1 1,4 4)'
));
SELECT
AsText
(
b
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
GEOMETRY
DEFAULT
PointOnSurface
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
GeomFromText
(
'POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'
));
SELECT
GeometryType
(
b
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
GEOMETRY
DEFAULT
Point
(
1
,
1
),
c
GEOMETRY
DEFAULT
ST_UNION
(
a
,
b
));
INSERT
INTO
t1
(
a
)
VALUES
(
Point
(
0
,
0
));
SELECT
AsText
(
c
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
VARCHAR
(
20
)
DEFAULT
GeometryType
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
Point
(
0
,
0
));
SELECT
b
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
INT
DEFAULT
IsSimple
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
Point
(
0
,
0
));
SELECT
b
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
INT
DEFAULT
IsEmpty
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
Point
(
0
,
0
));
SELECT
b
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
INT
DEFAULT
IsRing
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
GeomFromText
(
'LineString(0 0,0 1,1 1,1 0,0 0)'
));
SELECT
b
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
INT
DEFAULT
IsClosed
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
GeomFromText
(
'LineString(0 0,0 1,1 1,1 0,0 0)'
));
SELECT
b
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
INT
DEFAULT
Dimension
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
Buffer
(
Point
(
1
,
1
),
1
));
SELECT
b
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
INT
DEFAULT
NumGeometries
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
ST_UNION
(
Point
(
1
,
1
),
Point
(
0
,
0
)));
SELECT
b
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
INT
DEFAULT
NumInteriorRings
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
GeomFromText
(
'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))'
));
SELECT
b
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
INT
DEFAULT
NumPoints
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
LineString
(
Point
(
1
,
1
),
Point
(
0
,
0
)));
SELECT
b
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
INT
DEFAULT
SRID
(
a
));
INSERT
INTO
t1
(
a
)
VALUES
(
GeomFromText
(
'Point(1 1)'
,
100
));
SELECT
b
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
GEOMETRY
,
c
INT
DEFAULT
MBRDisjoint
(
a
,
b
));
INSERT
INTO
t1
(
a
,
b
)
VALUES
(
Point
(
1
,
1
),
Point
(
1
,
1
));
SELECT
c
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
GEOMETRY
,
c
INT
DEFAULT
ST_Disjoint
(
a
,
b
));
INSERT
INTO
t1
(
a
,
b
)
VALUES
(
Point
(
1
,
1
),
Point
(
1
,
1
));
SELECT
c
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
GEOMETRY
,
b
GEOMETRY
,
c
INT
DEFAULT
ST_Relate
(
a
,
b
,
'T*F**FFF*'
));
INSERT
INTO
t1
(
a
,
b
)
VALUES
(
Point
(
1
,
1
),
Point
(
1
,
1
));
SELECT
c
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.2 tests
--
echo
#
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment