summaryrefslogtreecommitdiff
path: root/mysql-test/r/select.result
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2006-01-11 23:16:21 +0300
committerunknown <evgen@moonbone.local>2006-01-11 23:16:21 +0300
commitddcc6d7bd445617b3e0bfaff1247a453d21d48f0 (patch)
tree5775e9efc2e3ec11945eb525887ac49f7a458aa3 /mysql-test/r/select.result
parentf81ed05cdcad5723c986c580cfcf3ee5e22a385c (diff)
downloadmariadb-git-ddcc6d7bd445617b3e0bfaff1247a453d21d48f0.tar.gz
Fixed bug #15347: Wrong result of subselect when records cache and set
functions are involved. When subselect is a join with set functions and no record have been found in it, end_send_group() sets null_row for all tables in order aggregate functions to calculate their values correctly. Normally this null_row flag is cleared for each table in sub_select(), but flush_cached_records() doesn't do so. Due to this all fields from the table processed by flush_cached_records() are always evaluated as nulls and whole select produces wrong result. flush_cached_records() now clears null_row flag at the very beginning. mysql-test/t/select.test: Added test case for bug #15347: Wrong result of subselect when records cache and set functions are involved mysql-test/r/select.result: Added test case for bug #15347: Wrong result of subselect when records cache and set functions are involved sql/sql_select.cc: Fixed bug #15347: Wrong result of subselect when records cache and set functions are involved flush_cached_records() now clears null_row flag at the very beginning.
Diffstat (limited to 'mysql-test/r/select.result')
-rw-r--r--mysql-test/r/select.result11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 598ea2b10d1..b9b0c1ee9e8 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -3337,3 +3337,14 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 Using index
1 SIMPLE t3 const PRIMARY PRIMARY 8 const,const 1
DROP TABLE t1,t2,t3;
+create table t1 (f1 int);
+insert into t1 values(1),(2);
+create table t2 (f2 int, f3 int, key(f2));
+insert into t2 values(1,1),(2,2);
+create table t3 (f4 int not null);
+insert into t3 values (2),(2),(2);
+select f1,(select count(*) from t2,t3 where f2=f1 and f3=f4) as count from t1;
+f1 count
+1 0
+2 3
+drop table t1,t2,t3;