Bug #14517 Table corruption when running an UPDATE statement
Submitted: 31 Oct 2005 17:35 Modified: 31 Oct 2005 19:22
Reporter: Raymond DeRoo Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S1 (Critical)
Version:5.0.15 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[31 Oct 2005 17:35] Raymond DeRoo
Description:
Data corruption with the InnoDB engine when running an update query. An example is given below. This has been confirmed happening on both Linux and Windows.

mysql> select ProductKey, InsertionOrder, Id from Campaign limit 10;
+------------+----------------+--------+
| ProductKey | InsertionOrder | Id |
+------------+----------------+--------+
| 1 | | demo |
| 2 | NULL | Camp_A |
| 2 | | Camp_B |
| 2 | NULL | Camp_C |
| 2 | | Camp_D |
| 1 | NULL | sv |
| 1 | NULL | qw |
| 4 | NULL | C0001 |
| 4 | | C1002 |
| 4 | | C1003 |
+------------+----------------+--------+
10 rows in set (0.00 sec)

mysql> update Campaign set InsertionOrder = '' where InsertionOrder is NULL;
Query OK, 102 rows affected (0.02 sec)
Rows matched: 102 Changed: 102 Warnings: 0

mysql> select ProductKey, InsertionOrder, Id from Campaign limit 10;
+-------------+----------------+--------+
| ProductKey | InsertionOrder | Id |
+-------------+----------------+--------+
| 1 | | demo |
| 2 | NULL | Camp_A |
| 2 | | Camp_B |
| 2 | NULL | Camp_C |
| -2147483646 | | Camp_D |
| 1 | NULL | sv |
| 1 | NULL | qw |
| 4 | NULL | C0001 |
| 4 | | C1002 |
| 4 | | C1003 |
+-------------+----------------+--------+
10 rows in set (0.00 sec)

How to repeat:
Load the attached dumpfile then run the following query.

mysql5.0> UPDATE Campaign SET InsertionOrder = '' WHERE InsertionOrder IS NULL;
[31 Oct 2005 19:22] Heikki Tuuri
Hi!

This is a duplicate of:

http://bugs.mysql.com/bug.php?id=13900

It is already fixed in 5.0.16.

Regards,

Heikki