Skip to content

Commit

Permalink
cleanup: remove FixedBinTypeBundle
Browse files Browse the repository at this point in the history
now the main class is the Type_handler_fbt.

It contains everything and generates objects of all other classes as
needed.
  • Loading branch information
vuvova committed Jul 4, 2023
1 parent 238cfcc commit c09b158
Show file tree
Hide file tree
Showing 4 changed files with 1,391 additions and 1,385 deletions.
10 changes: 5 additions & 5 deletions plugin/type_inet/item_inetfunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ String *Item_func_inet6_aton::val_str(String *buffer)
return buffer;
}

Inet6Bundle::Fbt_null ipv6(*tmp.string());
Type_handler_inet6::Fbt_null ipv6(*tmp.string());
if (!ipv6.is_null())
{
ipv6.to_binary(buffer);
Expand Down Expand Up @@ -197,7 +197,7 @@ String *Item_func_inet6_ntoa::val_str_ascii(String *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())
{
ipv6.to_string(buffer);
Expand All @@ -221,10 +221,10 @@ longlong Item_func_is_ipv4::val_int()
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:
IP6(Item* arg) : Inet6Bundle::Fbt_null(arg) {}
IP6(Item* arg) : Type_handler_inet6::Fbt_null(arg) {}
bool is_v4compat() const
{
static_assert(sizeof(in6_addr) == IN6_ADDR_SIZE, "unexpected in6_addr size");
Expand All @@ -246,7 +246,7 @@ longlong Item_func_is_ipv6::val_int()
{
DBUG_ASSERT(fixed());
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();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion plugin/type_inet/plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
static struct st_mariadb_data_type plugin_descriptor_type_inet6=
{
MariaDB_DATA_TYPE_INTERFACE_VERSION,
Inet6Bundle::type_handler_fbt()
Type_handler_inet6::singleton()
};


Expand Down
2 changes: 1 addition & 1 deletion plugin/type_inet/sql_type_inet.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Inet6: public FixedBinTypeStorage<IN6_ADDR_SIZE, IN6_ADDR_MAX_CHAR_LENGTH>


#include "sql_type_fixedbin.h"
typedef FixedBinTypeBundle<Inet6> Inet6Bundle;
typedef Type_handler_fbt<Inet6> Type_handler_inet6;

/***********************************************************************/

Expand Down
Loading

0 comments on commit c09b158

Please sign in to comment.