Bug #18543 Server goes away instead of error 1442 (
Submitted: 27 Mar 2006 14:50 Modified: 27 Apr 2006 16:14
Reporter: Christian Kirsch Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.18 OS:Linux (Linux)
Assigned to: Assigned Account CPU Architecture:Any

[27 Mar 2006 14:50] Christian Kirsch
Description:
Given two tables (ixdb.heft and ixlive.manu) and an update/after trigger on ixlive.manu that updates ixdb.heft. The following makes the server barf:

mysql> update manu, ixdb.heft h set manu.status=3 where h.status=2 and h.monat=5 and h.jahr=2006 and h.artnum=manuid;

ERROR 2013 (HY000): Lost connection to MySQL server during query

whereas the equivalent statement

update manu set manu.status=3 where manuid in (select artnum from ixdb.heft h where h.status=2 and h.monat=5 and h.jahr=2006);

gives the 
ERROR 1442 (HY000): Can't update table 'heft' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.

The first statement should give the same error as the second one. 

How to repeat:
see above

Suggested fix:
Handle both statements in the same way.
[27 Mar 2006 16:01] MySQL Verification Team
Thank you for the bug report.
Could you please provide a test case with create definitions and
some inserts if needed and it crashes on your side. I was unable
to repeat on current source server with a similar test.
Thanks in advance.
[27 Mar 2006 16:14] MySQL Verification Team
Thank you for the feedback. Yes is OK to me. Please change the
the status to open after you provide the test case. Thanks in
advance.
[27 Apr 2006 23: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".