1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-12 OpenGIS: create required tables: GeometryColumns, related views.

GEOMETRY_COLUMNS and SPATIAL_REF_SYS tables added to the INFORMATION_SCHEMA.
This commit is contained in:
Alexey Botchkov
2014-09-02 11:31:26 +05:00
parent c1f5f61c9b
commit c3db445956
6 changed files with 184 additions and 1 deletions

View File

@ -1613,3 +1613,37 @@ insert into t1 values(Geomfromtext('POLYGON((1 1, 2 2, 2 1, 1 1))'));
ERROR 22007: Incorrect POINT value: 'POLYGON' for column 'pt' at row 1
drop table t1;
End of 5.5 tests
SHOW CREATE TABLE information_schema.geometry_columns;
Table Create Table
GEOMETRY_COLUMNS CREATE TEMPORARY TABLE `GEOMETRY_COLUMNS` (
`F_TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '',
`F_TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`F_TABLE_NAME` varchar(64) NOT NULL DEFAULT '',
`F_GEOMETRY_COLUMN` varchar(64) NOT NULL DEFAULT '',
`G_TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '',
`G_TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`G_TABLE_NAME` varchar(64) NOT NULL DEFAULT '',
`G_GEOMETRY_COLUMN` varchar(64) NOT NULL DEFAULT '',
`STORAGE_TYPE` tinyint(2) NOT NULL DEFAULT '0',
`GEOMETRY_TYPE` int(7) NOT NULL DEFAULT '0',
`COORD_DIMENSION` tinyint(2) NOT NULL DEFAULT '0',
`MAX_PPR` tinyint(2) NOT NULL DEFAULT '0',
`SRID` smallint(5) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
SHOW CREATE TABLE information_schema.spatial_ref_sys;
Table Create Table
SPATIAL_REF_SYS CREATE TEMPORARY TABLE `SPATIAL_REF_SYS` (
`SRID` smallint(5) NOT NULL DEFAULT '0',
`AUTH_NAME` varchar(512) NOT NULL DEFAULT '',
`AUTH_SRID` smallint(5) NOT NULL DEFAULT '0',
`SRTEXT` varchar(2048) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8
create table t1(g GEOMETRY, pt POINT);
create table t2(g LINESTRING, pl POLYGON);
select * from information_schema.geometry_columns;
F_TABLE_CATALOG F_TABLE_SCHEMA F_TABLE_NAME F_GEOMETRY_COLUMN G_TABLE_CATALOG G_TABLE_SCHEMA G_TABLE_NAME G_GEOMETRY_COLUMN STORAGE_TYPE GEOMETRY_TYPE COORD_DIMENSION MAX_PPR SRID
def test t1 def test t1 g 1 0 2 0 0 0
def test t1 def test t1 pt 1 1 2 0 0 0
def test t2 def test t2 g 1 2 2 0 0 0
def test t2 def test t2 pl 1 3 2 0 0 0
drop table t1, t2;

View File

@ -58,6 +58,7 @@ ENABLED_ROLES
ENGINES
EVENTS
FILES
GEOMETRY_COLUMNS
GLOBAL_STATUS
GLOBAL_VARIABLES
INDEX_STATISTICS
@ -74,6 +75,7 @@ SCHEMATA
SCHEMA_PRIVILEGES
SESSION_STATUS
SESSION_VARIABLES
SPATIAL_REF_SYS
STATISTICS
SYSTEM_VARIABLES
TABLES

View File

@ -1473,3 +1473,12 @@ insert into t1 values(Geomfromtext('POLYGON((1 1, 2 2, 2 1, 1 1))'));
drop table t1;
--echo End of 5.5 tests
SHOW CREATE TABLE information_schema.geometry_columns;
SHOW CREATE TABLE information_schema.spatial_ref_sys;
create table t1(g GEOMETRY, pt POINT);
create table t2(g LINESTRING, pl POLYGON);
select * from information_schema.geometry_columns;
drop table t1, t2;