summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-12-20 01:56:41 -0800
committerIgor Babaev <igor@askmonty.org>2011-12-20 01:56:41 -0800
commit27380e4fb522062daa0d7775a3205363a5c1b110 (patch)
tree43a81cc4b742cd44a240c11cde177a94bfac097c /mysql-test
parentbad3e4179c5471728fb0dc3d72b81db02129128f (diff)
downloadmariadb-git-27380e4fb522062daa0d7775a3205363a5c1b110.tar.gz
Fixed LP bug #794005.
The function st_table::mark_virtual_columns_for_write() did not take into account the fact that for any table the value of st_table::vfield is 0 when there are no virtual columns in the table definition.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/view.result11
-rw-r--r--mysql-test/t/view.test16
2 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 40142c5e0a7..22fd4eb1722 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -3926,3 +3926,14 @@ drop table t1,t2;
# -----------------------------------------------------------------
# -- End of 5.1 tests.
# -----------------------------------------------------------------
+#
+# Bug #794005: crash in st_table::mark_virtual_columns_for_write
+#
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+CREATE VIEW v2 AS SELECT * FROM t2;
+CREATE VIEW v1 AS SELECT * FROM v2;
+CREATE OR REPLACE ALGORITHM = TEMPTABLE VIEW v2 AS SELECT * FROM t1;
+UPDATE v1 SET a = 10;
+DROP VIEW v1,v2;
+DROP TABLE t1,t2;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 644fbe0443f..462118af4ea 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3976,3 +3976,19 @@ drop table t1,t2;
--echo # -----------------------------------------------------------------
--echo # -- End of 5.1 tests.
--echo # -----------------------------------------------------------------
+
+--echo #
+--echo # Bug #794005: crash in st_table::mark_virtual_columns_for_write
+--echo #
+
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+
+CREATE VIEW v2 AS SELECT * FROM t2;
+CREATE VIEW v1 AS SELECT * FROM v2;
+CREATE OR REPLACE ALGORITHM = TEMPTABLE VIEW v2 AS SELECT * FROM t1;
+
+UPDATE v1 SET a = 10;
+
+DROP VIEW v1,v2;
+DROP TABLE t1,t2;