Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0.3
-
None
-
None
-
Ubuntu 12.10, MariaDB 10.0.3 from the mariadb.org repository
Description
CREATE TEMPORARY TABLE A(`id` mediumint, `value` mediumint, PRIMARY KEY(`id`,`value`));
|
INSERT INTO A VALUES (1,1),(2,2),(3,3);
|
CREATE TEMPORARY TABLE B(`id` mediumint, PRIMARY KEY(`id`));
|
INSERT INTO B VALUES (1),(2),(3);
|
SELECT SQL_CALC_FOUND_ROWS 1 FROM A LEFT JOIN B ON A.`id` = B.`id` WHERE B.`id` IS NULL ORDER BY `value` DESC;
|
SELECT FOUND_ROWS() AS `count`;
|
SELECT COUNT(*) FROM (SELECT 1 FROM A LEFT JOIN B ON A.`id` = B.`id` WHERE B.`id` IS NULL ORDER BY `value` DESC) AS `x`;
|
Expected result:
0
0
(as the left join can never fail)
Actual result:
3
0
This means that SQL_CALC_FOUND_ROWS ignores the fact that all rows will be filtered.