Bug #33067 Update of CSV row incorrect for some BLOBs,
Submitted: 7 Dec 2007 16:48 Modified: 9 Apr 2008 16:23
Reporter: Tim Clark Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: CSV Severity:S2 (Serious)
Version:5.1.22 OS:Other (i5/OS v5r4 PASE)
Assigned to: Antony Curtis CPU Architecture:Any
Tags: BLOB, csv, UPDATE

[7 Dec 2007 16:48] Tim Clark
The CSV engine does not honor update requests for BLOB fields when the new and old field values have the same length. "Rows matched" is set to 1, but "Changed" is 0. Other engines (MyISAM and InnoDB) appear to handle this without a problem.

How to repeat:
create table csvtest (c1 tinyblob) engine=csv;
Query OK, 0 rows affected (0.07 sec)           
insert into csvtest values("This");            
Query OK, 1 row affected (0.02 sec)            
update csvtest set c1="That" where c1 = "This";
Query OK, 0 rows affected (0.01 sec)           
Rows matched: 1  Changed: 0  Warnings: 0       
select * from csvtest;                         
| c1   |                                       
| This |                                       
1 row in set (0.02 sec)
[3 Jan 2008 19:59] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:


ChangeSet@1.2649, 2008-01-03 11:58:35-08:00, antony@pcg5ppc.xiphis.org +4 -0
    "Update of CSV row incorrect for some BLOBs"
    when reading in rows, move blob columns into temporary storage not
    allocated by Field_blob class or else row update operation will
    alter original row and make mysql think that nothing has been changed.
  fix incrementing wrong statistic values.
[17 Jan 2008 19:17] Mattias Jonsson
OK to push.
[17 Jan 2008 22:22] Brian Aker
Looks good, push.
[17 Jan 2008 22:53] Antony Curtis
Queued to 5.1-engines and 6.0-engines repositories.
[27 Mar 2008 11:21] Bugs System
Pushed into 5.1.24-rc
[27 Mar 2008 17:53] Bugs System
Pushed into 6.0.5-alpha
[31 Mar 2008 20:01] Jon Stephens
Pushed into 5.1.23-ndb-6.3.11.
[9 Apr 2008 16:23] Jon Stephens
Documented in the 5.1.23-ndb-6.3.11, 5.1.24, and 6.0.5 changelogs as follows:

        The CSV engine did not honor update requests for BLOB columns when the
        new column value had the same length as the value to be updated.