diff options
author | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2008-12-24 19:26:48 +0400 |
---|---|---|
committer | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2008-12-24 19:26:48 +0400 |
commit | bcfa0cedb26c372ed978d54d8f3d785d616132fa (patch) | |
tree | cb4bded9c5cfe49770c4ed0113dabbabb240da91 /mysql-test/r/select.result | |
parent | e75ba73a0762c159984498a06580f323caa2b72c (diff) | |
parent | ce985aa36e2fb9cb036ae66376bf3c0dfab433be (diff) | |
download | mariadb-git-bcfa0cedb26c372ed978d54d8f3d785d616132fa.tar.gz |
5.0-bugteam->5.1-bugteam merge
Diffstat (limited to 'mysql-test/r/select.result')
-rw-r--r-- | mysql-test/r/select.result | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 313bc9b9630..0519489b715 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -4340,6 +4340,39 @@ Handler_read_prev 0 Handler_read_rnd 0 Handler_read_rnd_next 6 DROP TABLE t1, t2; +CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0', +f2 int(11) NOT NULL default '0', +f3 bigint(20) NOT NULL default '0', +f4 varchar(255) NOT NULL default '', +PRIMARY KEY (f1), +KEY key1 (f4), +KEY key2 (f2)); +CREATE TABLE t2 (f1 int(11) NOT NULL default '0', +f2 enum('A1','A2','A3') NOT NULL default 'A1', +f3 int(11) NOT NULL default '0', +PRIMARY KEY (f1), +KEY key1 (f3)); +CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0', +f2 datetime NOT NULL default '1980-01-01 00:00:00', +PRIMARY KEY (f1)); +insert into t1 values (1, 1, 1, 'abc'); +insert into t1 values (2, 1, 2, 'def'); +insert into t1 values (3, 1, 2, 'def'); +insert into t2 values (1, 'A1', 1); +insert into t3 values (1, '1980-01-01'); +SELECT a.f3, cr.f4, count(*) count +FROM t2 a +STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1 +LEFT JOIN +(t1 cr2 +JOIN t3 ae2 ON cr2.f3 = ae2.f1 +) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND +cr.f4 = cr2.f4 +GROUP BY a.f3, cr.f4; +f3 f4 count +1 abc 1 +1 def 2 +drop table t1, t2, t3; End of 5.0 tests create table t1(a INT, KEY (a)); INSERT INTO t1 VALUES (1),(2),(3),(4),(5); |