I am quite mixed, because I've had people who are working on
substantial apps have things happen which came down to this problem.
So, on the one hand, I wish it had never been this way, but, on the
other hand, if it changes I'm going to hear about it.

My best hope would be a PRAGMA or some other solution which allows
this to be tweaked, but I can see why that won't get a lot of buy-in
from your end.  Why I like this solution is that it might allow an app
like Gears to deprecate the string-based double-quotes, while
providing some transition period where you can still use them, but see
warnings somewhere (where?  Well, I haven't thought that far ahead).
Failing that, it would be nice to have a compile-time option, or even
just some easy way we can touch the code to revert the change.

I will admit that apps like Gears have special needs relative to many
of SQLite's other users.

-scott


On Thu, Aug 7, 2008 at 10:26 AM, D. Richard Hipp <[EMAIL PROTECTED]> wrote:
> String literals in SQL are suppose to be enclosed in single-quotes -
> Pascal-style.  Double-quotes are used around table and/or column names
> in cases where the name would otherwise be a keyword or when the name
> contains non-standard characters.
>
> But SQLite tries to be flexible and accommodating.  To this end, it
> accepts some non-standard quoting mechanisms:
>
>    1.  Names can be enclosed in [...] for compatibility with Access
> and SQLServer.
>    2.  Names can be enclosed in grave accents for compatibility with
> MySQL.
>    3.  Double-quoted names fall back to being string literals if
> there is no matching table or column name.
>
> In retrospect, (3) seems to be a bad idea.  It is accident-prone and
> leads to all kinds of confusion.  For example, if double-quotes are
> being used correctly (which is to say to quote table or column names)
> but a misspelling occurs in the name, the token reverts to being a
> string literal rather than throwing an error.  Or if a double-quoted
> string really is being used as a string literal, but later a new
> column is added to a table that has the same name as the string text,
> the string literal will suddenly take on the value of the column.  It
> seems like we have one or two problem reports per month on this
> mailing list that involve people using double-quoted names where they
> should be using single-quoted string literals instead.
>
> So I'm giving some thought to removing feature (3) above and
> disallowing double-quoted string literals.  My concern is, though,
> that this might break many existing applications.
>
> What opinion do you, gentle users, have of this matter?
>
> D. Richard Hipp
> [EMAIL PROTECTED]
>
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to