[MDEV-2832] LP:992405 - Wrong result when using SQL_BUFFER_RESULT if min/max loose scan is chosen Created: 2012-05-01  Updated: 2017-04-25  Resolved: 2012-10-04

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Igor Babaev Assignee: Timour Katchaounov (Inactive)
Resolution: Fixed Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug992405.xml    
Issue Links:
Blocks
is blocked by MDEV-12589 wrong result order when using SQL_BUF... Closed

 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)



 Comments   
Comment by Rasmus Johansson (Inactive) [ 2012-05-07 ]

Launchpad bug id: 992405

Generated at Thu Feb 08 06:44:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.