Comment 12 for bug 612894

Revision history for this message
Michael Widenius (monty) wrote :

The bug is related to how we mark items when there is no rows in a group.
The following query is related to this:

CREATE TABLE t1 (a int(11) NOT NULL);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (
 key_col int(11) NOT NULL,
 KEY (key_col)
);
INSERT INTO t2 VALUES (1),(2);

select min(t2.key_col) from t1,t2 where t1.a=1;
> 1
select min(t2.key_col) from t1,t2 where t1.a > 1000;
> NULL
select min(t2.key_col)+1 from t1,t2 where t1.a> 1000;
> 2

The last query should return NULL