Re: [sqlite] Opcodes missing from documentation

2016-12-23 Thread Hick Gunter
According to sqlite 3.7.14 code the equivalences are SorterInsert == IdxInsert, SorterSort == Sort and SorterNext == Next case OP_SorterInsert: /* in2 */ #ifdef SQLITE_OMIT_MERGE_SORT pOp->opcode = OP_IdxInsert; #endif case OP_IdxInsert: {/* in2 */ case OP_SorterNext:/* jump

[sqlite] Opcodes missing from documentation

2016-12-23 Thread David Raymond
I'm looking at some explain output and am looking for info at http://www.sqlite.org/opcode.html but am not seeing a couple of the opcodes listed there. Specifically I'm looking for "SorterInsert", "SorterSort" and "SorterNext". I'm assuming they're gonna be like the similarly named entries,

Re: [sqlite] Bug: Problem with ORDER BY UPPER(...) in conjunction with UNION

2016-12-23 Thread nomad
On Fri Dec 23, 2016 at 02:25:29PM +0100, Clemens Ladisch wrote: > Lukasz.Stela wrote: > >The following query returns an error "1st ORDER BY term does not match > >any column in the result set". > > This restriction comes from the SQL standard. > > >When I replace the UPPER (Name) by Name -

Re: [sqlite] Bug: Problem with ORDER BY UPPER(...) in conjunction with UNION

2016-12-23 Thread Clemens Ladisch
Lukasz.Stela wrote: >The following query returns an error "1st ORDER BY term does not match >any column in the result set". This restriction comes from the SQL standard. >When I replace the UPPER (Name) by Name - everything works correctly. In theory, it would be possible to sort by something

Re: [sqlite] Possible bug with union and join.

2016-12-23 Thread Simon Slavin
On 22 Dec 2016, at 5:55pm, Adrian Stachlewski wrote: > In this case I think that the best way to do this is cast integer column to > text. > CREATE VIEW id_map(id, name) as > SELECT CAST(id AS TEXT), name > FROM map_integer > UNION ALL > SELECT id, name > FROM

Re: [sqlite] Possible bug with union and join.

2016-12-23 Thread Adrian Stachlewski
Richard, Thank you for your answer. Datatypes in sqlite was always weird for me, mostly the fact that for example TEXT can be inserted in INTEGER column. In this case I think that the best way to do this is cast integer column to text. CREATE VIEW id_map(id, name) as SELECT CAST(id AS TEXT),