Commit 8009c16a authored by ram@mysql.r18.ru's avatar ram@mysql.r18.ru

Fix for the QUOTE() function.

parent 3cf6a6b2
...@@ -61,6 +61,7 @@ paul@teton.kitebird.com ...@@ -61,6 +61,7 @@ paul@teton.kitebird.com
pem@mysql.com pem@mysql.com
peter@linux.local peter@linux.local
peter@mysql.com peter@mysql.com
ram@mysql.r18.ru
ram@ram.(none) ram@ram.(none)
ranger@regul.home.lan ranger@regul.home.lan
root@x3.internalnet root@x3.internalnet
......
...@@ -155,6 +155,9 @@ quote(concat('abc\'', '\\cba')) ...@@ -155,6 +155,9 @@ quote(concat('abc\'', '\\cba'))
select quote(1/0), quote('\0\Z'); select quote(1/0), quote('\0\Z');
quote(1/0) quote('\0\Z') quote(1/0) quote('\0\Z')
NULL '\0\Z' NULL '\0\Z'
select length(quote(concat(char(0),"test")));
length(quote(concat(char(0),"test")))
8
select reverse(""); select reverse("");
reverse("") reverse("")
......
...@@ -64,6 +64,7 @@ select decode(encode("abcdef","monty"),"monty")="abcdef"; ...@@ -64,6 +64,7 @@ select decode(encode("abcdef","monty"),"monty")="abcdef";
select quote('\'\"\\test'); select quote('\'\"\\test');
select quote(concat('abc\'', '\\cba')); select quote(concat('abc\'', '\\cba'));
select quote(1/0), quote('\0\Z'); select quote(1/0), quote('\0\Z');
select length(quote(concat(char(0),"test")));
# #
# Wrong usage of functions # Wrong usage of functions
......
...@@ -2134,7 +2134,7 @@ String *Item_func_quote::val_str(String *str) ...@@ -2134,7 +2134,7 @@ String *Item_func_quote::val_str(String *str)
*/ */
to= (char*) str->ptr() + new_length - 1; to= (char*) str->ptr() + new_length - 1;
*to--= '\''; *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 We can't use the bitmask here as we want to replace \O and ^Z with 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment