diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-02-25 15:57:08 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-02-26 08:32:02 +0100 |
commit | 82da98556cf58f0fbb43c82e9c6ae1a887b6cf3d (patch) | |
tree | 440df4bbd36734804eccafeb7bfba818ce158338 /mysql-test/main/view.test | |
parent | 50b3632fa434e6bf836830365f664b67ff989279 (diff) | |
download | mariadb-git-82da98556cf58f0fbb43c82e9c6ae1a887b6cf3d.tar.gz |
MDEV-18605: Loss of column aliases by using view and group
Preserv column name with copy fields even if it is function and Co.
Diffstat (limited to 'mysql-test/main/view.test')
-rw-r--r-- | mysql-test/main/view.test | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/main/view.test b/mysql-test/main/view.test index 82ef38f0eb6..643f050cee5 100644 --- a/mysql-test/main/view.test +++ b/mysql-test/main/view.test @@ -6415,5 +6415,28 @@ drop table t1; ALTER VIEW IF NOT EXISTS v1 AS SELECT 1; --echo # +--echo # MDEV-18605: Loss of column aliases by using view and group +--echo # + +CREATE TABLE t1 (id int, foo int); +CREATE VIEW v1 AS SELECT id, IFNULL(foo,'') AS foo FROM t1; + +INSERT INTO t1 (id, foo) VALUES (1,1),(2,2); + +SELECT v.id, v.foo AS bar FROM v1 v + WHERE id = 2; + +SELECT v.id, v.foo AS bar FROM v1 v + GROUP BY v.id; + +SELECT v.id, v.foo AS bar FROM v1 v + WHERE id = 2 + GROUP BY v.id; + +#Cleanup +Drop View v1; +Drop table t1; + +--echo # --echo # End of 10.3 tests --echo # |