Bug #70539 Server crashes with 0xc0000005 at !Item_func_group_concat::fix_fields()[item_sum
Submitted: 7 Oct 2013 0:58 Modified: 8 Nov 2013 18:11
Reporter: Stephen Belkin Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.1.47 OS:Windows
Assigned to: CPU Architecture:Any

[7 Oct 2013 0:58] Stephen Belkin
Description:
The MySQL server process is crashing when running a call to a stored procedure.

How to repeat:

I've checked the log which reports:
131007 13:46:56 - mysqld got exception 0xc0000005 ;

The trace starts at:
00000001401D015E    mysqld.exe!Item_func_group_concat::fix_fields()[item_sum.cc:3197]

It seems to think that the final query causing the problem is:
thd->query at 0000000080299328=
SELECT (IFNULL(GROUP_CONCAT(DISTINCT c.type_code ORDER BY 1) LIKE s.setting_value, FALSE)) FROM cover v JOIN plan p ON v.plan_code = p.plan_code JOIN plan_detail d ON v.plan_code = d.plan_code	JOIN category c ON d.category_code = c.category_code JOIN utilities.setting s WHERE v.family_id =  NAME_CONST('p_family_id',844076) AND  NAME_CONST('p_date',_binary'2013-10-07' COLLATE 'binary') BETWEEN v.start_cover AND v.end_cover	AND s.setting_name = "unimed.comprehensive_category_type_filter" INTO result

but if I run this query separately outside the SP it completes normally.
[7 Oct 2013 1:06] Stephen Belkin
MySQL server error log

Attachment: Stephen.err (text/plain), 6.02 KiB.

[7 Oct 2013 12:32] MySQL Verification Team
Thank you for the bug report. Please provide the server exactly version 5.1.XX and a complete test case table dump file (create and insert statements). Thanks.
[7 Oct 2013 22:44] Stephen Belkin
I have rewritten the query in the stored procedure from:

SELECT (IFNULL(GROUP_CONCAT(DISTINCT c.type_code ORDER BY 1) LIKE s.setting_value, FALSE)) FROM cover v JOIN plan_detail d ON v.plan_code = d.plan_code JOIN category c ON d.category_code = c.category_code JOIN utilities.setting s WHERE v.family_id = p_family_id AND p_date BETWEEN v.start_cover AND v.end_cover AND s.setting_name = "unimed.comprehensive_category_type_filter" INTO result;

(p_family_id and p_date are input parameters to the SP)

to:

SELECT (IFNULL(GROUP_CONCAT(DISTINCT t.type_code ORDER BY 1) LIKE s.setting_value, FALSE)) FROM cover v JOIN acumen.hpplan_detl d ON v.plan_code = d.plan JOIN extensions.category c ON d.category_code = c.category_code 
JOIN extensions.category_type t ON c.type_id = t.id JOIN utilities.setting s 
WHERE v.family_id = p_family_id	AND p_date BETWEEN v.start_cover AND v.end_cover AND s.setting_name = "unimed.comprehensive_category_type_filter" INTO result;

and everything now works!

The difference between the two queries is that the first one is based on views, while the second one uses the underlying tables to get the same result.

I'm afraid it would take too long for me to put the script you require together - and anyway, it didn't reliably fail - it seemed to be data dependent - although it didn't always fail at the same point.

I thought the error log might give you enough information to identify a previously reported bug.
[8 Oct 2013 18:11] Sveta Smirnova
Hi Stephen,

thank you for the report.

In order to confirm this is MySQL bug we need repeatable test case for you: dump of all tables, which the original query accessed.

But I also noticed you use very old version: 5.1.47. Please update to current version 5.1.72, try with it and inform if the issue still exists. Or, even better, to version 5.5.34 or 5.6.14
[9 Nov 2013 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".