List:MySQL++« Previous MessageNext Message »
From:Bill K Date:January 9 2007 12:43am
Subject:Re: inserting a vector into a MySQL blob field
View as plain text  

Michael Hanselmann wrote:
> Hello Daniel
>
> On Sun, Jan 07, 2007 at 03:49:43PM +0000, Daniel Thorpe wrote:
>   
>> I'm trying to store a vector of doubles into a blob field in a mysql  
>> database, along with the size of the vector in another field.
>>     
>
> Don't do that. Even if you could get it to work, you'll only have
> issues. Different architectures save numbers in different ways (Big and
> Little Endian, for example). At least for integers, you could also have
> problems between 32 and 64 bit architectures. You should create another
> table with a float column referencing the main table.
>   
Or use some kind of encapsulation such as Ice's serialization support.
http://www.zeroc.com/

I've used Ice to serialize vectors (and other arbitrary types) and store 
them in a blob for later retrieval and de-serialization.

- Bill Krahmer
> Greets,
> Michael
>
>   
Thread
inserting a vector into a MySQL blob fieldDaniel Thorpe7 Jan
  • Re: inserting a vector into a MySQL blob fieldMichael Hanselmann7 Jan
    • Re: inserting a vector into a MySQL blob fieldBill K9 Jan
  • Re: inserting a vector into a MySQL blob fieldWarren Young9 Jan