Bug #35 Min function might return NULL for columns containing null and non-null values

Submitted: 23 Jan 2003 18:26 Modified: 15 Feb 2003 23:37
Reporter: Igor Babaev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:3.23 OS:Any (any)
Assigned to: Igor Babaev CPU Architecture:Any

[23 Jan 2003 18:26] Igor Babaev
Description:
Min aggregate function might return null value for columns than contain both
null and non-null values if there is an index(key) for this column.
Min must always return minimal non-null value.

How to repeat:
create table t1(a1 int, a2 char(3), key k1(a1), key k2(a2));
insert into t1 values(10,'aaa'); 
insert into t1 values(10,null);
insert into t1 values(10,'bbb');
insert into t1 values(20,'zzz'); 

select min(a2) from t1;
[15 Feb 2003 23:37] Michael Widenius
Fixed in 4.0.11;  Is not likely to be fixed in 3.23 as this is not a 
critical bug.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.048 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.