small bug fix
This commit is contained in:
parent
f980950bb3
commit
20ea534d0c
@ -111,6 +111,7 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, TABLE_LIST *t)
|
||||
t->real_name=table->real_name;
|
||||
t->table=table;
|
||||
table->derived_select_number= sl->select_number;
|
||||
table->tmp_table=TMP_TABLE;
|
||||
if (!lex->describe)
|
||||
sl->exclude();
|
||||
t->db= (tables && tables->db && tables->db[0]) ? t->db : thd->db;
|
||||
|
@ -1332,13 +1332,18 @@ mysql_execute_command(THD *thd)
|
||||
TODO: make derived tables processing 'inside' SELECT processing.
|
||||
TODO: solve problem with depended derived tables in subselects
|
||||
*/
|
||||
if (lex->derived_tables)
|
||||
if ((lex->select_lex.next_select_in_list() &&
|
||||
lex->unit.create_total_list(thd, lex, &tables)) ||
|
||||
(table_rules_on && tables && thd->slave_thread &&
|
||||
!tables_ok(thd,tables)))
|
||||
DBUG_VOID_RETURN;
|
||||
if (lex->derived_tables)
|
||||
{
|
||||
for (TABLE_LIST *cursor= tables;
|
||||
cursor;
|
||||
cursor= cursor->next)
|
||||
if (cursor->derived && (res=mysql_derived(thd, lex,
|
||||
(SELECT_LEX_UNIT *)cursor->derived,
|
||||
(SELECT_LEX_UNIT *)cursor->derived,
|
||||
cursor)))
|
||||
{
|
||||
if (res < 0)
|
||||
@ -1346,11 +1351,6 @@ if (lex->derived_tables)
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
}
|
||||
if ((lex->select_lex.next_select_in_list() &&
|
||||
lex->unit.create_total_list(thd, lex, &tables)) ||
|
||||
(table_rules_on && tables && thd->slave_thread &&
|
||||
!tables_ok(thd,tables)))
|
||||
DBUG_VOID_RETURN;
|
||||
|
||||
thread_safe_increment(com_stat[lex->sql_command],&LOCK_status);
|
||||
switch (lex->sql_command) {
|
||||
@ -2717,6 +2717,8 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables,
|
||||
TABLE_LIST *org_tables=tables;
|
||||
for (; tables ; tables=tables->next)
|
||||
{
|
||||
if (tables->derived)
|
||||
continue;
|
||||
if ((thd->master_access & want_access) == (want_access & ~EXTRA_ACL) &&
|
||||
thd->db)
|
||||
tables->grant.privilege= want_access;
|
||||
|
Loading…
x
Reference in New Issue
Block a user