summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-11-12 21:27:52 +0200
committerunknown <monty@mysql.com>2004-11-12 21:27:52 +0200
commit6786c93bc7effecd4610a8f0514a3ae1de624b81 (patch)
treefb77a100a6fc8913c65c231f1013a50f49fd2d43 /sql/item_strfunc.cc
parent7c6738fb3c6b5675d53e3c398b301213ebc892a7 (diff)
parentc77cb0a3210106772e59e78059461a4eb4d69e54 (diff)
downloadmariadb-git-6786c93bc7effecd4610a8f0514a3ae1de624b81.tar.gz
Merge with 4.1 to get latest fix to client_test.c
mysql-test/r/func_str.result: Merge with 4.1 mysys/default.c: Merge with 4.1 sql/item_strfunc.cc: Merge with 4.1 tests/client_test.c: Merge with 4.1
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 2fcb64ce9d6..422a64ab976 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2574,9 +2574,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))
@@ -2601,7 +2604,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, collation.collation); // Return the string 'NULL'
+ null_value= 0;
+ return str;
+ }
+
arg_length= arg->length();
new_length= arg_length+2; /* for beginning and ending ' signs */