1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Fixed bug#5505: Wrong error message on INSERT into a view

On an INSERT into an updatable but non-insertable view an error message was
issued stating the view being not updatable. This can lead to a confusion of a
user.

A new error message is introduced. Is is showed when a user tries to insert
into a non-insertable view.
This commit is contained in:
evgen@moonbone.local
2006-09-29 01:00:18 +04:00
parent cf9d1c9152
commit f6fbbf2002
6 changed files with 49 additions and 24 deletions

View File

@@ -902,8 +902,11 @@ void update_non_unique_table_error(TABLE_LIST *update,
*/
if (update->view)
{
/* Issue the ER_NON_INSERTABLE_TABLE error for an INSERT */
if (update->view == duplicate->view)
my_error(ER_NON_UPDATABLE_TABLE, MYF(0), update->alias, operation);
my_error(!strncmp(operation, "INSERT", 6) ?
ER_NON_INSERTABLE_TABLE : ER_NON_UPDATABLE_TABLE, MYF(0),
update->alias, operation);
else
my_error(ER_VIEW_PREVENT_UPDATE, MYF(0),
(duplicate->view ? duplicate->alias : update->alias),