diff options
author | unknown <sanja@montyprogram.com> | 2012-02-03 10:28:23 +0200 |
---|---|---|
committer | unknown <sanja@montyprogram.com> | 2012-02-03 10:28:23 +0200 |
commit | d6e1377ac206718abd039426ab72690a9ee0b48e (patch) | |
tree | f3050ff5ee950f4bc88497ccc06f3d25aa0e1814 /sql/sql_update.cc | |
parent | 81690cf326e09799ca77d9f7bc5601905b706548 (diff) | |
download | mariadb-git-d6e1377ac206718abd039426ab72690a9ee0b48e.tar.gz |
Fix check of view updatability in case of underlying view changes its updatability.
For single table update/insert added deep check of single tables (single_table_updatable()).
For multi-table view insert added additional check of target table (check_view_single_update).
Multi-update was correct.
Test suite for all cases added.
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index c6f413e754e..b3c001849b5 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -277,7 +277,8 @@ int mysql_update(THD *thd, { DBUG_RETURN(1); } - if (!table_list->updatable || check_key_in_view(thd, table_list)) + if (!table_list->single_table_updatable() || + check_key_in_view(thd, table_list)) { my_error(ER_NON_UPDATABLE_TABLE, MYF(0), table_list->alias, "UPDATE"); DBUG_RETURN(1); |