mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fixed BUG#13683: INSERT DELAYED into a view creates an infinite loop.
The bug was caused by wrong behaviour of mysql_insert() which in case of INSERT DELAYED into a view exited with thd->net.report_error == 0. This blocked error reporting to the client which started waiting infinitely for response to the query. mysql-test/r/insert.result: Fixed results for the added test case. mysql-test/t/insert.test: Added test case. sql/sql_insert.cc: Fixed BUG#13683: INSERT DELAYED into a view creates an infinite loop. Changed mysql_insert(): delayed_get_table() applied to a view exits with ER_WRONG_OBJECT error (and with thd->net.report_error == 1) and in this case we must just exit from mysql_insert(). Prior to this change, instead of exiting open_and_lock_tables() was invoked which cleared thd->net.report_error to zero and caused the bug.
This commit is contained in:
@ -321,7 +321,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
|
||||
if (!table_list->derived && !table_list->view)
|
||||
table_list->updatable= 1; // usual table
|
||||
}
|
||||
else
|
||||
else if (thd->net.last_errno != ER_WRONG_OBJECT)
|
||||
{
|
||||
/* Too many delayed insert threads; Use a normal insert */
|
||||
table_list->lock_type= lock_type= TL_WRITE;
|
||||
|
Reference in New Issue
Block a user