Simple optimization

This commit is contained in:
Monty 2015-09-27 21:30:18 +02:00 committed by Sergei Golubchik
parent 7e31279666
commit 4193fa7ae2

View file

@ -8225,7 +8225,6 @@ bool setup_tables_and_check_access(THD *thd,
ulong want_access,
bool full_table_list)
{
bool first_table= true;
DBUG_ENTER("setup_tables_and_check_access");
if (setup_tables(thd, context, from_clause, tables,
@ -8234,16 +8233,16 @@ bool setup_tables_and_check_access(THD *thd,
List_iterator<TABLE_LIST> ti(leaves);
TABLE_LIST *table_list;
while((table_list= ti++))
ulong access= want_access_first;
while ((table_list= ti++))
{
if (table_list->belong_to_view && !table_list->view &&
check_single_table_access(thd, first_table ? want_access_first :
want_access, table_list, FALSE))
check_single_table_access(thd, access, table_list, FALSE))
{
tables->hide_view_error(thd);
DBUG_RETURN(TRUE);
}
first_table= 0;
access= want_access;
}
DBUG_RETURN(FALSE);
}