diff options
author | unknown <gkodinov/kgeorge@magare.gmz> | 2007-10-24 11:15:08 +0300 |
---|---|---|
committer | unknown <gkodinov/kgeorge@magare.gmz> | 2007-10-24 11:15:08 +0300 |
commit | e2433cbcaa81a1a1f16cf5576f7c6d045b6a9f67 (patch) | |
tree | f380fde5197f86428a6d49872c33a639b7d06316 /mysql-test/r/func_group.result | |
parent | 62a7e160bc0e960ec1374a546dde4a7f26120ceb (diff) | |
download | mariadb-git-e2433cbcaa81a1a1f16cf5576f7c6d045b6a9f67.tar.gz |
Bug #30715: Assertion failed: item_field->field->real_maybe_null(),
file .\opt_sum.cc, line
The optimizer pre-calculates the MIN/MAX values for queries like
SELECT MIN(kp_k) WHERE kp_1 = const AND ... AND kp_k-1 = const
when there is a key over kp_1...kp_k
In doing so it was not checking correctly nullability and
there was a superfluous assert().
Fixed by making sure that the field can be null before checking and
taking out the wrong assert().
.
Introduced a correct check for nullability
The MIN(field) can return NULL when all the row values in the group
are NULL-able or if there were no rows.
Fixed the assertion to reflect the case when there are no rows.
mysql-test/r/func_group.result:
Bug #30715: test case
mysql-test/t/func_group.test:
Bug #30715: test case
sql/opt_sum.cc:
Bug #30715: correct nullability check for MIN/MAX pre-calculation over index.
Diffstat (limited to 'mysql-test/r/func_group.result')
-rw-r--r-- | mysql-test/r/func_group.result | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 3a2cb26910a..e7f27ebb07e 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1387,4 +1387,9 @@ SELECT 1 FROM t1 GROUP BY (SELECT SLEEP(0) FROM t1 ORDER BY AVG(DISTINCT a) ); 1 1 DROP TABLE t1; +CREATE TABLE t1 (a int, b date NOT NULL, KEY k1 (a,b)); +SELECT MIN(b) FROM t1 WHERE a=1 AND b>'2007-08-01'; +MIN(b) +NULL +DROP TABLE t1; End of 5.0 tests |