aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2023-03-06 19:04:39 +0000
committerdrh <>2023-03-06 19:04:39 +0000
commitf30da226e3461eb11e67795ad7a28fa8f5a371a3 (patch)
tree4c10af3933ec9d1b8578c4362a9534d348fe648e /src
parenteac6e8cb6a177500422de07f75a089cad162c5f2 (diff)
downloadsqlite-f30da226e3461eb11e67795ad7a28fa8f5a371a3.tar.gz
sqlite-f30da226e3461eb11e67795ad7a28fa8f5a371a3.zip
Add SQLITE_DBCONFIG_REVERSE_SCANORDER for direct C-language access to the
"PRAGMA reverse_unordered_selects" setting. FossilOrigin-Name: 83e84531b46814aea6dad1ce8283cb9f6b90ad52badb60b875ea8f66e4ac0925
Diffstat (limited to 'src')
-rw-r--r--src/main.c1
-rw-r--r--src/shell.c.in2
-rw-r--r--src/sqlite.h.in19
3 files changed, 18 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 23010d5fc..3f03a5c1e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -971,6 +971,7 @@ int sqlite3_db_config(sqlite3 *db, int op, ...){
{ SQLITE_DBCONFIG_LEGACY_FILE_FORMAT, SQLITE_LegacyFileFmt },
{ SQLITE_DBCONFIG_TRUSTED_SCHEMA, SQLITE_TrustedSchema },
{ SQLITE_DBCONFIG_STMT_SCANSTATUS, SQLITE_StmtScanStatus },
+ { SQLITE_DBCONFIG_REVERSE_SCANORDER, SQLITE_ReverseOrder },
};
unsigned int i;
rc = SQLITE_ERROR; /* IMP: R-42790-23372 */
diff --git a/src/shell.c.in b/src/shell.c.in
index 944f65562..b76e44f45 100644
--- a/src/shell.c.in
+++ b/src/shell.c.in
@@ -8169,6 +8169,8 @@ static int do_meta_command(char *zLine, ShellState *p){
{ "load_extension", SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION },
{ "no_ckpt_on_close", SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE },
{ "reset_database", SQLITE_DBCONFIG_RESET_DATABASE },
+ { "reverse_scanorder", SQLITE_DBCONFIG_REVERSE_SCANORDER },
+ { "stmt_scanstatus", SQLITE_DBCONFIG_STMT_SCANSTATUS },
{ "trigger_eqp", SQLITE_DBCONFIG_TRIGGER_EQP },
{ "trusted_schema", SQLITE_DBCONFIG_TRUSTED_SCHEMA },
{ "writable_schema", SQLITE_DBCONFIG_WRITABLE_SCHEMA },
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index 9dd023821..ec63e52c7 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -2456,7 +2456,7 @@ struct sqlite3_mem_methods {
** not considered a bug since SQLite versions 3.3.0 and earlier do not support
** either generated columns or decending indexes.
** </dd>
-
+**
** [[SQLITE_DBCONFIG_STMT_SCANSTATUS]]
** <dt>SQLITE_DBCONFIG_STMT_SCANSTATUS</td>
** <dd>The SQLITE_DBCONFIG_STMT_SCANSTATUS option is only useful in
@@ -2465,7 +2465,17 @@ struct sqlite3_mem_methods {
** statistics. For statistics to be collected, the flag must be set on
** the database handle both when the SQL statement is prepared and when it
** is stepped. The flag is set (collection of statistics is enabled)
-** by default.
+** by default.</dd>
+**
+** [[SQLITE_DBCONFIG_REVERSE_SCANORDER]]
+** <dt>SQLITE_DBCONFIG_REVERSE_SCANORDER</td>
+** <dd>The SQLITE_DBCONFIG_REVERSE_SCANORDER option change the default order
+** in which tables and indexes are scanned so that the scans start at the end
+** and work toward the beginning rather than starting at the beginning and
+** working toward the end. Setting SQLITE_DBCONFIG_REVERSE_SCANORDER is the
+** same as setting [PRAGMA reverse_unordered_selects]. This configuration option
+** is useful for application testing.</dd>
+**
** </dl>
*/
#define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */
@@ -2486,8 +2496,9 @@ struct sqlite3_mem_methods {
#define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */
#define SQLITE_DBCONFIG_LEGACY_FILE_FORMAT 1016 /* int int* */
#define SQLITE_DBCONFIG_TRUSTED_SCHEMA 1017 /* int int* */
-#define SQLITE_DBCONFIG_STMT_SCANSTATUS 1018 /* int int* */
-#define SQLITE_DBCONFIG_MAX 1018 /* Largest DBCONFIG */
+#define SQLITE_DBCONFIG_STMT_SCANSTATUS 1080 /* int int* */
+#define SQLITE_DBCONFIG_REVERSE_SCANORDER 1019 /* int int* */
+#define SQLITE_DBCONFIG_MAX 1019 /* Largest DBCONFIG */
/*
** CAPI3REF: Enable Or Disable Extended Result Codes