summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-06-21 15:23:58 +0400
committerAlexander Barkov <bar@mariadb.com>2019-06-21 17:18:28 +0400
commite9a692fe1ecd82e0812f4986a0010ca0db9295b7 (patch)
tree44a5066f3471d4dd966167bd8a52736f3150f0b8 /sql
parent8b576616b442d061356bc5a2abd410f478e98ee7 (diff)
downloadmariadb-git-e9a692fe1ecd82e0812f4986a0010ca0db9295b7.tar.gz
MDEV-19819 ALTER from POINT to LINESTRING erroneously preserves POINT values
Diffstat (limited to 'sql')
-rw-r--r--sql/field.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/sql/field.h b/sql/field.h
index 0a2326ff5dc..1aeca8a34c9 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1528,7 +1528,7 @@ public:
{
return field_length / charset()->mbmaxlen;
}
- virtual geometry_type get_geometry_type()
+ virtual geometry_type get_geometry_type() const
{
/* shouldn't get here. */
DBUG_ASSERT(0);
@@ -4138,6 +4138,21 @@ public:
const Item *item,
bool is_eq_func) const;
void sql_type(String &str) const;
+ Copy_func *get_copy_func(const Field *from) const
+ {
+ if (type_handler() == from->type_handler() &&
+ (geom_type == GEOM_GEOMETRY ||
+ geom_type == static_cast<const Field_geom*>(from)->geom_type))
+ return get_identical_copy_func();
+ return do_conv_blob;
+ }
+ bool memcpy_field_possible(const Field *from) const
+ {
+ return type_handler() == from->type_handler() &&
+ (geom_type == GEOM_GEOMETRY ||
+ geom_type == static_cast<const Field_geom*>(from)->geom_type) &&
+ !table->copy_blobs;
+ }
uint is_equal(Create_field *new_field);
int store(const char *to, size_t length, CHARSET_INFO *charset);
int store(double nr);
@@ -4161,7 +4176,7 @@ public:
bool load_data_set_null(THD *thd);
bool load_data_set_no_data(THD *thd, bool fixed_format);
- geometry_type get_geometry_type() { return geom_type; };
+ geometry_type get_geometry_type() const { return geom_type; };
static geometry_type geometry_type_merge(geometry_type, geometry_type);
uint get_srid() { return srid; }
void print_key_value(String *out, uint32 length)