mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
after review PS fixes
sql/item_cmpfunc.cc: merged in one if sql/mysql_priv.h: removed unused paremeter of check_one_table_access declaration of new function for SP share code sql/set_var.cc: function descriotion added unneeded parantses removed sql/sql_acl.cc: new parameter to limit number of checked tables for check_grant sql/sql_acl.h: new parameter to limit number of checked tables for check_grant sql/sql_delete.cc: preparation moved in separate function sql/sql_insert.cc: preparation moved in separate function sql/sql_lex.cc: comment style fixed unneeded assignment removed sql/sql_parse.cc: new parameter to limit number of checked tables for check_grant table list manipulation removed (because of above) new precheck function sql/sql_prepare.cc: function rewrited to shere code with sql_prepare.cc flow control fixed sql/sql_show.cc: new parameter to limit number of checked tables for check_grant sql/sql_update.cc: preparation moved in separate function sql/table.h: flag renamed
This commit is contained in:
@ -1388,7 +1388,7 @@ static bool test_if_create_new_users(THD *thd)
|
||||
thd->priv_user, tl.db, 0);
|
||||
if (!(db_access & INSERT_ACL))
|
||||
{
|
||||
if (check_grant(thd,INSERT_ACL,&tl,0,1))
|
||||
if (check_grant(thd, INSERT_ACL, &tl, 0, UINT_MAX, 1))
|
||||
create_new_users=0;
|
||||
}
|
||||
}
|
||||
@ -2650,7 +2650,7 @@ void grant_reload(THD *thd)
|
||||
****************************************************************************/
|
||||
|
||||
bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
|
||||
uint show_table, bool no_errors)
|
||||
uint show_table, uint number, bool no_errors)
|
||||
{
|
||||
TABLE_LIST *table;
|
||||
char *user = thd->priv_user;
|
||||
@ -2660,7 +2660,7 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
|
||||
return 0; // ok
|
||||
|
||||
rw_rdlock(&LOCK_grant);
|
||||
for (table=tables; table ;table=table->next)
|
||||
for (table= tables; table && number--; table= table->next)
|
||||
{
|
||||
if (!(~table->grant.privilege & want_access) || table->derived)
|
||||
{
|
||||
|
Reference in New Issue
Block a user