Hi Dan,

Right, this is one more reason for having in the DB API a clear 
distinction between the string-like and blob-like types.

Regards,
Bogdan

Dan Pascu wrote:
> On Monday 21 April 2008, Henning Westerholt wrote:
>   
>> On Sunday 20 April 2008, Bogdan-Andrei Iancu wrote:
>>     
>>> I think option 2 will be better, mainly because we have 2 different
>>> data types - BLOB cannot be 100% mapped over string as BLOB was
>>> specifically design for:
>>>      1) large amount of data (not suitable for STRING)
>>>      2) data containing any kind of chars/bytes (not suitable for
>>> STRING, like \0)
>>>
>>> For BLOB processing, most of the database libs provide specific
>>> function to escape, un-escape data when comes to BLOB, and such code
>>> already exists in openser.
>>>
>>> Also, this will maintain some consistency at the data level and avoid
>>> mixing them (and create confusion).
>>>       
>> Hi Bogdan,
>>
>> according to http://dev.mysql.com/doc/refman/5.0/en/blob.html TEXT
>> colums are treated as non-binary strings, so its not allowed to store
>> binary data in them. So the usage of the specific escaping functions is
>> not really necessary. But the length argument is valid anyway.
>>     
>
> The usage of escaping is always necessary to avoid SQL injections.
>
> On a side note, TEXT and BLOB in mysql are limited to 64k. If one plans to 
> store presence related xml documents in such a column, be aware that they 
> can easily exceed 64k, which means that most likely a LONGTEXT or 
> LONGBLOB should be used.
>
>   


_______________________________________________
Devel mailing list
Devel@lists.openser.org
http://lists.openser.org/cgi-bin/mailman/listinfo/devel

Reply via email to