Small. Fast. Reliable.
Choose any three.

## SQLite Release 3.41.2 On 2023-03-22

Prior changes from version 3.41.0 (2023-02-21):

1. Query planner improvements:
   1. Make use of indexed expressions within an aggregate query that includes a GROUP BY clause.
   2. The query planner has improved awareness of when an index is a covering index and adjusts predicted runtimes accordingly.
   3. The query planner is more aggressive about using co-routines rather than materializing subqueries and views.
   4. Queries against the built-in table-valued functions json_tree() and json_each() will now usually treat "ORDER BY rowid" as a no-op.
   5. Enhance the ability of the query planner to use indexed expressions even if the expression has been modified by the constant-propagation optimization. (See forum thread 0a539c7.)
2. Add the built-in unhex() SQL function.
3. Add the base64 and base85 application-defined functions as an extension and include that extension in the CLI.
4. Add the sqlite3_stmt_scanstatus_v2() interface. (This interface is only available if SQLite is compiled using SQLITE_ENABLE_STMT_SCANSTATUS.)
5. In-memory databases created using sqlite3_deserialize() now report their filename as an empty string, not as 'x'.
6. Changes to the CLI:
   1. Add the new base64() and base85() SQL functions
   2. Enhanced EXPLAIN QUERY PLAN output using the new sqlite3_stmt_scanstatus_v2() interface when compiled using SQLITE_ENABLE_STMT_SCANSTATUS.
   3. The "`.scanstats est`" command provides query planner estimates in profiles.
   4. The continuation prompt indicates if the input is currently inside of a string literal, identifier literal, comment, trigger definition, etc.
   5. Enhance the --safe command-line option to disallow dangerous SQL functions.
   6. The double-quoted string misfeature is now disabled by default for CLI builds. Legacy use cases can reenable the misfeature at run-time using the "`.dbconfig dqs_dml on`" and "`.dbconfig dqs_ddl on`" commands.
7. Enhance the PRAGMA integrity_check command so that it detects when text strings in a table are equivalent to but not byte-for-byte identical to the same strings in the index.
8. Enhance the carray table-valued function so that it is able to bind an array of BLOB objects.
9. Added the sqlite3_is_interrupted() interface.
10. Long-running calls to sqlite3_prepare() and similar now invoke the progress handler callback and react to sqlite3_interrupt().
11. The sqlite3_vtab_in_first() and sqlite3_vtab_in_next() functions are enhanced so that they reliably detect if they are invoked on a parameter that was not selected for multi-value IN processing using sqlite3_vtab_in(). They return SQLITE_ERROR instead of SQLITE_MISUSE in this case.
12. The parser now ignores excess parentheses around a subquery on the right-hand side of an IN operator, so that SQLite now works the same as PostgreSQL in this regard. Formerly, SQLite treated the subquery as an expression with an implied "LIMIT 1".
13. Added the SQLITE_FCNTL_RESET_CACHE option to the sqlite3_file_control() API.
14. Makefile improvements:
    1. The new makefile target "sqlite3r.c" builds an amalgamation that includes the recovery extension.
    2. New makefile targets "devtest" and "releasetest" for running a quick developmental test prior to doing a check-in and for doing a full release test, respectively.
15. Miscellaneous performance enhancements.

Prior changes from version 3.41.1 (2023-03-10):

1. Provide compile-time options -DHAVE_LOG2=0 and -DHAVE_LOG10=0 to enable SQLite to be compiled on systems that omit the standard library functions log2() and log10(), repectively.
2. Ensure that the datatype for column t1.x in "`CREATE TABLE t1 AS SELECT CAST(7 AS INT) AS x;`" continues to be INT and is not NUM, for historical compatibility.
3. Enhance PRAGMA integrity_check to detect when extra bytes appear at the end of an index record.
4. Fix various obscure bugs reported by the user community. See the timeline of changes for details.

Changes in this specific patch release, version 3.41.2 (2023-03-22):

1. Multiple fixes for reads past the end of memory buffers (NB: reads not writes) in the following circumstances:
   1. When processing a corrupt database file using the non-standard SQLITE_ENABLE_STAT4 compile-time option.
   2. In the CLI when the sqlite3_error_offset() routine returns an out-of-range value (see also the fix to sqlite3_error_offset() below).
   3. In the recovery extension.
   4. In FTS3 when processing a corrupt database file.
2. Fix the sqlite3_error_offset() so that it does not return out-of-range values when reporting errors associated with generated columns.
3. Multiple fixes in the query optimizer for problems that cause incorrect results for bizarre, fuzzer-generated queries.
4. Increase the size of the reference counter in the page cache object to 64 bits to ensure that the counter never overflows.
5. Fix a performance regression caused by a bug fix in patch release 3.41.1.
6. Fix a few incorrect assert() statements.

   Hashes:

7. SQLITE_SOURCE_ID: 2023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da
8. SHA3-256 for sqlite3.c: c83f68b7aac1e7d3ed0fcdb9857742f024449e1300bfb3375131a6180b36cf7c

A complete list of SQLite releases in a single page and a chronology are both also available. A detailed history of every check-in is available at SQLite version control site.