Re: [sqlite] BLOB and TEXT comparisons

2019-07-13 Thread Darren Duncan
What's going on is that a Blob and a Text are logically different values and so can never possibly equal each other. Also they aren't represented by the same bytes either, because every value includes its type and the comparison is comparing the bytes indicating the type as well, which

Re: [sqlite] BLOB and TEXT comparisons

2019-07-12 Thread Clemens Ladisch
Charles Leifer wrote: > SELECT SUBSTR(?, 1, 3) == ? > > However, if I mix the types, e.g. sqlite3_bind_text("abcde") and > sqlite3_bind_blob("abc") then the comparison returns False. > > Fom a byte-to-byte perspective, this comparison should always return True. > > What's going on? Apparently,

[sqlite] BLOB and TEXT comparisons

2019-07-12 Thread Charles Leifer
I ran into a somewhat surprising result and wanted to just get a little clarification. I'll use the following statement as an example: SELECT SUBSTR(?, 1, 3) == ? And the parameters will be: * "abcde" * "abc" If I bind both parameters using the same type, the comparison returns True: *