diff options
author | unknown <igor@rurik.mysql.com> | 2004-08-12 00:02:29 -0700 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2004-08-12 00:02:29 -0700 |
commit | 090bc713a4ebae95ac07a862800a69e723833b29 (patch) | |
tree | ec0b9895a13bfd75cd3675d8e53a52bb082390ea /mysql-test/t/olap.test | |
parent | ec5c569103aca010816834426b9f56752f33a1c1 (diff) | |
download | mariadb-git-090bc713a4ebae95ac07a862800a69e723833b29.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.
sql/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 copy of an Item_sum object referring
to a field in a temporary table.
It looks like a hack yet.
sql/item_sum.cc:
Added a correct setting of maybe_null flag for copy of a
Item_sum object where there argument is a field of nullable table
read from the temporary table.
It's part of the fix for bug #4767.
mysql-test/r/olap.result:
Added test case for bug #4767.
mysql-test/t/olap.test:
Added test case for bug #4767.
Diffstat (limited to 'mysql-test/t/olap.test')
-rw-r--r-- | mysql-test/t/olap.test | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/mysql-test/t/olap.test b/mysql-test/t/olap.test index 7443aeee6f4..674b4ade097 100644 --- a/mysql-test/t/olap.test +++ b/mysql-test/t/olap.test @@ -88,3 +88,40 @@ INSERT INTO t2 VALUES (100),(200); SELECT i, COUNT(*) FROM t1 GROUP BY i WITH ROLLUP; SELECT t1.i, t2.i, COUNT(*) FROM t1,t2 GROUP BY t1.i,t2.i WITH ROLLUP; drop table t1,t2; + +#bug #4767: ROLLUP with LEFT JOIN + +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; + +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; + +DROP TABLE user_day; + |