mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Fix for QUOTE() function.
This commit is contained in:
parent
c7a02249f5
commit
aedd600401
3 changed files with 5 additions and 2 deletions
|
@ -170,6 +170,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("")
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,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
|
||||||
#
|
#
|
||||||
|
|
|
@ -2398,7 +2398,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
|
||||||
|
|
Loading…
Reference in a new issue