Recently upgraded, and we ran into failures because references to vtables
(via opcode VOpen's p4 column) changed from vtab:module_ptr:vtable_ptr to
just vtab:vtable_ptr.

What was the intent behind this change?
How can code one determine the module the vtable is coming from now?

This is not a showstopper for us, because we have a single module and we
were just asserting it matched our "singleton" module, but I definitely
missed that in the release notes :)

I understand that https://www.sqlite.org/opcode.html doesn't explicitly say
what VOpen's p4 column will contain, so I guess one could argue this is
undocumented behavior we should not rely on, but the alternatives of query
parsing, w/o an SQLite-provided AST of its queries would be even worse IMHO.

Just trying to get clarification on this. Thanks, --DD

/*!
 * \brief Introspects the pcode (compiled query) of a view.
 *
 * Uses an EXPLAIN SQL statement to list all SQLite VDBE instructions a
simple
 * query accessing the view compiles into, and looks for \em TableLock and
 * \em VOpen opcodes, gathering their p4 arguments. In the case of VOpen,
uses
 * a virtual table specific introspection function.
 *
 * \param view_name a SQL view name.
 * \return the list of table or virtual tables accessed by that view.
 *
 * \sa VirtualSchema::find_by_pcode()
 *
 * \note this type of introspection should be much more reliable than trying
 *     to parse the SQL definition of the view, given SQL's complex grammar.
 */

Reply via email to