summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2004-12-24 23:07:10 +0200
committerunknown <Sinisa@sinisa.nasamreza.org>2004-12-24 23:07:10 +0200
commit6569fc7ddac44c64915876f215f9d40756cd38f0 (patch)
treea774e5685709b7497bf11430a09f7d7c1e250a27 /sql/item_strfunc.cc
parent19ffa6a4ecdf30ca0d6071777a06b6d297a49529 (diff)
parent8feedada9d6968545a6ce3eec44f93be5e313575 (diff)
downloadmariadb-git-6569fc7ddac44c64915876f215f9d40756cd38f0.tar.gz
4.0 -> 4.1 merge
sql/item_strfunc.cc: Auto merged mysql-test/r/func_str.result: merged test results for QUOTE() buf fix mysql-test/t/func_str.test: merged test for QUOTE() buf fix
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index e1b063cd5e0..068878652e4 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2596,16 +2596,16 @@ String *Item_func_quote::val_str(String *str)
/*
We have to use realloc() instead of alloc() as we want to keep the
- old result in str
+ old result in arg
*/
- if (str->realloc(new_length))
+ if (arg->realloc(new_length))
goto null;
/*
As 'arg' and 'str' may be the same string, we must replace characters
from the end to the beginning
*/
- to= (char*) str->ptr() + new_length - 1;
+ to= (char*) arg->ptr() + new_length - 1;
*to--= '\'';
for (start= (char*) arg->ptr(),end= start + arg_length; end-- != start; to--)
{
@@ -2633,10 +2633,10 @@ String *Item_func_quote::val_str(String *str)
}
}
*to= '\'';
- str->length(new_length);
+ arg->length(new_length);
str->set_charset(collation.collation);
null_value= 0;
- return str;
+ return arg;
null:
null_value= 1;