Bug #17488 mysql crashes after updates are run on tables with foriegn keys
Submitted: 16 Feb 2006 18:01 Modified: 16 Mar 2006 12:51
Reporter: Alex Schultz Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:5.0.18 OS:Linux (RHEL 4 ES)
Assigned to: Assigned Account CPU Architecture:Any

[16 Feb 2006 18:01] Alex Schultz
Description:
I've got a bunch of innodb tables with foriegn keys, and after i try to do an INSERT ... ON DUPLICATE KEY UPDATE or INSERT IGNORE then UPDATE to the tables, followed by a select * from one of the tables mysql crashes with the following error:
060214 14:46:20InnoDB: Assertion failure in thread 1163680096 in file btr0cur.c line 3777
InnoDB: Failing assertion: copied_len == local_len + extern_len
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html
InnoDB: about forcing recovery.
mysqld got signal 11;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=8388600
read_buffer_size=131072
max_used_connections=32
max_connections=100
threads_connected=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 225791 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Number of processes running now: 0
060214 14:46:20  mysqld restarted

This is repeatable with my data.  It only happens when updated existing data, not after the inserts.

How to repeat:
Not sure what exactly is causing it.  I'm only guessing that it's the foriegn keys.  But with my database it's repeatable after running updates or insert on duplicate key updates.
[16 Feb 2006 18:50] MySQL Verification Team
Thank you for the bug report.
Were you tables created with server version prior to 5.0.XX ?
and when upgrading you didn't dumped/restore them? If it
is the case can you dump/restore and test again?

Thanks in davance.
[16 Feb 2006 18:51] Alex Schultz
They were created with 5.0.13.  And i have dumped them restored then tried to apply my updates repeatedly and all with the same result.
[16 Feb 2006 19:36] Heikki Tuuri
Alex,

please present a COMPLETE SELF-CONTAINED SQL script that leads to this crash.

Regards,

Heikki