Just to Add to what Ralf and David already pointed out:

Works for me on 3.18, not in 3.20.1 and more importantly,  the sqlite_stat1 table itself seems to have zero impact, once Analyze is run, the query always does not work, even if you drop the sqlite_stat1 table or mess with its values.


Hope the point is useful,
Cheers


On 2017/11/20 5:39 PM, Ralf Junker wrote:
I am presenting a scenario where a SELECT produces a different result after running ANALYZE.

To reproduce, download this database file (5.6MB, SHA1 12d1295d06327ee19ed2453517b0dd83233c6829, available for two days from now):

https://expirebox.com/download/328baafe26688579fccd55debfc54ad3.html

This SQL returns a single result row with a value of 1:

SELECT DISTINCT t2.a FROM t1
 INNER JOIN t2 ON t1.t2_id = t2.id
 WHERE t1.t2_id <> -1;

Then run ANALYZE and run the above select again. This time I receive no result.

Assuming that SQL SELECTs should always return the same results regardless of optimization, I assume that this might be a bug in SQLite.

Tested with the SQLite 3.21.0 CLI on Windows.

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

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

Reply via email to