[sqlite] sqlite bug report

2014-11-13 Thread Hinrichsen, John
The following SQL produces an incorrect result with sqlite-3.8.7.1: CREATE TABLE A( symbol TEXT, type TEXT ); INSERT INTO A VALUES('ABCDEFG','chars'); INSERT INTO A VALUES('1234567890','num'); CREATE TABLE B( chars TEXT, num TEXT ); CREATE TABLE IF NOT EXISTS C AS SELECT A.symbol AS

Re: [sqlite] sqlite bug report

2014-11-13 Thread Hinrichsen, John
in trunk and will be fixed in 3.8.7.2. On Thu, Nov 13, 2014 at 1:05 PM, Hinrichsen, John jhinrich...@c10p.com wrote: The following SQL produces an incorrect result with sqlite-3.8.7.1: CREATE TABLE A( symbol TEXT, type TEXT ); INSERT INTO A VALUES('ABCDEFG','chars'); INSERT

Re: [sqlite] column affinity and the query planner's use of indices

2014-07-09 Thread Hinrichsen, John
*. - Otherwise, an expression has NONE affinity. On Tue, Jul 8, 2014 at 7:31 PM, Simon Slavin slav...@bigfraud.org wrote: On 8 Jul 2014, at 11:11pm, Hinrichsen, John jhinrich...@c10p.com wrote: This applies when creating a table using a SELECT where a column is the result of an expression

Re: [sqlite] affinity critical problem with 3.8.5 - IN single value optimisation

2014-07-08 Thread Hinrichsen, John
This is a nasty bug; I do not see any follow-up regarding a fix. On Thu, Jun 26, 2014 at 9:17 AM, Guillaume Fougnies guilla...@eulerian.com wrote: Hi, It seems there's a problem with 3.8.5 and its affinity behavior. It's quite critical. --- CUT --- sqlite CREATE TABLE T (v text); sqlite

Re: [sqlite] column affinity and the query planner's use of indices

2014-07-08 Thread Hinrichsen, John
intuitive: why should aggregate functions like min(), max(), and sum() return column data stripped of the original column affinity? On Fri, May 23, 2014 at 2:21 PM, Hinrichsen, John jhinrich...@c10p.com wrote: At table creation time, when column types are not declared explicitly, or are produced

Re: [sqlite] column affinity and the query planner's use of indices

2014-07-08 Thread Hinrichsen, John
, Hinrichsen, John jhinrich...@c10p.com wrote: Hi, Would you consider changing the column affinity determination rules Probably not. There are over a half million apps (literally) in circulation that use the existing rules. Changing the rules would break some fraction of those half-million apps

Re: [sqlite] column affinity and the query planner's use of indices

2014-07-08 Thread Hinrichsen, John
, and behave like SQL as understood by other DBs. An alternative might be to make SQLite consistently use indices regardless of column affinity. On Tue, Jul 8, 2014 at 1:47 PM, Simon Slavin slav...@bigfraud.org wrote: On 8 Jul 2014, at 6:16pm, Hinrichsen, John jhinrich...@c10p.com wrote

[sqlite] column affinity and the query planner's use of indices

2014-05-23 Thread Hinrichsen, John
At table creation time, when column types are not declared explicitly, or are produced by an expression, column affinity defaults to NONE, with the result that indexes added afterwards often go unused in joins because of a column affinity mismatch. Adding casts around the expressions is an

Re: [sqlite] performance regression: sqlite-3.8.4.3 is not using an automatic covering index when joining with a where condition

2014-05-08 Thread Hinrichsen, John
to make calls to scalar functions more efficiently within the context of the join. On Wed, May 7, 2014 at 8:30 PM, Richard Hipp d...@sqlite.org wrote: On Wed, May 7, 2014 at 6:58 PM, Hinrichsen, John jhinrich...@c10p.com wrote: On Wed, May 7, 2014 at 5:21 PM, Richard Hipp d...@sqlite.org

[sqlite] performance regression: sqlite-3.8.4.3 is not using an automatic covering index when joining with a where condition

2014-05-07 Thread Hinrichsen, John
$ sqlite3 SQLite version 3.7.17 2013-05-20 00:56:22 Enter .help for instructions Enter SQL statements terminated with a ; sqlite CREATE TABLE x AS SELECT 1 AS a, 1 AS b; sqlite CREATE INDEX ix ON x (a); sqlite CREATE TABLE y AS SELECT 1 AS b; sqlite EXPLAIN QUERY PLAN SELECT * FROM x INNER JOIN y

Re: [sqlite] performance regression: sqlite-3.8.4.3 is not using an automatic covering index when joining with a where condition

2014-05-07 Thread Hinrichsen, John
On Wed, May 7, 2014 at 5:21 PM, Richard Hipp d...@sqlite.org wrote: Do you have a database file where the 3.8.4.3 query plan really is slower? Can you please run ANALYZE on that database and send us the content of the sqlite_stat1 table? It is true that if we add the analyze, the query does

[sqlite] group_concat(distinct) with empty strings

2014-05-06 Thread Hinrichsen, John
Are the results below expected? $ sqlite3 SQLite version 3.8.4.3 2014-04-03 16:53:12 Enter .help for usage hints. Connected to a transient in-memory database. Use .open FILENAME to reopen on a persistent database. sqlite CREATE TABLE z AS SELECT NULL AS a; sqlite SELECT (SELECT DISTINCT

[sqlite] problem with INSERT after ALTER TABLE ... ADD COLUMN ... DEFAULT ... performed on source table

2014-04-25 Thread Hinrichsen, John
Default non-NULL values copied from a column that was added using ALTER TABLE ... ADD COLUMN ... DEFAULT ... are inserted into another table as NULLs when copied using INSERT INTO ... SELECT * FROM ... However, the same values are propagated correctly when CREATE TABLE ... AS SELECT * FROM ... is

[sqlite] Join of two virtual tables returns incorrect result set in 3.8.4.1

2014-04-03 Thread Hinrichsen, John
pastbin.com. On Wed, Apr 2, 2014 at 6:42 PM, Andy Goth andrew.m.g...@gmail.com wrote: On 4/2/2014 4:52 PM, Hinrichsen, John wrote: sqlite 3.8.4.1 can return an incorrect result when joining two virtual tables that are themselves based on underlying sqlite tables. This problem does not happen

Re: [sqlite] Join of two virtual tables returns incorrect result set in 3.8.4.1

2014-04-03 Thread Hinrichsen, John
That was a fast turn-around. Thank you for addressing this issue so quickly! -- This message contains confidential information and is intended only for the individual named. If you are not the named addressee, you should not disseminate, distribute, alter or copy this e-mail. Please notify

[sqlite] Join of two virtual tables returns incorrect result set in 3.8.4.1

2014-04-02 Thread Hinrichsen, John
sqlite 3.8.4.1 can return an incorrect result when joining two virtual tables that are themselves based on underlying sqlite tables. This problem does not happen with sqlite 3.8.3.1 or earlier. Please see the attached repro. -- This message contains confidential information and is intended