1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.
This commit is contained in:
unknown
2012-02-03 10:28:23 +02:00
parent 81690cf326
commit d6e1377ac2
6 changed files with 87 additions and 7 deletions

View File

@ -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);