summaryrefslogtreecommitdiff
path: root/mysql-test/r/subselect.result
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-05-02 13:03:49 +0300
committerunknown <bell@sanja.is.com.ua>2004-05-02 13:03:49 +0300
commit748db21631c0850c2dccd61aa791358e0fa96470 (patch)
treee4c1605df4863d85b9e9b4b32f711b4d7aca8c52 /mysql-test/r/subselect.result
parent73ff0958c05d771b719538135bc146cc5ffd9aae (diff)
downloadmariadb-git-748db21631c0850c2dccd61aa791358e0fa96470.tar.gz
fixed zero result case for group functions in subquery (Bug #3505)
fixed LIMIT 0 for zero rows optimisation mysql-test/r/subselect.result: test case for bugreport mysql-test/t/subselect.test: test case for bugreport sql/sql_select.cc: cleanup sum function on reinit take in account LIMIT if zero result optimisation case do not forgot sum function in zero result case for subqueries
Diffstat (limited to 'mysql-test/r/subselect.result')
-rw-r--r--mysql-test/r/subselect.result12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index cf0f9b4cc14..32770614221 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -1707,3 +1707,15 @@ create table t3(flag int);
select (select * from t3 where id not null) from t1, t2;
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'null) from t1, t2' at line 1
drop table t1,t2,t3;
+CREATE TABLE t1 (id INT);
+CREATE TABLE t2 (id INT);
+INSERT INTO t1 VALUES (1), (2);
+INSERT INTO t2 VALUES (1);
+SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id);
+id c
+1 1
+2 0
+SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id) ORDER BY t1.id;
+id c
+1 1
+2 0