1
0
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:
Sergei Golubchik
2018-06-30 16:39:20 +02:00
273 changed files with 4467 additions and 1284 deletions

View File

@ -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;
}