1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Bug#47734: Assertion failed: ! is_set() when locking a view with non-existing definer

The problem was that a failure to open a view wasn't being
properly handled. When opening a view with unknown definer,
the open procedure would be treated as successful and would
later crash when attempting to lock the view (which wasn't
opened to begin with).

The solution is to skip further processing when opening a
table if it fails with a fatal error.
This commit is contained in:
Davi Arnaut
2010-01-27 11:10:53 -02:00
parent c1a6dc5084
commit 3990858bc7
3 changed files with 35 additions and 0 deletions

View File

@@ -4591,7 +4591,20 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
safe_to_ignore_table= prelock_handler.safely_trapped_errors();
}
else
{
tables->table= open_table(thd, tables, &new_frm_mem, &refresh, flags);
/*
Skip further processing if there has been a fatal error while
trying to open a table. For example, this might happen due to
stack shortage, unknown definer in views, etc.
*/
if (!tables->table && thd->is_error())
{
result= -1;
goto err;
}
}
}
else
DBUG_PRINT("tcache", ("referenced table: '%s'.'%s' 0x%lx",