diff options
author | Michael Widenius <monty@askmonty.org> | 2010-04-01 12:04:26 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2010-04-01 12:04:26 +0300 |
commit | 1aafea91e5e11c355b978c85544059224ec473cf (patch) | |
tree | a6fe26c7dc5503bdb62ef60d3e7d5f4ca2b816bb /sql/sql_acl.cc | |
parent | fee40e27738122d5c7d7916a1cfa8cd2b5a20186 (diff) | |
parent | cebec393cf0a5558a2800fb193ba098bda4eabe1 (diff) | |
download | mariadb-git-1aafea91e5e11c355b978c85544059224ec473cf.tar.gz |
Merge with 5.1
Fixed valgrind warnings found from running main.connect under valgrind
sql/sp_head.cc:
Ensure that vcol_info is reset
sql/sql_acl.cc:
Fixed usage of wrong memroot for password
sql/sql_yacc.yy:
Ensure that vcol_info is reset
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index ad6583b92f6..33b76cb20bc 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -536,6 +536,9 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) while (!(read_record_info.read_record(&read_record_info))) { ACL_USER user; + char *password; + uint password_len; + bzero(&user, sizeof(user)); update_hostname(&user.host, get_field(&mem, table->field[0])); user.user= get_field(&mem, table->field[1]); @@ -548,8 +551,8 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) continue; } - char *password= get_field(thd->mem_root, table->field[2]); - uint password_len= password ? strlen(password) : 0; + password= get_field(&mem, table->field[2]); + password_len= password ? strlen(password) : 0; user.auth_string.str= password ? password : const_cast<char*>(""); user.auth_string.length= password_len; set_user_salt(&user, password, password_len); @@ -7826,15 +7829,15 @@ static int do_auth_once(THD *thd, LEX_STRING *auth_plugin_name, bool unlock_plugin= false; plugin_ref plugin; +#ifdef EMBEDDED_LIBRARY + plugin= native_password_plugin; +#else if (auth_plugin_name->str == native_password_plugin_name.str) plugin= native_password_plugin; - else -#ifndef EMBEDDED_LIBRARY - if (auth_plugin_name->str == old_password_plugin_name.str) + else if (auth_plugin_name->str == old_password_plugin_name.str) plugin= old_password_plugin; - else - if ((plugin= my_plugin_lock_by_name(thd, auth_plugin_name, - MYSQL_AUTHENTICATION_PLUGIN))) + else if ((plugin= my_plugin_lock_by_name(thd, auth_plugin_name, + MYSQL_AUTHENTICATION_PLUGIN))) unlock_plugin= true; #endif |