summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 83ab24fc27d..062106d2fae 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -3330,6 +3330,14 @@ open_and_process_table(THD *thd, LEX *lex, TABLE_LIST *tables,
/*
Not a placeholder: must be a base/temporary table or a view. Let us open it.
*/
+
+ if (tables->db == no_db)
+ {
+ my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
+ error= TRUE;
+ goto end;
+ }
+
if (tables->table)
{
/*