From a041b940328d8b3ec86923d234fb31c30c89d69b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Wed, 28 Oct 2020 23:00:21 +0200 Subject: [PATCH] Move vers_type_timestamp within the CC file It's a virtual method and it can't be inlined anyway. This allows type plugins (mysql_json in particular) to use Type_handler_blob and / or subclass it, without needing to explicitly expose the vers_type_timestamp object. --- sql/sql_type.cc | 18 ++++++++++++++++++ sql/sql_type.h | 8 ++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/sql/sql_type.cc b/sql/sql_type.cc index b7ad8c04af5..32bb7c4cbf7 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -6958,6 +6958,24 @@ bool Type_handler_string_result:: /***************************************************************************/ +const Vers_type_handler* Type_handler_temporal_result::vers() const +{ + return &vers_type_timestamp; +} + +const Vers_type_handler* Type_handler_string_result::vers() const +{ + return &vers_type_timestamp; +} + +const Vers_type_handler* Type_handler_blob_common::vers() const + +{ + return &vers_type_timestamp; +} + +/***************************************************************************/ + uint Type_handler::Item_time_precision(THD *thd, Item *item) const { return MY_MIN(item->decimals, TIME_SECOND_PART_DIGITS); diff --git a/sql/sql_type.h b/sql/sql_type.h index c5d5dc7facc..7b541962bac 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -3498,7 +3498,7 @@ public: const Column_definition *row_start, const Column_definition *row_end) const; }; -extern MYSQL_PLUGIN_IMPORT Vers_type_timestamp vers_type_timestamp; +extern Vers_type_timestamp vers_type_timestamp; class Vers_type_trx: public Vers_type_handler @@ -5249,7 +5249,7 @@ public: bool Item_func_mul_fix_length_and_dec(Item_func_mul *) const override; bool Item_func_div_fix_length_and_dec(Item_func_div *) const override; bool Item_func_mod_fix_length_and_dec(Item_func_mod *) const override; - const Vers_type_handler *vers() const override { return &vers_type_timestamp; } + const Vers_type_handler *vers() const override; }; @@ -5416,7 +5416,7 @@ public: bool Item_func_mul_fix_length_and_dec(Item_func_mul *) const override; bool Item_func_div_fix_length_and_dec(Item_func_div *) const override; bool Item_func_mod_fix_length_and_dec(Item_func_mod *) const override; - const Vers_type_handler *vers() const override { return &vers_type_timestamp; } + const Vers_type_handler *vers() const override; }; @@ -7039,7 +7039,7 @@ public: const Bit_addr &bit, const Column_definition_attributes *attr, uint32 flags) const override; - const Vers_type_handler *vers() const override { return &vers_type_timestamp; } + const Vers_type_handler *vers() const override; };