diff options
author | Monty <monty@mariadb.org> | 2015-08-31 12:57:46 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2015-09-01 18:42:02 +0300 |
commit | 56aa19989f5800df8a398173727558bfb3ea1251 (patch) | |
tree | f87dbcca91d699cbc2539a344d6dabd6b71c2131 /sql/item_strfunc.cc | |
parent | 8ea9b8c0b168b3e5aad08886477d8726531abcd5 (diff) | |
download | mariadb-git-56aa19989f5800df8a398173727558bfb3ea1251.tar.gz |
MDEV-6152: Remove calls to current_thd while creating Item
Part 5: Removing calls to current_thd in net_read calls, creating fields,
query_cache, acl and some other places where thd was available
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 387e349300e..0be51de16d8 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1011,8 +1011,10 @@ String *Item_func_concat_ws::val_str(String *str) if (!(res2= args[i]->val_str(use_as_buff))) continue; // Skip NULL + if (!thd) + thd= current_thd; if (res->length() + sep_str->length() + res2->length() > - (thd ? thd : (thd= current_thd))->variables.max_allowed_packet) + thd->variables.max_allowed_packet) { push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_WARN_ALLOWED_PACKET_OVERFLOWED, @@ -1273,8 +1275,12 @@ redo: while (j != search_end) if (*i++ != *j++) goto skip; offset= (int) (ptr-res->ptr()); + + if (!thd) + thd= current_thd; + if (res->length()-from_length + to_length > - (thd ? thd : (thd= current_thd))->variables.max_allowed_packet) + thd->variables.max_allowed_packet) { push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_WARN_ALLOWED_PACKET_OVERFLOWED, @@ -1301,7 +1307,7 @@ redo: else #endif /* USE_MB */ { - THD *thd= current_thd; + thd= current_thd; do { if (res->length()-from_length + to_length > |