summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.h
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2022-02-01 20:33:04 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2022-02-01 20:33:04 +0100
commitcf63eecef44f189ce2d221612dee9dfc1885ba4e (patch)
tree93b4e6645a1d371bd8012a0aa8e6e3a3d541b2a6 /sql/item_strfunc.h
parentfb40a2fabf8d8cf765c83a0b8e609dd893c75ec3 (diff)
parentc04a203a10e282e1f33fd04d8a1b7ff0b076bce5 (diff)
downloadmariadb-git-cf63eecef44f189ce2d221612dee9dfc1885ba4e.tar.gz
Merge branch '10.4' into 10.5
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r--sql/item_strfunc.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 11d543dc474..0c4967a5247 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -35,21 +35,21 @@ protected:
character set. No memory is allocated.
@retval A pointer to the str_value member.
*/
- virtual String *make_empty_result()
+ virtual String *make_empty_result(String *str)
{
/*
Reset string length to an empty string. We don't use str_value.set() as
we don't want to free and potentially have to reallocate the buffer
for each call.
*/
- if (!str_value.is_alloced())
- str_value.set("", 0, collation.collation); /* Avoid null ptrs */
+ if (!str->is_alloced())
+ str->set("", 0, collation.collation); /* Avoid null ptrs */
else
{
- str_value.length(0); /* Reuse allocated area */
- str_value.set_charset(collation.collation);
+ str->length(0); /* Reuse allocated area */
+ str->set_charset(collation.collation);
}
- return &str_value;
+ return str;
}
public:
Item_str_func(THD *thd): Item_func(thd) { decimals=NOT_FIXED_DEC; }
@@ -501,7 +501,7 @@ class Item_func_substr_oracle :public Item_func_substr
protected:
longlong get_position()
{ longlong pos= args[1]->val_int(); return pos == 0 ? 1 : pos; }
- String *make_empty_result()
+ String *make_empty_result(String *str)
{ null_value= 1; return NULL; }
public:
Item_func_substr_oracle(THD *thd, Item *a, Item *b):
@@ -542,7 +542,7 @@ protected:
String *trimmed_value(String *res, uint32 offset, uint32 length)
{
if (length == 0)
- return make_empty_result();
+ return make_empty_result(&tmp_value);
tmp_value.set(*res, offset, length);
/*
@@ -575,7 +575,7 @@ public:
class Item_func_trim_oracle :public Item_func_trim
{
protected:
- String *make_empty_result()
+ String *make_empty_result(String *str)
{ null_value= 1; return NULL; }
const char *func_name_ext() const { return "_oracle"; }
public:
@@ -614,7 +614,7 @@ public:
class Item_func_ltrim_oracle :public Item_func_ltrim
{
protected:
- String *make_empty_result()
+ String *make_empty_result(String *str)
{ null_value= 1; return NULL; }
const char *func_name_ext() const { return "_oracle"; }
public:
@@ -649,7 +649,7 @@ public:
class Item_func_rtrim_oracle :public Item_func_rtrim
{
protected:
- String *make_empty_result()
+ String *make_empty_result(String *str)
{ null_value= 1; return NULL; }
const char *func_name_ext() const { return "_oracle"; }
public:
@@ -854,7 +854,7 @@ public:
String *val_str(String *);
bool fix_length_and_dec()
{
- max_length= MAX_FIELD_NAME * system_charset_info->mbmaxlen;
+ max_length= NAME_CHAR_LEN * system_charset_info->mbmaxlen;
maybe_null=1;
return FALSE;
}
@@ -1144,7 +1144,7 @@ public:
class Item_func_rpad_oracle :public Item_func_rpad
{
- String *make_empty_result()
+ String *make_empty_result(String *str)
{ null_value= 1; return NULL; }
public:
Item_func_rpad_oracle(THD *thd, Item *arg1, Item *arg2, Item *arg3):
@@ -1179,7 +1179,7 @@ public:
class Item_func_lpad_oracle :public Item_func_lpad
{
- String *make_empty_result()
+ String *make_empty_result(String *str)
{ null_value= 1; return NULL; }
public:
Item_func_lpad_oracle(THD *thd, Item *arg1, Item *arg2, Item *arg3):