On 8/31/17, Sharon Casaletto <shar...@tibco.com> wrote: > > I've implemented a virtual table and in my xColumn() method I'm using > sqlite3_value_subtype() to indicate when my SQLITE_TEXT columns need some > different processing when I'm retrieving the columns of my query results. > I've found that the subtype setting is [not] getting preserved for some reason > when my query includes GROUP BY or ORDER BY. > > Any ideas why this could be happening? Is this the expected behavior? I'm > running SQLite version 3.19.3.
That is documented behavior. The subtype is an *ephemeral* in-memory tag that exists only while a value is held in registers of the virtual machine that runs the SQL statement. The subtype is not an attribute of the value that is written to secondary storage. Nor is the subtype preserved by the sorter. The subtype was originally created to facilitate nesting of JSON primitive functions in the JSON1 extension. The subtype has subsequently been used to help the full-text search engine pass information into auxiliary functions such as snippet(). If you need an long-lived tag that can be persisted to secondary storage and/or run through a sorter, then the subtype will not work for you. You'll need to come up with a different mechanism. All of the above also applies to sqlite3_result_pointer(). -- 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