summaryrefslogtreecommitdiff
path: root/mysql-test/t/view.test
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2017-07-17 22:34:07 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2017-07-18 13:49:58 +0200
commite7fd6ed3875bd91dbd30a62291ae471c35da8fdf (patch)
tree06a694ac391095f16bd217dcd66446bade49ade6 /mysql-test/t/view.test
parent7e44eabdad59993c504699e01d15ddb106f64e9b (diff)
downloadmariadb-git-e7fd6ed3875bd91dbd30a62291ae471c35da8fdf.tar.gz
MDEV-11240: Server crashes in check_view_single_update or Assertion `derived->table' failed in mysql_derived_merge_for_insert
Move table pointer for single table view (even if it is view over other view) to make the access universal.
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r--mysql-test/t/view.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index aece2000cd4..659327eebb1 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -5565,6 +5565,22 @@ select *
drop view v1;
drop table t1,t2,t3;
+--echo #
+--echo # MDEV-11240: Server crashes in check_view_single_update or
+--echo # Assertion `derived->table' failed in mysql_derived_merge_for_insert
+--echo #
+
+CREATE TABLE t3 (a INT);
+CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.a FROM t3 AS t1, t3 AS t2;
+CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
+PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
+--error ER_VIEW_NO_INSERT_FIELD_LIST
+EXECUTE stmt;
+--error ER_VIEW_NO_INSERT_FIELD_LIST
+EXECUTE stmt;
+drop view v1,v2;
+drop table t3;
+
--echo # -----------------------------------------------------------------
--echo # -- End of 5.5 tests.
--echo # -----------------------------------------------------------------