diff options
author | ram@ram.(none) <> | 2002-08-09 19:37:47 +0500 |
---|---|---|
committer | ram@ram.(none) <> | 2002-08-09 19:37:47 +0500 |
commit | 8f7f648d8d55f87159abd95aa2ebbae0b53c3025 (patch) | |
tree | 7aac5b0270d3edf40c9568271f8ab9665aaf386c /sql | |
parent | 43f1fb79723e45838625820937b8793ed7ca9b77 (diff) | |
parent | 390678905bef91330f27578646aad847a49b9342 (diff) | |
download | mariadb-git-8f7f648d8d55f87159abd95aa2ebbae0b53c3025.tar.gz |
Merge rkalimullin@work.mysql.com:/home/bk/mysql-4.0
into ram.(none):/home/ram/work/mysql-4.0
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_strfunc.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 69aa4af980e..540026ed680 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2085,16 +2085,16 @@ String *Item_func_quote::val_str(String *str) char *from, *to, *end; uint delta= 2; /* for beginning and ending ' signs */ + if (!arg) + goto null; + for (from= (char*) arg->ptr(), end= from + arg->length(); from < end; from++) { if (*(escmask + (*from >> 3)) and (1 << (*from & 7))) delta++; } if (str->alloc(arg->length() + delta)) - { - null_value= 1; - return 0; - } + goto null; to= (char*) str->ptr() + arg->length() + delta - 1; *to--= '\''; for (end= (char*) arg->ptr(), from= end + arg->length() - 1; from >= end; @@ -2107,4 +2107,8 @@ String *Item_func_quote::val_str(String *str) *to= '\''; str->length(arg->length() + delta); return str; + +null: + null_value= 1; + return 0; } |