Commit 8b2800d0 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

Fix decimals to 0 for MySQL JSON

This prevents the clash between NOT_FIXED_DEC differing between server
and plugins if MYSQL_SERVER is not defined during plugin compilation.
parent f3c5a924
......@@ -37,6 +37,9 @@ class Type_handler_mysql_json: public Type_handler_blob
Field *make_table_field(MEM_ROOT *, const LEX_CSTRING *,
const Record_addr &, const Type_all_attributes &,
TABLE_SHARE *) const override;
void Column_definition_reuse_fix_attributes(THD *thd,
Column_definition *def,
const Field *field) const override;
};
Type_handler_mysql_json type_handler_mysql_json;
......@@ -85,6 +88,16 @@ Field *Type_handler_mysql_json::make_table_field_from_def(TABLE_SHARE *share,
attr->pack_flag_to_pack_length(), attr->charset);
}
void Type_handler_mysql_json::
Column_definition_reuse_fix_attributes(THD *thd,
Column_definition *def,
const Field *field) const
{
Type_handler_blob::Column_definition_reuse_fix_attributes(thd, def, field);
def->decimals= 0;
}
Field *Type_handler_mysql_json::make_table_field(MEM_ROOT *root,
const LEX_CSTRING *name, const Record_addr &addr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment