diff options
author | unknown <igor@rurik.mysql.com> | 2005-05-10 16:31:13 -0700 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2005-05-10 16:31:13 -0700 |
commit | e02416c53cc97cb16b8d6a3c0df76568a061538d (patch) | |
tree | a60dad46c054f43e7617ba684f1346dbcb0ba1b7 /sql/sql_update.cc | |
parent | 179451fc2a79763514cf11c3a90b09153ba72cb3 (diff) | |
download | mariadb-git-e02416c53cc97cb16b8d6a3c0df76568a061538d.tar.gz |
Many files:
Fixed bug #8528.
Representation for single-table views was made similar to
representation for multi-table views.
view.test:
Added test case for bug #8528.
view.result:
Added test case for bug #8528. Fixed other test cases.
mysql-test/r/view.result:
Added test case for bug #8528. Fixed other test cases.
mysql-test/t/view.test:
Added test case for bug #8528.
sql/sql_base.cc:
Fixed bug #8528.
Representation for single-table views was made similar to
representation for multi-table views.
sql/sql_delete.cc:
Fixed bug #8528.
Representation for single-table views was made similar to
representation for multi-table views.
sql/sql_insert.cc:
Fixed bug #8528.
Representation for single-table views was made similar to
representation for multi-table views.
sql/sql_parse.cc:
Fixed bug #8528.
Representation for single-table views was made similar to
representation for multi-table views.
sql/sql_prepare.cc:
Fixed bug #8528.
Representation for single-table views was made similar to
representation for multi-table views.
sql/sql_select.cc:
Fixed bug #8528.
Representation for single-table views was made similar to
representation for multi-table views.
sql/sql_update.cc:
Fixed bug #8528.
Representation for single-table views was made similar to
representation for multi-table views.
sql/sql_view.cc:
Fixed bug #8528.
Representation for single-table views was made similar to
representation for multi-table views.
sql/table.cc:
Fixed bug #8528.
Representation for single-table views was made similar to
representation for multi-table views.
sql/table.h:
Fixed bug #8528.
Representation for single-table views was made similar to
representation for multi-table views.
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 86aa0bf9890..95268c41aed 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -139,7 +139,7 @@ int mysql_update(THD *thd, if (open_tables(thd, &table_list, &table_count)) DBUG_RETURN(1); - if (table_list->ancestor && table_list->ancestor->next_local) + if (table_list->multitable_view) { DBUG_ASSERT(table_list->view != 0); DBUG_PRINT("info", ("Switch to multi-update")); @@ -706,9 +706,11 @@ bool mysql_multi_update_prepare(THD *thd) if (!tl->placeholder() && !tl->schema_table && !using_lock_tables) tl->table->reginfo.lock_type= tl->lock_type; } - + } + for(tl= table_list; tl; tl= tl->next_local) + { /* Check access privileges for table */ - if (!tl->derived && !tl->belong_to_view) + if (!tl->derived) { uint want_privilege= tl->updating ? UPDATE_ACL : SELECT_ACL; if (check_access(thd, want_privilege, @@ -721,12 +723,10 @@ bool mysql_multi_update_prepare(THD *thd) /* check single table update for view compound from several tables */ for (tl= table_list; tl; tl= tl->next_local) { - if (tl->table == 0) + if (tl->effective_algorithm == VIEW_ALGORITHM_MERGE) { - DBUG_ASSERT(tl->view && - tl->ancestor && tl->ancestor->next_local); TABLE_LIST *for_update= 0; - if (tl->check_single_table(&for_update, tables_for_update)) + if (tl->check_single_table(&for_update, tables_for_update, tl)) { my_error(ER_VIEW_MULTIUPDATE, MYF(0), tl->view_db.str, tl->view_name.str); |