Bug #1165 server crash on select statement
Submitted: 29 Aug 2003 10:07 Modified: 2 Sep 2003 10:57
Reporter: Vincent Fumo Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.0.14 OS:Windows (win 2000 pro)
Assigned to: CPU Architecture:Any

[29 Aug 2003 10:07] Vincent Fumo
Description:
The mysqld process locks up and will not respond to any service restarts after I enter the following SQL statement (which on other rows I have executed successfully in the past):

mysql> UPDATE element SET name='name' WHERE elementID = 51;

I have tried this in the command line client as well as the MySQL Control Center application (0.9.2 beta). 

The listing from the .err file is :

030829 12:57:26  InnoDB: Started
MySql: ready for connections.
Version: '4.0.14-max-debug'  socket: ''  port: 3306
Assertion failed: pos != (~(my_off_t) 0), file c:\build\build\mysql-4.0.14\mysys\my_seek.c, line 31

I'm guessing perhaps something has become corrupted in my database (which I can send you). Becasue this bug irreperably stops the server, I need to restart the PC every time I want to test another statement. I will attemt to test this on other tables in the database. If you contact me I will have more to report. 

How to repeat:
I have repeated this 3 times so far using the same statement. Obviously it has something to do with the current state of my data since it is nothing more than a regular UPDATE command.
[29 Aug 2003 10:20] Vincent Fumo
I've added the 'data' folder so you can attemt to recreate the error.
[29 Aug 2003 10:32] Vincent Fumo
Ok...I've tested things further. I can perform select and update statements just fine on other rows of this and the other tables in my database. I tried to DELETE the offending row from element (elementID = 51) and again crashed. I'm guessing that something is screwed up with this particular row. 

Is there a way I can remove this row and save my table?
[30 Aug 2003 11:53] MySQL Verification Team
We need elements table in order to reproduce the error.

You can upload a gzipped or zipped dump of that table to:

ftp://support.mysql.com:/pub/mysql/Incoming

and let us know a file name.
[2 Sep 2003 7:08] Indrek Siitan
I assume you have meant the 'element' table in the 'ed_test' database
provided in the data.zip file.

This table is simply crashed and needs a repair:

mysql> check table element;
+-----------------+-------+----------
+--------------------------------------------------------+
| Table           | Op    | Msg_type | Msg_text                                               |
+-----------------+-------+----------
+--------------------------------------------------------+
| ed_test.element | check | warning  | 4 clients is using or hasn't closed the table properly |
| ed_test.element | check | warning  | Not used space is supposed to be: 44 but is: 0         |
| ed_test.element | check | error    | record delete-link-chain corrupted                     |
| ed_test.element | check | error    | Corrupt                                                |
+-----------------+-------+----------
+--------------------------------------------------------+
4 rows in set (0.00 sec)

Please repair the table with REPAIR TABLE and try again.
[2 Sep 2003 7:38] Vincent Fumo
yes...that did the trick..sorry, I'm a newbie...
[2 Sep 2003 10:57] Sergei Golubchik
Though the table was corrupted it absolutely should not crash or hang the server, so the bugreport is valid.
(by the way, if you ever notice again that mysqld crashes or hangs - never hesitate to report the bug!)

But I failed to repeat it on the latest mysql-4.0.15 tree:

mysql> UPDATE element SET name='name' WHERE elementID = 51;
ERROR 1030: Got error 134 from storage engine

and

% perror 134
Error code 134:  Unknown error: 134
134 = Record was already deleted (or record file crashed)

so the table is correctly reported as corrupted.

Most probably the bug was already fixed since 4.0.14