diff options
author | bar@bar.mysql.r18.ru <> | 2003-03-27 13:09:09 +0400 |
---|---|---|
committer | bar@bar.mysql.r18.ru <> | 2003-03-27 13:09:09 +0400 |
commit | 0989db3e90d5488f6948b5bc0b3554ead2b93e56 (patch) | |
tree | cf02a1f110ca4ad00d79000f82123c306165adf0 /sql/field.cc | |
parent | 3f777ceff3c702ac81abe412ac554f9a1a4cd55d (diff) | |
download | mariadb-git-0989db3e90d5488f6948b5bc0b3554ead2b93e56.tar.gz |
More OpenGIS compatibility:
Point, MultiLine, Poligom, etc, are now not aliases
for Geometry, but separate field types.
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/sql/field.cc b/sql/field.cc index 6b403b85aae..7d877a02bf7 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4775,7 +4775,33 @@ void Field_geom::set_key_image(char *buff, uint length, CHARSET_INFO *cs) void Field_geom::sql_type(String &res) const { - res.set("geometry", 8, &my_charset_latin1); + CHARSET_INFO *cs= &my_charset_latin1; + switch (geom_type) + { + case GEOM_POINT: + res.set("point", 5, cs); + break; + case GEOM_LINESTRING: + res.set("linestring", 10, cs); + break; + case GEOM_POLYGON: + res.set("polygon", 7, cs); + break; + case GEOM_MULTIPOINT: + res.set("multipoint", 10, cs); + break; + case GEOM_MULTILINESTRING: + res.set("multilinestring", 15, cs); + break; + case GEOM_MULTIPOLYGON: + res.set("multipolygon", 12, cs); + break; + case GEOM_GEOMETRYCOLLECTION: + res.set("geometrycollection", 18, cs); + break; + default: + res.set("geometry", 8, cs); + } } @@ -5286,6 +5312,7 @@ Field *make_field(char *ptr, uint32 field_length, uint pack_flag, enum_field_types field_type, CHARSET_INFO *field_charset, + Field::geometry_type geom_type, Field::utype unireg_check, TYPELIB *interval, const char *field_name, @@ -5309,7 +5336,7 @@ Field *make_field(char *ptr, uint32 field_length, if (f_is_geom(pack_flag)) return new Field_geom(ptr,null_pos,null_bit, unireg_check, field_name, table, - pack_length); + pack_length, geom_type); if (f_is_blob(pack_flag)) return new Field_blob(ptr,null_pos,null_bit, unireg_check, field_name, table, |