summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <lars@mysql.com>2005-07-13 02:13:04 +0200
committerunknown <lars@mysql.com>2005-07-13 02:13:04 +0200
commit8daa1c422927964741c2977aea50567558d5f607 (patch)
tree288cefd45b67649d427ee7a8a02969119055a4a4 /sql/item_strfunc.cc
parent1c8ef0cbd025557fc34f02d9a8cc99a392579141 (diff)
parent73fd169d0215700583f335c6e42243e3fa1553c4 (diff)
downloadmariadb-git-8daa1c422927964741c2977aea50567558d5f607.tar.gz
Merge mysql.com:/home/bkroot/mysql-4.1
into mysql.com:/home/bk/mysql-5.0 BitKeeper/etc/config: Auto merged include/my_global.h: Auto merged sql/des_key_file.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/mysql_priv.h: Auto merged sql/net_serv.cc: Auto merged vio/vio.c: Auto merged vio/viosocket.c: Auto merged sql/log.cc: Manual merge sql/slave.cc: Manual merge
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index ccc56adf007..dcb539476a1 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -378,6 +378,9 @@ String *Item_func_des_encrypt::val_str(String *str)
if (arg_count == 1)
{
+ /* Make sure LOCK_des_key_file was initialized. */
+ init_des_key_file();
+
/* Protect against someone doing FLUSH DES_KEY_FILE */
VOID(pthread_mutex_lock(&LOCK_des_key_file));
keyschedule= des_keyschedule[key_number=des_default_key];
@@ -388,6 +391,10 @@ String *Item_func_des_encrypt::val_str(String *str)
key_number= (uint) args[1]->val_int();
if (key_number > 9)
goto error;
+
+ /* Make sure LOCK_des_key_file was initialized. */
+ init_des_key_file();
+
VOID(pthread_mutex_lock(&LOCK_des_key_file));
keyschedule= des_keyschedule[key_number];
VOID(pthread_mutex_unlock(&LOCK_des_key_file));
@@ -474,6 +481,10 @@ String *Item_func_des_decrypt::val_str(String *str)
// Check if automatic key and that we have privilege to uncompress using it
if (!(current_thd->master_access & SUPER_ACL) || key_number > 9)
goto error;
+
+ /* Make sure LOCK_des_key_file was initialized. */
+ init_des_key_file();
+
VOID(pthread_mutex_lock(&LOCK_des_key_file));
keyschedule= des_keyschedule[key_number];
VOID(pthread_mutex_unlock(&LOCK_des_key_file));