--- mysql-5.0.bk-orig/sql/sql_acl.cc Fri Mar 23 11:12:09 2007 +++ mysql-5.0.bk-priv_err/sql/sql_acl.cc Tue Jun 5 15:58:33 2007 @@ -23,10 +23,11 @@ data in tables is sorted according to how many not-wild-cards there is in the relevant fields. Empty strings comes last. */ #include "mysql_priv.h" +#include "mysys_err.h" #include "hash_filo.h" #ifdef HAVE_REPLICATION #include "sql_repl.h" //for tables_ok() #endif #include @@ -257,10 +258,11 @@ VOID(my_init_dynamic_array(&acl_users,sizeof(ACL_USER),50,100)); password_length= table->field[2]->field_length / table->field[2]->charset()->mbmaxlen; if (password_length < SCRAMBLED_PASSWORD_CHAR_LENGTH_323) { + my_error(ER_UNKNOWN_ERROR, MYF(0)); sql_print_error("Fatal error: mysql.user table is damaged or in " "unsupported 3.20 format."); goto end; } @@ -271,10 +273,11 @@ if (password_length < SCRAMBLED_PASSWORD_CHAR_LENGTH) { if (opt_secure_auth) { pthread_mutex_unlock(&LOCK_global_system_variables); + my_error(ER_UNKNOWN_ERROR, MYF(0)); sql_print_error("Fatal error: mysql.user table is in old format, " "but server started with --secure-auth option."); goto end; } sys_old_passwords.after_update= restrict_update_of_old_passwords_var; @@ -3391,10 +3394,11 @@ { GRANT_TABLE *mem_check; if (!(mem_check=new GRANT_TABLE(t_table,c_table))) { /* This could only happen if we are out memory */ + my_error(EE_OUTOFMEMORY, MYF(0), sizeof(GRANT_TABLE)); grant_option= FALSE; goto end_unlock; } if (check_no_resolve) @@ -3413,10 +3417,11 @@ if (! mem_check->ok()) delete mem_check; else if (my_hash_insert(&column_priv_hash,(byte*) mem_check)) { + // out of memory, error is set in my_has_insert->alloc_dynamic->my_realloc delete mem_check; grant_option= FALSE; goto end_unlock; } } @@ -3431,11 +3436,12 @@ GRANT_NAME *mem_check; HASH *hash; if (!(mem_check=new GRANT_NAME(p_table))) { /* This could only happen if we are out memory */ - grant_option= FALSE; + my_error(EE_OUTOFMEMORY, MYF(0), sizeof(GRANT_NAME)); + grant_option= FALSE; goto end_unlock; } if (check_no_resolve) { @@ -3469,10 +3475,11 @@ mem_check->privs= fix_rights_for_procedure(mem_check->privs); if (! mem_check->ok()) delete mem_check; else if (my_hash_insert(hash, (byte*) mem_check)) { + // out of memory, error is set in my_has_insert->alloc_dynamic->my_realloc delete mem_check; grant_option= FALSE; goto end_unlock; } }