It is up to your xBestIndex method to confern this information to your xFilter 
method, e.g. by setting the idxStr return parameter in a way these methods 
understand (e.g. leave it pointing to a character that encodes the required 
comparison). The idxStr is passed to xFilter unchanged from what the specific 
call to xBestIndex returns. If the idxStr is dynamically allocated, it is a 
good idea to set the "idxStr needs to be freed" return parameter. Remember that 
there can be more than one call to xBestIndex while the SQLite Query Planner is 
trying to figure out the optimum plan.

-----Urspr?ngliche Nachricht-----
Von: sqlite-users-bounces at mailinglists.sqlite.org 
[mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von Johnny 
Wezel
Gesendet: Freitag, 13. November 2015 18:34
An: SQLite mailing list
Betreff: [sqlite] Information passing between xBestIndex and xFilter

I think there is a flaw in information passing between the xBestIndex and 
xFilter methods in virtual tables.

The information about the constraint operation in the aConstraint array can't 
reach xFilter. But how is xFilter to know how to set up the cursor when a 
statement like

SELECT * FROM MyTable WHERE a > 10

is given? I can pass the index covering a and I can make SQLite pass the 
constant 10 to xFilter, but not the > operation.

IMHO xBestIndex should be called after xOpen as opposed to before and have a 
cursor parameter so I can set up the whole filtering information on my terms.

Any thoughts on that?

Cheers,
Johnny
_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 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: hick at 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.


Reply via email to