On 6 Dec 2016, at 3:36pm, David Raymond <david.raym...@tomtom.com> wrote:

> It seems that the CASE expression results in NO AFFINITY as an expression, 
> and does not carry the affinity of "posted" even though it is a direct 
> reference to the field. Therefore the first bullet point in section 4.3 does 
> NOT get applied, and the text '1' does NOT get converted to an integer for 
> the comparison.

Right.

> I am a little confused though why bullet point 2 doesn't get applied then, 
> and the 1 from the case expression isn't treated as text.

Judging by what you’re seeing, the affinity of a column value is used in direct 
comparisons (=, <, etc.) as documented, but is not preserved in the result of a 
CASE statement.  It would be possible to check this by reading the source code, 
but your sample code is a pretty good demonstration of the behaviour.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to