mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge branch '10.2' into 10.3
This commit is contained in:
27
sql/field.cc
27
sql/field.cc
@ -3054,6 +3054,23 @@ void Field_decimal::sql_type(String &res) const
|
||||
}
|
||||
|
||||
|
||||
Field *Field_decimal::make_new_field(MEM_ROOT *root, TABLE *new_table,
|
||||
bool keep_type)
|
||||
{
|
||||
if (keep_type)
|
||||
return Field_real::make_new_field(root, new_table, keep_type);
|
||||
|
||||
Field *field= new (root) Field_new_decimal(NULL, field_length,
|
||||
maybe_null() ? (uchar*) "" : 0, 0,
|
||||
NONE, &field_name,
|
||||
dec, flags & ZEROFILL_FLAG,
|
||||
unsigned_flag);
|
||||
if (field)
|
||||
field->init_for_make_new_field(new_table, orig_table);
|
||||
return field;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
** Field_new_decimal
|
||||
****************************************************************************/
|
||||
@ -7473,15 +7490,7 @@ Field *Field_string::make_new_field(MEM_ROOT *root, TABLE *new_table,
|
||||
This is done to ensure that ALTER TABLE will convert old VARCHAR fields
|
||||
to now VARCHAR fields.
|
||||
*/
|
||||
field->init(new_table);
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
field->orig_table= orig_table;
|
||||
field->init_for_make_new_field(new_table, orig_table);
|
||||
}
|
||||
return field;
|
||||
}
|
||||
|
Reference in New Issue
Block a user