summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-06-25 09:08:07 +0400
committerAlexander Barkov <bar@mariadb.com>2018-06-25 09:08:07 +0400
commitee6ac4d313c5e8846c4f7b92a923154984528215 (patch)
tree685b769339ac256bdfc6b8de9a74fe0b76a7be13 /sql/field.h
parent01bbb912bf688d1c1a4ef75967248ee2a9f8e12b (diff)
downloadmariadb-git-ee6ac4d313c5e8846c4f7b92a923154984528215.tar.gz
MDEV-12574 MAX(old_decimal) produces a column of the old DECIMAL type
Diffstat (limited to 'sql/field.h')
-rw-r--r--sql/field.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/field.h b/sql/field.h
index 820cc5f3a7a..22c276478b6 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1368,6 +1368,18 @@ public:
orig_table= table= table_arg;
set_table_name(&table_arg->alias);
}
+ void init_for_make_new_field(TABLE *new_table_arg, TABLE *orig_table_arg)
+ {
+ init(new_table_arg);
+ /*
+ Normally orig_table is different from table only if field was
+ created via ::make_new_field. Here we alter the type of field,
+ so ::make_new_field is not applicable. But we still need to
+ preserve the original field metadata for the client-server
+ protocol.
+ */
+ orig_table= orig_table_arg;
+ }
/* maximum possible display length */
virtual uint32 max_display_length()= 0;
@@ -1828,6 +1840,7 @@ public:
unireg_check_arg, field_name_arg,
dec_arg, zero_arg, unsigned_arg)
{}
+ Field *make_new_field(MEM_ROOT *root, TABLE *new_table, bool keep_type);
enum_field_types type() const { return MYSQL_TYPE_DECIMAL;}
enum ha_base_keytype key_type() const
{ return zerofill ? HA_KEYTYPE_BINARY : HA_KEYTYPE_NUM; }