summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2016-03-14 10:22:42 +0400
committerAlexander Barkov <bar@mariadb.org>2016-03-14 10:22:42 +0400
commit5c1add3e0760594e36c6b7d36d0059525d628c4f (patch)
tree8297151cf6c6c4f6db2395aadbe781d9b8194715 /sql/field.h
parent75d8544c0bc611e82078b9e5f59caef9105e4892 (diff)
downloadmariadb-git-5c1add3e0760594e36c6b7d36d0059525d628c4f.tar.gz
MDEV-9709 Unexpected modification of value and warning about out of range value upon ALTER
MDEV-4102 Limitation on DOUBLE or REAL length is ignored with INSERT .. SELECT
Diffstat (limited to 'sql/field.h')
-rw-r--r--sql/field.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/field.h b/sql/field.h
index 8869c16cb98..3c6e318f270 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1707,6 +1707,16 @@ public:
return do_field_real;
}
int save_in_field(Field *to) { return to->store(val_real()); }
+ bool memcpy_field_possible(const Field *from) const
+ {
+ /*
+ Cannot do memcpy from a longer field to a shorter field,
+ e.g. a DOUBLE(53,10) into a DOUBLE(10,10).
+ But it should be OK the other way around.
+ */
+ return Field_num::memcpy_field_possible(from) &&
+ field_length >= from->field_length;
+ }
int store_decimal(const my_decimal *);
int store_time_dec(MYSQL_TIME *ltime, uint dec);
bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);