diff options
author | Igor Babaev <igor@askmonty.org> | 2017-02-16 23:44:54 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2017-02-16 23:44:54 -0800 |
commit | f49375fddfd83cfc23b83b5c00d37781bf0bb070 (patch) | |
tree | 65313e2f5868e850c253717baf3d0ff63cf9ea03 /mysql-test/t | |
parent | b70cd26d73d727ad871c109b47a8a2645c553fd8 (diff) | |
download | mariadb-git-f49375fddfd83cfc23b83b5c00d37781bf0bb070.tar.gz |
Fixed bug mdev-9028.
This patch is actually a complement for the fix of bug mdev-6892.
The procedure create_tmp_table() now must take into account
Item_direct_refs that wrap up constant fields of derived tables/views
that are used as inner tables in outer join operations.
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/derived.test | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index e8a6ac34392..f8ba87ac1f5 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -842,4 +842,27 @@ SELECT Customer, Success, SUM(OrderSize) DROP TABLE example1463; set sql_mode= @save_sql_mode; +--echo # +--echo # MDEV-9028: SELECT DISTINCT constant column of derived table +--echo # used as the second operand of LEFT JOIN +--echo # + +create table t1 (id int, data varchar(255)); +insert into t1 values (1,'yes'),(2,'yes'); + +select distinct t1.id, tt.id, tt.data + from t1 + left join + (select t1.id, 'yes' as data from t1) as tt + on t1.id = tt.id; + +select distinct t1.id, tt.id, tt.data + from t1 + left join + (select t1.id, 'yes' as data from t1 where id > 1) as tt + on t1.id = tt.id; + +drop table t1; + + --echo # end of 5.5 |