mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge with 4.1
BitKeeper/etc/logging_ok: auto-union BitKeeper/deleted/.del-Makefile.am: Auto merged BitKeeper/deleted/.del-Makefile.am~1: Delete: Docs/Images/Makefile.am client/mysqltest.c: Auto merged include/mysql.h: Auto merged libmysql/libmysql.c: Auto merged myisam/mi_check.c: Auto merged mysql-test/r/grant.result: Auto merged mysql-test/r/ps_1general.result: Auto merged mysql-test/t/grant.test: Auto merged mysql-test/t/mix_innodb_myisam_binlog.test: Auto merged mysql-test/t/ps_1general.test: Auto merged sql/field.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/mysqld.cc: Auto merged sql/share/french/errmsg.txt: Auto merged sql/share/greek/errmsg.txt: Auto merged sql/sql_acl.cc: Auto merged sql/sql_table.cc: Auto merged sql/time.cc: Auto merged sql-common/my_time.c: Auto merged sql/share/portuguese/errmsg.txt: Auto merged sql/share/romanian/errmsg.txt: Auto merged sql/share/serbian/errmsg.txt: Auto merged sql/share/spanish/errmsg.txt: Auto merged sql/share/swedish/errmsg.txt: Auto merged configure.in: Merge with 4.0 mysql-test/r/mix_innodb_myisam_binlog.result: Merge with 4.0 mysys/default.c: Merge with 4.1 (to get new extension handling) sql/log.cc: Merge with 4.0 tests/client_test.c: Merge with 4.1 (to get possibility to run any tests)
This commit is contained in:
@ -1057,6 +1057,7 @@ ulong acl_get(const char *host, const char *ip,
|
||||
db_access=0; host_access= ~0;
|
||||
char key[ACL_KEY_LENGTH],*tmp_db,*end;
|
||||
acl_entry *entry;
|
||||
DBUG_ENTER("acl_get");
|
||||
|
||||
VOID(pthread_mutex_lock(&acl_cache->lock));
|
||||
end=strmov((tmp_db=strmov(strmov(key, ip ? ip : "")+1,user)+1),db);
|
||||
@ -1070,7 +1071,8 @@ ulong acl_get(const char *host, const char *ip,
|
||||
{
|
||||
db_access=entry->access;
|
||||
VOID(pthread_mutex_unlock(&acl_cache->lock));
|
||||
return db_access;
|
||||
DBUG_PRINT("exit", ("access: 0x%lx", db_access));
|
||||
DBUG_RETURN(db_access);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1122,7 +1124,8 @@ exit:
|
||||
acl_cache->add(entry);
|
||||
}
|
||||
VOID(pthread_mutex_unlock(&acl_cache->lock));
|
||||
return (db_access & host_access);
|
||||
DBUG_PRINT("exit", ("access: 0x%lx", db_access & host_access));
|
||||
DBUG_RETURN(db_access & host_access);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1798,7 +1801,7 @@ static int replace_db_table(TABLE *table, const char *db,
|
||||
goto table_error; /* purecov: deadcode */
|
||||
}
|
||||
}
|
||||
else if ((error=table->file->write_row(table->record[0])))
|
||||
else if (rights && (error=table->file->write_row(table->record[0])))
|
||||
{
|
||||
if (error && error != HA_ERR_FOUND_DUPP_KEY) /* purecov: inspected */
|
||||
goto table_error; /* purecov: deadcode */
|
||||
@ -1808,6 +1811,7 @@ static int replace_db_table(TABLE *table, const char *db,
|
||||
if (old_row_exists)
|
||||
acl_update_db(combo.user.str,combo.host.str,db,rights);
|
||||
else
|
||||
if (rights)
|
||||
acl_insert_db(combo.user.str,combo.host.str,db,rights);
|
||||
DBUG_RETURN(0);
|
||||
|
||||
|
Reference in New Issue
Block a user