Bug #51343 Field_blob::unpack() is broken
Submitted: 20 Feb 2010 10:56 Modified: 8 Oct 2010 7:54
Reporter: Sergei Golubchik Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: CPU Architecture:Any

[20 Feb 2010 10:56] Sergei Golubchik
Description:
Field_blob::unpack ignores the 'to' argument and unpacks the data into ptr, that is into record[0].

This seems to work for replication, as it always unpacks into record[0], but breaks for any storage engine that uses Field::pack/unpack (the methods that were initially introduced for storage engines, in particular - for BDB).

How to repeat:
see Field_blob::unpack ()

Suggested fix:
calling Field_blob::store() from Field_blob::unpack() is an overkill, Field_blob::pack() is simple, Field_blob::unpack can be just as simple.
[22 Feb 2010 14:00] MySQL Verification Team
Thank you for the bug report.
[22 Feb 2010 14:42] Sergei Golubchik
ok, now I think that Field_blob cannot support unpacking into anything else but record[0]. It allocates the memory and only can track one pointer.

Fine, but still it should not just silently update wrong record buffer.
It could have an assert that to == record[0], and in non-debug mode simply return without updating anything if that condition is false.
[7 Oct 2010 19:31] Sveta Smirnova
See bug #45413 also.
[8 Oct 2010 7:54] Georgi Kodinov
Duplicate of bug #45413.