summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorunknown <bell@laptop.sanja.is.com.ua>2003-08-28 03:10:14 +0300
committerunknown <bell@laptop.sanja.is.com.ua>2003-08-28 03:10:14 +0300
commit85f7a6978bced6b17940363b792e7bc80dcce3aa (patch)
treeed1b5477d82793fa5e64d377ef4d4c7a1e83bc07 /mysql-test/r
parentc2d54add7ede5e2e4610c43eeff6aa6f055cf197 (diff)
downloadmariadb-git-85f7a6978bced6b17940363b792e7bc80dcce3aa.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) mysql-test/r/subselect.result: test for BUG#860 mysql-test/t/subselect.test: test for BUG#860 sql/item_sum.cc: reset() replaced with clear() sql/item_sum.h: reset() replaced with clear() (reset now is just composition of clear() and add()) sql/item_uniq.h: reset() replaced with clear() sql/sql_select.cc: removed NULL value assigment, now it will be done by clear() call function for clearing if there was not found any row in group sql/sql_select.h: function for clearing if there was not found any row in group
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/subselect.result9
1 files changed, 9 insertions, 0 deletions
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index cf02eda9aba..dd8aeba8563 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -1352,3 +1352,12 @@ ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_
select * from t1 where s1 > any (select max(s2) from t1);
ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '>'
drop table t1;
+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);
+userid pmtotal pmnew calc_total calc_new
+1 0 0 9 3
+2 0 0 4 2
+drop table t1, t2;