Bug #7493 MySQL 5.0 crashes on simple update query
Submitted: 22 Dec 2004 18:08 Modified: 28 Dec 2004 0:11
Reporter: Mark Matthews Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.3 OS:TaoLinux (RHES3)
Assigned to: Marko Mäkelä CPU Architecture:Any

[22 Dec 2004 18:08] Mark Matthews
Description:
MySQL-5.0 (compiled with BUILD/compile-pentium-max), BK pull from today (Dec 22), crashes when trying to update a MEDIUMTEXT field inside InnoDB, from the stack dump, looks like a BTree problem/bug:

thd=0xa445408
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0x4eddcc, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x8171df0 handle_segfault + 480
0x20ce58 (?)
0x1 (?)
0x83678f5 btr_cur_update_in_place + 1221
0x8367ee3 btr_cur_optimistic_update + 643
0x83464ef row_upd_clust_rec + 1343
0x8345094 row_upd_clust_step + 804
0x834483f row_upd + 431
0x83439ec row_upd_step + 300
0x832d508 row_update_for_mysql + 504
0x821b14e _ZN11ha_innobase10update_rowEPKcPc + 238
0x81d46b0 _Z12mysql_updateP3THDP13st_table_listR4ListI4ItemES6_PS4_jP8st_orderm15enum_duplicates + 2288
0x8188a5d _Z21mysql_execute_commandP3THD + 3549
0x818df87 _Z11mysql_parseP3THDPcj + 279
0x8186558 _Z16dispatch_command19enum_server_commandP3THDPcj + 1096
0x81860ae _Z10do_commandP3THD + 158
0x81856c5 handle_one_connection + 613
0x206dec (?)
0x38ba2a (?)
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/Using_stack_trace.html and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0xa44acf0 = update Longvarcharnull_Tab set NULL_VAL='9223372036854775807'
thd->thread_id=1

How to repeat:
mysql> use test;
Database changed
mysql>  CREATE TABLE `Longvarcharnull_Tab` (
    ->   `NULL_VAL` mediumtext
    -> ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.04 sec)

mysql> insert into Longvarcharnull_Tab values (NULL), (NULL);
Query OK, 2 rows affected (0.00 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> update Longvarcharnull_Tab set NULL_VAL='9223372036854775807'; ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>
Number of processes running now: 0
041222 17:47:17  mysqld restarted
[22 Dec 2004 20:46] Mark Matthews
I tested this on 5.0.2, it works fine. Tried new datadir with 5.0.3 on original system, same problem. Tried compiling 5.0.3 on my development machine (FC3), same crash.
[22 Dec 2004 22:29] Mark Matthews
Dean in support tested this as well on his machine. Same crash, same stack trace.
[27 Dec 2004 16:55] Marko Mäkelä
I'm having a look at it.
[28 Dec 2004 0:11] Marko Mäkelä
The function rec_offs_nth_size() was implemented incorrectly, and thus an update-in-place was attempted when not possible.