MySQL Forums
Forum List  »  Custom Storage Engines

Re: internal row format for blob
Posted by: Jason B
Date: December 16, 2009 12:32PM

Figured this out:

Format for blob column as stored in buf (internal format). I'm on a 64 bit machine so my addresses are 8 bytes wide:

(size) (address)
XXXX XXXXXXXX

Size is an int representing size of blob and address is the address in memory where the blob is stored.

To get blob info:

uchar *blob
long long ptr
memcpy from buf to &ptr
blob = (uchar *)ptr

It works - not sure how "standard" an approach this is, or if there should be some additional checking on the pointer before casting it (casting numbers to pointers begets unease).

Options: ReplyQuote


Subject
Views
Written By
Posted
6297
December 15, 2009 07:39AM
Re: internal row format for blob
4020
December 16, 2009 12:32PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.