diff options
author | unknown <bell@sanja.is.com.ua> | 2004-11-21 20:08:12 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-11-21 20:08:12 +0200 |
commit | 5a00a868b74ffb6b220eb72c87ec38696ce9406c (patch) | |
tree | 76a673d7a9b20f184988993cc14ce455b1d73f70 /sql/sql_delete.cc | |
parent | 436c7714dd6df991f2e968b313906d4b1e70db97 (diff) | |
parent | c9497e2365461fb2547a8cfceb33b68a99d7fe0b (diff) | |
download | mariadb-git-5a00a868b74ffb6b220eb72c87ec38696ce9406c.tar.gz |
merge
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/opt_sum.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_help.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_view.h:
Auto merged
sql/sql_yacc.yy:
Auto merged
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index e764e957a16..26ca837bdbd 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -44,7 +44,14 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, if (open_and_lock_tables(thd, table_list)) DBUG_RETURN(TRUE); - table= table_list->table; + if (!(table= table_list->table)) + { + DBUG_ASSERT(table_list->view && + table_list->ancestor && table_list->ancestor->next_local); + my_error(ER_VIEW_DELETE_MERGE_VIEW, MYF(0), + table_list->view_db.str, table_list->view_name.str); + DBUG_RETURN(-1); + } table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK); thd->proc_info="init"; table->map=1; @@ -289,8 +296,8 @@ bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds) SELECT_LEX *select_lex= &thd->lex->select_lex; DBUG_ENTER("mysql_prepare_delete"); - if (setup_tables(thd, table_list, conds) || - setup_conds(thd, table_list, conds) || + if (setup_tables(thd, table_list, conds, &select_lex->leaf_tables, 0) || + setup_conds(thd, table_list, select_lex->leaf_tables, conds) || setup_ftfuncs(select_lex)) DBUG_RETURN(TRUE); if (!table_list->updatable || check_key_in_view(thd, table_list)) @@ -345,7 +352,8 @@ bool mysql_multi_delete_prepare(THD *thd) lex->query_tables also point on local list of DELETE SELECT_LEX */ - if (setup_tables(thd, lex->query_tables, &lex->select_lex.where)) + if (setup_tables(thd, lex->query_tables, &lex->select_lex.where, + &lex->select_lex.leaf_tables, 0)) DBUG_RETURN(TRUE); /* Fix tables-to-be-deleted-from list to point at opened tables */ |