1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +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.

mysql-test/r/view.result:
  Add test case result for Bug#47734.
mysql-test/t/view.test:
  Add test case for Bug#47734.
sql/sql_base.cc:
  Skip further processing if opening a table failed due to
  a fatal error (for the statement).
This commit is contained in:
Davi Arnaut
2010-01-27 11:10:53 -02:00
parent f4a16558c8
commit ee66332ce4
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",