summaryrefslogtreecommitdiff
path: root/mysql-test/t/insert.test
diff options
context:
space:
mode:
authorunknown <aivanov@mysql.com>2006-04-05 01:09:07 +0400
committerunknown <aivanov@mysql.com>2006-04-05 01:09:07 +0400
commit708f3b7b3d68d86b36a5b74b3fb719e7bfa96b1b (patch)
treeb8a537f5ba78842f7fb147123c69df7ed9182a00 /mysql-test/t/insert.test
parentb0d896e6f45dc18ac953004d7e674aa09d57ba42 (diff)
downloadmariadb-git-708f3b7b3d68d86b36a5b74b3fb719e7bfa96b1b.tar.gz
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.
Diffstat (limited to 'mysql-test/t/insert.test')
-rw-r--r--mysql-test/t/insert.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index ddde6cfa5d3..0c64dd80bec 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -175,3 +175,15 @@ select count(*) from t2;
insert into t2 select t1.* from t1, t2 t, t3 where t1.id1 = t.id2 and t.id2 = t3.id3;
select count(*) from t2;
drop table t1,t2,t3;
+
+#
+# Test for INSERT DELAYED INTO a <view>
+# BUG#13683: INSERT DELAYED into a view creates an infinite loop
+#
+
+create table t1 (n int);
+create view v1 as select * from t1;
+--error 1347
+insert delayed into v1 values (1);
+drop table t1;
+drop view v1;