Michael,

I think part of the problem is that the "obviously" (or 'obviously',
ha) useful behavior here would be for single quoted arguments to
result in column interpretation. You're quite right to say that you
want to be told that your column doesn't exist--that is very helpful
information!. But if my understanding is correct, you *should* expect
a calculated index even though you don't *want* one because single
quoted arguments are always supposed to be interpreted as string
literals, not interpolated columns. So the correct behavior is the
unhelpful one, in this case.

tl;dr: You should expect something other than column interpretation
because single quoted arguments are never supposed to be interpolated,
even when that leads to not useful results (like indexing a string
literal).

(Please someone correct me if I'm wrong here. I'm a SQLite n00b who
managed to stumble onto a subtle problem while debugging Rails. =)

-Ersin

On Thu, Jan 26, 2017 at 3:26 PM, Michael Falconer
<michael.j.falco...@gmail.com> wrote:
> Ersin,
>
> apologies if I seem to be suffering from terminal thickness, but I still
> don't get it. Why would I expect anything other than column interpretation
> from a single quoted argument. I *want to be told* that my column does not
> exist, I don't want a calculated index so why should I be expecting one. On
> the other hand if I choose double quotes I'm probably doing something
> different. Maybe someone else should weigh in and the penny will finally
> drop if I am missing the point, but I'm still not seeing crawly things. :-)
>
>
> On 27 January 2017 at 10:01, Ersin Akinci <ersin.aki...@gmail.com> wrote:
>
>> Michael,
>>
>> If I understood DRH and Simon correctly, I think the cause for concern
>> is that SQLite should be interpreting the single quotes as a string
>> literal, yet it interprets it as a column. Perhaps it's a strange
>> example (i.e., why would you want to index a string literal?), but
>> still, the behavior deviates from what's expected, the expected
>> behavior being that we should get a calculated index.
>>
>> Best,
>> Ersin
>>
>> On Thu, Jan 26, 2017 at 2:56 PM, Michael Falconer
>> <michael.j.falco...@gmail.com> wrote:
>> > Simon,
>> >
>> > as I see it there is no problem here. Explicit quoting regardless, the
>> > column does not exist and an error is returned, isn't this the expected
>> > outcome? In the DRH quoted section a reason is presented as to why no
>> error
>> > is returned due to a built in default action. This may or may not be a
>> > point for further analysis (ie. is this an appropriate default) but I'm
>> not
>> > seeing obvious crawly things. Perhaps it's me missing something Simon but
>> > I'm not overly concerned about the above. Don't use double quotes (always
>> > single) and it would appear things are just fine. You'll get told if your
>> > column is non-existent.
>> >
>> >
>> > On 27 January 2017 at 00:12, Simon Slavin <slav...@bigfraud.org> wrote:
>> >
>> >>
>> >> On 25 Jan 2017, at 12:50pm, Simon Slavin <slav...@bigfraud.org> wrote:
>> >>
>> >> > Bug is as follows:
>> >>
>> >> Anyone ?  Did I miss something and you’re all too polite to point it
>> out ?
>> >>
>> >> Simon.
>> >> _______________________________________________
>> >> sqlite-users mailing list
>> >> sqlite-users@mailinglists.sqlite.org
>> >> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>> >>
>> >
>> >
>> >
>> > --
>> > Regards,
>> >      Michael.j.Falconer.
>> > _______________________________________________
>> > sqlite-users mailing list
>> > sqlite-users@mailinglists.sqlite.org
>> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>
>>
>>
>> --
>> Ersin Y. Akinci -- ersinakinci.com
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
> Regards,
>      Michael.j.Falconer.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



-- 
Ersin Y. Akinci -- ersinakinci.com
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to