mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Cleanup: removing Type_handler members m_version_xxx
Introducing methods instead: const Name version_mysql56() const; const Name version_mariadb53() const; This is needed to avoid exporting members with MYSQL_PLUGIN_IMPORT, which would be needed to compile data type plugins on Windows.
This commit is contained in:
@ -1475,10 +1475,23 @@ const Name Type_handler_ulonglong::name() const
|
|||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
const Name
|
const Name Type_handler::version() const
|
||||||
Type_handler::m_version_default(STRING_WITH_LEN("")),
|
{
|
||||||
Type_handler::m_version_mariadb53(STRING_WITH_LEN("mariadb-5.3")),
|
static const Name ver(STRING_WITH_LEN(""));
|
||||||
Type_handler::m_version_mysql56(STRING_WITH_LEN("mysql-5.6"));
|
return ver;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Name Type_handler::version_mariadb53() const
|
||||||
|
{
|
||||||
|
static const Name ver(STRING_WITH_LEN("mariadb-5.3"));
|
||||||
|
return ver;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Name Type_handler::version_mysql56() const
|
||||||
|
{
|
||||||
|
static const Name ver(STRING_WITH_LEN("mysql-5.6"));
|
||||||
|
return ver;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
@ -3241,9 +3241,8 @@ public:
|
|||||||
class Type_handler
|
class Type_handler
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
static const Name m_version_default;
|
const Name version_mysql56() const;
|
||||||
static const Name m_version_mysql56;
|
const Name version_mariadb53() const;
|
||||||
static const Name m_version_mariadb53;
|
|
||||||
String *print_item_value_csstr(THD *thd, Item *item, String *str) const;
|
String *print_item_value_csstr(THD *thd, Item *item, String *str) const;
|
||||||
String *print_item_value_temporal(THD *thd, Item *item, String *str,
|
String *print_item_value_temporal(THD *thd, Item *item, String *str,
|
||||||
const Name &type_name, String *buf) const;
|
const Name &type_name, String *buf) const;
|
||||||
@ -3303,7 +3302,7 @@ public:
|
|||||||
const Type_handler *h2);
|
const Type_handler *h2);
|
||||||
|
|
||||||
virtual const Name name() const= 0;
|
virtual const Name name() const= 0;
|
||||||
virtual const Name version() const { return m_version_default; }
|
virtual const Name version() const;
|
||||||
virtual const Name &default_value() const= 0;
|
virtual const Name &default_value() const= 0;
|
||||||
virtual uint32 flags() const { return 0; }
|
virtual uint32 flags() const { return 0; }
|
||||||
bool is_unsigned() const { return flags() & UNSIGNED_FLAG; }
|
bool is_unsigned() const { return flags() & UNSIGNED_FLAG; }
|
||||||
@ -5688,7 +5687,7 @@ class Type_handler_time: public Type_handler_time_common
|
|||||||
public:
|
public:
|
||||||
static uint hires_bytes(uint dec) { return m_hires_bytes[dec]; }
|
static uint hires_bytes(uint dec) { return m_hires_bytes[dec]; }
|
||||||
virtual ~Type_handler_time() {}
|
virtual ~Type_handler_time() {}
|
||||||
const Name version() const override { return m_version_mariadb53; }
|
const Name version() const override { return version_mariadb53(); }
|
||||||
uint32 max_display_length_for_field(const Conv_source &src) const override
|
uint32 max_display_length_for_field(const Conv_source &src) const override
|
||||||
{ return MIN_TIME_WIDTH; }
|
{ return MIN_TIME_WIDTH; }
|
||||||
uint32 calc_pack_length(uint32 length) const override;
|
uint32 calc_pack_length(uint32 length) const override;
|
||||||
@ -5718,7 +5717,7 @@ class Type_handler_time2: public Type_handler_time_common
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Type_handler_time2() {}
|
virtual ~Type_handler_time2() {}
|
||||||
const Name version() const override { return m_version_mysql56; }
|
const Name version() const override { return version_mysql56(); }
|
||||||
enum_field_types real_field_type() const override { return MYSQL_TYPE_TIME2; }
|
enum_field_types real_field_type() const override { return MYSQL_TYPE_TIME2; }
|
||||||
uint32 max_display_length_for_field(const Conv_source &src) const override;
|
uint32 max_display_length_for_field(const Conv_source &src) const override;
|
||||||
uint32 calc_pack_length(uint32 length) const override;
|
uint32 calc_pack_length(uint32 length) const override;
|
||||||
@ -5972,7 +5971,7 @@ class Type_handler_datetime: public Type_handler_datetime_common
|
|||||||
public:
|
public:
|
||||||
static uint hires_bytes(uint dec) { return m_hires_bytes[dec]; }
|
static uint hires_bytes(uint dec) { return m_hires_bytes[dec]; }
|
||||||
virtual ~Type_handler_datetime() {}
|
virtual ~Type_handler_datetime() {}
|
||||||
const Name version() const override { return m_version_mariadb53; }
|
const Name version() const override { return version_mariadb53(); }
|
||||||
uint32 max_display_length_for_field(const Conv_source &src) const override
|
uint32 max_display_length_for_field(const Conv_source &src) const override
|
||||||
{ return MAX_DATETIME_WIDTH; }
|
{ return MAX_DATETIME_WIDTH; }
|
||||||
uint32 calc_pack_length(uint32 length) const override;
|
uint32 calc_pack_length(uint32 length) const override;
|
||||||
@ -6002,7 +6001,7 @@ class Type_handler_datetime2: public Type_handler_datetime_common
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Type_handler_datetime2() {}
|
virtual ~Type_handler_datetime2() {}
|
||||||
const Name version() const override { return m_version_mysql56; }
|
const Name version() const override { return version_mysql56(); }
|
||||||
enum_field_types real_field_type() const override
|
enum_field_types real_field_type() const override
|
||||||
{
|
{
|
||||||
return MYSQL_TYPE_DATETIME2;
|
return MYSQL_TYPE_DATETIME2;
|
||||||
@ -6130,7 +6129,7 @@ class Type_handler_timestamp: public Type_handler_timestamp_common
|
|||||||
public:
|
public:
|
||||||
static uint sec_part_bytes(uint dec) { return m_sec_part_bytes[dec]; }
|
static uint sec_part_bytes(uint dec) { return m_sec_part_bytes[dec]; }
|
||||||
virtual ~Type_handler_timestamp() {}
|
virtual ~Type_handler_timestamp() {}
|
||||||
const Name version() const override { return m_version_mariadb53; }
|
const Name version() const override { return version_mariadb53(); }
|
||||||
uint32 max_display_length_for_field(const Conv_source &src) const override
|
uint32 max_display_length_for_field(const Conv_source &src) const override
|
||||||
{ return MAX_DATETIME_WIDTH; }
|
{ return MAX_DATETIME_WIDTH; }
|
||||||
uint32 calc_pack_length(uint32 length) const override;
|
uint32 calc_pack_length(uint32 length) const override;
|
||||||
@ -6160,7 +6159,7 @@ class Type_handler_timestamp2: public Type_handler_timestamp_common
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Type_handler_timestamp2() {}
|
virtual ~Type_handler_timestamp2() {}
|
||||||
const Name version() const override { return m_version_mysql56; }
|
const Name version() const override { return version_mysql56(); }
|
||||||
enum_field_types real_field_type() const override
|
enum_field_types real_field_type() const override
|
||||||
{
|
{
|
||||||
return MYSQL_TYPE_TIMESTAMP2;
|
return MYSQL_TYPE_TIMESTAMP2;
|
||||||
|
Reference in New Issue
Block a user