Skip to content

Commit 4193fa7

Browse files
montywivuvova
authored andcommitted
Simple optimization
1 parent 7e31279 commit 4193fa7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

sql/sql_base.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8225,7 +8225,6 @@ bool setup_tables_and_check_access(THD *thd,
82258225
ulong want_access,
82268226
bool full_table_list)
82278227
{
8228-
bool first_table= true;
82298228
DBUG_ENTER("setup_tables_and_check_access");
82308229

82318230
if (setup_tables(thd, context, from_clause, tables,
@@ -8234,16 +8233,16 @@ bool setup_tables_and_check_access(THD *thd,
82348233

82358234
List_iterator<TABLE_LIST> ti(leaves);
82368235
TABLE_LIST *table_list;
8237-
while((table_list= ti++))
8236+
ulong access= want_access_first;
8237+
while ((table_list= ti++))
82388238
{
82398239
if (table_list->belong_to_view && !table_list->view &&
8240-
check_single_table_access(thd, first_table ? want_access_first :
8241-
want_access, table_list, FALSE))
8240+
check_single_table_access(thd, access, table_list, FALSE))
82428241
{
82438242
tables->hide_view_error(thd);
82448243
DBUG_RETURN(TRUE);
82458244
}
8246-
first_table= 0;
8245+
access= want_access;
82478246
}
82488247
DBUG_RETURN(FALSE);
82498248
}

0 commit comments

Comments
 (0)