summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <jani@ua141d10.elisa.omakaista.fi>2004-11-12 20:38:58 +0200
committerunknown <jani@ua141d10.elisa.omakaista.fi>2004-11-12 20:38:58 +0200
commit75a4c71b67508c7b1390477a4a3a4a4aba120bbb (patch)
treed351998dbbb6448d1c9c837ff4fa33e2687cce1c /sql/item_strfunc.cc
parent20d88eb76f4e5fea1acdb68b6d2ad86b59ba61f9 (diff)
parentc7b66f9ddefb95050c21a9938578a0f56d9dd0d0 (diff)
downloadmariadb-git-75a4c71b67508c7b1390477a4a3a4a4aba120bbb.tar.gz
Merge with 4.0
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 81fff899ec7..3f659964a6c 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2562,9 +2562,12 @@ String* Item_func_inet_ntoa::val_str(String* str)
This function is very useful when you want to generate SQL statements
- RETURN VALUES
+ NOTE
+ QUOTE(NULL) returns the string 'NULL' (4 letters, without quotes).
+
+ RETURN VALUES
str Quoted string
- NULL Argument to QUOTE() was NULL or out of memory.
+ NULL Out of memory.
*/
#define get_esc_bit(mask, num) (1 & (*((mask) + ((num) >> 3))) >> ((num) & 7))
@@ -2589,7 +2592,12 @@ String *Item_func_quote::val_str(String *str)
String *arg= args[0]->val_str(str);
uint arg_length, new_length;
if (!arg) // Null argument
- goto null;
+ {
+ str->copy("NULL", 4); // Return the string 'NULL'
+ null_value= 0;
+ return str;
+ }
+
arg_length= arg->length();
new_length= arg_length+2; /* for beginning and ending ' signs */