diff options
author | jimw@mysql.com <> | 2005-07-12 09:31:07 -0700 |
---|---|---|
committer | jimw@mysql.com <> | 2005-07-12 09:31:07 -0700 |
commit | 60368919f985da535591c4b8bede53b513fa8478 (patch) | |
tree | 78648255ba349d492b1a8081694cf26dd6e26141 /sql/item_strfunc.cc | |
parent | a2ed7cb257654aa00d105661113d42e55e48ae3a (diff) | |
parent | de9909faec7ae81b7946f314b97ff2da8be7fe2e (diff) | |
download | mariadb-git-60368919f985da535591c4b8bede53b513fa8478.tar.gz |
Merge mysql.com:/home/jimw/my/mysql-4.1-11643
into mysql.com:/home/jimw/my/mysql-4.1-clean
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 08e6a222c69..d57b3b89bf9 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -388,6 +388,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]; @@ -398,6 +401,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)); @@ -485,6 +492,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)); |