aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
diff options
context:
space:
mode:
authordan <Dan Kennedy>2023-02-28 19:39:59 +0000
committerdan <Dan Kennedy>2023-02-28 19:39:59 +0000
commit45163fc45e138c5af15b24ea88c31c8b54581cec (patch)
tree39cc1ba9dea6eb92d17a11c3cf0de5b2bca2a8f4 /src/sqliteInt.h
parent4990fc84f1586662caab919ad8eadc052f668572 (diff)
downloadsqlite-45163fc45e138c5af15b24ea88c31c8b54581cec.tar.gz
sqlite-45163fc45e138c5af15b24ea88c31c8b54581cec.zip
Add an sqlite3_db_config() option - SQLITE_DBCONFIG_STMT_SCANSTATS - for enabling and disabling the collection of sqlite3_stmt_scanstats() statistics in SQLITE_ENABLE_STMT_SCANSTATUS builds. Collection of statistics is disabled by default.
FossilOrigin-Name: 0f5579bef27b84ee855065cfe87703c51e1f9773906a9e0d4e4dafc90bd0e553
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r--src/sqliteInt.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 40afc08db..21ad2fa7e 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -1757,7 +1757,7 @@ struct sqlite3 {
#define SQLITE_NullCallback 0x00000100 /* Invoke the callback once if the */
/* result set is empty */
#define SQLITE_IgnoreChecks 0x00000200 /* Do not enforce check constraints */
-#define SQLITE_ReadUncommit 0x00000400 /* READ UNCOMMITTED in shared-cache */
+#define SQLITE_StmtScanStats 0x00000400 /* Enable stmt_scanstats() counters */
#define SQLITE_NoCkptOnClose 0x00000800 /* No checkpoint on close()/DETACH */
#define SQLITE_ReverseOrder 0x00001000 /* Reverse unordered SELECTs */
#define SQLITE_RecTriggers 0x00002000 /* Enable recursive triggers */
@@ -1783,6 +1783,7 @@ struct sqlite3 {
/* DELETE, or UPDATE and return */
/* the count using a callback. */
#define SQLITE_CorruptRdOnly HI(0x00002) /* Prohibit writes due to error */
+#define SQLITE_ReadUncommit HI(0x00004) /* READ UNCOMMITTED in shared-cache */
/* Flags used only if debugging */
#ifdef SQLITE_DEBUG
@@ -5581,4 +5582,10 @@ int sqlite3KvvfsInit(void);
sqlite3_uint64 sqlite3Hwtime(void);
#endif
+#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
+# define IS_STMT_SCANSTATUS(db) (db->flags & SQLITE_StmtScanStats)
+#else
+# define IS_STMT_SCANSTATUS(db) 0
+#endif
+
#endif /* SQLITEINT_H */