diff options
author | Joerg Bruehe <joerg@mysql.com> | 2008-11-10 20:32:45 +0100 |
---|---|---|
committer | Joerg Bruehe <joerg@mysql.com> | 2008-11-10 20:32:45 +0100 |
commit | a1e2d2d14615b0ccac6b1246a58cd347effaeefb (patch) | |
tree | 0c6bedc8298d6ba68c23420c95626e2b52466499 /sql/sql_base.cc | |
parent | 12ad7f3b9da5e0563c24698856102b4b646cea82 (diff) | |
parent | 9a0637750a4775e199b3915bd83e630540729d64 (diff) | |
download | mariadb-git-a1e2d2d14615b0ccac6b1246a58cd347effaeefb.tar.gz |
Merge main 5.1 -> 5.1-build
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index f18ee0ec562..d7bb571b8c7 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -489,12 +489,20 @@ static TABLE_SHARE "no such table" errors. @todo Rework the alternative ways to deal with ER_NO_SUCH TABLE. */ - if (thd->is_error() && table_list->belong_to_view) + if (thd->is_error()) { - TABLE_LIST *view= table_list->belong_to_view; - thd->clear_error(); - my_error(ER_VIEW_INVALID, MYF(0), - view->view_db.str, view->view_name.str); + if (table_list->parent_l) + { + thd->clear_error(); + my_error(ER_WRONG_MRG_TABLE, MYF(0)); + } + else if (table_list->belong_to_view) + { + TABLE_LIST *view= table_list->belong_to_view; + thd->clear_error(); + my_error(ER_VIEW_INVALID, MYF(0), + view->view_db.str, view->view_name.str); + } } DBUG_RETURN(0); } @@ -7760,6 +7768,10 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name, if (!(item= field_iterator.create_item(thd))) DBUG_RETURN(TRUE); + DBUG_ASSERT(item->fixed); + /* cache the table for the Item_fields inserted by expanding stars */ + if (item->type() == Item::FIELD_ITEM && tables->cacheable_table) + ((Item_field *)item)->cached_table= tables; if (!found) { |