diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-01-27 11:10:53 -0200 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-01-27 11:10:53 -0200 |
commit | 3990858bc7545cb9311e49a31c8e96ed88a4a7cd (patch) | |
tree | b3d8c72c63fba2d404bb42d9a5db6b771ea0388c /sql/sql_base.cc | |
parent | c1a6dc5084cd91bfbaa7d0bb68d5a3a5b98dc031 (diff) | |
download | mariadb-git-3990858bc7545cb9311e49a31c8e96ed88a4a7cd.tar.gz |
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.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index a1f34f6a770..06e4b1d3e63 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -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", |