mirror of
https://github.com/MariaDB/server.git
synced 2026-04-29 11:45:32 +02:00
Bug#25122: Views based on a self-joined table aren't insertable.
When INSERT is done over a view the table being inserted into is checked to be unique among all views tables. But if the view contains self-joined table an error will be thrown even if all tables are used under different aliases. The unique_table() function now also checks tables' aliases when needed. sql/mysql_priv.h: Bug#25122: Views based on a self-joined table aren't insertable. Updated prototype of the unique_table() function. sql/sql_base.cc: Bug#25122: Views based on a self-joined table aren't insertable. Now the unique_table() function checks tables' aliases when needed. sql/sql_delete.cc: Bug#25122: Views based on a self-joined table aren't insertable. Updated calls to the unique_table() function. sql/sql_insert.cc: Bug#25122: Views based on a self-joined table aren't insertable. Updated calls to the unique_table() function. sql/sql_load.cc: Bug#25122: Views based on a self-joined table aren't insertable. Updated calls to the unique_table() function. sql/sql_parse.cc: Bug#25122: Views based on a self-joined table aren't insertable. Updated calls to the unique_table() function. sql/sql_update.cc: Bug#25122: Views based on a self-joined table aren't insertable. Updated calls to the unique_table() function.
This commit is contained in:
parent
6d537f01fd
commit
1437a9c532
7 changed files with 19 additions and 13 deletions
|
|
@ -175,7 +175,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
|
|||
table is marked to be 'used for insert' in which case we should never
|
||||
mark this table as as 'const table' (ie, one that has only one row).
|
||||
*/
|
||||
if (unique_table(thd, table_list, table_list->next_global))
|
||||
if (unique_table(thd, table_list, table_list->next_global, 0))
|
||||
{
|
||||
my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->table_name);
|
||||
DBUG_RETURN(TRUE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue