Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:
Description
Using mariadb-5.2 create and populate table 1 with the following commands:
CREATE TABLE t1 (pk INT PRIMARY KEY, a INT);
INSERT INTO t1 VALUES (2,7), (4,7), (6,2), (17,0);
Execute the following queries:
SELECT MIN(t.pk) FROM t1, t1 as t WHERE t1.pk = 1;
SELECT MIN(t.pk) FROM t1, t1 as t WHERE t1.pk = 1 HAVING MIN(t.pk) < 10;
The first query return the right result while the second query returns a wrong result:
MariaDB [test]> SELECT MIN(t.pk) FROM t1, t1 as t WHERE t1.pk = 1;
-----------
| MIN(t.pk) |
-----------
| NULL |
-----------
MariaDB [test]> SELECT MIN(t.pk) FROM t1, t1 as t WHERE t1.pk = 1 HAVING MIN(t.pk) < 10;
-----------
| MIN(t.pk) |
-----------
| NULL |
-----------
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Launchpad bug id: 938518