summaryrefslogtreecommitdiff
path: root/sql/item_inetfunc.h
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2015-08-11 11:18:38 +0400
committerSergey Vojtovich <svoj@mariadb.org>2015-08-21 10:40:39 +0400
commit31e365efae28ba3208e80511c4d18fe11a79541a (patch)
treef249682cc42490fc86382f5244a051001dc13c9e /sql/item_inetfunc.h
parent4374da63f03abc472f68f42e4e93261a18bfe417 (diff)
downloadmariadb-git-31e365efae28ba3208e80511c4d18fe11a79541a.tar.gz
MDEV-8010 - Avoid sql_alloc() in Items (Patch #1)
Added mandatory thd parameter to Item (and all derivative classes) constructor. Added thd parameter to all routines that may create items. Also removed "current_thd" from Item::Item. This reduced number of pthread_getspecific() calls from 290 to 177 per OLTP RO transaction.
Diffstat (limited to 'sql/item_inetfunc.h')
-rw-r--r--sql/item_inetfunc.h37
1 files changed, 18 insertions, 19 deletions
diff --git a/sql/item_inetfunc.h b/sql/item_inetfunc.h
index 3a85d367ff1..82a4405df1e 100644
--- a/sql/item_inetfunc.h
+++ b/sql/item_inetfunc.h
@@ -27,7 +27,7 @@
class Item_func_inet_aton : public Item_int_func
{
public:
- Item_func_inet_aton(Item *a) :Item_int_func(a) {}
+ Item_func_inet_aton(THD *thd, Item *a): Item_int_func(thd, a) {}
longlong val_int();
const char *func_name() const { return "inet_aton"; }
void fix_length_and_dec()
@@ -47,8 +47,7 @@ public:
class Item_func_inet_ntoa : public Item_str_func
{
public:
- Item_func_inet_ntoa(Item *a)
- : Item_str_func(a)
+ Item_func_inet_ntoa(THD *thd, Item *a): Item_str_func(thd, a)
{ }
String* val_str(String* str);
const char *func_name() const { return "inet_ntoa"; }
@@ -69,8 +68,8 @@ public:
class Item_func_inet_bool_base : public Item_bool_func
{
public:
- inline Item_func_inet_bool_base(Item *ip_addr)
- : Item_bool_func(ip_addr)
+ inline Item_func_inet_bool_base(THD *thd, Item *ip_addr):
+ Item_bool_func(thd, ip_addr)
{
null_value= false;
}
@@ -91,8 +90,8 @@ protected:
class Item_func_inet_str_base : public Item_str_ascii_func
{
public:
- inline Item_func_inet_str_base(Item *arg)
- : Item_str_ascii_func(arg)
+ inline Item_func_inet_str_base(THD *thd, Item *arg):
+ Item_str_ascii_func(thd, arg)
{ }
public:
@@ -110,8 +109,8 @@ protected:
class Item_func_inet6_aton : public Item_func_inet_str_base
{
public:
- inline Item_func_inet6_aton(Item *ip_addr)
- : Item_func_inet_str_base(ip_addr)
+ inline Item_func_inet6_aton(THD *thd, Item *ip_addr):
+ Item_func_inet_str_base(thd, ip_addr)
{ }
public:
@@ -137,8 +136,8 @@ protected:
class Item_func_inet6_ntoa : public Item_func_inet_str_base
{
public:
- inline Item_func_inet6_ntoa(Item *ip_addr)
- : Item_func_inet_str_base(ip_addr)
+ inline Item_func_inet6_ntoa(THD *thd, Item *ip_addr):
+ Item_func_inet_str_base(thd, ip_addr)
{ }
public:
@@ -169,8 +168,8 @@ protected:
class Item_func_is_ipv4 : public Item_func_inet_bool_base
{
public:
- inline Item_func_is_ipv4(Item *ip_addr)
- : Item_func_inet_bool_base(ip_addr)
+ inline Item_func_is_ipv4(THD *thd, Item *ip_addr):
+ Item_func_inet_bool_base(thd, ip_addr)
{ }
public:
@@ -189,8 +188,8 @@ protected:
class Item_func_is_ipv6 : public Item_func_inet_bool_base
{
public:
- inline Item_func_is_ipv6(Item *ip_addr)
- : Item_func_inet_bool_base(ip_addr)
+ inline Item_func_is_ipv6(THD *thd, Item *ip_addr):
+ Item_func_inet_bool_base(thd, ip_addr)
{ }
public:
@@ -209,8 +208,8 @@ protected:
class Item_func_is_ipv4_compat : public Item_func_inet_bool_base
{
public:
- inline Item_func_is_ipv4_compat(Item *ip_addr)
- : Item_func_inet_bool_base(ip_addr)
+ inline Item_func_is_ipv4_compat(THD *thd, Item *ip_addr):
+ Item_func_inet_bool_base(thd, ip_addr)
{ }
public:
@@ -229,8 +228,8 @@ protected:
class Item_func_is_ipv4_mapped : public Item_func_inet_bool_base
{
public:
- inline Item_func_is_ipv4_mapped(Item *ip_addr)
- : Item_func_inet_bool_base(ip_addr)
+ inline Item_func_is_ipv4_mapped(THD *thd, Item *ip_addr):
+ Item_func_inet_bool_base(thd, ip_addr)
{ }
public: