summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <kent@mysql.com>2005-10-13 12:09:39 +0200
committerunknown <kent@mysql.com>2005-10-13 12:09:39 +0200
commitd144a00d81c5f8cb5e8e09223c0de123d4874868 (patch)
tree75657cd42779e3d4c890a6bb6a2c14712bf609ae /sql/item_strfunc.cc
parent799b1e6c5aa2b086acf1fb34c51134249dc74c89 (diff)
parent041123bade5372483d387a724d22a8f7e06d0645 (diff)
downloadmariadb-git-d144a00d81c5f8cb5e8e09223c0de123d4874868.tar.gz
Merge mysql.com:/Users/kent/mysql/bk/mysql-4.1-tmp
into mysql.com:/Users/kent/mysql/bk/mysql-5.0 sql/item_strfunc.cc: Auto merged
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 1812256d532..1e8fe2e695f 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1504,7 +1504,13 @@ String *Item_func_encrypt::val_str(String *str)
salt_ptr= salt_str->c_ptr();
}
pthread_mutex_lock(&LOCK_crypt);
- char *tmp=crypt(res->c_ptr(),salt_ptr);
+ char *tmp= crypt(res->c_ptr(),salt_ptr);
+ if (!tmp)
+ {
+ pthread_mutex_unlock(&LOCK_crypt);
+ null_value= 1;
+ return 0;
+ }
str->set(tmp,(uint) strlen(tmp),res->charset());
str->copy();
pthread_mutex_unlock(&LOCK_crypt);