summaryrefslogtreecommitdiff
path: root/mysql-test/t/dyncol.test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-03-27 10:03:28 +0100
committerSergei Golubchik <sergii@pisem.net>2013-03-27 10:03:28 +0100
commit6599fd3e9c23a8957a63146cbe6a0ffc4c292a3d (patch)
tree5a7e05e0a9abb5f5cc2672bc3d545ac3f5f7fa43 /mysql-test/t/dyncol.test
parent102a7a2a763dc5f2da8dd1f9ca9a53664c5aad6a (diff)
parente308d7417bc4ceb1b3b72cac2642015b88f310ff (diff)
downloadmariadb-git-6599fd3e9c23a8957a63146cbe6a0ffc4c292a3d.tar.gz
5.3 merge
Diffstat (limited to 'mysql-test/t/dyncol.test')
-rw-r--r--mysql-test/t/dyncol.test57
1 files changed, 57 insertions, 0 deletions
diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test
index 66e308540f4..ca95dea0779 100644
--- a/mysql-test/t/dyncol.test
+++ b/mysql-test/t/dyncol.test
@@ -550,3 +550,60 @@ select hex(COLUMN_CREATE(0, COLUMN_GET(@a, 9 AS DECIMAL(19,0))));
select hex(COLUMN_CREATE(0, COLUMN_GET(COLUMN_CREATE(0, 0.0 as decimal), 0 as decimal)));
select hex(COLUMN_CREATE(0, 0.0 as decimal));
+
+--echo #
+--echo # MDEV-4292: parse error when selecting on views using dynamic column
+--echo #
+create table t1 (i int, d blob);
+
+create view v1 as select i, column_get(d, 1 as binary) as a from t1;
+select * from v1;
+show create view v1;
+drop view v1;
+
+create view v1 as select i, column_get(d, 1 as int) as a from t1;
+select * from v1;
+show create view v1;
+drop view v1;
+
+create view v1 as select i, column_get(d, 1 as unsigned int) as a from t1;
+select * from v1;
+show create view v1;
+drop view v1;
+
+create view v1 as select i, column_get(d, 1 as date) as a from t1;
+select * from v1;
+show create view v1;
+drop view v1;
+
+create view v1 as select i, column_get(d, 1 as time) as a from t1;
+select * from v1;
+show create view v1;
+drop view v1;
+
+create view v1 as select i, column_get(d, 1 as datetime) as a from t1;
+select * from v1;
+show create view v1;
+drop view v1;
+
+create view v1 as select i, column_get(d, 1 as decimal) as a from t1;
+select * from v1;
+show create view v1;
+drop view v1;
+
+create view v1 as select i, column_get(d, 1 as double) as a from t1;
+select * from v1;
+show create view v1;
+drop view v1;
+
+create view v1 as select i, column_get(d, 1 as char) as a from t1;
+select * from v1;
+show create view v1;
+drop view v1;
+
+drop table t1;
+
+--echo #
+--echo # end of 5.3 tests
+--echo #
+