summaryrefslogtreecommitdiff
path: root/mysql-test/suite/vcol
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2014-02-07 15:50:36 -0800
committerIgor Babaev <igor@askmonty.org>2014-02-07 15:50:36 -0800
commit50b9e30b7270095c6b151a993d3231d546f491ca (patch)
tree27f81f540c68b54f72cc49717706848f0e7d480d /mysql-test/suite/vcol
parent5b441013e1975741512fbb6f1f1ff34d336cfcc1 (diff)
downloadmariadb-git-50b9e30b7270095c6b151a993d3231d546f491ca.tar.gz
Fixed bug mdev-5611.
The method Item_field::update_table_bitmaps() should not try to mark the bit for a self-referencing virtual column.
Diffstat (limited to 'mysql-test/suite/vcol')
-rw-r--r--mysql-test/suite/vcol/r/vcol_misc.result5
-rw-r--r--mysql-test/suite/vcol/t/vcol_misc.test7
2 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result
index 4514928e592..8631789f15f 100644
--- a/mysql-test/suite/vcol/r/vcol_misc.result
+++ b/mysql-test/suite/vcol/r/vcol_misc.result
@@ -316,4 +316,9 @@ ERROR HY000: The value specified for computed column 'd' in table 't1' ignored
INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,'a');
ERROR HY000: The value specified for computed column 'd' in table 't1' ignored
drop table t1;
+#
+# MDEV-5611: self-referencing virtual column
+#
+create table t1 (a int, b int as (b is null) virtual);
+ERROR HY000: A computed column cannot be based on a computed column
# end of 5.3 tests
diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test
index 9c8443218fa..a4c1fc06ce9 100644
--- a/mysql-test/suite/vcol/t/vcol_misc.test
+++ b/mysql-test/suite/vcol/t/vcol_misc.test
@@ -275,4 +275,11 @@ UPDATE `test`.`t1` SET `d`='b' WHERE `a`='1' AND `b`='a' AND `c`='1' AND `d`='a
INSERT INTO `test`.`t1`(`a`,`b`,`c`,`d`) VALUES ( '1','a',NULL,'a');
drop table t1;
+--echo #
+--echo # MDEV-5611: self-referencing virtual column
+--echo #
+
+--error ER_VCOL_BASED_ON_VCOL
+create table t1 (a int, b int as (b is null) virtual);
+
--echo # end of 5.3 tests