Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
The following sequence of commands brings us to a wrong result in MariaDB 5.2 :
CREATE TABLE t1 (a int, b varchar(1), KEY (b,a) );
INSERT INTO t1 VALUES (1,NULL),(0,'a');
SINSERT INTO t1 VALUES (2,'x'),(0,'y');
SELECT SQL_BUFFER_RESULT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b;
MariaDB [test]> SELECT SQL_BUFFER_RESULT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b;
------------+
MIN(a) | b |
------------+
NULL | NULL |
------------+
The result is correct without the modifier SQL_BUFFER_RESULT:
MariaDB [test]> SELECT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b;
------------+
MIN(a) | b |
------------+
0 | a |
------------+
(See also bug #12640437 for mysql-5.6)
Attachments
Issue Links
- is blocked by
-
MDEV-12589 wrong result order when using SQL_BUFFER_RESULT
- Closed