[Commits] 5f14fc3: MDEV-7540 Information Schema SPATIAL_REF_SYS contents don't match the expected contents.

holyfoot at askmonty.org holyfoot at askmonty.org
Mon Dec 21 14:08:22 EET 2015


revision-id: 5f14fc3cc9570dea690f090e220c00e4dfeac20a (mariadb-10.1.9-27-g5f14fc3)
parent(s): ab9a488dec79f325d73dddd11d7ee120108a9f36
committer: Alexey Botchkov
timestamp: 2015-12-21 16:07:07 +0400
message:

MDEV-7540 Information Schema SPATIAL_REF_SYS contents don't match the expected contents.
        Table content filled appropriately.
        Thare are still just two records as we don't have geodetics yet.

---
 mysql-test/r/gis.result                         |  2 +-
 mysql-test/suite/funcs_1/r/is_columns_is.result |  4 ++--
 sql/sql_show.cc                                 | 17 ++++++++++++-----
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 69a14b2..3308050 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -1727,7 +1727,7 @@ 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',
+  `AUTH_SRID` int(5) NOT NULL DEFAULT '0',
   `SRTEXT` varchar(2048) NOT NULL DEFAULT ''
 ) ENGINE=MEMORY DEFAULT CHARSET=utf8
 create table t1(g GEOMETRY, pt POINT);
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index 34ff5ec..66a90f1 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -326,7 +326,7 @@ def	information_schema	SESSION_STATUS	VARIABLE_VALUE	2		NO	varchar	2048	6144	NUL
 def	information_schema	SESSION_VARIABLES	VARIABLE_NAME	1		NO	varchar	64	192	NULL	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select	
 def	information_schema	SESSION_VARIABLES	VARIABLE_VALUE	2		NO	varchar	2048	6144	NULL	NULL	NULL	utf8	utf8_general_ci	varchar(2048)			select	
 def	information_schema	SPATIAL_REF_SYS	AUTH_NAME	2		NO	varchar	512	1536	NULL	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select	
-def	information_schema	SPATIAL_REF_SYS	AUTH_SRID	3	0	NO	smallint	NULL	NULL	5	0	NULL	NULL	NULL	smallint(5)			select	
+def	information_schema	SPATIAL_REF_SYS	AUTH_SRID	3	0	NO	int	NULL	NULL	10	0	NULL	NULL	NULL	int(5)			select	
 def	information_schema	SPATIAL_REF_SYS	SRID	1	0	NO	smallint	NULL	NULL	5	0	NULL	NULL	NULL	smallint(5)			select	
 def	information_schema	SPATIAL_REF_SYS	SRTEXT	4		NO	varchar	2048	6144	NULL	NULL	NULL	utf8	utf8_general_ci	varchar(2048)			select	
 def	information_schema	STATISTICS	CARDINALITY	10	NULL	YES	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(21)			select	
@@ -855,7 +855,7 @@ NULL	information_schema	ROUTINES	LAST_ALTERED	datetime	NULL	NULL	NULL	NULL	datet
 3.0000	information_schema	SESSION_VARIABLES	VARIABLE_VALUE	varchar	2048	6144	utf8	utf8_general_ci	varchar(2048)
 NULL	information_schema	SPATIAL_REF_SYS	SRID	smallint	NULL	NULL	NULL	NULL	smallint(5)
 3.0000	information_schema	SPATIAL_REF_SYS	AUTH_NAME	varchar	512	1536	utf8	utf8_general_ci	varchar(512)
-NULL	information_schema	SPATIAL_REF_SYS	AUTH_SRID	smallint	NULL	NULL	NULL	NULL	smallint(5)
+NULL	information_schema	SPATIAL_REF_SYS	AUTH_SRID	int	NULL	NULL	NULL	NULL	int(5)
 3.0000	information_schema	SPATIAL_REF_SYS	SRTEXT	varchar	2048	6144	utf8	utf8_general_ci	varchar(2048)
 3.0000	information_schema	STATISTICS	TABLE_CATALOG	varchar	512	1536	utf8	utf8_general_ci	varchar(512)
 3.0000	information_schema	STATISTICS	TABLE_SCHEMA	varchar	64	192	utf8	utf8_general_ci	varchar(64)
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 10d8ed2..ab86868 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -344,14 +344,21 @@ static int fill_spatial_ref_sys(THD *thd, TABLE_LIST *tables, COND *cond)
   table->field[0]->store(-1, FALSE); /*SRID*/
   table->field[1]->store(STRING_WITH_LEN("Not defined"), cs); /*AUTH_NAME*/
   table->field[2]->store(-1, FALSE); /*AUTH_SRID*/
-  table->field[3]->store(STRING_WITH_LEN(""), cs);/*SRTEXT*/
+  table->field[3]->store(STRING_WITH_LEN(
+        "LOCAL_CS[\"Spatial reference wasn't specified\","
+        "LOCAL_DATUM[\"Unknown\",0]," "UNIT[\"m\",1.0]," "AXIS[\"x\",EAST],"
+        "AXIS[\"y\",NORTH]]"), cs);/*SRTEXT*/
   if (schema_table_store_record(thd, table))
     goto exit;
 
   table->field[0]->store(0, TRUE); /*SRID*/
-  table->field[1]->store(STRING_WITH_LEN("Cartesian plane"), cs); /*AUTH_NAME*/
-  table->field[2]->store(0, TRUE); /*AUTH_SRID*/
-  table->field[3]->store(STRING_WITH_LEN(""), cs);/*SRTEXT*/
+  table->field[1]->store(STRING_WITH_LEN("EPSG"), cs); /*AUTH_NAME*/
+  table->field[2]->store(404000, TRUE); /*AUTH_SRID*/
+  table->field[3]->store(STRING_WITH_LEN(
+        "LOCAL_CS[\"Wildcard 2D cartesian plane in metric unit\","
+        "LOCAL_DATUM[\"Unknown\",0]," "UNIT[\"m\",1.0],"
+        "AXIS[\"x\",EAST]," "AXIS[\"y\",NORTH],"
+        "AUTHORITY[\"EPSG\",\"404000\"]]"), cs);/*SRTEXT*/
   if (schema_table_store_record(thd, table))
     goto exit;
 
@@ -8977,7 +8984,7 @@ ST_FIELD_INFO spatial_ref_sys_fields_info[]=
 {
   {"SRID", 5, MYSQL_TYPE_SHORT, 0, 0, 0, SKIP_OPEN_TABLE},
   {"AUTH_NAME", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
-  {"AUTH_SRID", 5, MYSQL_TYPE_SHORT, 0, 0, 0, SKIP_OPEN_TABLE},
+  {"AUTH_SRID", 5, MYSQL_TYPE_LONG, 0, 0, 0, SKIP_OPEN_TABLE},
   {"SRTEXT", 2048, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
   {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, 0}
 };


More information about the commits mailing list