summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-02-22 00:33:11 +0300
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-02-22 00:33:11 +0300
commit8c31c4d16cfe9c3bbafcb30d0cd70210f6f230d3 (patch)
tree94830ebea81e944773f55fcb501055d762e3db1d /sql/sql_base.cc
parentb3e01b6da86dca93764ea67673c8d34f63e94cd2 (diff)
parentae12a723605f5059d73ee9284fd78ecc7583fac2 (diff)
downloadmariadb-git-8c31c4d16cfe9c3bbafcb30d0cd70210f6f230d3.tar.gz
Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index e2efb91c1a9..452f13244fd 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2177,6 +2177,7 @@ void wait_for_condition(THD *thd, pthread_mutex_t *mutex, pthread_cond_t *cond)
proc_info=thd->proc_info;
thd_proc_info(thd, "Waiting for table");
DBUG_ENTER("wait_for_condition");
+ DEBUG_SYNC(thd, "waiting_for_table");
if (!thd->killed)
(void) pthread_cond_wait(cond, mutex);
@@ -4598,7 +4599,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",