Wrong result with icp , HAVING , ORDER BY in 5.3-icp
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
High
|
Igor Babaev |
Bug Description
The following query:
SELECT t1.b, t1.c
FROM t1
JOIN t2
ON t1.a = t2.a
WHERE t1.b != 0
HAVING t1.c != 5
ORDER BY t1.c;
returns no rows in 5.3-icp even though there are rows that match the WHERE and HAVING conditions.
explain:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using where; Using filesort
1 SIMPLE t2 ref a a 770 test.t1.a 1 Using where
bzr version-info
revision-id: <email address hidden>
date: 2011-11-04 05:39:45 -0700
build-date: 2011-11-04 16:17:50 +0200
revno: 3268
branch-nick: maria-5.3-icp
minimal switch: index_condition
full switch: index_merge=
test case:
--source include/
CREATE TABLE t2 ( a varchar(1024), KEY (a)) ENGINE=InnoDB;
INSERT INTO t2 VALUES ('Ill')
CREATE TABLE t1 ( b int NOT NULL , c int, a varchar(1024), PRIMARY KEY (b)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,4,'Ill');
SET SESSION optimizer_
SELECT t1.b, t1.c
FROM t1
JOIN t2
ON t1.a = t2.a
WHERE t1.b != 0
HAVING t1.c != 5
ORDER BY t1.c;
Related branches
Changed in maria: | |
milestone: | none → 5.3 |
assignee: | nobody → Igor Babaev (igorb-seattle) |
Changed in maria: | |
status: | New → Confirmed |
Changed in maria: | |
status: | Confirmed → In Progress |
importance: | Undecided → High |
Changed in maria: | |
status: | In Progress → Fix Committed |
Changed in maria: | |
status: | Fix Committed → Fix Released |