Bug #78229 Workbench crash on compound SELECT with INNER JOIN
Submitted: 26 Aug 2015 16:04 Modified: 26 Sep 2015 16:26
Reporter: Andrew Schulz Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench Severity:S1 (Critical)
Version:6.3.4.0 OS:Windows
Assigned to: CPU Architecture:Any
Tags: compound select, crash, hang, INNER JOIN, SELECT

[26 Aug 2015 16:04] Andrew Schulz
Description:
I wrote a statement that checks to see if any of my devices periodically reporting data hasn't reported in the last 2 minutes. When I add the INNER JOIN to refine my SELECT the query hangs. Workbench then crashes when I stop the query.

How to repeat:
TABLE Volume (FK_DeviceID bigint, SampleTime datetime, Data int)
TABLE Devices (PK_DeviceID bigint, isTest bit, Active bit)

select  v.FK_DeviceID, 
    (Select SampleTime < Date_Sub(NOW(), INTERVAL 2 minute) from Volume
    Where FK_DeviceID = v.FK_DeviceID
    Order by SampleTime DESC
    LIMIT 1)
FROM Volume v
INNER JOIN Devices d
on d.PK_DeviceID = v.FK_DeviceID
WHERE d.isTest = 0
GROUP BY FK_DeviceID;

Changed to below to avoid the problem.

select v.FK_DeviceID, max(SampleTime) < Date_Sub(NOW(), INTERVAL 2 minute)
FROM Volume v
INNER JOIN Devices d
ON v.FK_DeviceID = d.PK_DeviceID
where d.isTest = 0
AND d.Active = 1
group by FK_DeviceID
[26 Aug 2015 16:26] MySQL Verification Team
Thank you for the bug report. Duplicate/related with http://bugs.mysql.com/bug.php?id=78135?.
[27 Sep 2015 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".