Details
-
Bug
-
Status: Closed (View Workflow)
-
Resolution: Not a Bug
-
None
-
None
-
None
Description
The following query on the attached table & data yields different results in MySQL 5.5 & MariaDB 5.5:
SELECT id, date_i, date_ontop, date_until
FROM
(
SELECT id, date_i, date_ontop, date_until
FROM news
WHERE
date_i <= CURRENT_TIMESTAMP
AND
date_ontop >= CURRENT_TIMESTAMP
ORDER BY date_i DESC
) AS ontop
UNION
SELECT id, date_i, date_ontop, date_until
FROM
(
SELECT id, date_i, date_ontop, date_until
FROM news
WHERE
date_i <= CURRENT_TIMESTAMP
AND
( date_until >= CURRENT_TIMESTAMP OR date_until IS NULL)
AND
( date_ontop IS NULL OR date_ontop < CURRENT_TIMESTAMP )
ORDER BY date_i DESC
) AS therest
LIMIT 0, 18
In MariaDB 5.2 it gives the same results as MySQL 5.5.
It may be related to Bug#1010116 because if I switch optimizer_switch='derived_merge=off' it give the correct results.
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Resolution | Not a Bug [ 6 ] | |
Status | Closed [ 6 ] | Reopened [ 4 ] |
Labels | Launchpad |
Resolution | Not a Bug [ 6 ] | |
Status | Reopened [ 4 ] | Closed [ 6 ] |
Key |
|
MDEV-2155 |
Project | ImportTest [ 10200 ] | MariaDB Development [ 10000 ] |
Workflow | jira [ 20275 ] | defaullt [ 22999 ] |
Key |
|
MDEV-3284 |
Project | ImportTest [ 10200 ] | MariaDB Development [ 10000 ] |
Workflow | jira [ 20275 ] | defaullt [ 24128 ] |
Workflow | defaullt [ 24582 ] | MariaDB v2 [ 45996 ] |
Workflow | MariaDB v2 [ 45996 ] | MariaDB v3 [ 66676 ] |
Workflow | MariaDB v3 [ 66676 ] | MariaDB v4 [ 145085 ] |
Re: Incorect results in union & subqueries