On 8/19/16, Hick Gunter <h...@scigames.at> wrote: > It seems that SQLite is no longer honoring the aConstaintUsage[].omit flag > for constraints that do not have an aContraint[].argvIndex set.
I'm going to call this a bug-fix, not a break. Every term of the WHERE clause ought to be processed, either by SQLite itself, or by xFilter, or both. One should never completely ignore a WHERE-clause term. xFilter will only get involved if argvIndex is set. So if argvIndex is not set, the processing is solely up to SQLite. Hence, the omit flag should be ignored if argvIndex is not set. > > This breaks a feature of our virtual table implementation that allows > special hidden columns named in the WHERE clause to be interpreted as hints > (i.e. which virtual table index to use) or to speed up data transfer for our > partitioned table implementation (returning the composite record image > instead of n distinct fields therough 2 levels of SELECT statements). > > SQL syntax requires that they be named in an expression, but since their > value is not required the argvIndex is left at 0 (instead of having to > append unique index values, with SQLite generating arguments to xFilter that > are simply ignored). > > 3.13.0 opcodes: > > asql> explain select __table from cma_ct_card_42 where __table=0; > addr opcode p1 p2 p3 p4 p5 comment > ---- ------------- ---- ---- ---- ------------- -- ------------- > 0 Init 0 13 0 00 Return > 1 VOpen 0 0 0 vtab:6205C08 00 VColumn > 2 Explain 0 0 0 SCAN TABLE cma_ct_card_42 VIRTUAL > TABLE INDEX 0: 00 > 3 Integer 0 1 0 00 Int64 > 4 Integer 0 2 0 00 Int64 > 5 VFilter 0 11 1 00 VUpdate > 6 VColumn 0 35 3 00 VRename; > cma_ct_card_42.__table > 7 Ne 4 10 3 (BINARY) 53 Eq > 8 Copy 3 5 0 00 SCopy > 9 ResultRow 5 1 0 00 CollSeq > 10 VNext 0 6 0 00 Init > 11 Close 0 0 0 00 ColumnsUsed > 12 Halt 0 0 0 00 Integer > 13 Integer 0 4 0 00 Int64 > 14 Goto 0 1 0 00 Gosub > > 3.7.14.1 opcodes: > > asql> explain select __table from cma_ct_card_05 where __table=0; > addr opcode p1 p2 p3 p4 p5 comment > ---- ------------- ---- ---- ---- ------------- -- ------------- > 0 Trace 0 0 0 00 NULL > 1 Integer 0 1 0 00 NULL > 2 Goto 0 12 0 00 NULL > 3 VOpen 0 0 0 vtab:1D32698:2B178127BA70 00 NULL > 4 Integer 0 2 0 00 NULL > 5 Integer 0 3 0 00 NULL > 6 VFilter 0 10 2 00 NULL > 7 VColumn 0 35 5 00 > cma_ct_card_05.__table > 8 ResultRow 5 1 0 00 NULL > 9 VNext 0 7 0 00 NULL > 10 Close 0 0 0 00 NULL > 11 Halt 0 0 0 00 NULL > 12 Goto 0 3 0 00 NULL > > > ___________________________________________ > Gunter Hick > Software Engineer > Scientific Games International GmbH > FN 157284 a, HG Wien > Klitschgasse 2-4, A-1130 Vienna, Austria > Tel: +43 1 80100 0 > E-Mail: h...@scigames.at > > This communication (including any attachments) is intended for the use of > the intended recipient(s) only and may contain information that is > confidential, privileged or legally protected. Any unauthorized use or > dissemination of this communication is strictly prohibited. If you have > received this communication in error, please immediately notify the sender > by return e-mail message and delete all copies of the original > communication. Thank you for your cooperation. > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users