diff options
author | bell@laptop.sanja.is.com.ua <> | 2003-08-28 03:10:14 +0300 |
---|---|---|
committer | bell@laptop.sanja.is.com.ua <> | 2003-08-28 03:10:14 +0300 |
commit | 3d2a3804a1e26906c3d0b1d969452465e97fa572 (patch) | |
tree | ed1b5477d82793fa5e64d377ef4d4c7a1e83bc07 /mysql-test/t/subselect.test | |
parent | 42171225eb8b94bcb35c47512da735dc8a4803fc (diff) | |
download | mariadb-git-3d2a3804a1e26906c3d0b1d969452465e97fa572.tar.gz |
reset() split in 2 function clear() & add()
aggregate function reinitialization (if no rows was found) made with help of clear()
(fixed BUG#860)
Diffstat (limited to 'mysql-test/t/subselect.test')
-rw-r--r-- | mysql-test/t/subselect.test | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 457b64a5a11..c9dba498428 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -912,3 +912,13 @@ select * from t1 where s1 > (select max(s2) from t1); -- error 1266 select * from t1 where s1 > any (select max(s2) from t1); drop table t1; + +# +# aggregate functions reinitialization +# +create table t1(toid int,rd int); +create table t2(userid int,pmnew int,pmtotal int); +insert into t2 values(1,0,0),(2,0,0); +insert into t1 values(1,0),(1,0),(1,0),(1,12),(1,15),(1,123),(1,12312),(1,12312),(1,123),(2,0),(2,0),(2,1),(2,2); +select userid,pmtotal,pmnew, (select count(rd) from t1 where toid=t2.userid) calc_total, (select count(rd) from t1 where rd=0 and toid=t2.userid) calc_new from t2 where userid in (select distinct toid from t1); +drop table t1, t2; |