Bug #94206 | IFNULL expression leaks out of outer join when using "distinct" or "group by" | ||
---|---|---|---|
Submitted: | 5 Feb 2019 14:12 | Modified: | 5 Feb 2019 15:44 |
Reporter: | Jordi Salvat i Alabart | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S2 (Serious) |
Version: | 5.7/8.0 | OS: | Ubuntu (5.7.25-0ubuntu0.18.04.2) |
Assigned to: | CPU Architecture: | Any |
[5 Feb 2019 14:12]
Jordi Salvat i Alabart
[5 Feb 2019 15:21]
MySQL Verification Team
Thank you for the bug report. Verified as described.
[5 Feb 2019 15:44]
Jordi Salvat i Alabart
My workaround eventually led me to an error SQL Error [1062] [23000]: Duplicate entry '2019-01-28-NULL' for key '<group_key>' Sorry I can't provide more details: I don't have the time to research further -- I need to move on. So I've replaced NULL values with a marker value so I won't need those IFNULL expressions.
[6 Feb 2019 8:23]
Roy Lyseng
Hi Jordi, you can workaround the issue by forcing a materialization of the derived table, until there is a proper fix: set optimizer_switch='derived_merge=off'; For 8.0, you can add an optimizer hint after the select keyword: /*+ no_merge(t2) */