Re: [sqlite] sqlite segfault on INNER JOIN ON (...) + WHERE fieldIN (list, of, items)

2019-02-19 Thread dave
... > To: SQLite mailing list > Subject: Re: [sqlite] sqlite segfault on INNER JOIN ON (...) > + WHERE fieldIN (list, of, items) > > > If you compile with assert() statements enabled (using the > --enable-debug option with ./configure or otherwise adding the > -DSQL

Re: [sqlite] sqlite segfault on INNER JOIN ON (...) + WHERE fieldIN (list, of, items)

2019-02-19 Thread Richard Hipp
Additional background: The optimization that caused this bug was an attempt to fix a performance regression reported here (https://www.mail-archive.com/sqlite-users@mailinglists.sqlite.org/msg113314.html) which was in turned caused by a fix to a prior bug here

Re: [sqlite] sqlite segfault on INNER JOIN ON (...) + WHERE fieldIN (list, of, items)

2019-02-19 Thread Richard Hipp
Further debugging hints (for those who are interested): If you compile with --enable-debug and run the script below, it will give you more information about what is going on in the bytecode: CREATE TABLE IF NOT EXISTS t1(id INTEGER PRIMARY KEY); INSERT INTO t1 VALUES(1); .eqp trace SELECT a.id

Re: [sqlite] sqlite segfault on INNER JOIN ON (...) + WHERE fieldIN (list, of, items)

2019-02-19 Thread Richard Hipp
If you compile with assert() statements enabled (using the --enable-debug option with ./configure or otherwise adding the -DSQLITE_DEBUG flag) then you will hit an assertion fault earlier. The problem is that the same ephemeral table - the in-memory table that is constructed to hold the RHS of the

Re: [sqlite] sqlite segfault on INNER JOIN ON (...) + WHERE fieldIN (list, of, items)

2019-02-19 Thread dave
> Wow; can confirm. I crashed it in my debugger in the > amalgamation of 3.27.1 > in the function SQLITE_PRIVATE RecordCompare > sqlite3VdbeFindCompare(UnpackedRecord *p) > > At line 80720, if( p->pKeyInfo->nAllField<=13 ) > > in that case: > pKeyInfo is NULL Lastly, if it helps, converting