On Thu, Oct 11, 2012 at 10:20 AM, Pavel Ivanov <paiva...@gmail.com> wrote:
> On Thu, Oct 11, 2012 at 7:09 AM, Hamish Symington > <ham...@lightbluesoftware.com> wrote: > >> Note that I was mistaken earlier when I said that "X=Y" and "Y=X" should > >> result in the same answer. If X and Y have different default collating > >> sequences, then X=Y does not mean the same thing as Y=X and so the > answers > >> can be different. > > Right, I understand. Perhaps a brief note on the docs for the query > optimizer to remind people of this might be worth it - it seems slightly > counterintuitive, from a 'normal' user's point of view. > > Usage of appropriate collating function is not an optimizer feature, > it's property of SQLite data types. And it's well documented here > http://www.sqlite.org/datatype3.html (see section 6.1). Whether > optimizer chooses to use index or not depending on collating function > is also well documented. > > And yet the coding mistake in the SQL query was very subtle. It makes me wonder if we shouldn't somehow come up with a "warning" mechanism in SQLite to give developers a heads-up on error-prone constructs, such as using == between two columns with different default collating sequences... > Pavel > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users