Comment 2 for bug 825075

Revision history for this message
Philip Stoev (pstoev-askmonty) wrote : Re: Wrong result with GROUP BY + scalar subquery + multipart key

This is repeatable without a subquery:

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( a int, b varchar(1), KEY (b,a));
INSERT INTO t1 VALUES (0,NULL),(9,NULL),(8,'c'),(4,'d'),(7,'d'),(NULL,'f'),(7,'f'),(8,'g'),(NULL,'j');

SELECT a , b FROM t1 WHERE a IS NULL OR b = 'z' ;
SELECT max(a) , b FROM t1 WHERE a IS NULL OR b = 'z' GROUP BY b;