Re: SQLite and pike strings in bindings

"H. William Welliver III" <[email protected]> Sat, 8 Jul 2017 00:07:57 -0400
Newsgroups gmane.comp.lang.pike.user
Message-ID <[email protected]>
This old conversation got re-opened recently… 

I’ve committed a fix for the SQLite binding in 8.1 and 8.0 that stores string values as unicode strings. This should cause the binding to store data in a way that works properly with bound and direct queries. I believe the commit to 8.0 was warranted because any reasonable attempt to use the SQLite bindings would have failed without using extremely contorted logic. 

Additionally, I’ve added support for using single-value multisets to store values as binary (BLOB) values, as found in the Oracle glue. I haven’t committed tests, but will do so in the next day or two.

Please let me know if there are any questions or concerns about this change.

Bill

> On May 4, 2012, at 11:11 AM, Henrik Grubbström <[email protected]> wrote:
> 
> On Thu, 19 Apr 2012, Marc Dirix wrote:
> 
>> Op 18-04-12 19:30, [email protected] schreef:
>>> The shift indicates how much room each character in a string
>>> uses. Thus shift 0 =>  1 byte/character, shift 1 =>  2 bytes, shift 3 =>
>>> 4 bytes/character.
>> I suspect that the original implementor has chosen BLOB as an easy way to store both binary data as well as strings contained in pike-strings. But forgot to consider the mixed results one later get's when using selected with in-query strings.
>> 
>> On the SQLite website [1] TEXT is defined as being string which is encodable in UTF-8, UTF-16BE or UTF-16LE.
>> In my understanding 1 byte/character should be encodable in those three, so I propose changing this to always use
>> TEXT instead of blob when the pike string is nonbinary (8bit).
> 
> If I remember correctly, the Oracle glue uses strings wrapped in multisets to indicate BLOBS in bindings. This should be doable in the SQLite case as well.
> 
> --
> Henrik Grubbström					[email protected]
> Roxen Internet Software AB