Re: [sqlite] Possible bug: wrong query result when using an index

2010-12-06 Thread Gavrie Philipson
Richard Hipp writes: > > FYI: This is a real problem. We were just about to release SQLite version > 3.7.4 when Gavrie's email appeared. The 3.7.4 release will be delayed so > that we can fix this. The delay will probably be about a week. > > Bisecting shows that the problem has been in the

Re: [sqlite] Possible bug: wrong query result when using an index

2010-12-06 Thread Richard Hipp
FYI: This is a real problem. We were just about to release SQLite version 3.7.4 when Gavrie's email appeared. The 3.7.4 release will be delayed so that we can fix this. The delay will probably be about a week. Bisecting shows that the problem has been in the code since at least 2009-08-13. Bu

Re: [sqlite] Possible bug: wrong query result when using an index

2010-12-06 Thread Gavrie Philipson
Gerry Snyder writes: ... > The changes were to use the real column names and not the aliases from the > SELECT clause. > > I believe the problem arises (and the book "Using SQLite" explains it a lot > better than I can) because the FROM and WHERE clauses are executed before > the SELECT clause.

Re: [sqlite] Possible bug: wrong query result when using an index

2010-12-05 Thread Gerry Snyder
On Sun, Dec 5, 2010 at 7:25 AM, Gavrie Philipson wrote: > Hi, > > > The query is as follows: > > SELECT entry_type AS entry_type_int, entry_types.name as > entry_type_name, entry_id > FROM timeline JOIN entry_types ON entry_type_int = entry_types.id > WHERE > (entry_type_name = 'cli_command'

[sqlite] Possible bug: wrong query result when using an index

2010-12-05 Thread Gavrie Philipson
Hi, I'd like to report a possible bug in SQLite that causes a query to give wrong results when an index exists on one of the columns. Without the index the results are correct. I have honed down the data to the smallest possible set that still shows the bad behavior. The behavior was observed wit