On Thu, Jun 28, 2018 at 11:48 AM Dominique Devienne <ddevie...@gmail.com> wrote: > > On Thu, Jun 28, 2018 at 11:18 AM Hick Gunter <h...@scigames.at> wrote: >> >> The xBestIndex function needs to call the sqlite_vtab_collation() function to query the collation name required for each constraint and return the appropriate index number. >> >> Subs: yes, yes, see above > > > Oh, great! Thanks Gunther!!! > > Richard, may I suggest https://www.sqlite.org/c3ref/vtab_collation.html to be mentioned or linked somewhere in https://www.sqlite.org/vtab.html? TIA. --DD
Hmmm, on second thought, https://www.sqlite.org/c3ref/vtab_collation.html seems to work with constraints only (i.e. WHERE clause), and not the sqlite3_index_info.aOrderBy[]... The second argument must be an index into the aConstraint[] array belonging > to the sqlite3_index_info structure passed to xBestIndex So SQLite cannot reliably use a vindex to optimize an Order By if a custom collation is used in the query? Is that a latent bug? And apparently this returns the collation of the query, instead of providing the vindex's "own" collation. Which implies that it's the xBestIndex impl that supposed to rule out the vindex, not SQLite itself? In other words, any xBestIndex impl which does *NOT* call sqlite3_vtab_collation is necessarily buggy, if one day a query using a different collation (than the vindex) somehow uses a plan using that vindex? There seems to be a lot of subtle things to consider here. Can more light be shed on this? In the vtab.html doc? Thanks, --DD _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users