cleanup: remove FixedBinTypeBundle
now the main class is the Type_handler_fbt. It contains everything and generates objects of all other classes as needed.
This commit is contained in:
parent
238cfcc729
commit
c09b1583f5
@ -158,7 +158,7 @@ String *Item_func_inet6_aton::val_str(String *buffer)
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
Inet6Bundle::Fbt_null ipv6(*tmp.string());
|
Type_handler_inet6::Fbt_null ipv6(*tmp.string());
|
||||||
if (!ipv6.is_null())
|
if (!ipv6.is_null())
|
||||||
{
|
{
|
||||||
ipv6.to_binary(buffer);
|
ipv6.to_binary(buffer);
|
||||||
@ -197,7 +197,7 @@ String *Item_func_inet6_ntoa::val_str_ascii(String *buffer)
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
Inet6Bundle::Fbt_null ipv6(static_cast<const Binary_string&>(*tmp.string()));
|
Type_handler_inet6::Fbt_null ipv6(static_cast<const Binary_string&>(*tmp.string()));
|
||||||
if (!ipv6.is_null())
|
if (!ipv6.is_null())
|
||||||
{
|
{
|
||||||
ipv6.to_string(buffer);
|
ipv6.to_string(buffer);
|
||||||
@ -221,10 +221,10 @@ longlong Item_func_is_ipv4::val_int()
|
|||||||
return !tmp.is_null() && !Inet4_null(*tmp.string()).is_null();
|
return !tmp.is_null() && !Inet4_null(*tmp.string()).is_null();
|
||||||
}
|
}
|
||||||
|
|
||||||
class IP6 : public Inet6Bundle::Fbt_null
|
class IP6 : public Type_handler_inet6::Fbt_null
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IP6(Item* arg) : Inet6Bundle::Fbt_null(arg) {}
|
IP6(Item* arg) : Type_handler_inet6::Fbt_null(arg) {}
|
||||||
bool is_v4compat() const
|
bool is_v4compat() const
|
||||||
{
|
{
|
||||||
static_assert(sizeof(in6_addr) == IN6_ADDR_SIZE, "unexpected in6_addr size");
|
static_assert(sizeof(in6_addr) == IN6_ADDR_SIZE, "unexpected in6_addr size");
|
||||||
@ -246,7 +246,7 @@ longlong Item_func_is_ipv6::val_int()
|
|||||||
{
|
{
|
||||||
DBUG_ASSERT(fixed());
|
DBUG_ASSERT(fixed());
|
||||||
String_ptr_and_buffer<STRING_BUFFER_USUAL_SIZE> tmp(args[0]);
|
String_ptr_and_buffer<STRING_BUFFER_USUAL_SIZE> tmp(args[0]);
|
||||||
return !tmp.is_null() && !Inet6Bundle::Fbt_null(*tmp.string()).is_null();
|
return !tmp.is_null() && !Type_handler_inet6::Fbt_null(*tmp.string()).is_null();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
static struct st_mariadb_data_type plugin_descriptor_type_inet6=
|
static struct st_mariadb_data_type plugin_descriptor_type_inet6=
|
||||||
{
|
{
|
||||||
MariaDB_DATA_TYPE_INTERFACE_VERSION,
|
MariaDB_DATA_TYPE_INTERFACE_VERSION,
|
||||||
Inet6Bundle::type_handler_fbt()
|
Type_handler_inet6::singleton()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
#include "sql_type_fixedbin.h"
|
#include "sql_type_fixedbin.h"
|
||||||
typedef FixedBinTypeBundle<Inet6> Inet6Bundle;
|
typedef Type_handler_fbt<Inet6> Type_handler_inet6;
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user