Skip to content
Permalink
Browse files
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.
  • Loading branch information
cvicentiu committed Oct 29, 2020
1 parent f3c5a92 commit 8b2800d
Showing 1 changed file with 13 additions and 0 deletions.
@@ -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,

0 comments on commit 8b2800d

Please sign in to comment.