summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <ram@mysql.r18.ru>2003-01-03 19:46:15 +0400
committerunknown <ram@mysql.r18.ru>2003-01-03 19:46:15 +0400
commit287906e972266e9f629a8b53a7f6c46f22bac11a (patch)
treef6a69b3d1a55e968079d9efbcf01da86fe5fb48d
parent07eb2fc4f32f0fdf0204e524f7a7a8e50c842dd7 (diff)
downloadmariadb-git-287906e972266e9f629a8b53a7f6c46f22bac11a.tar.gz
Fix for the QUOTE() function.
BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
-rw-r--r--BitKeeper/etc/logging_ok1
-rw-r--r--mysql-test/r/func_str.result3
-rw-r--r--mysql-test/t/func_str.test1
-rw-r--r--sql/item_strfunc.cc2
4 files changed, 6 insertions, 1 deletions
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index a55a5f46496..652ac3eb519 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -61,6 +61,7 @@ paul@teton.kitebird.com
pem@mysql.com
peter@linux.local
peter@mysql.com
+ram@mysql.r18.ru
ram@ram.(none)
ranger@regul.home.lan
root@x3.internalnet
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 69e37d7b911..9e8f2b90f07 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -155,6 +155,9 @@ quote(concat('abc\'', '\\cba'))
select quote(1/0), quote('\0\Z');
quote(1/0) quote('\0\Z')
NULL '\0\Z'
+select length(quote(concat(char(0),"test")));
+length(quote(concat(char(0),"test")))
+8
select reverse("");
reverse("")
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 717b9c86a07..f95cd901dfb 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -64,6 +64,7 @@ select decode(encode("abcdef","monty"),"monty")="abcdef";
select quote('\'\"\\test');
select quote(concat('abc\'', '\\cba'));
select quote(1/0), quote('\0\Z');
+select length(quote(concat(char(0),"test")));
#
# Wrong usage of functions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index af533eefe9a..1d058a7d810 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2134,7 +2134,7 @@ String *Item_func_quote::val_str(String *str)
*/
to= (char*) str->ptr() + new_length - 1;
*to--= '\'';
- for (start= (char*) arg->ptr() ; end-- != start; to--)
+ for (start= (char*) arg->ptr(),end= start + arg_length; end-- != start; to--)
{
/*
We can't use the bitmask here as we want to replace \O and ^Z with 0