summaryrefslogtreecommitdiff
path: root/mysql-test/r/olap.result
diff options
context:
space:
mode:
authorigor@rurik.mysql.com <>2004-08-12 00:02:29 -0700
committerigor@rurik.mysql.com <>2004-08-12 00:02:29 -0700
commitf2b9c5f491dfc373112e01f18dd7ce2b7bae3003 (patch)
treeec0b9895a13bfd75cd3675d8e53a52bb082390ea /mysql-test/r/olap.result
parent39614a3ab3f37247979cbcbe6c489c097290e8ba (diff)
downloadmariadb-git-f2b9c5f491dfc373112e01f18dd7ce2b7bae3003.tar.gz
olap.test, olap.result:
Added test case for bug #4767. item_sum.cc: Added a correct setting of the maybe_null flag for a copy of an Item_sum object where the argument was a field of an inner table in an outer join read from a temporary table. It's part of the fix for bug #4767. sql_select.cc: Made change_refs_to_tmp_fields work correctly for test case of bug #4767 where Item_sum::get_tmp_table_item failed to build a correct copy of an Item_sum object referring to a field in a temporary table. It looks like a hack yet.
Diffstat (limited to 'mysql-test/r/olap.result')
-rw-r--r--mysql-test/r/olap.result36
1 files changed, 36 insertions, 0 deletions
diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result
index 50048808c39..bcbe5a8791c 100644
--- a/mysql-test/r/olap.result
+++ b/mysql-test/r/olap.result
@@ -271,3 +271,39 @@ i i COUNT(*)
100 NULL 2
NULL NULL 2
drop table t1,t2;
+CREATE TABLE user_day(
+user_id INT NOT NULL,
+date DATE NOT NULL,
+UNIQUE INDEX user_date (user_id, date)
+);
+INSERT INTO user_day VALUES
+(1, '2004-06-06' ),
+(1, '2004-06-07' ),
+(2, '2004-06-06' );
+SELECT
+d.date AS day,
+COUNT(d.user_id) as sample,
+COUNT(next_day.user_id) AS not_cancelled
+FROM user_day d
+LEFT JOIN user_day next_day
+ON next_day.user_id=d.user_id AND
+next_day.date= DATE_ADD( d.date, interval 1 day )
+GROUP BY day;
+day sample not_cancelled
+2004-06-06 2 1
+2004-06-07 1 0
+SELECT
+d.date AS day,
+COUNT(d.user_id) as sample,
+COUNT(next_day.user_id) AS not_cancelled
+FROM user_day d
+LEFT JOIN user_day next_day
+ON next_day.user_id=d.user_id AND
+next_day.date= DATE_ADD( d.date, interval 1 day )
+GROUP BY day
+WITH ROLLUP;
+day sample not_cancelled
+2004-06-06 2 1
+2004-06-07 1 0
+NULL 3 1
+DROP TABLE user_day;