diff options
Diffstat (limited to 'plugin/type_mysql_json/type.cc')
-rw-r--r-- | plugin/type_mysql_json/type.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/plugin/type_mysql_json/type.cc b/plugin/type_mysql_json/type.cc index 2b3c415f346..b897f64a3b2 100644 --- a/plugin/type_mysql_json/type.cc +++ b/plugin/type_mysql_json/type.cc @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ -#include <mysql/plugin_data_type.h> #include <my_global.h> +#include <mysql/plugin_data_type.h> #include <sql_type.h> #include <field.h> #include <mysqld_error.h> @@ -40,6 +40,18 @@ public: void Column_definition_reuse_fix_attributes(THD *thd, Column_definition *def, const Field *field) const override; + const Type_handler *type_handler_base() const override + { + /* + Override this method in the same way with what Type_handler_blob_json + does, to tell the server that MySQL JSON inherits aggregation behaviour + from the LONGBLOB data type. + This makes MariaDB JSON column and a MySQL JSON column compatible for + assignment, so "ALTER TABLE table_with_mysql_json FORCE" can run without + raising ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION. + */ + return &type_handler_long_blob; + } }; Type_handler_mysql_json type_handler_mysql_json; |