*** DRAFT ***

SQLite Requirement Matrix Details
stmt_readonly.html

Index Summary Markup Original


R-23332-64992-62836-09715-29451-35524-14907-15195 tcl slt th3 src

The sqlite3_stmt_readonly(X) interface returns true (non-zero) if and only if the prepared statement X makes no direct changes to the content of the database file.

th3/cov1/vdbeapi14.test:34

/* IMP: R-23332-64992 */
# EVIDENCE-OF: R-23332-64992 The sqlite3_stmt_readonly(X) interface
# returns true (non-zero) if and only if the prepared statement X makes
# no direct changes to the content of the database file.

R-21769-42523-56036-07125-49513-08938-03164-12762 tcl slt th3 src

For example, if an application defines a function "eval()" that calls sqlite3_exec(), then the following SQL statement would change the database file through side-effects:

SELECT eval('DELETE FROM t1') FROM t2;

But because the SELECT statement does not change the database file directly, sqlite3_stmt_readonly() would still return true.

th3/cov1/vdbeapi14.test:105

/* IMP: R-21769-42523 */
# EVIDENCE-OF: R-21769-42523 For example, if an application defines a
# function "eval()" that calls sqlite3_exec(), then the following SQL
# statement would change the database file through side-effects: SELECT
# eval('DELETE FROM t1') FROM t2; But because the SELECT statement does
# not change the database file directly, sqlite3_stmt_readonly() would
# still return true.

R-07474-04783-61557-15842-18544-20982-63471-50658 tcl slt th3 src

Transaction control statements such as BEGIN, COMMIT, ROLLBACK, SAVEPOINT, and RELEASE cause sqlite3_stmt_readonly() to return true, since the statements themselves do not actually modify the database but rather they control the timing of when other statements modify the database.

th3/cov1/vdbeapi14.test:66

/* IMP: R-07474-04783 */
# EVIDENCE-OF: R-07474-04783 Transaction control statements such as
# BEGIN, COMMIT, ROLLBACK, SAVEPOINT, and RELEASE cause
# sqlite3_stmt_readonly() to return true, since the statements
# themselves do not actually modify the database but rather they control
# the timing of when other statements modify the database.

R-37014-01401-21089-17070-29691-04562-53032-12534 tcl slt th3 src

The ATTACH and DETACH statements also cause sqlite3_stmt_readonly() to return true since, while those statements change the configuration of a database connection, they do not make changes to the content of the database files on disk.

th3/cov1/vdbeapi14.test:58

/* IMP: R-37014-01401 */
# EVIDENCE-OF: R-37014-01401 The ATTACH and DETACH statements also cause
# sqlite3_stmt_readonly() to return true since, while those statements
# change the configuration of a database connection, they do not make
# changes to the content of the database files on disk.

R-36961-63052-16205-51009-18443-35672-28780-03927 tcl slt th3 src

The sqlite3_stmt_readonly() interface returns true for BEGIN since BEGIN merely sets internal flags, but the BEGIN IMMEDIATE and BEGIN EXCLUSIVE commands do touch the database and so sqlite3_stmt_readonly() returns false for those commands.

th3/cov1/vdbeapi14.test:72

/* IMP: R-36961-63052 */
# EVIDENCE-OF: R-36961-63052 The sqlite3_stmt_readonly() interface
# returns true for BEGIN since BEGIN merely sets internal flags, but the
# BEGIN IMMEDIATE and BEGIN EXCLUSIVE commands do touch the database and
# so sqlite3_stmt_readonly() returns false for those commands.