summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2014-12-03 14:07:43 +0400
committerSergei Golubchik <serg@mariadb.org>2014-12-04 16:09:34 +0100
commitc4cb15e87ba8cf4f1e7fd8e7cda5c88098ecd515 (patch)
tree042b437f82a3368aa8c9d5b3c894182f75ec93bf /sql/sql_show.cc
parentc4655cf862b24fe040280e38cb71d3b5d25f049b (diff)
downloadmariadb-git-c4cb15e87ba8cf4f1e7fd8e7cda5c88098ecd515.tar.gz
MDEV-60 Support for Spatial Reference systems for the GIS data.
The GEOMETRY field metadata is stored in the FRM file. SRID for a spatial column now can be stored, it was added to the CREATE TABLE syntax, so the AddGeometryData() stored procedure is now possible. Script adding the required Add/DropGeometryColumn sp-s added.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 09be25c327d..b2fa01a4fae 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -396,23 +396,23 @@ static int get_geometry_column_record(THD *thd, TABLE_LIST *tables,
/*F_TABLE_NAME*/
table->field[2]->store(table_name->str, table_name->length, cs);
/*G_TABLE_CATALOG*/
- table->field[3]->store(STRING_WITH_LEN("def"), cs);
+ table->field[4]->store(STRING_WITH_LEN("def"), cs);
/*G_TABLE_SCHEMA*/
- table->field[4]->store(db_name->str, db_name->length, cs);
+ table->field[5]->store(db_name->str, db_name->length, cs);
/*G_TABLE_NAME*/
- table->field[5]->store(table_name->str, table_name->length, cs);
+ table->field[6]->store(table_name->str, table_name->length, cs);
/*G_GEOMETRY_COLUMN*/
- table->field[6]->store(field->field_name, strlen(field->field_name), cs);
+ table->field[7]->store(field->field_name, strlen(field->field_name), cs);
/*STORAGE_TYPE*/
- table->field[7]->store(1LL, TRUE); /*Always 1 (binary implementation)*/
+ table->field[8]->store(1LL, TRUE); /*Always 1 (binary implementation)*/
/*GEOMETRY_TYPE*/
- table->field[8]->store((longlong) (fg->get_geometry_type()), TRUE);
+ table->field[9]->store((longlong) (fg->get_geometry_type()), TRUE);
/*COORD_DIMENSION*/
- table->field[9]->store(2LL, TRUE);
+ table->field[10]->store(2LL, TRUE);
/*MAX_PPR*/
- table->field[10]->set_null();
+ table->field[11]->set_null();
/*SRID*/
- table->field[11]->store((longlong) (fg->get_srid()), TRUE);
+ table->field[12]->store((longlong) (fg->get_srid()), TRUE);
if (schema_table_store_record(thd, table))
DBUG_RETURN(1);
@@ -5550,7 +5550,7 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table,
field= make_field(&share, (uchar*) 0, field_def->length,
(uchar*) "", 0, field_def->pack_flag,
field_def->sql_type, field_def->charset,
- field_def->geom_type, Field::NONE,
+ field_def->geom_type, field_def->srid, Field::NONE,
field_def->interval, "");
field->table= &tbl;
@@ -5603,7 +5603,7 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table,
field= make_field(&share, (uchar*) 0, field_def->length,
(uchar*) "", 0, field_def->pack_flag,
field_def->sql_type, field_def->charset,
- field_def->geom_type, Field::NONE,
+ field_def->geom_type, field_def->srid, Field::NONE,
field_def->interval, spvar->name.str);
field->table= &tbl;
@@ -5702,7 +5702,7 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
field= make_field(&share, (uchar*) 0, field_def->length,
(uchar*) "", 0, field_def->pack_flag,
field_def->sql_type, field_def->charset,
- field_def->geom_type, Field::NONE,
+ field_def->geom_type, field_def->srid, Field::NONE,
field_def->interval, "");
field->table= &tbl;