Re: unsafe use of virtual table

[email protected]
Newsgroups gmane.comp.db.sqlite.general
Message-ID <[email protected]>
Ah I see now. Thank you Keith!

Tom

Message: 14
Date: Tue, 04 Feb 2020 14:57:06 -0700
From: "Keith Medcalf" <[email protected]>
To: "SQLite mailing list" <[email protected]>
Subject: Re: [sqlite] unsafe use of virtual table
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"


This is part of the trusted schema.

Virtual Tables and Functions can be labeled as DIRECT_ONLY, INNOCUOUS, or unlabeled.

INNOCUOUS virtual tables and functions can be used anywhere they are allowed including in the schema and views and indexes and so forth (provided that they would otherwise
 be permitted in that location).  DIRECT_ONLY virtual tables and functions can only be used from top-level SQL, ever.

Unlabeled virtual tables and views depend on whether or not the schema is trusted.  If the schema containing those things (in views, the schema definitions, etc) is untrus
ted, then those unlabeled virtual tables and functions are treated as DIRECT_ONLY.  If the schema is trusted, then there are no restrictions on the use of unlabeled virtua
l tables and functions.  The TEMP schema is always trusted since it must have always been created by the application/user and cannot have been a "crafted part" of the data
base.

The dbstat virtual table is DIRECT_ONLY meaning that since 3.30.0 it can only be used in top-level (directly issued) SQL and not in a view, even a view created in the temp
 database.

_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.