# event

type: t
user: drh
brief: Fixed ticket [e6e962d6b0f06f46|e6e962d6b0].
comment:
  Fixed ticket [e6e962d6b0f06f46|e6e962d6b0]: <i>sqlite3_blob_reopen() misbehavior on ALTER-ed table</i> plus 5 other changes


type: ci
user: drh
ecomment:
  Modify the ICU extension to use a static initializer, as VC++ complains about
  a dynamic initialization.  Maybe the dynamic structure initialization is a
  GCC extension.  This fixes a problem identified on the SQLite mailing list
  by Ziemowit Laski.

comment:
  Modify the ICU extension to use a static initializer, as VC++ complains about
  a dynamic initialization.  Maybe the dynamic structure initialization is a
  GCC extension.


type: ci
user: drh
comment:
  Make SQLITE_DIRECT_OVERFLOW_READ work for in WAL mode as long as the page
  being read is not in the the -wal file.


type: ci
user: drh
comment:
  Remove the obsolete lastRowid cache from the sqlite3VdbeExec() for a size
  reduction and performance improvement.


type: ci
user: drh
comment:
  Improvement to the OP_Permutation opcode to prevent it from using CPU cycles
  for initialization in prepared statements that do not use that opcode.


type: ci
user: drh
comment:
  Simplify the accessPayload() routine so that it always populates the overflow
  page cache.  In the one case where populating the page cache can lead to 
  problems, simply invalidate the cache as soon as accessPayload() returns.  
  This simplification reduces code size and helps accessPayload() to run a 
  little faster.  This backs out the eOp==2 mode of accessPayload() added by 
  check-in [da59198505].


type: ci
user: drh
comment:
  In the command-line shell, enhance the ".mode" command so that it restores the
  default column and row separators for modes "line", "list", "column", and
  "tcl".


type: ci
user: drh
comment:
  In the speed-check.sh script, automatically invoke "fossil test-diff --tk" on
  the cachegrind output against trunk, if not generating a trunk run.


type: ci
user: drh
comment:
  In the amalgamation, allocate the parser engine object from stack rather than
  from heap, for improved performance.  This only happens in the amalgamation,
  since otherwise the sqlite3RunParser() routine does not know the object size.


type: ci
user: drh
comment:
  Add the "stat" command to kvtest.c.  Also add the --variance option to the
  "init" command.  Add the tool/kvtest-speed.sh script used for doing 
  performance testing on key/value access patterns.


type: g
user: drh
comment:
  Edit [02f6293f278f7b0a|02f6293f27]: Move to branch [/timeline?r=micro-optimizations&nd&dp=02f6293f278f7b0a&unhide | micro-optimizations].


type: ci
user: drh
comment:
  This is an experimental patch that ensures that all cursors have their position
  saved prior to starting a ROLLBACK TO.


type: ci
user: drh
comment:
  Use the sqlite3_blob interface for reading values from the %_node shadow
  table in RTREE.  This is a work in progress.  There are still some minor
  problems.


type: ci
user: drh
comment:
  Change RTREE so that the sqlite3_blob object is closed whenever the cursor
  count drops to zero and there is not a pending write transaction.


type: ci
user: drh
comment:
  The sqlite3_blob_close() interface can cause recursive invocations of
  nodeBlobReset() in RTREE.  Make sure that does not cause problems.


type: ci
user: drh
comment:
  Add the sqlite3_blob_reset() interface.  Enhance the behavior of sqlite3_blob
  objects so that they can go active again after encountering an error by
  rerunning sqlite3_blob_reopen().  More work needed on the documentation.


type: ci
user: drh
comment:
  Improved performance and stack usage when processing VALUES clauses with
  a very large number of rows.


type: ci
user: drh
comment:
  In RTREE, use an sqlite3_blob object rather than an sqlite3_stmt object
  for reading content out of the %_node shadow table.


type: ci
user: drh
comment: Add the companion "carray_asc" table-valued function to the carray extension.
ecomment:
  Bummer.  Checked this in as a branch off of the wrong branch....  Was:
  Add the companion "carray_asc" table-valued function to the carray extension.


type: ci
user: dan
comment:
  Allow sqlite3session_apply() to apply changesets to tables that have been
  extended using ALTER TABLE ADD COLUMN.


type: ci
user: drh
comment:
  Make the cellMargin() routine of R-Tree slightly smaller and faster while also
  fixing a harmless compiler warning.


type: ci
user: dan
comment:
  Fix a test case to account for the fact that sqlite3_blob_reopen() now returns
  SQLITE_IOERR_NOMEM instead of SQLITE_NOMEM if an OOM occurs in the VFS layer.


type: ci
user: dan
comment:
  Update a test parameter in malloc5.test to account for the increase in default
  lookaside buffer size.


type: ci
user: drh
comment:
  The dbselftest utility now generates hashes in the selftest table with --init.
  It also accepts multiple database files on the command-line.


type: ci
user: drh
comment:
  When generating the hash on the sqlite_master table in dbselftest, use an
  ORDER BY clause, since the sqlite_master table is reordered by VACUUM.


type: ci
user: drh
comment:
  Round up the size of all memory allocations to a multiple of 8 bytes when
  using the system memory allocator.


type: ci
user: dan
comment:
  Avoid preparing a SELECT statement each time an UPDATE or DELETE
  by docid is executed against an fts3 table.


type: ci
user: dan
comment:
  Avoid preparing a SELECT statement each time an UPDATE or DELETE by docid is
  executed against an fts3 table.


type: ci
user: drh
comment:
  Cleanup the usage of the SQLITE_DISABLE_INTRINSIC compile-time option.
  Remove the SQLITE_RUNTIME_BYTEORDER compile-time option.  Use
  -DSQLITE_BYTEORDER=0 instead.  Fix a bug in R-Tree that occurs when compiling
  on a known little-endian machine without the use of intrinsic byteswapping
  functions.


type: ci
user: drh
comment:
  Ensure that indexed expressions with collating sequences are handled
  correctly.  Fix for ticket [eb703ba7b50c1a5] backported from trunk.


type: ci
user: drh
comment:
  Enhance the LIKE optimization so that it works for arbitrary expressions on
  the LHS as long as the pattern on the RHS does not begin with a digit or
  a minus sign.


type: ci
user: drh
comment:
  Ensure that indexed expressions with collating sequences are handled
  correctly.  Proposed fix for ticket [eb703ba7b50c1a5].


type: t
user: drh
brief: New ticket [eb703ba7b50c1a52|eb703ba7b5].
comment:
  New ticket [eb703ba7b50c1a52|eb703ba7b5] <i>Incorrect result using index on expression with collating function</i>.


type: t
user: drh
brief: Fixed ticket [eb703ba7b50c1a52|eb703ba7b5].
comment:
  Fixed ticket [eb703ba7b50c1a52|eb703ba7b5]: <i>Incorrect result using index on expression with collating function</i> plus 5 other changes


type: ci
user: drh
comment:
  Remove the CLANG_VERSION macro, since we have learned that version numbers in
  clang are "marketing" and are inconsistent and unreliable.  Builds using clang
  will still use the GCC_VERSION macro since clang works hard to be gcc
  compatible.


type: g
user: drh
comment:
  Edit [396b9d99ae43cc5c|396b9d99ae]: Move to branch [/timeline?r=mistake&nd&dp=396b9d99ae43cc5c&unhide | mistake]. Mark "Closed". Edit check-in comment.


type: ci
user: drh
comment:
  Query planner optimization to detect empty tables in a join early and bail out
  without doing excess work.


type: ci
user: drh
comment:
  Always use the IsVirtual() macro to determine if a Table object is a virtual
  table.  Slightly smaller and faster code.


type: ci
user: drh
comment:
  Change the name of WhereInfo.pDistinctSet to pResultSet, since it is now
  used for more than just DISTINCT processing.


type: ci
user: drh
comment:
  Increase the estimated cost of sorting when sorting wide results sets, to
  account for the extra storage space and I/O required for the external sort.


type: ci
user: drh
comment:
  Fix a test case that was made to fail by the LIKE optimization enhancement
  in check-in [158290c0ab] but which went unnoticed because test builds were
  running with ICU enabled and ICU disables the LIKE optimization.


type: ci
user: drh
comment:
  Enable the ".wheretrace" and ".selecttrace" extensions in the command-line
  shell when compiled on Windows using DEBUG=3 or higher.  Fix a harmless
  warning in the shell that comes up when compiled this way.


type: ci
user: drh
comment:
  The VDBE cycle counts for the sqlite3_progress_handler() callback are now
  cumulative.  Leftovers from the previous statement are applied to the next
  statement.


type: ci
user: drh
comment:
  Set the TF_StatsUsed flag on tables when the query planner outcome is
  affected by the sqlite_stat1 data.  Also, change the column names of the
  "PRAGMA stats" command so that they are not keywords.


type: ci
user: drh
comment:
  Enhance the Index and Table objects so that they remember if their stats come
  from the sqlite_stat1 table.  Make the "PRAGMA stats" an SQLITE_DEBUG only
  pragma.  Add the flags column to "PRAGMA stats".  These are all preliminary
  steps toward a "PRAGMA analyze_ifneeded;" feature.


type: ci
user: drh
comment:
  The analyze_as_needed pragma now responds to table size growth and will
  automatically rerun the analysis after each 10x size increase.


type: ci
user: drh
comment:
  In the analyze_as_needed pragma, avoid running unnecessary OP_LoadAnalysis 
  and OP_Expire opcodes.  Make the analyze_as_needed pragma responsive to the
  schema name.


type: ci
user: dan
comment:
  Before beginning an incremental checkpoint in RBU, sync the directory
  containing the target database file. This ensures that the new directory entry
  created by renaming the *-oal file to *-wal is synced to disk. Cherrypick of
  [915a9a28].


type: ci
user: drh
comment:
  Add the SQLITE_BUG_COMPATIBLE_20160819 compile-time option to omit the error
  message when an unrecognized argument is provided to the VACUUM command.


type: ci
user: drh
comment:
  Add the OP_SqlExec opcode and use it to implement "PRAGMA analyze_as_needed",
  invoking ANALYZE subcommands as necessary.  This simplifies the implementation.


type: ci
user: dan
comment:
  Add an optimization to OP_Column to speed up sequential OP_Column
  instructions that read earlier fields from the same cursor. Attempt to reorder
  OP_Column opcodes so as to take advantage of this.


type: ci
user: mistachkin
comment:
  Avoid unsigned integer overflows for SQLITE_WIN32_HEAP_INIT_SIZE when the Win32 heap subsystem is used with very large values of SQLITE_DEFAULT_CACHE_SIZE and/or SQLITE_DEFAULT_PAGE_SIZE.


type: ci
user: drh
comment:
  Proof of concept for a "PRAGMA vdbe_cycle_limit=N" command.  When N>0,
  invoke sqlite3_interrupt() whenever any byte code program uses more than
  N virtual machine cycles.


type: ci
user: drh
comment:
  Add the --recovery-mode option to the CLI ".dump" command.  This involves
  enhancing the "PRAGMA reverse_unordered_selects" command to accept a "TOGGLE"
  option.  Recovery mode used to be always on.  Now it is opt-in.  Not sure this
  is the correct approach.  Also not sure if TOGGLE is a good feature to have
  on boolean PRAGMA statements.


type: ci
user: dan
comment:
  Fix an FTS5 problem that could cause a crash when certain queries were
  interrupted using sqlite3_interrupt().


type: ci
user: dan
comment:
  In sqlite3VdbeHalt(), return as soon as possible if
  Vdbe.magic!=VDBE_MAGIC_RUN. This makes sqlite3_reset() slightly faster in some
  cases.


type: ci
user: drh
comment:
  Fix integrity_check so that it verifies NOT NULL constraints even for tables
  that have no indexes.  Enhance quick_check so that it verifies NOT NULL and
  CHECK constraints.


type: ci
user: drh
comment:
  Improvements to PRAGMA integrity_check.
  Verify CHECK constraints.
  Verify NOT NULL constraints even on table that lack indexes.
  Verify CHECK and NOT NULL constraints with PRAGMA quick_check.


type: ci
user: drh
comment:
  Change the name of the analyze_as_needed pragma to "optimize".  Enhance the
  comment (which will become documentation, assuming these changes land on trunk)
  to explain that the optimize pragma is likely to be enhanced in various ways
  in future releases and that applications should not depend upon the current
  behavior.


type: ci
user: drh
comment:
  Do a single OP_Expire at the very end of "PRAGMA optimize", and omit the
  OP_Expire on ANALYZE commands invoked by the pragma.


type: ci
user: dan
comment:
  Optimize defragmentPage() in the case where the page contains either one or
  two free-blocks and a small number of fragmented bytes.


type: ci
user: dan
comment:
  Save a few bytes and a few cycles by setting Vdbe.expmask to zero for
  statements prepared using legacy interface sqlite3_prepare().


type: ci
user: dan
comment:
  Remove references to special handling in virtual table methods from the
  documentation for sqlite3_last_insert_rowid().


type: ci
user: dan
comment:
  Add an sqlite3_set_last_insert_rowid() method. Use it to work around fts4 and
  fts5 modifying the last-insert-rowid unintuitively from within commit
  processing.


type: ci
user: dan
comment:
  Improve performance of fts5 writes by writing the "averages" record once at
  the end of each transaction instead of every time the table is updated.


type: ci
user: dan
comment:
  Fix a use-after-free problem in the shell tool code that could occur if an SQL
  statement were executed after an ".open" command with invalid options.


type: ci
user: drh
comment:
  Make sure the Vdbe.expmask value is set correctly in sqlite3VdbeSwap().
  This fixes a problem introduced by [a8fd7052].


type: ci
user: drh
comment:
  Add an optional bitmask of allowed optimizations on the "PRAGMA optimize"
  command.  The 0x01 bit is Debug Mode.


type: ci
user: dan
comment:
  Fix another RBU case similar to the previous. This one for systems where the
  sector-size is larger than the page-size.


type: ci
user: dan
comment:
  When saving the state of an RBU update in the incremental-checkpoint phase,
  sync the database file. Otherwise, if a power failure occurs and the RBU
  update resumed following system recovery, the database may become corrupt.


type: ci
user: drh
comment:
  Fix a bug in the 'start of ...' date/time modifiers when they follow a
  julian day number.  Fix for ticket [6097cb92745327a1].


type: t
user: drh
brief: New ticket [6097cb92745327a1|6097cb9274].
comment:
  New ticket [6097cb92745327a1|6097cb9274] <i>Broken &#39;start of day&#39; modifier on date/time functions</i>.


type: ci
user: dan
comment:
  Before beginning an incremental checkpoint in RBU, sync the directory
  containing the target database file. This ensures that the new directory entry
  created by renaming the *-oal file to *-wal is synced to disk.


type: t
user: drh
brief: Fixed ticket [6097cb92745327a1|6097cb9274].
comment:
  Fixed ticket [6097cb92745327a1|6097cb9274]: <i>Broken &#39;start of day&#39; modifier on date/time functions</i> plus 5 other changes


type: ci
user: drh
comment:
  Fix another corner-case for the 'start of ...' modifier in the date/time
  functions.  Related to ticket [6097cb92745327a1].


type: ci
user: drh
comment:
  If a reprepare is needed after binding to a variable with a number larger
  than 32, set only the high-order bit of the Vdbe.expmask rather than setting
  all bits.  This could potentially result in fewer false-positive reprepares.


type: ci
user: drh
comment:
  Merge recent enhancements from trunk, including the --preserve-rowids option
  to .dump and the .sha3sum commands of the CLI.


type: ci
user: drh
comment:
  Make the default MASK argument for "PRAGMA optimize" be 0xfffe, to allow for
  future expansion of up to 14 new default-on optimizations.


type: ci
user: dan
comment:
  Add test script ext/rbu/rbu_round_trip.tcl. Uses "dbselftest" to test that
  "rbu" and "sqldiff" work together.


type: ci
user: dan
comment:
  Fix another RBU case similar to the previous. This one for systems where the
  sector-size is larger than the page-size. Cherrypick of [4012bb3a].


type: ci
user: dan
comment:
  When saving the state of an RBU update in the incremental-checkpoint phase,
  sync the database file. Otherwise, if a power failure occurs and the RBU
  update resumed following system recovery, the database may become corrupt.
  Cherrypick of [edee6a80].


type: ci
user: drh
comment:
  In the CLI, avoid unnecessary identifier quoting in the ".dump" output.
  Also add new ".dump" test cases.


type: ci
user: drh
comment:
  Improved comments explaining the sha3_query() format.  Fix a performance #ifdef
  error in the sha3 implementation.


type: ci
user: drh
comment:
  Add the ".sha3sum" command to the CLI - used to compute a cryptographic hash
  of the <em>content</em> of a database file or of individual tables with in
  that file.


type: ci
user: drh
comment:
  In the ".sha3sum" command, if there is a LIKE pattern, show the hashes for
  each table separately.  Without a LIKE pattern, show a single hash over the
  entire database.


type: ci
user: drh
comment:
  Refactor the output logic in the CLI.  Not sure we want to go this way.  Just
  saving the work for historical reference, or in case I decide to come back
  to it.


type: ci
user: drh
comment:
  Begin moving separate boolean variables in the ShellState object of the CLI
  into the shellFlgs bitmask.


type: ci
user: drh
comment: Version 3.18.1
ecomment:
  Failed version 3.18.1.  Somehow I managed to omit the bug fix which was the
  entire purpose of 3.18.1 in the first place!


type: ci
user: drh
comment:
  Remove the test/dbselftest.c program.  In its place, add the ".selftest"
  command to the CLI.  The new CLI version is .selftest is slightly different
  in that it uses SHA3 hashing instead of SHA1, so the new is subtly 
  incompatible with the old.


type: ci
user: drh
comment:
  Improvements to ".selftest --init".  Tests are number in increments of 10
  starting with 100.  The tests are generated inside a SAVEPOINT.  Errors are
  reported during test generation.  Tests can be appended to existing tests.
  Add a test case to verify the schema.


type: ci
user: drh
comment:
  Add the SQLITE_MAX_MEMORY compile-time option that provides a hard upper bound
  on the amount of memory that SQLite will use, per process.


type: ci
user: drh
comment:
  Fix an error in the SQLITE_MAX_MEMORY implementation resulting from a bad
  merge.  Update the OSSFuzz interface so that it times out after running
  the byte-code engine for 10 seconds.


type: ci
user: drh
comment:
  Increase the number of significant digits in floating point literals on
  ".dump" output from the shell.


type: ci
user: drh
comment:
  The output of the ".dump" command in the CLI quotes newline and carriage-return
  characters using "char(10)" and "char(13)".


type: ci
user: drh
comment:
  In the output of the ".dump" command in the CLI, quote newline and
  carriage-return characters using the char() function, so that they do not
  get eaten by end-of-line processing logic in the OS or in other command-line
  utilities and/or libraries.


type: ci
user: drh
comment:
  Make sure the translateColumnToCopy() routine in the query planner does not
  try to access an array that failed to be fully allocated due to a prior OOM.
  This fixes an issue discovered by OSSFuzz.


type: ci
user: drh
comment:
  Fix a possible NULL pointer dereference in following an OOM error
  in sqlite3ExprIsInteger(). Problem found by OSS-Fuzz.


type: ci
user: drh
comment:
  In the OSSFuzz test module, invoke the progress handler much more frequently
  so that timeouts are detected punctually even if the test script is running
  opcodes that individually take a long time (for example, an OP_Function opcode
  that invokes "randomblob(1.5e6)").


type: ci
user: drh
comment:
  Infrastructure for an extension C-library to implement sqlite3_db_dump() and
  a corresponding "dbdump" command-line utility - both of which do the same
  work as the ".dump" command of the CLI.


type: ci
user: drh
comment:
  Add the dbdump.c extension that implements functionality similar to the
  ".dump" command of the CLI, though in a separate library.


type: ci
user: drh
comment:
  Make "PRAGMA temp.synchronous=N" a no-op to ensure that the TEMP schema
  always has synchronous=OFF.  This fixes an issue discovered by OSS-Fuzz.


type: ci
user: dan
comment: Fix a crash that could follow an OOM condition in the instr() SQL function.
ecomment:
  Fix a crash that could follow an OOM condition in the instr() SQL function.
  Problem discovered by OSS-Fuzz.


type: ci
user: drh
comment:
  Fix a problem in the "showdb" utility that prevents it from correctly
  decoding cells with no content beyond the record header.


type: ci
user: drh
comment:
  Fix an uninitialized variable reference in the text generator 
  for "PRAGMA vdbe_trace=ON" output.
  Problem discovered by OSS-Fuzz.


type: ci
user: dan
comment:
  If the user has not set it explicitly, set the "PRAGMA synchronous" setting to
  SQLITE_DEFAULT_SYNCHRONOUS when a database connection changes from wal to
  rollback journal mode.


type: g
user: dan
comment:
  Edit [78030c0f52aa39fb|78030c0f52]: Move to branch [/timeline?r=default-synchronous-fix&nd&dp=78030c0f52aa39fb&unhide | default-synchronous-fix].


type: ci
user: drh
comment:
  Fix a problem in the enhanced PRAGMA integrity_check where it verifies
  CHECK constraints: Do not be confused by the reuse of the Table.pCheck field
  by VIEWs with named columns.  Problem discovered by OSS-Fuzz.


type: ci
user: dan
comment:
  Fix a buffer overread in debugging routine sqlite3VdbeMemPrettyPrint().
  Problem discovered by OSS-Fuzz.


type: ci
user: drh
comment:
  Set a reasonable limit on the number of opcodes in a prepared statement
  for ossfuzz.c.  This should prevent timeouts in OSS-Fuzz when it generates
  totally unreasonable queries.


type: ci
user: drh
comment:
  Only do the specialized MacOS single-core zone_malloc initialization if
  compiled with the SQLITE_MIGHT_BE_SINGLE_CORE flag.  This avoids a (harmless)
  warning about OSAtomicCompareAndSwapPtrBarrier() being deprecated.


type: ci
user: dan
comment:
  Do not run sync2.test as part of the "journaltest" permutation, as it uses
  "PRAGMA synchronous = off".


type: ci
user: drh
comment:
  Avoid the possibility of signed integer overflow with oversized precisions
  in %d conversions in the printf() implementation.


type: ci
user: drh
comment:
  Add the --native-malloc option to fuzzcheck.  Fix ossfuzz.c and fuzzcheck.c
  so that they both deallocate the temp_store_directory before closing.


type: ci
user: dan
comment:
  Remove an invalid assert() statement failing when VACUUMing a database that
  contains an index on a column explicitly declared "COLLATE BINARY".


type: t
user: dan
brief: New ticket [06796225f59c057c|06796225f5].
comment:
  New ticket [06796225f59c057c|06796225f5] <i>Crash in recursive invocation of a trigger that uses an ephemeral table</i>.


type: t
user: drh
brief: Ticket [06796225f59c057c|06796225f5]: 6 changes
comment:
  Ticket [06796225f59c057c|06796225f5] <i>Crash in recursive invocation of a trigger that uses an ephemeral table</i> status still Open with 6 other changes


type: ci
user: drh
comment:
  Previous check-in was not correct.  This is a better fix for the OP_Once
  problem of ticket [06796225f59c057cd120f1].


type: ci
user: drh
comment:
  Fix the OP_Once opcode so that it works correctly for recursive triggers.
  Ticket [06796225f59c057cd120f1].


type: t
user: drh
brief: Fixed ticket [06796225f59c057c|06796225f5].
comment:
  Fixed ticket [06796225f59c057c|06796225f5]: <i>Crash in recursive invocation of a trigger that uses an ephemeral table</i> plus 3 other changes


type: ci
user: drh
comment:
  Make the default value for SQLITE_DEFAULT_SYNCHRONOUS a simple integer
  literal, so that it does not show up goofy in the output of
  "PRAGMA compile_options;".


type: ci
user: drh
comment:
  Disable the new --preserve-rowids option on the CLI ".dump" command if
  compiled with SQLITE_OMIT_VIRTUALTABLE.


type: g
user: drh
comment:
  Edit [424a0d380332858e|424a0d3803]: Move to branch [/timeline?r=branch-3.18&nd&dp=424a0d380332858e&unhide | branch-3.18].


type: ci
user: dan
comment:
  Fix some tests in malloc5.test to account for the sqlite3_release_memory()
  change in the previous commit.


type: ci
user: drh
comment:
  Fix the sqlite3_release_memory() interface so that it works even if
  SQLITE_DEFAULT_PCACHE_INITSZ is non-zero.


type: ci
user: drh
comment:
  Ensure that the stack space used to hold the Lemon-generated parser object
  is always 8-byte aligned.


type: g
user: drh
comment:
  Edit [424a0d380332858e|424a0d3803]: Change background color to "#d0c0ff". Edit check-in comment. Add tag "release".


type: ci
user: dan
comment:
  Add the sqlite3_whereinfo_hook() API - an experimental API replacing the
  DBCONFIG_WHEREINFO hack on this branch.


type: ci
user: drh
comment:
  Save a 78 bytes of code space and a million CPU cycles in speedtest1 by
  storing the cell index for the leaf page in the BtCursor object in its own
  field (BtCursor.ix), rather than as an entry in the BtCursor.aiIdx array.


type: ci
user: drh
comment:
  Remove an unnecessary setting of the Mem.enc field for the output of the
  OP_Record opcode, for a performance improvement and size reduction.


type: ci
user: dan
comment:
  Fix a problem causing "PRAGMA integrity_check" to disable the xfer
  optimization for subsequent VACUUM operations on tables with one or more CHECK
  constraints. This could result in VACUUM producing slightly larger database
  files.


type: ci
user: drh
comment:
  Combine the ExprList_item objects and the ExprList wrapper into a single
  memory allocation, for improved performance and reduced footprint.


type: ci
user: drh
comment:
  Split off sqlite3DbFreeNN() from sqlite3DbFree() and use it in cases where
  we know that the argument to be freed is never NULL.


type: ci
user: drh
comment:
  Remove a confusing and pointless sentence from the documentation for the
  sqlite3_interrupt() interface.


type: ci
user: dan
comment:
  Fix the ".lint fkey" shell tool command so that it works for foreign keys that
  refer implicitly to primary key columns with non-BINARY default collation
  sequences.


type: ci
user: drh
comment:
  Use replace() instead of char() to quote newline and return characters in
  strings in the output of .dump, to avoid excess expression complexity.


type: ci
user: drh
comment:
  Proof of concept for the ability to use the expression columns in an index
  on expressions in place of equivalent expressions in the result set or in
  the WHERE clause.  This check-in compiles but is mostly untested.


type: ci
user: drh
comment:
  Fix the ".dump" command so that it works with ".headers on".  Also fix the
  display of ".mode insert" with ".headers on".


type: ci
user: dan
comment:
  Have fts5 close any open blob-handle when a new savepoint is opened. This
  ensures that fts5 does not prevent DROP TABLE statements (which always open a
  savepoint) from succeeding.


type: ci
user: dan
comment:
  Have the rtree module close any open blob-handle within the xSavepoint method.
  This prevents such an open blob handle from interfering with DROP TABLE
  operations.


type: ci
user: dan
comment:
  Expand on the comment above OP_Destroy to explain why it throws an error if
  there are any active reader VMs.


type: t
user: drh
brief: Fixed ticket [b93be8729a895a52|b93be8729a].
comment:
  Fixed ticket [b93be8729a895a52|b93be8729a]: <i>JSON extension accepts invalid numeric values</i> plus 5 other changes


type: ci
user: dan
comment:
  Changes to allow the code in sqlite3expert.c to be tested directly (via the
  API in sqlite3expert.h) instead of by invoking the sqlite3_expert application.
  Fix memory leaks and other problems.


type: ci
user: drh
comment:
  Change the JSON extension so that it disallows control characters inside of
  strings.  Fix for ticket [6c9b5514077fed34551f98e64c09a10dc2fc8e16].


type: t
user: drh
brief: New ticket [6c9b5514077fed34|6c9b551407].
comment:
  New ticket [6c9b5514077fed34|6c9b551407] <i>JSON allows unescaped control characters in strings</i>.


type: ci
user: drh
comment:
  Add a new JSON test case to verify that all control characters are escaped
  in the json_quote() function.


type: t
user: drh
brief: Fixed ticket [6c9b5514077fed34|6c9b551407].
comment:
  Fixed ticket [6c9b5514077fed34|6c9b551407]: <i>JSON allows unescaped control characters in strings</i> plus 5 other changes


type: ci
user: dan
comment:
  Add header comments to the API functions in sqlite3expert.h. Include a list of
  all candidate indexes in the report output by the sqlite3_expert program.


type: ci
user: drh
ecomment:
  When evaluating a query that uses an index on an expression,
  try to use the expression values read directly from the index
  rather than reevaluating the expression.

comment:
  When using an index on an expression, try to use the columns of the index
  rather than pulling columns from the table and reevaluating the expression.


type: ci
user: dan
comment:
  Fix a segfault that could occur if an indexed expression was used in a
  comparison operation within the result-set of a SELECT statement.


type: ci
user: drh
comment:
  Limit the depth of recursion for valid JSON in the JSON1 extension in order
  to avoid using excess stack space in the recursive descent parser.
  Fix for ticket [981329adeef51011052667a9].


type: ci
user: dan
comment:
  Avoid updating unaffected indexes on a table as part of an UPDATE that requires
  foreign key processing in some cases.


type: t
user: drh
brief: Fixed ticket [981329adeef51011|981329adee].
comment:
  Fixed ticket [981329adeef51011|981329adee]: <i>Stack overflow while parsing deeply nested JSON</i> plus 5 other changes


type: ci
user: dan
comment:
  Avoid updating unaffected indexes on a table as part of an UPDATE that
  requires foreign key processing in some cases.


type: ci
user: drh
comment:
  Improved \n and \r escapes in the ext/misc/dbdump.c utility function.  The
  implementation of dbdump.c now matches the implementation in the CLI.


type: ci
user: dan
comment:
  Update fts5 to support "<colset> : ( <expr> )" for column filtering, as well
  as "<colset> : NEAR(...)" and "<colset> : <phrase>".


type: ci
user: drh
comment:
  Fix a regression caused by the fix for ticket [6c9b5514077fed34551f98e64c09a1] -
  control characters allowed in JSON.


type: ci
user: drh
comment:
  Forward port the skip-ahead-distinct branch which was abandoned for some reason
  that I do not recall.  This port should have been achived by a merge of trunk
  into the previous head of skip-ahead-distinct, but that did not work.  So I had
  to manually "rebase" the changes.


type: ci
user: drh
comment:
  Only use the skip-ahead-distinct optimization if the index has been analyzed
  and we know that a skip-head is likely to skip over at least 11 rows.  The
  magic number 11 was determined by experimentation.


type: ci
user: dan
comment:
  Reinstate the SQLITE_API qualifier on the sqlite3_delete_database() method in
  test_delete.c. Accidentally removed by the previous commit.


type: ci
user: dan
comment:
  Modify the code in ext/expert/ to use the vtab interface instead of
  sqlite3_whereinfo_hook(). Remove sqlite3_whereinfo_hook().


type: ci
user: drh
comment:
  Fix the skip-ahead-distinct optimization so that it works with indexes that
  have repeated columns with different collating sequences.


type: ci
user: drh
comment:
  When doing a DISTINCT query using an index, try to use the index to skip ahead
  to the next distinct element, rather than doing a full scan of the index.
  (This is the "skip-ahead-distinct" optimization.)


type: ci
user: drh
comment:
  Simplify the interface to the subst() routines that are part of the
  query flattener by collecting common parameters into the SubstContext object
  and passing around a pointer to that object.


type: ci
user: drh
comment:
  Enhance the sqlite3TreeView() display for Expr objects so that it shows
  the iRightJoinTable value for Expr nodes that have the EP_FromJoin property.


type: ci
user: drh
comment:
  An initial attempt to optimize VIEWs that occur as the right operand of a
  LEFT JOIN.  This particular check-in does not work correctly because it does
  not deal with the case of columns in the VIEW that return non-NULL even when
  all columns in the table of the VIEW are NULL because of the LEFT JOIN.


type: ci
user: drh
comment:
  Add the TK_IF_NULL_ROW opcode to deal with non-NULL result columns in the
  result set of a view or subquery on the RHS of a LEFT JOIN that gets flattened.


type: ci
user: dan
comment:
  Fix memory leaks in the code on this branch. Make use of the
  sqlite3_index_constraint.usage field. Do not try to handle ORDER BY terms with
  explicit COLLATE clauses - they don't get passed to the vtab layer anyway.


type: ci
user: drh
comment:
  In the skip-ahead-distinct optimization, fix a bug in the logic that determines
  when to invoke the optimization based on sqlite_stat1 statistics.


type: ci
user: drh
comment:
  In the showwal command-line tool, for unix builds, if the
  auxiliary argument is of
  the form "Ntruncate" where "N" is a frame number, then truncate the WAL
  file after the N-th frame.


type: ci
user: drh
comment:
  Fix the ".column" output mode in the command-line shell so that it correctly
  counts and formats multi-byte UTF characters.


type: ci
user: dan
ecomment:
  Fix a problem in "PRAGMA foreign_key_check" in handling a WITHOUT ROWID child
  table with an INTEGER PRIMARY KEY parent key. Also, if an FK violation is
  detected in a WITHOUT ROWID child table, do not try to read and return the
  rowid. The second column returned by "PRAGMA foreign_key_check" in this case
  (WITHOUT ROWID child table) is now always set to NULL.

comment:
  Fix a problem in "PRAGMA foreign_key_check" in handling a WITHOUT ROWID child
  table with an INTEGER PRIMARY KEY parent key. Also, if an FK violation is
  detected in a WITHOUT ROWID child table, do not try to read and return the
  rowid. The third column returned by "PRAGMA foreign_key_check" in this case
  (WITHOUT ROWID child table) is now always set to NULL.


type: ci
user: dan
comment:
  Have sqlite3_expert_analyze() populate the sqlite_stat1 table before running
  queries through the planner for the second time.


type: ci
user: dan
comment:
  Use sqlite3_table_column_metadata() instead of a SELECT statement to check for
  the existence of a %_stat table in fts3. This leads to smaller and easier to
  test code.


type: ci
user: dan
comment:
  Add an option to generate stat1 data based on a subset of the user database
  table contents to sqlite3_expert.


type: ci
user: dan
comment:
  Avoid creating a temp table in the user database in the sqlite3_expert code.
  Trouble is, this makes sampling for stat1 data much slower.


type: ci
user: dan
comment:
  Remove a NEVER macro for a condition that may be true as of [a47efb7c].
  Problem reported by OSSFuzz.


type: ci
user: dan
comment:
  Fix an FTS5 bug that could cause a prefix-query without a prefix-index on a
  database that contains delete-markers to return extra, non-matching, rows.


type: ci
user: dan
comment:
  When building an ephemeral table of integers, do not assume that the table
  does not already contain N if the insert cursor points to N-1. Fix for ticket
  [61fe9745].


type: t
user: drh
brief: New ticket [61fe97454c00bc4a|61fe97454c].
comment:
  New ticket [61fe97454c00bc4a|61fe97454c] <i>Duplicate result using an IN operator in the WHERE clause</i>.


type: t
user: dan
brief: Closed ticket [61fe97454c00bc4a|61fe97454c].
comment:
  Closed ticket [61fe97454c00bc4a|61fe97454c]: <i>Duplicate result using an IN operator in the WHERE clause</i> plus 6 other changes


type: ci
user: drh
comment:
  Fix a subtle bug in Lemon discovered and reported on the mailing list
  by Kelvin Sherlock, who also suggested the correct fix.


type: ci
user: dan
comment:
  Do not write master journal filenames into server-mode journal files. Use
  SQLITE_MUTEX_STATIC_APP1 to protect critical sections in server.c.


type: ci
user: dan
comment:
  Within a loop that uses a non-covering index test, test non-indexed terms that
  can be tested without seeking the main table cursor before those that cannot.


type: ci
user: drh
comment:
  Evaluate WHERE clause terms that reference only the index before evaluating
  terms that require the table, and thereby avoid seeking the table row if
  index terms are false.
  This is called the "push-down" optimization in the MySQL world, we are told.


type: ci
user: dan
comment:
  Automatically transfer terms from the HAVING clause to the WHERE clause of an
  aggregate query in cases where the result of evaluating the term depends only
  one one or more of the GROUP BY expressions (and on no other inputs).


type: ci
user: drh
comment:
  Initial implementation of an optimization that attempts to reuse the same
  materialization of a view on a self-join of the view.


type: ci
user: drh
comment:
  Reuse the same materialization of a view when that view appears in a query
  more than once, such as in a self-join.


type: t
user: drh
brief: New ticket [f68dc596c4e6018d|f68dc596c4].
comment:
  New ticket [f68dc596c4e6018d|f68dc596c4] <i>Database corruption on REPLACE with a mix of NULL and non-NULL rowids.</i>.


type: ci
user: dan
comment:
  Clear the BTCF_ValidNKey flag set if a cursor is moved by
  sqlite3BtreeInsert(). Fix for [f68dc596c4].


type: t
user: drh
brief: Fixed ticket [f68dc596c4e6018d|f68dc596c4].
comment:
  Fixed ticket [f68dc596c4e6018d|f68dc596c4]: <i>Database corruption on REPLACE with a mix of NULL and non-NULL rowids.</i> plus 5 other changes


type: ci
user: drh
comment:
  Move terms of the HAVING clause that reference only columns in the GROUP BY
  clause over to the WHERE clause, resulting in a faster query plan.


type: ci
user: drh
comment:
  Fix the fts3EvalAverageDocsize() routine so that it returns errors from
  sqlite3_reset() rather than always returning SQLITE_OK.


type: ci
user: drh
comment:
  In the sqlite3_expert command-line tool, allow two-dash options.  Do not
  accept the database name if it begins with "-".


type: ci
user: drh
comment:
  In sqlite3expert.c, do not copy the schema for virtual tables.  Updates to
  makefiles to make building easier.


type: ci
user: dan
comment:
  Remove the tool/schemalint.tcl script. And related Makefile entries. It is
  superseded by sqlite3_expert.


type: ci
user: drh
comment:
  Always enable URI filenames when compiling with SQLITE_HAS_CODEC.  Also allow
  plaintext keys using the key= query parameter.


type: ci
user: drh
comment:
  Fix a collision of the "B0" identifier name between the termios.h header
  file and the SHA3 implementation in the shell.


type: ci
user: drh
comment:
  Fix an obscure assertion fault that can follow an OOM.   The problem
  was introduced by check-in [a1cf44763277b6c7].


type: ci
user: drh
comment:
  Invoke the SQLITE_READ authorizer callback with a NULL column name for any
  table referenced by a query but from when no columns are extracted.


type: ci
user: dan
comment:
  Fix a problem causing a lock to be held past the end of a transaction. Use a
  blocking lock to take the read-lock on page 1 taken by all transactions.


type: ci
user: dan
comment:
  Require exclusive access to the db to wrap the wal file. Have "PRAGMA
  wal_checkpoint = restart" block for this.


type: ci
user: drh
comment:
  Change the SQLITE_READ authorization call for unreferenced tables to use
  an empty string for the column name, as this is less likely to impact legacy
  authorization callbacks that assume column names are always non-NULL.


type: ci
user: drh
comment:
  Negative N values in sqlite3_get_auxdata() and sqlite3_set_auxdata() can be
  used to access an auxiliary data cache over all functions in a single prepared 
  statement.


type: ci
user: drh
comment:
  Enhance the json_extract() function to reuse parses of the same JSON when
  the function appears multiple times in the same query.


type: ci
user: dan
comment:
  Do not save the state of an fts5 merge operation mid-way through an input
  term, even if no previous entry for that term has caused any output. Doing so
  may corrupt the FTS index.


type: ci
user: drh
comment:
  Cause the ANALYZE command to build sqlite_stat1 table entries for empty tables
  with the assumption that such tables really contain 10 elements.  This gives
  better query plans for tables that are truely empty, but is likely to cause
  problems in legacy systems, so the change is kept off trunk.  Some TCL tests
  fail on this check-in due to the new stat1 entries.


type: ci
user: dan
comment:
  Add code to this branch to emit a log message after each cumulative second
  that the WRITER lock has been held.


type: ci
user: drh
comment:
  Prevent a possible NULL pointer dereference in the OP_Found opcode that
  can follow an OOM error.  Problem found by OSS-Fuzz.


type: ci
user: drh
comment:
  Improved comments on one routine in the query planner.  Improved diagnostic
  output for ".wheretrace".  No production code changes.


type: ci
user: drh
comment:
  Fix a problem in STAT4 equality estimation for multi-column indexes
  introduced by check-in [3e0590dee0e68cc1599].


type: ci
user: dan
comment:
  Fix a case where NULL was being passed to memcmp() following an OOM. This is
  probably not a real problem, as the number-of-bytes parameter was passed 0 in
  this case, but it was causing a santizer complaint.


type: ci
user: dan
comment:
  Add too/tserver.c - the implementation of a simple multi-threaded server
  designed for interactive testing of concurrency between connections used by
  different threads of the same process.


type: ci
user: dan
comment:
  Fix incompatibilities between the "sqldiff --changeset" command and the
  sessions module. Specifically, allow sessions to process changesets containing
  tables with zero operations on them and have sqldiff output the expected
  output for tables with multi-column primary keys.


type: ci
user: drh
comment:
  Remove a surplus semicolon, which was harmless on gcc and clang but caused
  compile-time errors on msvc.  This only comes up using the encryption extension.


type: ci
user: drh
comment:
  When flattening a query, make sure iTable attribute of TK_IF_NULL_ROW
  operators (that result from a prior flattening of a LEFT JOIN) are updated
  correctly.  Fix for ticket [cad1ab4cb7b0fc344].


type: ci
user: drh
comment:
  Ensure that the expression rewriter inside the query flattener decends into
  the substructure of the TK_IF_NULL_ROW operator.  This is a continuation
  of the fix for ticket [cad1ab4cb7b0fc344].


type: t
user: drh
brief: Fixed ticket [cad1ab4cb7b0fc34|cad1ab4cb7].
comment:
  Fixed ticket [cad1ab4cb7b0fc34|cad1ab4cb7]: <i>Segfault due to LEFT JOIN flattening optimization</i> plus 5 other changes


type: t
user: drh
brief: Ticket [cad1ab4cb7b0fc34|cad1ab4cb7]: 3 changes
comment:
  Ticket [cad1ab4cb7b0fc34|cad1ab4cb7] <i>Segfault due to LEFT JOIN flattening optimization</i> status still Fixed with 3 other changes


type: ci
user: drh
comment:
  Disable the LEFT JOIN flattening optimization for aggregate queries, as it
  does not currently work.  Further fix for ticket [cad1ab4cb7b0fc344].


type: t
user: drh
brief: Open ticket [cad1ab4cb7b0fc34|cad1ab4cb7].
comment:
  Open ticket [cad1ab4cb7b0fc34|cad1ab4cb7]: <i>Segfault due to LEFT JOIN flattening optimization</i> plus 3 other changes


type: ci
user: drh
comment:
  Do not use strcpy() in the (obsolete) amatch extension.
  In releasetest.tcl, run Apple tests using -Os instead of -O1


type: t
user: drh
brief: Fixed ticket [cad1ab4cb7b0fc34|cad1ab4cb7].
comment:
  Fixed ticket [cad1ab4cb7b0fc34|cad1ab4cb7]: <i>Segfault due to LEFT JOIN flattening optimization</i> plus 3 other changes


type: ci
user: dan
comment:
  Fix a problem with the deferred page allocation on this branch that could
  occur when the database file is just slightly smaller than the PENDING_BYTE
  page offset.


type: ci
user: drh
comment:
  Add the SQLITE_DEFAULT_ROWEST compile-time option for changing the estimated
  number of rows in tables that lack sqlite_stat1 entries.


type: ci
user: drh
comment:
  Increase the version number to 3.19.2 since ticket [7fde638e94287d2] is
  going to necessitate another patch release.


type: ci
user: drh
comment:
  The TK_IF_NULL_ROW expression node must be treated as a variable that
  references the table Expr.iTable.
  Proposed fix for ticket [7fde638e94287d2c].


type: ci
user: drh
comment:
  The SQLITE_EXTRA_IFNULLROW compile-time option causes OP_IfNullRow opcodes
  to be issued for references to the right-hand side table of *any* flattened
  join, not just LEFT JOINs.  This puts extra stress on the OP_IfNUllRow opcodes
  for testing purposes.


type: t
user: drh
brief: Fixed ticket [7fde638e94287d2c|7fde638e94].
comment:
  Fixed ticket [7fde638e94287d2c|7fde638e94]: <i>Assertion fault on a LEFT JOIN</i> plus 5 other changes


type: ci
user: dan
comment:
  Fix a problem with deferred page allocation in transactions that revert page
  allocations by savepoint rollbacks.


type: g
user: dan
comment:
  Edit [214d238a4763adff|214d238a47]: Move to branch [/timeline?r=btree-debug&nd&dp=214d238a4763adff&unhide | btree-debug].


type: ci
user: drh
comment:
  Correctly initialize the iSelectId of FROM clause terms that are a self
  join of a reused materialized subquery.  Without this, the EXPLAIN QUERY PLAN
  output for the query will identify the subquery using the uninitialized
  (and arbitrary) iSelectId.


type: ci
user: drh
comment:
  Optimizations to the Walker object and its methods to make the code a little
  smaller and to help it run a little faster.


type: ci
user: dan
comment:
  Instead of a root page number, log the object (table or index) name if a page
  level locking conflict is detected.


type: ci
user: drh
comment:
  Avoid unnecessary fstat() calls to determine the database size when
  transitioning into a read transaction on a rollback-mode database.


type: ci
user: drh
comment:
  Omit unnecessary fstat() calls for determining the database file size,
  resulting in smaller and faster code.


type: ci
user: dan
comment:
  Generate extra log messages in response to irregularites in the pointer-map
  used by "BEGIN CONCURRENT" transactions.


type: ci
user: dan
comment:
  Omit a test of codepoint 0x202F (non-break narrow space) from the fts3 ICU
  tests. Different versions of ICU apparently handle this obscure codepoint
  slightly differently.


type: ci
user: drh
comment:
  Change sqlite3BtreeNext() and sqlite3BtreePrevious() so that they return
  SQLITE_DONE if they have already reached the end (or beginning) of the table.
  This gives a performance increase and size reduction.


type: ci
user: drh
comment:
  Add the SQLITE_STMTSTATUS_MEMUSED option for sqlite3_stmt_status() that reports
  the amount of heap memory used for a single prepared statement.


type: ci
user: drh
comment:
  Add the SQLITE_STMTSTATUS_MEMUSED opcode to sqlite3_stmt_status()
  for finding the heap memory usage by a single prepared statement.


type: ci
user: dan
comment:
  Extend even further the logging designed to find problems in the pointer-map
  structure. Call abort() to dump a core as soon as such a problem is seen.


type: ci
user: drh
comment:
  Add interfaces sqlite3_prepare_v3() and sqlite3_prepare16_v3() with the
  extra prepFlags argument.  Add the SQLITE_PREPARE_PERSISTENT option as one
  bit in that argument.


type: ci
user: drh
comment:
  Change the name of the OP_Seek opcode into OP_DeferredSeek for better
  clarity of function.  No functional code changes.


type: ci
user: drh
comment:
  In kvtest, add the ability to work with a hierarchy of files on disk,
  in addition to having all files in the same directory.


type: ci
user: drh
comment:
  Initialize a variable to zero to prevent an (incorrect) compiler warning of
  it potentially being uninitialized.


type: ci
user: drh
comment:
  Fix the column width deduction logic in the command-line shell to account
  for multi-byte utf8 characters.


type: ci
user: drh
comment:
  For the kvtest utility, add the --vacuum option to "kvtest stat" and also
  run PRAGMA integrity_check with "kvtest stat".


type: ci
user: dan
comment:
  Fix a bug in test_fs.c that occurs when the first component of a path contains
  a GLOB or LIKE escape character.


type: ci
user: drh
comment:
  Avoid adding an artifical "LIMIT 1" on scalar subqueries that do not need it.
  This seems like a pointless optimization as it makes minimal run-time difference
  but does increase code complexity.  Parked on a branch for historical
  reference.


type: ci
user: dan
comment:
  Ensure that test tool "tserver" finalizes all statements before attempting to
  close a database handle.


type: ci
user: dan
comment:
  Ensure pointer map entries are always added when a row that does use overflow
  pages replaces one that does not in an auto-vacuum database. Fix for
  [fda22108].


type: ci
user: drh
comment:
  In SQLITE_DEBUG mode, attempt to log the page number of the database that
  contained the problem when SQLITE_CORRUPT errors are seen.


type: t
user: drh
brief: New ticket [fda2210880369264|fda2210880].
comment:
  New ticket [fda2210880369264|fda2210880] <i>Corrupt due to REPLACE in an auto-vacuumed database</i>.


type: t
user: drh
brief: Ticket [fda2210880369264|fda2210880]: 6 changes
comment:
  Ticket [fda2210880369264|fda2210880] <i>Corruption due to REPLACE in an auto-vacuumed database</i> status still Open with 6 other changes


type: t
user: drh
brief: Fixed ticket [fda2210880369264|fda2210880].
comment:
  Fixed ticket [fda2210880369264|fda2210880]: <i>Corruption due to REPLACE in an auto-vacuumed database</i> plus 3 other changes


type: ci
user: drh
comment:
  Adjust the implementation of the ".selftest" feature of the shell to avoid
  using the deprecated sqlite3_get_table() interface.


type: ci
user: dan
comment:
  Update the recent auto-vacuum fix so that it works for the in-memory
  pointer-map structure used by this branch.


type: ci
user: dan
comment:
  Remove sqlite3_log() and abort() calls added to this branch to debug the
  pointer-map problem ([fda22108]).


type: ci
user: drh
comment:
  Update the documentation to make it clear that the table name parameter
  to sqlite3_table_column_metadata() may not be NULL.


type: ci
user: drh
comment:
  Fix a potential null-pointer deference following OOM introduced by
  check-in [e39795d7] (unreleased).


type: ci
user: drh
comment:
  When reusing a materialized view, make sure the estimated number of
  output rows is correctly initialized to avoid confusing the query planner.


type: ci
user: drh
comment:
  Fix an off-by-one error that messes up the display of loop codes in the
  ".wheretrace" debugging output for queries with more than 62 candidate
  loops when SQLITE_ENABLE_WHERETRACE is on.


type: ci
user: drh
comment:
  Fix the processing of double-negatives in WHERE clause constraints with
  STAT4.  Ticket [cfa2c908f2182]


type: ci
user: drh
comment:
  An unintentional fork was created due to a typo when creating branch-3.18.
  This check-in resolves the fork and is the 3.18.1 release candidate.


type: ci
user: drh
comment:
  Enhance the sqlite3_analyzer.exe utility so that it computes and shows the
  number of bytes of metadata on btree pages and per table and index entry.


type: ci
user: drh
comment:
  In the command-line shell, enhance the ".schema" command show that it
  shows the schema for ATTACH-ed databases in addition to "main".


type: ci
user: drh
comment:
  Improvements to the ".tables" command in the command-line shell so that
  it shows the name of all schemas if the name is anything other than "main".


type: ci
user: drh
comment:
  Move the "shell_add_schema()" SQL function used by the ".schema" command
  of the command-line shell to a different spot in the shell.c source file
  so that it is not in the middle of an unrelated module.


type: ci
user: drh
comment:
  Fix typo and improve the wording of the description of "Metadata" in the
  output of the sqlite3_analyzer tool.


type: ci
user: drh
comment:
  Prevent pagesize changes on VACUUM in encrypted databases even when running
  the VACUUM on an attached database.


type: g
user: drh
comment:
  Edit [e3038fbfc2af8201|e3038fbfc2]: Move to branch [/timeline?r=mistake&nd&dp=e3038fbfc2af8201&unhide | mistake]. Add propagating "hidden". Edit check-in comment. Cancel background color.


type: g
user: drh
comment:
  Edit [30c50f0e06084f3c|30c50f0e06]: Move to branch [/timeline?r=branch-3.18&nd&dp=30c50f0e06084f3c&unhide | branch-3.18].


type: ci
user: drh
comment:
  When building an ephemeral table of integers, do not assume that the table
  does not already contain N if the insert cursor points to N-1. Fix for ticket
  [61fe9745].  Also increase the version number to 3.18.2.  This is the
  release candidate.


type: ci
user: dan
comment:
  Rework the code in ctime.c a bit to report on more compile time options. And
  to only output configuration options passed in to SQLite, not the default
  values of #define symbols set automatically. Also generate the large array in
  ctime.c using new script tool/mkctime.tcl, instead of entering it manually.


type: ci
user: dan
comment:
  Ensure that the value of the THREADSAFE symbol is always included when
  reporting compile time options, even if it was not explicitly configured.


type: ci
user: drh
comment:
  Add new interfaces sqlite3_result_pointer(), and
  sqlite3_value_pointer() and use them to transfer the eponymous FTS3 column
  pointer to the snippet() and offsets() routines.  This changes is a 
  cherry-pick of [f0f49224] via [69906880cee] and is ultimately inspired
  by check-in [72de49f2].


type: ci
user: drh
comment:
  Add the "PRAGMA secure_delete=FAST" option, which overwrites most deleted
  content without increasing the amount of I/O.  Deleted content might persist
  on the free page list, however.  And extra CPU cycles are used for zeroing,
  of course.


type: ci
user: drh
comment:
  Experimental "PRAGMA secure_delete=FAST" pragma.  The intent is to overwrite
  deleted content with zeros without increasing the amount of disk I/O.


type: t
user: drh
brief: New ticket [892fc34f173e99d8|892fc34f17].
comment:
  New ticket [892fc34f173e99d8|892fc34f17] <i>Incorrect query result when a LEFT JOIN subquery is flattened</i>.


type: ci
user: drh
comment:
  Rename the azCompileOpt global constant to avoid a harmless compiler warning
  about a name conflict with a local variable.


type: ci
user: dan
comment:
  Ensure that the query planner knows that any column of a flattened LEFT JOIN
  can be NULL even if that column is labeled with "NOT NULL".
  Fix for ticket [892fc34f173e99d8].


type: t
user: drh
brief: Fixed ticket [892fc34f173e99d8|892fc34f17].
comment:
  Fixed ticket [892fc34f173e99d8|892fc34f17]: <i>Incorrect query result when a LEFT JOIN subquery is flattened</i> plus 5 other changes


type: ci
user: dan
comment:
  When generating individual loops for each ORed term of an OR scan, move any
  constant WHERE expressions outside of the loop, as is done for top-level
  loops.


type: t
user: drh
brief: Ticket [b9f010107724ca99|b9f0101077]: 6 changes
comment:
  Ticket [b9f010107724ca99|b9f0101077] <i>Violation of the Query Planner Stability Guarantee</i> status still Open with 6 other changes


type: ci
user: drh
comment:
  Query planner tuning:  When deciding between two plans with the same cost,
  bias the selection toward the one that does not use the sorter.


type: ci
user: drh
comment:
  Make sure enough memory is allocated for pathological quoting cases when
  computing a quoted table name in the command-line shell.


type: ci
user: dan
comment:
  Consider the values bound to SQL variables when determining whether or not a
  partial index may be used.


type: ci
user: drh
comment:
  Add the SQLITE_DBCONFIG_ENABLE_QPSG option to activate the query planner
  stability guarantee.  This involves refactoring the sqlite3.flags bitvector
  to carve out a free bit to use.


type: ci
user: dan
comment:
  Update a test case to reflect the fact that the lsm blocksize is configured in
  KiB. And defaults to 1024, not 2048.


type: ci
user: drh
comment:
  Add SQLITE_DBCONFIG_ENABLE_QPSG that forces the query planner stability
  guarantee.  This is the fix for ticket [b9f010107724c]


type: ci
user: drh
comment:
  Instead of the new sqlite3_prepare_v3() interface, provide the
  SQLITE_DBCONFIG_PREPARE_FLAGS interface which sets the flags on the single
  next call to sqlite3_prepare_v2() or its cousins.


type: g
user: drh
comment:
  Edit [cbe441b231397a9b|cbe441b231]: Move to branch [/timeline?r=unsetnull-option&nd&dp=cbe441b231397a9b&unhide | unsetnull-option].


type: ci
user: drh
comment:
  The ".import" command of the shell, and the csv virtual table extension both
  ignore a single UTF-8 BOM at the beginning of their input.


type: ci
user: dan
comment:
  Fix a virtual table problem that can occur when the vtab is on the RHS of a
  LEFT JOIN and there is a MATCH constraint in the ON clause, or when the vtab
  is in a sub-query that is the RHS of a LEFT JOIN and there is a MATCH
  constraint in the WHERE clause of the sub-query.


type: ci
user: drh
comment:
  Avoid even trying to open a SHM file read/write in WAL mode if we know that
  the file is read-only.  This avoids scare security log messages.


type: t
user: drh
brief: Fixed ticket [b9f010107724ca99|b9f0101077].
comment:
  Fixed ticket [b9f010107724ca99|b9f0101077]: <i>Violation of the Query Planner Stability Guarantee</i> plus 3 other changes


type: ci
user: drh
comment:
  In the lemon-generated parser, automatically promote SHIFTREDUCE actions on
  nonterminal systems to pure REDUCE actions, for a performance enhancement.


type: ci
user: drh
comment:
  In the lemon-generated parser, store the number of symbols on the RHS of each
  rule as a negative number and add it to the stack pointer, rather than storing
  the value as a positive and subtracting it.  This makes the parser faster.


type: ci
user: drh
comment:
  Build the "stmts" virtual table into the amalgamation.  It is active only
  when compiled using SQLITE_ENABLE_STMTSVTAB.  That option is supplied to the
  command-line shell.


type: ci
user: drh
comment:
  Add the SQLITE_STMTSTATUS_REPREPARE and SQLITE_STMTSTATUS_RUN options to
  sqlite3_stmt_status().  Use this for two new columns in the stmts virtual
  table.


type: ci
user: drh
comment:
  Make the query planners use of partial indexes based on bound variables
  responsive to the SQLITE_DBCONFIG_ENABLE_QPSG setting.


type: ci
user: drh
ecomment: Alternative implementation of exprCompareVariable().
comment:
  Alternative implementation of exprCompareVariable().  Need to run tests on
  both this branch and the original to see which one to go with.


type: ci
user: dan
comment:
  Have this branch maintain an in-memory hash-table of old pages for read-only
  MVCC clients. There is no way to access it yet.


type: g
user: drh
comment:
  Edit [b959c6297c151150|b959c6297c]: Move to branch [/timeline?r=partial-index-variables&nd&dp=b959c6297c151150&unhide | partial-index-variables]. Edit check-in comment.


type: ci
user: drh
comment:
  The query planner examines the values of bound parameters to help determine 
  if a partial index is usable.  Reprepares may happen if the bindings change.
  This behavior is disabled by the QPSG setting.


type: ci
user: drh
comment:
  Add the "stmts" virtual table to the amalgamation, activated when compiled
  using -DSQLITE_ENABLE_STMTSVTAB.  Add the SQLITE_STMTSTATUS_REPREPARE and
  SQLITE_STMTSTATUS_RUN statistics outputs from sqlite3_stmt_status() and add
  corresponding columns to the stmts virtual table.  Change the numeric value
  of SQLITE_STMTSTATUS_MEMUSED to get it out of the way of counter values.


type: ci
user: drh
comment:
  Add the stmts virtual table to testfixture builds.  Add new compile-time
  options SQLITE_ENABLE_QPSG and SQLITE_ENABLE_STMTSVTAB to ctime.c


type: ci
user: drh
comment:
  Add interfaces sqlite3_prepare_v3() and sqlite3_prepare16_v3() with the 
  extra prepFlags argument. Add the SQLITE_PREPARE_PERSISTENT option as 
  one bit in that argument.  Use the new option in FTS3, FTS5, and RTREE.


type: ci
user: drh
comment:
  Edit comments in sqlite.h.in used for generating documentation, to improve
  the description of the new sqlite3_prepare_v3() interfaces, and other
  miscellaneous cleanup.  No changes to executable code.


type: ci
user: drh
comment:
  Remove the ".explain" command from the ".help" output of the command-line
  shell, though keep the implementation around for backwards compatibility.


type: ci
user: drh
comment:
  In the command-line shell, add the -quote option to start up in quote mode.
  Enhance the ".mode" command so that it reports the current output mode if
  given no arguments.


type: ci
user: dan
ecomment:
  Avoid constantly freeing and reallocing small internal buffers associated with
  LSM cursors. Instead, allow them to persist for the lifetime of the cursor if
  they are LSM_SEGMENTPTR_FREE_THRESHOLD (default 1024) bytes or smaller. This change is based on research by Martijn Blaauw.

comment:
  Avoid constantly freeing and reallocing small internal buffers associated with
  LSM cursors. Instead, allow them to persist for the lifetime of the cursor if
  they are LSM_SEGMENTPTR_FREE_THRESHOLD (default 1024) bytes or smaller.


type: ci
user: drh
comment:
  Update the carray() and remember() extension functions so that they user
  the new sqlite3_value_pointer() interface.


type: ci
user: dan
comment:
  Add more tests for LSM log file recovery. Fix a problem in recovering log
  files that contain range deletes.


type: ci
user: dan
comment:
  Fix a bug in lsm queries on levels undergoing incremental an merge that
  contain range-delete markers.


type: ci
user: drh
comment:
  Fix a problem in the lempar.c Lemon template for YYSTACKDEPTH<=0 introduced
  by check-in [36e54cd8b1fb37]


type: ci
user: dan
comment:
  Have fts3 virtual table cursors free internal resources when they reach EOF,
  instead of waiting until the xClose method is called.


type: ci
user: drh
comment:
  Fix the covering index OR optimization (check-in [fcbd6abd]) so that
  it works with SQLITE_MAX_ATTACHED>30.  Broken by a bad cherry-pick merge.


type: ci
user: drh
comment:
  Slightly more compact implementation of the byte-code generator for
  the COMMIT and ROLLBACK commands.


type: ci
user: drh
comment:
  Avoid unnecessary upper-to-lower case conversion for function names when
  registering the built-in functions.


type: ci
user: drh
comment:
  Change the (machine-generated) keywordhash.h file to increase the scope of the
  tables used for keyword matching, so that the tables are accessible to
  functions other then keywordCode().


type: ci
user: drh
comment:
  Initial implementation of a highly experimental interface for listing all
  keywords and symbolic names for an SQLite database connection.


type: ci
user: drh
comment:
  Change the sqlite3_namelist() interface to return a pointer to an array of
  pointers to strings, and to avoid duplicates.


type: ci
user: drh
comment:
  Exploit the fact that Expr.pRight and Expr.x are never used at the same time
  for a small performance gain.


type: ci
user: drh
comment:
  Add the "Pragma_list" pragma.  Put all three pragmas created on this branch
  inside of #ifdef SQLITE_INTROSPECTION_PRAGMAS.


type: ci
user: drh
comment:
  Enhance the sqlite3VdbeMultiLoad() interface to automatically generate the
  OP_ResultRow opcode on PRAGMA implementations, for a small reduction in the
  library footprint.


type: ci
user: dan
comment:
  In lsmtest, use an empty string instead of ":memory:" when requesting a
  temporary database from SQLite. This prevents other test code from trying to
  unlink() ":memory:", which fails on win32.


type: ci
user: drh
comment:
  Add new PRAGMAs: "function_list", "module_list", and "pragma_list".  All are
  enclosed within #ifdef SQLITE_INTROSPECTION_PRAGMAS.  The compile-time option
  is not on ctime.c yet, since these are still experimental and one can always
  test "PRAGMA pragma_list" and see whether or not it returns an empty set.


type: ci
user: drh
comment:
  In the command-line shell, when running ".schema" give a sensible error when
  the database file is locked.


type: ci
user: drh
comment:
  Change the error message text for SQLITE_ERROR to omit the part about
  "missing database" as that meaning is now obsolete (since approx SQLite 2.0).


type: ci
user: drh
comment:
  Fix test cases in wal2.test due to the fact that Darwin checks to see if
  the SHM file is writable before attempting to open in read/write.


type: ci
user: drh
comment:
  For FROM-clause subqueries that cannot be flattened, try to push relevant
  WHERE clause terms of the outer query down into the subquery in order to help
  the subquery run faster and/or use less memory.
  Cherry-pick from [6df18e949d36].  Still need to backport bug fixes associated
  with that check-in.


type: g
user: drh
comment:
  Edit [dbb59f6156625a45|dbb59f6156]: Move to branch [/timeline?r=icc-fix&nd&dp=dbb59f6156625a45&unhide | icc-fix].


type: ci
user: drh
comment:
  Make sure the columns of a VALUES() clause are named "column%d" even if
  the VALUES() clause is a subquery in the FROM clause of an outer query.


type: ci
user: drh
comment:
  Update error message text for standard error codes to better describe the
  latest usage of those error codes.  Modify sqlite3_open_v2() so that it does
  return a valid sqlite3 object in the event of SQLITE_MISUSE due to bad
  open flags, so that sqlite3_errmsg() does not report "out of memory" in that
  case.


type: ci
user: dan
comment:
  When testing non-indexed WHERE constraints, test those that involve
  correlated sub-queries last of all. This increases the chances of not having
  to run the sub-query at all.


type: ci
user: drh
comment:
  When multiple constraints need to be evaluated for a row, do any constraints
  that involve correlated subqueries last.  Hence, the priority is index-covered
  constraints first, correlated subquery constraints last, and all others in
  the middle.  This is a
  follow-on and improvement to the push-down optimization of check-in [d7bb79ed].


type: ci
user: drh
comment:
  Add the "--newlines" option to the ".dump" command in the shell to disable
  the newline escaping mechanism.


type: ci
user: dan
comment:
  In LSM, avoid calling the VFS xTestLock method to test for a lock that
  conflicts with one held by the same process. The results of such a call are
  considered undefined (since they are different under win32 and posix).


type: ci
user: drh
comment:
  Incomplete implementation of the COMPLETION table-valued function.  So far it
  only works for SQL keywords.


type: ci
user: drh
comment:
  The COMPLETION virtual table now looks at the names of databases, tables,
  and columns in addition to SQL keywords.


type: ci
user: drh
comment:
  Add the "phase" output column on the COMPLETION table-valued function, for
  debugging.  Improved comments on the implementation.


type: ci
user: drh
comment:
  Change the src/shell.c file so that it is generated from a new script at
  tool/mkshellc.tcl and the template file src/shell.c.in, and automatically
  includes the extensions it needs out of ext/misc.


type: ci
user: drh
comment:
  Add support for tab-completion (using the ext/misc/completion.c virtual table)
  to the command-line shell.


type: ci
user: dan
comment:
  Simplify the way in which the database file is truncated when the last
  connection disconnects. Also ignore the error code from the xTruncate call -
  as truncating a database file is always optional.


type: ci
user: dan
comment:
  Make the freelist format a separate feature from the page-level locking.
  Freelist format is now configure using "PRAGMA freelist_format".


type: ci
user: dan
comment:
  In lsm, attempt to unmap the database file before truncating it when
  disconnecting. A mapped file may not be truncated on win32.


type: ci
user: drh
comment:
  The EP_Resolved flag on the Expr object is not required for correctness nor
  performance, so remove it.


type: ci
user: drh
comment:
  Update the FTS3 extension to use sqlite3_result_pointer() and
  sqlite3_value_pointer() for passing FTS3 cursor objects from the table
  into functions such as snippet().


type: ci
user: drh
comment:
  Add the three new pointer interfaces to the loadable extension mechanism.
  Update sqlite3_value_subtype() documentation to remove the statement about
  it not being used internally.


type: ci
user: drh
comment:
  Add new interfaces sqlite3_bind_pointer(), sqlite3_result_pointer(), and
  sqlite3_value_pointer() used to safely move pointer values through SQL without
  exposing underlying memory address information.


type: ci
user: drh
comment:
  Update header comments on the carray() and remember() extensions to bring
  out the fact that the pointer arguments must be bound using
  sqlite3_bind_pointer().


type: ci
user: drh
comment:
  Change the name of the STMT virtual table to SQLITE_STMT.  Also remove the
  first column of that virtual table, which was a pointer leak.


type: ci
user: drh
comment:
  Update the Makefile for LSM1 so that the LSMOPTS can be set prior to
  including the Makefile, in order to add platform arguments such as -fPIC.


type: ci
user: dan
comment:
  Modify mkopcodeh.tcl so that it can handle "same as" opcodes with values
  larger than the total number of opcodes.


type: ci
user: dan
comment:
  Tweak Makefile.in so that testfixture can be built with the
  --disable-amalgamation configure switch.


type: ci
user: drh
comment:
  Identify requirements text in the SQLITE_DBCONFIG_ENABLE_QPSG documentation.
  Add some implementation marks for SQLITE_DBCONFIG_MAINDBNAME requirements.
  No code changes.


type: ci
user: drh
comment:
  Minor change to one of the command-line shell test scripts to make that
  script compatible with Tcl 8.5.


type: ci
user: drh
comment:
  Enhance the showstat4 utility program to show the full precision of 
  floating point values in sqlite_stat4 tables.


type: t
user: drh
brief: New ticket [a4e06e75a9ab61a1|a4e06e75a9].
comment:
  New ticket [a4e06e75a9ab61a1|a4e06e75a9] <i>False-positive from &quot;PRAGMA integrity_check&quot;</i>.


type: ci
user: drh
comment:
  Fix a register allocation problem in PRAGMA integrity_check that caused
  the same register to be used for two different purposes on the first
  ATTACHed database if the schema for the ATTACHed database was noticable
  more complex than the schema for the first database.
  Fix for ticket [a4e06e75a9ab61a1].


type: t
user: drh
brief: Fixed ticket [a4e06e75a9ab61a1|a4e06e75a9].
comment:
  Fixed ticket [a4e06e75a9ab61a1|a4e06e75a9]: <i>False-positive from &quot;PRAGMA integrity_check&quot;</i> plus 6 other changes


type: ci
user: drh
comment:
  Add an experimental "pointer type" parameter to sqlite3_bind_pointer(),
  sqlite3_result_pointer(), and sqlite3_value_pointer().  The pointer type is
  a string that must compare equal using strcmp() or else the pointer comes
  through as a NULL.


type: ci
user: drh
comment:
  Improve the sqlite3_result_pointer() interface so that it cannot be faked
  using sqlite3_result_null() and sqlite3_result_subtype().


type: ci
user: drh
comment:
  Create "pure" versions of the date/time functions that omit the 'now' feature
  and are therefore deterministic and usable in an index.


type: ci
user: drh
comment:
  Add the pointer-type parameter to sqlite3_bind_pointer(),
  sqlite3_result_pointer(), and sqlite3_value_pointer().  The pointer type is
  a static string that must match (according to strcmp()) or else the pointer
  is passed as a NULL.  This is a security measure to prevent crossing pointers
  between different extensions.


type: g
user: drh
comment:
  Edit [62a86aa6c0519cf1|62a86aa6c0]: Move to branch [/timeline?r=union-vtab&nd&dp=62a86aa6c0519cf1&unhide | union-vtab].


type: ci
user: drh
comment:
  Merge all changes from branch-3.20.  Improvements to the fts5() extension
  interface.  Work around a gcc/valgrind bug in the sqlite3_value_pointer()
  interface.


type: ci
user: drh
comment:
  Interchange to branches within an "if" statement in sqlite3_value_pointer()
  in order to work around a bug in gcc.


type: ci
user: drh
comment:
  Do not apply the WHERE-clause pushdown optimization to terms that originate
  in the ON or USING clause of a LEFT JOIN.  Fix for ticket
  [c2a19d81652f40568c].


type: ci
user: drh
comment:
  Try to push relevant WHERE clause terms of the outer query down
  into the subquery in order to help the subquery run faster and/or 
  use less memory.   This is a cherry-pick of [6df18e949d36] with
  bug fixes.


type: ci
user: dan
comment:
  Avoid creating an automatic index on the RHS of a LEFT JOIN to optimize an IS
  term. Fix for [ce68383b].


type: t
user: drh
brief: New ticket [ce68383bf6aba2f8|ce68383bf6].
comment:
  New ticket [ce68383bf6aba2f8|ce68383bf6] <i>Incorrect LEFT JOIN result with IS operator in WHERE clause and auto-index</i>.


type: ci
user: dan
comment:
  Do not use the flattening optimization for a sub-query on the RHS of a LEFT
  JOIN if that subquery reads data from a virtual table. Because it prevents the
  planner from creating an automatic index on the results of the sub-query, the
  flattening optimization sometimes slows things down in this case.


type: ci
user: dan
comment:
  Have unionvtab support constraints on the column that corresponds to the
  INTEGER PRIMARY KEY field of the underlying source tables in the same way as
  rowid.


type: ci
user: drh
comment:
  Add VFS interfaces needed to make use of batch atomic write capabilities
  in the underlying filesystem.


type: ci
user: drh
comment:
  Experimental API sqlite3_stmt_refresh() to force a prepared statement to
  recompile if it needs to due to a schema change or other factor.


type: ci
user: dan
comment:
  Only open a db in server-mode if there is a directory named "db-journal"
  in the file-system and the VFS is an exclusive locking VFS.


type: ci
user: drh
comment:
  Combine the Parse.ckBase and Parse.iSelfTab fields into just Parse.iSelfTab.
  This fixes a problem with date/time functions in check-constraints.  Add
  some test cases for date/time functions in index expressions and check
  constraints.


type: ci
user: drh
comment:
  Allow indexes to be created on date/time functions as long as the 'now'
  date and the 'localtime' and 'utc' modifiers are not used.


type: ci
user: drh
comment:
  New test cases for date/time functions in indexes on expressions, in the
  WHERE clause of partial indexes, and in CHECK constraints.


type: ci
user: drh
comment:
  Enhance the built-in date/time functions so that they can be used in
  CHECK constraints, in the WHERE clause or partial indexes, and index
  expressions, provided that none of the non-deterministic keywords
  ("now", "localtime", "utc") are used as arguments.


type: ci
user: dan
comment:
  Split SQLITE_ENABLE_ATOMIC_WRITE into two options - the original and
  SQLITE_ENABLE_BATCH_ATOMIC_WRITE.


type: g
user: drh
comment:
  Edit [416973ede3bde856|416973ede3]: Move to branch [/timeline?r=batch-atomic-write&nd&dp=416973ede3bde856&unhide | batch-atomic-write].


type: ci
user: drh
comment:
  Add new interfaces sqlite3_result_pointer(), and
  sqlite3_value_pointer() and use them to transfer the eponymous FTS3 column
  pointer to the snippet() and offsets() routines.  This is a cherry-pick
  of [f0f492245e95], which is in turn inspired by check-in [72de49f2].


type: ci
user: drh
comment:
  Add new interfaces sqlite3_result_pointer(), and
  sqlite3_value_pointer() and use them to transfer the eponymous FTS3 column
  pointer to the snippet() and offsets() routines.  This changes is
  inspired by check-in [72de49f2] but is new implementation, not a cherry-pick.


type: ci
user: drh
comment:
  Add new interfaces sqlite3_result_pointer(), and
  sqlite3_value_pointer() and use them to transfer the eponymous FTS3 column
  pointer to the snippet() and offsets() routines.  This is a cherry-pick
  of [f0f49224] which was in turn inspired by [72de49f2].


type: ci
user: drh
comment:
  Add new interfaces sqlite3_result_pointer(), and
  sqlite3_value_pointer() and use them to transfer the eponymous FTS3 column
  pointer to the snippet() and offsets() routines.  This changes is a 
  cherry-pick of [f0f49224] with version-specific edits.  That check-in was
  inspired by check-in [72de49f2].


type: t
user: drh
brief: Fixed ticket [ce68383bf6aba2f8|ce68383bf6].
comment:
  Fixed ticket [ce68383bf6aba2f8|ce68383bf6]: <i>Incorrect LEFT JOIN result with IS operator in WHERE clause and auto-index</i> plus 5 other changes


type: ci
user: drh
comment:
  Keep batch-atomic-writes turned on for journal_mode=MEMORY, but turn them
  off for synchronous=OFF.  Refuse to compile with both SQLITE_MMAP_READWRITE
  and SQLITE_ENABLE_BATCH_ATOMIC_WRITE.  Fix up some comments in the commit
  logic.


type: ci
user: dan
comment:
  Add the "atomic-batch-write" permutation to permutations.test. This
  permutation fails if not run on a file-system that supports
  atomic-batch-writes.


type: ci
user: drh
comment:
  Additional documentation on sqlite3_bind_pointer() and sqlite3_result_pointer().
  No changes to code.


type: ci
user: drh
comment:
  Add the new sqlite3.mDbFlags field.  Factor out bits of sqlite3.flags that
  do not interact with PRAGMA statements into sqlite3.mDbFlags.


type: ci
user: drh
comment:
  Do now allow the geometry object in the right operand of a MATCH operator in
  the RTREE extension to be inpersonated by a BLOB literal.


type: ci
user: drh
comment:
  Use the subquery column name, not the original SQL statement text, as the
  added AS clause in the query flattener.


type: ci
user: drh
comment:
  A demonstration of how FTS3 cursor pointers can be passed from the MATCH
  operator to the snippet() function securely and opaquely without having to
  use the sqlite3_result_pointer() and sqlite3_value_pointer() interfaces.


type: ci
user: drh
comment:
  In sqlite3_bind_pointer(), invoke the destructor if the bind index is
  out of range, like sqlite3_bind_blob() does.


type: ci
user: drh
comment:
  Add destructor functions for the pointer argument (NB: not the type string)
  to the sqlite3_bind_pointer() and sqlite3_result_pointer() interfaces.  Use
  this new capability to resolve a pointer leak in the custom geometry function
  mechanism of the RTREE extension.


type: ci
user: drh
comment:
  Correctly handle an "INTEGER PRIMARY KEY UNIQUE" column in a WITHOUT ROWID
  table.  This is a fix for ticket [bc115541132dad136] cherry-picked from
  [5216bfb73f1a49bdd].


type: ci
user: dan
comment:
  Update test program "tserver" to use a native pthreads mutex/condition
  variable to efficiently manage wal file checkpoints without the wal file
  growing indefinitely.


type: ci
user: drh
comment:
  In the query flattener, only add AS clauses to output columns of the outer
  query that are copied directly from the inner query.  Formerly, all columns
  of the outer query received an AS clause if they did not have one already.
  This is a proposed fix for ticket [de3403bf5ae5f72].


type: t
user: drh
brief: New ticket [de3403bf5ae5f72e|de3403bf5a].
comment:
  New ticket [de3403bf5ae5f72e|de3403bf5a] <i>Column name shift due to LEFT JOIN query flattening</i>.


type: ci
user: drh
comment:
  Move the generation of output column names earlier, to right after name
  resolution and before query transformations such as flattening.  This prevents
  the names from getting mangled by query transformations, and obviates hacks
  in the query flattener that attempt to work around the name mangling.
  The resulting code is smaller and faster and gives more consistent output.
  This is an alternative fix to ticket [de3403bf5ae5f72ed].


type: ci
user: drh
comment:
  Move the generation of output column names earlier, to right after
  name resolution and before query transformations such as flattening. 
  This prevents the names from getting mangled by query transformations, 
  and obviates hacks in the query flattener that attempt to work around 
  the name mangling. The resulting code is smaller and faster and gives
  more consistent output. Fix to ticket [de3403bf5ae5f72ed].


type: t
user: drh
brief: Ticket [de3403bf5ae5f72e|de3403bf5a]: 6 changes
comment:
  Ticket [de3403bf5ae5f72e|de3403bf5a] <i>Column name shift due to LEFT JOIN query flattening</i> status still Open with 6 other changes


type: t
user: drh
brief: New ticket [bc115541132dad13|bc11554113].
comment:
  New ticket [bc115541132dad13|bc11554113] <i>Assertion fault on a dodgy CREATE TABLE statement using WITHOUT ROWID</i>.


type: ci
user: drh
comment:
  Add the schema6.test module for demonstrating schemas that generate identical
  and different content.


type: ci
user: drh
comment:
  Correctly handle an "INTEGER PRIMARY KEY UNIQUE" column in a WITHOUT ROWID
  table.  This is a fix for ticket [bc115541132dad136], a problem discovered
  by OSSFuzz.


type: ci
user: drh
comment:
  More consistent column names.  Cherry-pick of
  [09834279] and [0c38dde45] as a fix for ticket [de3403bf5ae].


type: t
user: drh
brief: Fixed ticket [bc115541132dad13|bc11554113].
comment:
  Fixed ticket [bc115541132dad13|bc11554113]: <i>Assertion fault on a dodgy CREATE TABLE statement using WITHOUT ROWID</i> plus 5 other changes


type: ci
user: drh
comment:
  Use batch atomic writes when running on a recent F2FS filesystem, if compiled
  with SQLITE_ENABLE_BATCH_ATOMIC_WRITE.


type: ci
user: drh
comment:
  Correctly handle an "INTEGER PRIMARY KEY UNIQUE" column in a WITHOUT ROWID
  table.  This is a fix for ticket [bc115541132dad136], cherry-picked from
  check-in [5216bfb73f1a49bdd8]


type: ci
user: drh
comment:
  Move the generation of output column names earlier, to right after name
  resolution and before query transformations such as flattening.  This prevents
  the names from getting mangled by query transformations, and obviates hacks
  in the query flattener that attempt to work around the name mangling.
  The resulting code is smaller and faster and gives more consistent output.
  This is a fix for ticket [de3403bf5ae5f72ed] and a cherry-pick
  of check-in [09834279aeca3bda]


type: ci
user: drh
comment:
  Prevent OSSFuzz from using debugging pragmas that are disabled in default builds
  and which generate lots of excess output.


type: t
user: drh
brief: Fixed ticket [de3403bf5ae5f72e|de3403bf5a].
comment:
  Fixed ticket [de3403bf5ae5f72e|de3403bf5a]: <i>Column name shift due to LEFT JOIN query flattening</i> plus 3 other changes


type: ci
user: drh
comment:
  Make sure the sqlite3_result_pointer() interface does not leave a VM register
  in an inconsistent state.  Fix for ticket [7486aa54b968e9b5].  Test cases
  are in TH3.


type: ci
user: drh
comment:
  Split the OP_Last opcode into OP_Last and OP_SeekEnd.  Use OP_SeekEnd to
  position a cursor prior to appending.  Ticket [cb91bf4290c211d].


type: ci
user: drh
comment:
  Take advantage of atomic-write capabilities in the F2FS filesystem when the
  database is stored on such a filesystem.  This is a compile-time option
  activated using SQLITE_ENABLE_BATCH_ATOMIC_WRITE.


type: t
user: drh
brief: New ticket [cb91bf4290c211de|cb91bf4290].
comment:
  New ticket [cb91bf4290c211de|cb91bf4290] <i>Assertion fault following PRAGMA reverse_unordered_selects=ON</i>.


type: t
user: drh
brief: Fixed ticket [cb91bf4290c211de|cb91bf4290].
comment:
  Fixed ticket [cb91bf4290c211de|cb91bf4290]: <i>Assertion fault following PRAGMA reverse_unordered_selects=ON</i> plus 5 other changes


type: ci
user: drh
comment:
  Rearrange integer token values in the parser and logic in the
  resolveP2Values() routine for a small size reduction and performance increase.


type: ci
user: dan
comment:
  Enhance the code in unionvtab.c to also provide the "swarmvtab" virtual table
  module. There are still several problems on this branch.


type: ci
user: drh
comment:
  In the KeyInfo object, refactor the nField and nXField elements into
  nKeyField and nAllField, which are more useful and run a little faster.


type: ci
user: dan
comment:
  Fix some problems in RBU test cases. Also update RBU source code to better
  handle the trivial case where an RBU update is applied to a database zero
  pages in size.


type: ci
user: dan
comment:
  Update script tool/mksqlite3c.tcl to avoid duplicating the SQLITE_API
  qualifier when copying sqlite3rbu.h into the amalgamation.


type: g
user: dan
comment:
  Edit [d8637badf63b90b6|d8637badf6]: Move to branch [/timeline?r=mistake&nd&dp=d8637badf63b90b6&unhide | mistake]. Mark "Closed".


type: g
user: dan
comment:
  Edit [d8637badf63b90b6|d8637badf6]: Move to branch [/timeline?r=sqlite3rbu.h-fix&nd&dp=d8637badf63b90b6&unhide | sqlite3rbu.h-fix]. Remove the "Closed" mark.


type: ci
user: dan
comment:
  Fix a segfault in swarmvtab that could occur if there was an error in the SQL
  statement passed to the constructor. Add other test cases.


type: g
user: dan
comment:
  Edit [46c3085dcad6372a|46c3085dca]: Change background color to "#ffc0ff". Add tag "mmap-size-limit".


type: g
user: dan
comment:
  Edit [46c3085dcad6372a|46c3085dca]: Move to branch [/timeline?r=mmap-size-limit&nd&dp=46c3085dcad6372a&unhide | mmap-size-limit].


type: ci
user: mistachkin
comment:
  On Windows, avoid casting a value larger than 2^31 to a (SIZE_T) on systems where it is a 32-bit type.


type: ci
user: dan
comment:
  Avoid casting a value larger than 2^31 to a (size_t) or (SIZE_T) on systems
  where it is a 32-bit type.


type: ci
user: drh
comment:
  Enhance the CSV virtual table extension so that it accepts the last row of
  the CSV file even if the last row omits the closing \n, as long as the last
  row has a full set of columns.


type: ci
user: drh
comment:
  The identifier "vsnprintf" appears to be a reserved word in recent versions
  of XCode, so avoid using it as a structure field.


type: ci
user: dan
comment:
  Add experimental sqlite3_open_v2() flag SQLITE_OPEN_REUSE_SCHEMA. For sharing
  identical in-memory schema objects between connections.


type: ci
user: drh
comment:
  Add a first draft of the "vtablog" extensions that implements a generic
  virtual table useful for experimentation using the command-line shell.


type: ci
user: drh
comment:
  Preserve the error code from xConnect or xCreate methods in virtual table
  implementations when they are encountered during parsing.


type: ci
user: drh
comment:
  Experimental changes that allow a WITHOUT ROWID virtual table to be writable
  as long as it has only a single-column PRIMARY KEY.


type: ci
user: drh
comment:
  Test case for writing to a WITHOUT ROWID virtual table.  The TCLVAR virtual
  table is modified to add a "fullname" column which is the primary key, and
  to accept update operations against the primary key.


type: ci
user: drh
comment:
  Allow WITHOUT ROWID virtual tables to be writable as long as they have
  exactly one column as their PRIMARY KEY.


type: ci
user: dan
comment:
  Add the "instance" type to the fts5vocab virtual table module. For direct
  access to the contents of the fts5 term index.


type: ci
user: drh
comment:
  Convert the LSM1 virtual table to be WITHOUT ROWID and get UPDATE and DELETE
  operations working on it.


type: ci
user: drh
comment:
  Fix compiler warnings that arise if the PAGERTRACE macro is turned on.
  This changes does not affect production builds.


type: ci
user: drh
comment:
  Add a PAGERTRACE() macro to log when frames are written into the WAL file.
  This is for analysis only and is a no-op for production builds.


type: ci
user: drh
comment:
  Add another PAGERTRACE() macro to show when pages are added to Pager.pAllRead.
  No impact on production builds.


type: ci
user: dan
comment:
  Fix a problem allowing a conflicting transaction to be committed in the case
  where more than one 32KB shared-memory page has been written to since the
  transaction was started.


type: t
user: drh
brief: New ticket [aa98619ad08ddcab|aa98619ad0].
comment:
  New ticket [aa98619ad08ddcab|aa98619ad0] <i>Assertion fault on an IN operator using a constant index</i>.


type: t
user: drh
brief: Closed ticket [8897054d959750c9|8897054d95].
comment:
  Closed ticket [8897054d959750c9|8897054d95]: <i>lsm1 does not overwrite values for duplicate keys</i> plus 5 other changes


type: ci
user: drh
ecomment:
  Sometimes a TK_COLUMN Expr node can have Expr.pTab==0 if it is a reference
  to an expression column in an index on an expression.  Fix for ticket
  [aa98619ad08ddcab].

comment:
  Sometimes a TK_COLUMN Expr node can have Expr.pTab==0 if it is a reference
  to an expression column in an index on and expression.  Fix for ticket
  [aa98619ad08ddcab].


type: t
user: drh
brief: Fixed ticket [aa98619ad08ddcab|aa98619ad0].
comment:
  Fixed ticket [aa98619ad08ddcab|aa98619ad0]: <i>Assertion fault on an IN operator using a constant index</i> plus 5 other changes


type: ci
user: drh
comment:
  Change the internal btree routine moveToRoot() to return SQLITE_EMPTY if
  the table is empty or if it has pgnoRoot==0.  This simplifies the callers,
  making them smaller and faster.  The SQLITE_EMPTY result code is intercepted
  and changed into SQLITE_OK before surfacing in an API.


type: ci
user: drh
comment:
  Btree optimization:  New field BtCursor.pPage that points to the current page,
  saving a single pointer dereference on each access.


type: ci
user: drh
comment:
  Remove the rarely-used scratch memory allocator.  This makes the code smaller,
  faster, and easier to maintain.  In place of the scratch allocator, add the
  SQLITE_CONFIG_SMALL_MALLOC configuration option that provides a hint to SQLite
  that large memory allocations should be avoided.


type: ci
user: drh
comment:
  Remove an unnecessary local variable from OP_Column, for a small size
  reduction and performance increase.


type: ci
user: drh
comment:
  Avoid a test for CURTYPE_BTREE in sqlite3VdbeCursorMoveto() in order to reduce
  the size and improve the performance of OP_Column.


type: t
user: drh
brief: New ticket [be436a7f4587ce51|be436a7f45].
comment:
  New ticket [be436a7f4587ce51|be436a7f45] <i>Use-after-free on schema change where RTREE is used inside of a trigger</i>.


type: ci
user: drh
comment:
  The RTREE extension should return SQLITE_CORRUPT_VTAB, not just SQLITE_CORRUPT
  when it encounters incorrectly formatted shadow tables.


type: t
user: drh
brief: Fixed ticket [be436a7f4587ce51|be436a7f45].
comment:
  Fixed ticket [be436a7f4587ce51|be436a7f45]: <i>Use-after-free on schema change where RTREE is used inside of a trigger</i> plus 5 other changes


type: ci
user: drh
comment:
  Use the __builtin_clzll() function of gcc to improve the performance and
  reduce the size of the sqlite3LogEst() routine.


type: ci
user: dan
comment:
  Do not search for locks to clear when connecting to a db in multi-process mode
  unless it looks like the previous user of the client-id crashed.


type: ci
user: dan
comment:
  Only use indexes on expressions to optimize ORDER BY and GROUP BY if the
  collation sequence matches. Possible fix for [e20dd54a].


type: t
user: dan
brief: New ticket [e20dd54ab0e43838|e20dd54ab0].
comment:
  New ticket [e20dd54ab0e43838|e20dd54ab0] <i>COLLATE sequence for ORDER/GROUP BY ignored when using an index-on-expression</i>.


type: ci
user: drh
comment:
  Combine the OP_CreateTable and OP_CreateIndex opcodes of the bytecode engine
  into a single OP_CreateBtree opcode.  This simplifies the implementation and
  makes the bytecode programs clearer.


type: t
user: dan
brief: Ticket [e20dd54ab0e43838|e20dd54ab0]: 6 changes
comment:
  Ticket [e20dd54ab0e43838|e20dd54ab0] <i>COLLATE sequence for ORDER/GROUP BY ignored when using an index-on-expression</i> status still Open with 6 other changes


type: t
user: drh
brief: Fixed ticket [e20dd54ab0e43838|e20dd54ab0].
comment:
  Fixed ticket [e20dd54ab0e43838|e20dd54ab0]: <i>COLLATE sequence for ORDER/GROUP BY ignored when using an index-on-expression</i> plus 3 other changes


type: ci
user: drh
comment:
  For the unix VFS, avoid an unnecessary stat() system call prior to opening
  any file in the common case where there are no unused file descriptors.


type: ci
user: dan
comment:
  Ensure that write-locks on pages are dropped at the end of each
  write transaction, even if there is still a read transaction open.


type: ci
user: drh
comment:
  Another size and performance optimization to readDbPage().  This time we
  eliminate some unnecessary local variables.


type: ci
user: drh
comment:
  Add the "mksourceid" program to the build process.  That program changes
  the SQLITE_SOURCE_ID if the source tree has been modified in any way.


type: g
user: drh
comment:
  Edit [d4c05e04f7e1325a|d4c05e04f7]: Move to branch [/timeline?r=mksourceid&nd&dp=d4c05e04f7e1325a&unhide | mksourceid].


type: g
user: drh
comment:
  Edit [ca5dcb4a36931161|ca5dcb4a36]: Move to branch [/timeline?r=mistake&nd&dp=ca5dcb4a36931161&unhide | mistake]. Edit check-in comment.


type: ci
user: drh
comment:
  Less dramatic changes to the source-id following an edit.  Modify the way
  that the amalgamation is constructed to give it the opportunity to detect
  changes and modify the source-id.


type: ci
user: drh
comment:
  Update documentation to make it clear that SQLITE_SOURCE_ID and
  sqlite3_sourceid() might changes if the source code is edited.


type: t
user: drh
brief: Fixed ticket [7486aa54b968e9b5|7486aa54b9].
comment:
  Fixed ticket [7486aa54b968e9b5|7486aa54b9]: <i>Assertion fault caused by sqlite3_result_pointer()</i> plus 5 other changes


type: ci
user: drh
comment:
  Update the mechanism used to keep track of what kind of syncing to do for
  WAL transaction commits and checkpoint operations.  Use the checkpoint-style
  of syncing to sync the header of a new or restarted WAL file.


type: ci
user: drh
comment:
  Improve the internal mechanism used to keep track of what kind of syncing
  to do for WAL transaction commits and checkpoint operations. 
  Use the checkpoint-style of syncing to sync the header of a new
  or restarted WAL file.


type: ci
user: dan
comment:
  Avoid returning duplicate rows in experimental pragmas "pragma_list",
  "module_list" and "function_list".


type: t
user: drh
brief: New ticket [02f0f4c54f2819b3|02f0f4c54f].
comment:
  New ticket [02f0f4c54f2819b3|02f0f4c54f] <i>The &quot;.dump&quot; comman crashes following PRAGMA empty_result_callbacks=1</i>.


type: ci
user: drh
comment:
  Fix the ".dump", ".schema", and ".fullschema" commands of the command-line
  shell so that they work even if PRAGMA empty_result_callbacks is enabled.
  Fix for ticket [02f0f4c54f281].


type: t
user: drh
brief: Fixed ticket [02f0f4c54f2819b3|02f0f4c54f].
comment:
  Fixed ticket [02f0f4c54f2819b3|02f0f4c54f]: <i>The &quot;.dump&quot; comman crashes following PRAGMA empty_result_callbacks=1</i> plus 5 other changes


type: ci
user: drh
comment:
  Avoid unnecessary mutexes in the pcache1 implementation in the common case
  where no auxiliary page cache memory is configured.


type: ci
user: drh
comment:
  Faster memory allocation from lookaside by not trying to keep track of the
  number of outstanding allocations, and rather computing that value only
  when requested.


type: ci
user: drh
comment:
  Clarify the documentation about "protected" versus "unprotected" sqlite3_value
  objects.  No changes to code.


type: ci
user: drh
comment:
  Small size and performance improvement in pcacheManageDirtyList() by not
  zeroing the PgHdr.pDirtyNext and PgHdr.pDirtyPrev pointers for PgHdr objects
  that are not on the dirty list.


type: ci
user: drh
comment:
  Remove an obsolete optimization in pcache that due to more recent changes
  was recently making the code a little slower.


type: ci
user: drh
comment:
  Add the new sqlite3PagerUnrefPageOne() pager method to deal with the special
  case of unreferencing page1.


type: ci
user: drh
comment:
  Fix recent test cases in test/indexepxr2.test so that they work even without
  SQLITE_ENABLE_STAT4 and SQLITE_ENABLE_JSON1.


type: t
user: drh
brief: New ticket [b899b6042f97f52d|b899b6042f].
comment:
  New ticket [b899b6042f97f52d|b899b6042f] <i>Segfault on correlated subquery on the RHS of an IN operator in the WHERE clause</i>.


type: ci
user: dan
comment:
  Add experimental API sqlite3rbu_temp_size_limit(). For limiting the amount of
  temporary disk space RBU uses.


type: ci
user: dan
comment:
  Update "PRAGMA integrity_check" to detect inconsistencies between a single
  record's header and body.


type: ci
user: drh
comment:
  Prevent a possible crash when trying to recover using a carefully corrupted \
  and truncated rollback journal.  (Test case in TH3)


type: ci
user: dan
comment:
  Have the header comment for sqlite3Checkpoint() mention TRUNCATE along with
  the other three checkpoint types. No changes to code.


type: ci
user: drh
comment:
  Use a mutex-free PRNG for the random() and randomblob() SQL functions and for
  the randomness used during checkpoint operations.


type: ci
user: dan
comment:
  Add tests to check that affinities work with != operators on virtual table
  column values. No changes to code.


type: ci
user: drh
comment:
  Make sure all connections are closed in the pragma.test script.
  Test change only - no changes to code.


type: t
user: drh
brief: Fixed ticket [b899b6042f97f52d|b899b6042f].
comment:
  Fixed ticket [b899b6042f97f52d|b899b6042f]: <i>Segfault on correlated subquery on the RHS of an IN operator in the WHERE clause</i> plus 5 other changes


type: t
user: drh
brief: Fixed ticket [cfa2c908f218254d|cfa2c908f2].
comment:
  Fixed ticket [cfa2c908f218254d|cfa2c908f2]: <i>Assertion fault in STAT4 on a double-negation</i> plus 5 other changes


type: ci
user: drh
comment:
  Fix an error in [b22cdd67] that can cause a negative infinity to be (rarely)
  reported as a positive infinity.


type: ci
user: dan
comment:
  Hack to have multiple connections to a single file share a
  single memory mapping of the databse file.


type: ci
user: mistachkin
comment:
  Remove use of the rand_s() function (added by [139081bef9f63c3e]) as it appears to cause issues with some third-party DLLs.


type: ci
user: drh
comment:
  Improvements to PRAGMA integrity_check for better detection of malformed
  records.  Integrity_check now avoids returning SQLITE_CORRUPT on a corrupt
  record.  Also includes microoptimizations that I stumbled over while working
  on integrity_check.


type: ci
user: drh
comment:
  Avoid an out-of-bounds read on a recovery attempt using a carefully crafted
  database and rollback journal with mismatched page sizes.  The test case for
  this is in TH3.


type: ci
user: drh
comment:
  Do not make the assumption (as check-in [4da49a95c0f07] incorrectly did) that
  the ExprList returned by sqlite3ExprListDup() would never be passed into
  sqlite3ExprListAppend().  Include a new test case that shows this sometimes
  does happen.


type: ci
user: drh
comment:
  The out-of-bounds read on recovery fix of check-in [378afa16381a222a] caused
  problems for some corner-case error conditions.  This alternative fix appears
  to work better.


type: ci
user: dan
comment:
  Add extension "mmapwarm.c". Provides function sqlite3_mmap_warm(), used to
  "warm up" the memory mapping used by SQLite in mmap mode to access db file
  content.


type: ci
user: drh
comment:
  Fix the rendering of the P4_INTARRAY argument to the OP_IntegrityCk opcode
  in the output of EXPLAIN.


type: ci
user: drh
comment:
  Revert one performance improvement changes from check-in [3b3e32d4cd07] as
  it was causing a reference to an uninitialized value.


type: ci
user: drh
comment:
  Fix a bug in tool/mksourceid.c: 
  The mksourceid.c program was incorrectly including the "# Remove this line"
  line of the Fossil-generated "manifest" file in the SHA3 hash.  That means
  that all SQLITE_SOURCE_IDs for trunk versions going back to
  check-in [30966d56] (2017-08-22) are incorrect.


type: ci
user: drh
comment:
  Merge in all the trunk enhancements of the previous 7 months.  The LIKE
  optimization has stopped working when there is an ESCAPE - that problem will
  be addressed in a subsequent check-in.


type: ci
user: drh
comment:
  In the Windows VFS, do not emit an SQLITE_CANTOPEN error log message when
  falling back from SQLITE_OPEN_READWRITE to SQLITE_OPEN_READONLY.  Wait until
  the open fails completely.


type: ci
user: drh
comment:
  In the Windows VFS, when trying to open a database file read/write, if it
  fails check to see if the file exists and is read-only and immediately fall
  back to a read-only open attempt, rather than running the AV retry loop.


type: ci
user: dan
comment:
  Cherrypick [ec37ad6d08] into this branch. With this patch, if
  SQLITE_SHARED_MAPPING is defined at build-time SQLite will use a single memory
  mapping for multiple connections to the same database file within a single
  process.


type: ci
user: mistachkin
comment:
  Use the updated Win32 VFS semantics for winOpen from check-in [5d03c738e9] for WinRT, et al, as well.


type: ci
user: drh
comment:
  Partial backout of check-in [e0af9a904076].  It turns out we do need some
  extra space at the end of the record blob as an overrun area to use when
  decoding a maliciously malformed record.


type: ci
user: drh
comment: Simplification to the logic that computes column type names.
ecomment:
  Simplification to the logic that computes column type names.
  Update: Does not work in all configurations.


type: ci
user: dan
comment:
  Lock the wal file for all snapshot transactions, even if they would not
  otherwise require this, preventing checkpointers and writers from wrapping the
  wal file. This means that if one connection has an open snapshot transaction
  it is guaranteed that a second connection can open a transaction on the same
  snapshot.


type: ci
user: dan
comment:
  Experimental change so that snapshot transactions always lock the wal file -
  preventing writers or truncate-checkpointers from wrapping it.


type: ci
user: drh
comment:
  Disable tests for the LIKE optimization when ICU is enabled, since the
  LIKE optimization only works for the built-in LIKE operator and ICU overrides
  the built-in.


type: ci
user: drh
comment:
  Indexes on expressions with a COLLATE clause are able to satisfy an ORDER BY 
  with the same COLLATE clause.


type: ci
user: drh
comment:
  Add new routines to simplify dealing with collating sequences in expressions:
  sqlite3ExprNNCollSeq() and sqlite3ExprCollSeqMatch().


type: ci
user: drh
comment:
  Fix an issue introduced by check-in [4cd2a9672c59] (2017-03-03) that could
  allow a negative value in the 3rd parameter to memmove() when
  defragmentPage() is called on a btree page with a corrupted
  freeblock list.  The corruption is now detected early and results in
  an SQLITE_CORRUPT return before the memmove() is reached.


type: ci
user: drh
ecomment:
  Remove the (undocumented) query-planner control that prevents 
  a "SELECT ALL" subquery in FROM clause from being implemented as a co-routine.
  This control was added by [a29e117d7ec], where it was called a "stop-gap".

comment:
  Remove the (undocumented) query-planner control that prevents 
  a "SELECT ALL" subquery in FROM clause from being implemented as a co-routine.


type: ci
user: drh
comment:
  Do not flatten subqueries that contain an ORDER BY or GROUP BY clause and
  can be implemented using a co-routine.


type: ci
user: drh
comment:
  Make sure the 6th parameter to the authorizer callback for view subqueries
  has the correct view name.


type: ci
user: drh
comment:
  Clean up the comments on the query flattener to more clearly and accurately
  express the conditions under which the flattener is able to run.


type: ci
user: drh
comment:
  Fix unreachable conditionals and revise a testcase that was made obsolete by
  the changes on this branch.


type: ci
user: drh
comment:
  Make sure the SQLITE_Stat34 optimization switch is always 0x800, a value
  which is hard-coded in the TH3 test suite.


type: ci
user: drh
comment:
  The query planner now always prefers to implement a FROM-clause subquery using
  a co-routine rather than flattening the subquery into the outer query.


type: ci
user: drh
comment:
  Add the OK_IF_ALWAYS_TRUE() and OK_IF_ALWAYS_FALSE() macros for marking
  conditionals that improve performance but do not change the outcome.


type: ci
user: drh
comment:
  Do not compute column and row size estimates for the transient Table objects
  associated with the result set of a SELECT statement, since those estimates
  are never used for anything constructive.


type: ci
user: dan
ecomment:
  Add the experimental "sqlite_expert" extension. Used to find index definitions
  that might help with specified SQL queries.  (Later:) Parked on a dead-end 
  branch due to an assertion fault in TH3.  We will merge again after the
  bug is fixed.

comment:
  Add the experimental "sqlite_expert" extension. Used to find index definitions
  that might help with specified SQL queries.


type: g
user: drh
comment:
  Edit [f10ece964f1f484f|f10ece964f]: Move to branch [/timeline?r=does-not-work&nd&dp=f10ece964f1f484f&unhide | does-not-work]. Edit check-in comment.


type: ci
user: drh
comment:
  Fix the sqlite3_column_decltype() interface to return the correct datatype
  when the value comes through a CTE.


type: ci
user: drh
comment:
  The simplification to sqlite3SelectExpand() in last night's
  [3a4ffb21] check-in was not completely correct.  This adjustment is needed
  for correct OOM handling in some configurations.


type: ci
user: drh
comment:
  Remove an unused variable from sqlite3Insert() and fix harmless
  compiler warnings associated with -DSQLITE_MUTATION_TEST.


type: ci
user: drh
comment:
  Do not enable SELECT tracing with -DSQLITE_DEBUG.  Require the
  -DSQLITE_ENABLE_SELECTTRACE compile-time option to enable SELECT tracing.


type: ci
user: dan
comment:
  Add tests to verify that the busy-handler is invoked correctly when processing "PRAGMA optimize" and ANALYZE commands.


type: ci
user: drh
comment:
  Turn restriction 20 on the query flattener into an assert since the situation
  restricted can no longer occur because of the more aggressive use of
  co-routines.


type: ci
user: drh
comment:
  New test cases for ticket [b899b6042f97f5] derived from a bug report on
  the mailing list from Wout Mertens.


type: ci
user: dan
comment:
  Update the speedtest1 program so that it prints the output of "PRAGMA
  compile_options" if the -stats option is specified.


type: ci
user: drh
comment:
  Fix the command-line shell so that the ".schema --indent" command does a better
  job of dealing with \r\n in the middle of a CREATE statement in the schema.


type: ci
user: drh
comment:
  Disable the delta checksum verification in RBU by default.  Reenable it using
  -DRBU_ENABLE_DELTA_CKSUM, if desired.


type: ci
user: mistachkin
comment:
  Revise variable declaration moved in the previous check-in so sqlite3VdbeReset() is consistent with sqlite3VdbeRewind().


type: ci
user: dan
comment:
  Add new extension "bgckpt" in ext/misc/bgckpt.c. For experimenting with
  running wal2 mode checkpoints in a background thread.


type: t
user: drh
brief: New ticket [e651b1341861d699|e651b13418].
comment:
  New ticket [e651b1341861d699|e651b13418] <i>DROP TABLE fails for WITHOUT ROWID tables an SQLITE_OMIT_AUTOVACUUM</i>.


type: ci
user: drh
comment:
  DROP TABLE now works for WITHOUT ROWID tables and the SQLITE_OMIT_AUTOVACUUM
  compile-time option.  Fix for ticket [e651b1341861d6]


type: t
user: drh
brief: Fixed ticket [e651b1341861d699|e651b13418].
comment:
  Fixed ticket [e651b1341861d699|e651b13418]: <i>DROP TABLE fails for WITHOUT ROWID tables an SQLITE_OMIT_AUTOVACUUM</i> plus 5 other changes


type: ci
user: drh
comment:
  Initial implementation of the "sqlite_dbpage" virtual table.  Currently
  it is read-only and has a place-holder xBestIndex.


type: ci
user: drh
comment:
  In the speed-check.sh test script, allow an additional test-name argument
  which becomes the comparison baseline, in place of "trunk".


type: ci
user: drh
comment:
  Convert the implementation of the ".dbstat" dot-command of the command-line
  shell to use the sqlite_dbpage table.


type: ci
user: drh
comment:
  Fix a typo in a numeric constant in an assert() - a bug that has been present
  in the code since check-in [79e22b95038] on 2010-03-30.


type: ci
user: dan
comment:
  Add new extension "checkfreelist", which uses sqlite_dbpage to check that
  there are no invalid entries on the database free-list.


type: ci
user: dan
comment:
  Check that the leaf count on each freelist trunk page is in range as part of
  checkfreelist processing.


type: ci
user: drh
comment:
  Create the new ext/repair folder and move checkfreelist.c there.  Remove
  checkfreelist.c from the command-line shell (undoing check-in [48418f2e]).


type: ci
user: drh
comment:
  Make sure the tableColumnList() routine of the command-line shell does not
  cause a null-pointer dereference in an error condition.


type: ci
user: drh
comment:
  The src/shell.c file is now generated from src/shell.c.in, so remove shell.c
  from version control and update the makefiles to build it automatically.


type: ci
user: drh
comment:
  Merge fixes from trunk.  All changes are on makefiles and test scripts.
  There are no core code changes.


type: ci
user: drh
comment:
  Fix the "snapshot-tarball" makefile target, which was broken by the shell.c
  change of check-in [36acc0a9].


type: ci
user: drh
ecomment:
  I was a little concerned about this check-in.  Though I could not generate a
  failure myself, I thought it was risky.  I checked it in for further testing.
  Then, overnight, OSSFuzz found a failure case for me.  So the change is now
  moved out into a deadend branch.
  Was: Use OP_SCopy rather than OP_Copy to transfer results from a co-routine to
  its consumer.  This undoes an earlier fix for ticket [98825a79ce] by
  check-in [ec6a06246e] because that problem no longer occurs due to WHERE
  clause push-down.

comment:
  Use OP_SCopy rather than OP_Copy to transfer results from a co-routine to
  its consumer.  This undoes an earlier fix for ticket [98825a79ce] by
  check-in [ec6a06246e] because that problem no longer occurs due to WHERE
  clause push-down.


type: ci
user: drh
comment:
  Add the sqlite_dbpage virtual table (enabled using SQLITE_ENABLE_DBPAGE_VTAB).
  Make that virtual table and dbstat available to the command-line shell.


type: g
user: drh
comment:
  Edit [d1ef9eaba0b1bf61|d1ef9eaba0]: Move to branch [/timeline?r=withdrawn&nd&dp=d1ef9eaba0b1bf61&unhide | withdrawn]. Mark "Closed". Edit check-in comment.


type: ci
user: dan
comment:
  Update main.mk to build the sqlite3_expert program with -DSQLITE_THREADSAFE=0
  and -DSQLITE_OMIT_LOAD_EXTENSION. To minimize dependencies.


type: ci
user: drh
comment:
  Move some test logic out of tclsqlite.c and into auxiliary test_*.c files.
  This is a work in progress.


type: ci
user: drh
comment:
  When compiling with SQLITE_TEST, extra options are available on the
  "DB version" command for controlling the internal state of the SqliteDb
  object, for testing purposes.


type: ci
user: drh
comment:
  The db_use_legacy_prepare command no longer exists.  Use the undocumented
  -use-legacy-prepare option to DB version instead.


type: ci
user: drh
comment:
  Move a bunch of unrelated test code out of tclsqlite.c and into
  test_*.c files.  There is still some test code in tclsqlite.c, but the amount
  is greatly reduced.


type: ci
user: drh
comment:
  Add the tcl/mkccode.tcl script used to construct a single C-language source
  fiel for programs that combine C-code, SQLite, and TCL.  Use this script to
  construct the sqlite3_analyzer program.


type: ci
user: drh
comment:
  Improved ability to generate stand-alone program using TCL and SQLite by
  compiling with -DTCLSH_INIT_PROC=name to cause the TCL interpreter to be
  initialized using procedure name().  Both sqlite3_analyzer and testfixture
  are now built this way.


type: ci
user: drh
comment:
  In the query planner, do not consider index X to be a proper subset of 
  index Y if X is a covering index but Y is not.


type: ci
user: drh
comment:
  Merge all the enhancements and bug fixes from trunk, since none are
  destablizing.  Call this the second beta.


type: ci
user: drh
comment:
  Fix the ".check" command of the command-line shell to return 1 (error)
  rather than 2 (exit) on a test failure.


type: ci
user: mistachkin
comment:
  The source code files generated for the 'sqlite3-all.c' target should not have Windows line-endings.


type: ci
user: dan
comment:
  Avoid using snprintf as a member variable of a struct in sqlite3ext.h. This
  causes problems on OSX. Similar to fix [a1fd3aa8].


type: ci
user: dan
comment: Take extra care to avoid an OOB read caused by a corrupt b-tree page.
ecomment:
  Take extra care to avoid an OOB read caused by a corrupt b-tree page.
  This fixes a problem detected by Natalie Silvanovich of Google Project Zero.


type: ci
user: drh
comment:
  Catch and avoid a 16-bit integer overflow on the number of columns in a
  common table expression.  This fixes a problem found by OSS-Fuzz.  The
  test case is in TH3.


type: ci
user: dan
comment:
  In lsm (not SQLite), avoid opening the *-shm file before the database file is
  locked. Otherwise, there is a race condition whereby a connection in another
  process process may unlink() it while it is still in use.


type: ci
user: drh
comment:
  Updates to test procedures so that they all work with encryption.  No changes
  to the core SQLite code.


type: ci
user: dan
comment:
  Merge trunk fixes to swarmvtabfault.test and the lsm extension into this
  branch. No changes to core SQLite code.


type: ci
user: mistachkin
comment:
  In the 'swarmvtabfault' test module, make sure to close the database handle prior to raising an error from the 'not found' callback script.


type: ci
user: drh
comment:
  On the amalgamation package, enable the sqlite_dbpage virtual table so that
  the .dbinfo command works in the CLI.


type: ci
user: dan
comment:
  Fix a problem in the incr-blob code causing a new cursor to be opened for
  every sqlite3_blob_reopen() call.


type: ci
user: drh
comment:
  Add the sqlite_btreeinfo eponymous-only table for introspecting the schema
  and estimating the sizes of various btrees.


type: ci
user: drh
comment:
  Do not reference the ioctl() system call in the unix backend unless it
  is actually needed by the Batch Atomic Write extension.  This should allow
  the build to work on VxWorks.


type: ci
user: dan
comment:
  Add SQL scalar function rtreecheck() to the rtree module. For running checks
  to ensure the shadow tables used by an rtree virtual table are internally
  consistent.


type: g
user: mistachkin
comment:
  Edit [dde0bb3eab1316c3|dde0bb3eab]: Move to branch [/timeline?r=rtree-integrity-check&nd&dp=dde0bb3eab1316c3&unhide | rtree-integrity-check].


type: ci
user: mistachkin
comment:
  Add SQL scalar function rtreecheck() to the rtree module. For running checks to ensure the shadow tables used by an rtree virtual table are internally consistent.


type: ci
user: drh
comment:
  Use extra locks to prevent a readonly_shm=1 process from connecting to a
  WAL-mode database if there are no writers.


type: ci
user: dan
comment:
  Instead of extra locks, use F_GETLK to ensure that readonly_shm clients cannot
  connect to a wal-mode database if there are no writers.


type: ci
user: dan
comment:
  Fix a bug causing "make amalgmation-autoconf" to create an invalid package if
  either the current or parent directory contains a file named install.sh or
  install-sh.


type: ci
user: dan
comment:
  Fix a race condition in os_unix.c that might allow a client to use a *-shm
  file corrupted by a power failure if another client fails between locking the
  *-shm file and truncating it to zero bytes.


type: ci
user: drh
comment:
  Additional test case demonstrating the ability to access structure elements
  using quoted names in the JSON1 extension.


type: ci
user: dan
comment:
  Add the start of the "incremental_index_check" virtual table in
  ext/repair/checkindex.c. For incremental verification of index contents.


type: g
user: drh
comment:
  Edit [0926df095faf72c2|0926df095f]: Move to branch [/timeline?r=mistake&nd&dp=0926df095faf72c2&unhide | mistake]. Mark "Closed". Edit check-in comment.


type: ci
user: drh
comment:
  Reactivate query flattening when the result set of the outer query has
  no function calls or subqueries.  This is a partial reversal of 
  check-in [c9104b59].  Co-routines are still preferred if the outer
  query has a complex result set, but for simple results sets, query flattening
  is used.  Check-in [4464f40ccd7] is completely backed
  out due to this change.


type: ci
user: drh
comment:
  Increase the version number for the next release - which is still months
  away but there have been significant query planner enhancements since the
  previous release.


type: ci
user: dan
comment:
  In checkindex.c, use C code instead of SQL/group_concat() to compose various
  SQL clauses. This is to make it easier to support indexes on expressions.


type: ci
user: dan
comment:
  Fix a couple of issues in incremental_index_check to do with CREATE INDEX
  statements that contain embedded SQL comments.


type: ci
user: drh
comment:
  Update the built procedures for the sqlite3_analyzer utility to allow it
  to be linked with an external sqlite3.o library.  Automatically detect a
  missing dbstat extension and report the compile-time error.


type: ci
user: drh
comment:
  When sqlite3_checker finds a problem, show the row key as part of the error
  message, not the row index number.


type: ci
user: drh
comment:
  Minor cleanup in checkindex.c.  Add progress displays when checking a
  single index in the top-level TCL script for sqlite3_checker.


type: ci
user: dan
comment:
  If a readonly_shm connection cannot map the *-shm file because no other
  process is holding the DMS lock, have it read from the database file only,
  ignoring any content in the wal file.


type: ci
user: drh
comment:
  Move the test scripts for checkfreelist and checkindex over into the
  ext/repair/test directory.  Run them now using the sqlite3_checker utility
  with the --test option.  Some tests are currently failing due to an
  incomplete port.  This is an incremental check-in.


type: ci
user: drh
comment:
  Add the "sqlite3_imposter DB SCHEMA ROOT SQL" command to sqlite3_checker.
  Use it to fix the checkindex01.test module.  There are still errors reported
  by the checkfreelist01.test module.


type: ci
user: drh
comment:
  Adjust page numbers in the ext/repair/test/checkfreelist01.test module due to
  the fact that the pending-byte page is no longer shifted down to a low-numbered
  page but is in its rightful place.


type: ci
user: drh
comment:
  The "PRAGMA noop_update" command now requires SQLITE_ENABLE_NOOP_UPDATE
  and no longer requires SQLITE_DEBUG.


type: ci
user: drh
comment:
  Add the checkindex.c extension and the sqlite3_checker utility program used
  for doing live validation of large databases.


type: ci
user: dan
comment:
  Merge changes from trunk. This fixes the SQLITE_ENABLE_UPDATE_DELETE_LIMIT functionality so that it works with views and WITHOUT ROWID tables.


type: ci
user: dan
comment:
  Avoid locking shm-lock WAL_READ_LOCK(0) during recovery. Doing this allows
  recovery to proceed while a readonly_shm connection in unlocked mode has an
  ongoing read transaction.


type: ci
user: dan
comment:
  Allow readonly_shm connections to access the *-shm file using read() even if
  it is unable to take a DMS lock.


type: ci
user: dan
comment:
  In cases where a readonly_shm client cannot take the DMS lock on the *-shm
  file, have it parse the wal file and create a wal-index to access it in heap
  memory.


type: g
user: dan
comment:
  Edit [9b0d5c4ff707f58b|9b0d5c4ff7]: Move to branch [/timeline?r=fcntl_shm_read&nd&dp=9b0d5c4ff707f58b&unhide | fcntl_shm_read].


type: t
user: dan
brief: Ticket [aa98619ad08ddcab|aa98619ad0]: 3 changes
comment:
  Ticket [aa98619ad08ddcab|aa98619ad0] <i>Assertion fault on an IN operator using a constant index</i> status still Fixed with 3 other changes


type: ci
user: dan
comment:
  On unix, if the *-shm file cannot be opened for read/write access, open it
  read-only and proceed as if the readonly_shm=1 URI option were specified.


type: ci
user: dan
comment:
  Handle the race condition that may occur if another process connects and then
  checkpoints and truncates the wal file while a readonly-shm client is building
  its heap-memory wal-index.


type: ci
user: drh
comment:
  Enhance the checkindex.c virtual table so that it will output the
  index_name and after_key parameters.  Also add a new diagnostic output
  column named scanner_sql which shows the SQL statement used to implement
  the current index scan.


type: ci
user: drh
comment:
  Disallow ORDER BY and LIMIT on UPDATE and DELETE of views and WITHOUT ROWID
  tables.  This is a temporary fix for ticket [d4beea1633f1b88f] until a better
  solution can be found.


type: ci
user: drh
comment:
  Turns out that SQLITE_READONLY_CANTLOCK is an historical name that must
  be preserved.  So make a new SQLITE_READLOCK_CANTINIT name instead.


type: t
user: drh
brief: New ticket [d4beea1633f1b88f|d4beea1633].
comment:
  New ticket [d4beea1633f1b88f|d4beea1633] <i>DELETE with a LIMIT does not work for WITHOUT ROWID tables</i>.


type: ci
user: dan
comment:
  Fix the SQLITE_ENABLE_UPDATE_DELETE_LIMIT functionality so that it works with
  views and WITHOUT ROWID tables. This is a modified cherrypick of [dae4a97a].


type: ci
user: dan
comment:
  Fix a problem with (DELETE...LIMIT) statements against WITHOUT ROWID tables
  with a single column PK.


type: ci
user: dan
comment:
  Fix the SQLITE_ENABLE_UPDATE_DELETE_LIMIT functionality so that it works with views and WITHOUT ROWID tables.


type: ci
user: drh
comment:
  In wal.c: improved comments, new assert() and testcase() macros, and
  replace some magic numbers with appropriate symbolic constants.


type: ci
user: drh
comment:
  Remove some branches in walTryBeginRead() that were 
  added by check-in [ce5d13c2de] but became unreachable with the addition
  of logic in check-in [18b26843] that enabled read-only clients to parse
  the WAL file into a heap-memory WAL-index, thus guaranteeing that the 
  WAL-index header is always available.


type: ci
user: drh
comment:
  Add the ability to read from read-only WAL-mode database files as long as
  the -wal and -shm files are present on disk.


type: ci
user: drh
comment:
  Merge the patch that enables reading a read-only WAL-mode database, without
  any special query parameters, as long as the -shm and -wal files are on disk.


type: ci
user: drh
comment:
  In the parse tree, combine LIMIT and OFFSET into a single expression rooted
  on a TK_LIMIT node, for a small code size reduction and performance increase,
  and a reduction in code complexity.


type: ci
user: drh
comment:
  An experimental optimization to DISTINCT that causes an immediate exit of
  the inner loop of a join following each output row if the inner loop does
  not contribute any columns to the result set.


type: ci
user: dan
comment:
  Avoid creating a master journal if all or all but one of the databases in the
  transaction is a temp file.


type: ci
user: dan
ecomment:
  In the LSM extension,
  ensure that empty space on pages is zeroed before they are written to disk.
  This helps with compressed databases, and stops valgrind complaining about
  uninitialized bytes and write().

comment:
  Ensure that empty space on pages is zeroed before they are written to disk.
  This helps with compressed databases, and stops valgrind complaining about
  uninitialized bytes and write().


type: ci
user: dan
comment:
  Do not count temporary databases that have been attached using ATTACH when
  figuring out if a master-journal file is required by a transaction.


type: ci
user: dan
comment:
  Merge latest trunk changes, including the SQLITE_ENABLE_MULTITHREADED_CHECKS
  feature, into this branch.


type: ci
user: dan
comment:
  Enhance the log messages produced in some cases if database corruption is
  encountered by an SQLITE_DEBUG build.


type: ci
user: drh
comment:
  Improved fix for ticket [da78413751863] that does not require disabling the
  query flattener as was done in [005d5b870625].  This also makes the code
  generator for vector IN operators a little easier to understand.


type: ci
user: dan
comment:
  Fix a problem preventing the planner from identifying scans that visit at most
  one row in cases where that property is guaranteed by a unique, not-null,
  non-IPK column that is the leftmost in its table.


type: g
user: dan
comment:
  Edit [299d7ca52fec32f0|299d7ca52f]: Move to branch [/timeline?r=left-join-omit-fix&nd&dp=299d7ca52fec32f0&unhide | left-join-omit-fix].


type: ci
user: dan
comment:
  Update the omit-table-from-left-join optimization so that it can omit tables
  from the middle of the join as well as the end.


type: t
user: drh
brief: New ticket [ef9318757b152e3a|ef9318757b].
comment:
  New ticket [ef9318757b152e3a|ef9318757b] <i>Incorrect result due to the skip-ahead-distinct optimization</i>.


type: ci
user: drh
comment:
  Fix the skip-ahead-distinct optimization on joins for cases there the table
  in the inner loop of the join does not contribute any columns to the
  result set.  Proposed fix for ticket [ef9318757b152e3a2]


type: t
user: drh
brief: Ticket [ef9318757b152e3a|ef9318757b]: 6 changes
comment:
  Ticket [ef9318757b152e3a|ef9318757b] <i>Incorrect result due to the skip-ahead-distinct optimization</i> status still Open with 6 other changes


type: ci
user: drh
comment:
  Fix a problem in the omit-table-from-left-join optimization 
  from check-in [0cd82ee9a8413cf] that was discovered by OSSFuzz.


type: ci
user: drh
comment:
  Completely disable the skip-ahead-distinct optimization for all but the
  inner-most loop of a DISTINCT join.  Fix for ticket [ef9318757b152e3a26e9592]


type: t
user: drh
brief: Fixed ticket [ef9318757b152e3a|ef9318757b].
comment:
  Fixed ticket [ef9318757b152e3a|ef9318757b]: <i>Incorrect result due to the skip-ahead-distinct optimization</i> plus 3 other changes


type: ci
user: dan
comment:
  Add experimental feature to detect threading bugs in apps that use
  SQLITE_CONFIG_MULTITHREADED. Enabled at compile time using
  SQLITE_ENABLE_MULTITHREADED_CHECKS.


type: t
user: drh
brief: Fixed ticket [d4beea1633f1b88f|d4beea1633].
comment:
  Fixed ticket [d4beea1633f1b88f|d4beea1633]: <i>DELETE with a LIMIT does not work for WITHOUT ROWID tables</i> plus 5 other changes


type: ci
user: dan
comment:
  Merge latest trunk changes, including the compilation fix for builds that
  define both SQLITE_ENABLE_MULTITHREADED_CHECKS and SQLITE_ENABLE_API_ARMOUR.


type: ci
user: dan
comment:
  Fix a compilation problem when both SQLITE_ENABLE_MULTITHREADED_CHECKS and
  SQLITE_ENABLE_API_ARMOUR are defined.


type: ci
user: dan
comment:
  If SQLITE_HAVE_ZLIB is defined at build-time, include the functions in
  ext/misc/compress.c in the shell.


type: ci
user: dan
comment:
  Begin adding support for the sqlar archive format to shell.c. There is no
  "extract" command so far, only "create".


type: ci
user: drh
comment:
  When doing a table scan using an index, do not error out if collating
  functions used by that index are unavailable, since they will not be used.


type: ci
user: drh
comment:
  Make sure the bComplex variable in sqlite3DeleteFrom() is initialized when
  compiling with -DSQLITE_OMIT_TRIGGER.


type: ci
user: dan
comment:
  Add compile time switch SQLITE_ENABLE_ICU_COLLATIONS. For enabling ICU
  collations without also enabling the tokenizer, the LIKE operator, the
  REGEXP operator, or the unicode aware upper()/lower() scalar functions.


type: ci
user: dan
comment:
  Enhance virtual table "fsdir" in ext/misc/fileio.c. Add support for "-C" to
  the shell command's ".ar c" command.


type: ci
user: dan
comment:
  Add support for parsing options in non-traditional tar form to the ".ar"
  command. Have writefile() attempt to create any missing path components. And
  not to throw an exception if it is called to create a directory that already
  exists.


type: ci
user: dan
comment:
  Change some LSM code internal typenames from "Blob" and "Pgno" to "LsmBlob"
  and "LsmPgno". This allows the LSM code to be compiled as a single unit with
  sqlite3.c.


type: ci
user: drh
comment:
  Correctly invalidate a column cache line when it is overwritten with NULL.
  Fix for ticket [123c9ba32130a6c9d432].


type: t
user: drh
brief: New ticket [123c9ba32130a6c9|123c9ba321].
comment:
  New ticket [123c9ba32130a6c9|123c9ba321] <i>Incorrect result when an index is used for an ordered join</i>.


type: ci
user: drh
comment:
  New result code SQLITE_READONLY_DIRECTORY is returned when an attempt is
  made to write on a database file that is in a read-only directory and hence
  the journal file could not be created.  This situation formerly returned
  SQLITE_CANTOPEN, which less helpful.


type: t
user: drh
brief: Fixed ticket [123c9ba32130a6c9|123c9ba321].
comment:
  Fixed ticket [123c9ba32130a6c9|123c9ba321]: <i>Incorrect result when an index is used for an ordered join</i> plus 5 other changes


type: ci
user: drh
comment:
  An improved way of generating the SQLITE_READONLY_DIRECTORY error.
  The error message submitted to sqlite3_log() is still correct this way.


type: ci
user: drh
comment:
  Add the ability to write to an appended database.  This check-in compiles
  but is otherwise untested.


type: ci
user: dan
comment:
  Have the writefile() function optionally set the modification-time of the
  files it writes or creates. And many small fixes to the new code on this
  branch.


type: ci
user: drh
comment:
  Fixes to the appendvfs.c extension.  Add the "sqltclsh" application that
  uses appendvfs.c to find its scripts.


type: ci
user: dan
comment:
  Do not use the compress() and uncompress() functions in ext/misc/compress.c -
  they are not quite compatible with the spec. Instead use new functions in
  ext/misc/sqlar.c.


type: ci
user: drh
comment:
  Add unnecessary initializations to some local variables in the rtree module
  to suppress false-positive compiler warnings coming out of MSVC.


type: ci
user: dan
comment:
  Add the sqlite3_vtab_collation() function, which allows an xBestIndex callback
  to determine the collation sequence that SQLite will use for a comparison. And
  the SQLITE_DBCONFIG_FULL_EQP configuration option, which enhances the output
  of "EXPLAIN QUERY PLAN" so that it includes statements run by triggers. And
  the code for the sqlite3_expert extension and command line application.


type: ci
user: drh
comment:
  Add an experimental location(X) SQL function that attempt to return the
  location of the payload within the database for the record that contains
  column X.  location(X) returns NULL if X is not an ordinary table column or
  if SQLite cannot figure out the location because it is using a covering index.


type: ci
user: drh
comment:
  Lowercase local variable names in the SHA3 extension in order to avoid
  collisions with macros in termios.h.


type: ci
user: drh
comment:
  Add the SQLITE_DBCONFIG_MAX preprocessor macro which will always be equal to
  the largest SQLITE_DECONFIG value.


type: ci
user: drh
comment:
  Change the name of SQLITE_DBCONFIG_FULL_EQP to be SQLITE_DBCONFIG_TRIGGER_EQP
  (which we can do without breaking compatibility because the former name has
  not yet appeared in an official release) and streamline its implementation.


type: ci
user: drh
comment:
  Add the ".eqp trigger" option to the ".eqp" command in the command-line
  shell.  Implemented using the new SQLITE_DBCONFIG_TRIGGER_EQP control.


type: ci
user: drh
comment:
  Modify the new sqlite3_vtab_collation() interface so that it takes a
  pointer to the sqlite3_index_info object passed into xBestIndex rather than
  an sqlite3 connection pointer, which the xBestIndex method might not have
  access to.


type: ci
user: drh
comment:
  In the sqlite3TreeViewExprList() routine, show the "AS" alias name for 
  each expression in the list, if it exists.


type: t
user: drh
brief: Ticket [3b4450072511e621|3b44500725]: 6 changes
comment:
  Ticket [3b4450072511e621|3b44500725] <i>Inconsistent column names</i> status still Open with 6 other changes


type: ci
user: drh
comment:
  Add a SELECTTRACE() macro to indicate when column names are assigned to
  a SELECT statement.  This helps with debugging for tickets like
  [de3403bf5ae5f72e] and [3b4450072511e621].


type: ci
user: drh
comment:
  Move the generation of output column names earlier in the case of a
  CREATE TABLE AS.  This is a fix for ticket [3b4450072511e62] and a
  continuation of check-in [ade7ddf1998190b2b63] that fixes cases of
  ticket [de3403bf5ae5f72ed6] that were missed previously.


type: ci
user: drh
comment:
  Improve the error message that comes back when sqlite3_load_extension()
  fails because the named file exists but is not a valid shared library.


type: ci
user: dan
comment:
  Add new file ext/misc/zipfile.c, containing a virtual table for read-only
  access to simple zip archives.


type: ci
user: drh
comment:
  Remove the ExprSpan object. Instead, keep track of the test of subphrases in
  the parse using the "scanpt" non-terminal.


type: ci
user: drh
comment:
  In the LEMON-generated parser, rearrange the meanings of integer action codes
  so that reduce actions occur last.  This means that the most common case
  (reduce actions) can be recognized with a single comparison operation, thus
  speeding up the main parser loop, slightly.


type: ci
user: drh
comment:
  Fix an assertion fault on a syntax error input caused by check-in
  [6b2ff26c25bb9da3].  Problem discovered by OSSFuzz.


type: ci
user: drh
comment:
  Fix a NULL pointer dereference after a syntax error that can occur as a
  result of check-in [6b2ff26c25bb9da3] yesterday.  This problem was
  discovered by the OSSFuzz.


type: ci
user: drh
comment:
  Enhance LEMON so that it generates the action table in such a way that no
  range check is needed on the lookahead table to verify that the next input
  token is valid.  This makes the lookahead table slightly larger (about 120
  bytes) but helps the parser to run faster.


type: ci
user: drh
comment:
  Add support for measuring and reporting coverage of the parser state machine
  using the SQLITE_TESTCTRL_PARSER_COVERAGE test-control.


type: ci
user: dan
comment:
  Fix crashes that could occur if SQL NULL values were passed to the built-in
  FTS5 snippet function.

ecomment:
  Fix crashes that could occur if SQL NULL values were passed to the built-in
  FTS5 snippet function. Edit: breaks amalgamation builds.


type: ci
user: drh
comment:
  Add options to speedtest1.c and speed-check.sh for testing performance of
  floating-point computatations.


type: ci
user: drh
comment:
  Experiments with the regexp.c extension, trying to get it to report the
  exact substring that matches the RE.


type: ci
user: dan
comment:
  Fix crashes that could occur if SQL NULL values were passed to the built-in
  FTS5 snippet function. Edit: breaks amalgamation builds.


type: g
user: dan
comment:
  Edit [553a3ad32498ddda|553a3ad324]: Move to branch [/timeline?r=mistake&nd&dp=553a3ad32498ddda&unhide | mistake]. Add propagating "closed". Edit check-in comment.


type: ci
user: drh
comment:
  Change the lemon-parser coverage report format to report all state/lookahead
  pairs and indicate on each whether it is hit or missed.


type: ci
user: dan
comment:
  Have the shell tool ".ar --list" and ".ar --extract" commands support zip
  files. Currently the "-zip" switch is required.


type: ci
user: drh
comment:
  In the lemon-generated parser, do not report the End-of-input character and
  the wildcard character as missed coverage.


type: ci
user: drh
comment:
  Change the coverage measurement logic in the lemon-generated parser so that
  it only checks for coverage of state/lookahead pairs that are valid syntax.
  It turns out that some states are unreachable if the lookahead is not valid
  syntax, because the states are only reachable through a shift following a
  reduce, and the reduce does not happen if the lookahead is a syntax error.


type: ci
user: drh
comment:
  Enhance the Lemon parser generator so that it creates a faster parser at the
  cost of slightly larger parser tables.  Add the ability to measure coverage
  of the generated state machine when compiling with the -DYYCONVERGE option.
  In SQLite, add the SQLITE_TESTCTRL_PARSER_COVERAGE test-control to query the
  new parser coverage feature.


type: ci
user: drh
comment:
  Show the text of individual statements within a trigger, as they
  execute, as comments in the output from sqlite3_trace() and sqlite3_trace_v2().


type: ci
user: drh
comment:
  The output of sqlite3_trace() now shows each command of a trigger as it is
  evaluated.  This feature involved major changes to the parser, such as
  removing the ExprSpan object and replacing it with a new mechanism for
  capturing the original SQL text of phrases in the input SQL.


type: ci
user: drh
comment:
  Enhance location(X) so that it works with indexes and WITHOUT ROWID tables.
  The function might return an offset to the main table or to an index,
  depending on whether the column X would be loaded from the main table or
  from the index.


type: ci
user: drh
comment:
  Change the function name to sqlite_unsupported_offset(X).  Only enable the
  function if compiled with -DSQLITE_ENABLE_OFFSET_SQL_FUNC.  The makefiles add
  that definition to shell builds.


type: ci
user: drh
comment:
  Add support for the sqlite_unsupported_offset() SQL function if and only
  if compiled using -DSQLITE_ENABLE_OFFSET_SQL_FUNC.  Use that definition
  when compiling the command-line shell.


type: ci
user: dan
comment:
  Rearrange things a bit so that writing to a zipfile does not invert the order
  of objects it contains.


type: ci
user: drh
ecomment: Checked into the wrong branch.
comment:
  All the use of ".ar -t" without specifying an archive file or the "-z" option
  when the command-line shell is opened on a ZIP archive.


type: ci
user: drh
comment:
  In the output of ".schema", show the column names of virtual tables and
  views in a separate comment.


type: ci
user: drh
comment:
  Improved name quoting and escaping in the auxiliary column info section
  of the ".schema" output for views and virtual tables.


type: ci
user: drh
comment:
  The ".schema" command in the command-line shell now shows the structure of
  table-valued functions and eponymous virtual tables if they are named on the
  ".schema" command line.  Example:  ".schema sql%" shows the structure of
  the "sqlite_dbstat" and "sqlite_stmt" virtual tables.


type: ci
user: drh
comment:
  Do not attempt to use pragma_module_list in the command-line shell unless 
  it has been compiled with -DSQLITE_INTROSPECTION_PRAGMAS.


type: ci
user: drh
comment:
  In the constraint resolution logic, be careful not to cache column values 
  in registers whose initialization might be bypassed by an OP_NoConflict opcode.
  Fix for ticket [dc3f932f5a147771] reported by OSSFuzz.


type: t
user: drh
brief: New ticket [dc3f932f5a147771|dc3f932f5a].
comment:
  New ticket [dc3f932f5a147771|dc3f932f5a] <i>Assertion fault doing a REPLACE with index on an expression.</i>.


type: t
user: drh
brief: Fixed ticket [dc3f932f5a147771|dc3f932f5a].
comment:
  Fixed ticket [dc3f932f5a147771|dc3f932f5a]: <i>Assertion fault doing a REPLACE with index on an expression.</i> plus 5 other changes


type: ci
user: dan
comment:
  Fix problem causing free-list corruption when merging free-lists for two
  concurrent transactions that have both used page X as an in-memory free-list
  trunk page, where X lies past the end of the initial database images.


type: ci
user: drh
comment:
  Add support for the "memdb" VFS and the sqlite3_memdb_ptr() and
  sqlite3_memdb_config() interfaces, to enable an SQLite database to be
  manipulated as an in-memory object.


type: ci
user: drh
comment:
  Add another test case (found by OSSFuzz) for the problem fixed in 
  check-in [2846458a] and described by ticket [dc3f932f5a147771].
  No changes to code.


type: ci
user: drh
comment:
  Simplify the "sqlite3" command in the TCL interface.  The filename is now
  optional.  There is a new --memdb option with an argument that is the blob
  to which the database content should be initialized.


type: ci
user: drh
comment:
  Replace sqlite3_memdb_config() with sqlite3_deserialize().  Remove the
  "db memdb" command from the TCL interface, replacing it with "db serialize"
  and "db deserialize".


type: ci
user: mistachkin
comment:
  Remove 'timespec' related code from the shell that has no effect and a (now) superfluous 'timespec' typedef from the Win32 dirent header file.


type: ci
user: mistachkin
comment:
  In the 'fileio' extension code for Win32, use the FILE_FLAG_BACKUP_SEMANTICS flag when setting the file times, just in case the file is actually a directory.


type: ci
user: dan
comment:
  Fix an LSM problem causing the wrong amount of "auto-work" to be performed
  under fairly obscure circumstances.


type: ci
user: mistachkin
comment:
  In the Makefile for MSVC, only attempt to link against Tcl when it is needed.  Also, only compile 'zipfile.c' when use of zlib is enabled.


type: ci
user: mistachkin
comment:
  In the Makefile for MSVC, the default target should not include binaries that link against the Tcl library.


type: ci
user: drh
comment:
  In the shell, include the ".archive" command only if compiling with
  SQLITE_HAVE_ZLIB.  Add ".archive" to the ".help" output.


type: ci
user: drh
comment:
  Improved comments on the sqlar.c and compress.c extensions that describe
  the differences between the "zlib format" used by SQLAR, the raw deflate
  format used by ZIP, and the custom format used by compress.c.  No changes
  to code.


type: ci
user: drh
comment:
  Modify the sqltclsh startup script to look for a properly formatted
  SQLAR at the end of the executable.  Fix the CLI so that it automatically
  links against appendvfs and so that the --append command-line option works.


type: ci
user: drh
comment:
  Add IN-operator normalizating and the SQLITE_NORMALIZE_CLI compile-time
  option for generating a stand-alone program.


type: ci
user: dan
comment:
  Do not attempt to build the code in ext/expert/sqlite3expert.c if
  SQLITE_OMIT_VIRTUALTABLE is defined.


type: ci
user: dan
comment:
  In the os_unix.c implementation of xOpen(), do not return
  SQLITE_READONLY_DIRECTORY in cases where the file cannot be opened for reasons
  other than a readonly directory, such as the process running out of file
  descriptors.


type: ci
user: mistachkin
comment:
  When disconnecting from the 'swarmvtab' extension, close each database prior to invoking the 'openclose' function on it.


type: ci
user: drh
comment:
  Compute the correct column name even if the column identifier is the
  very last token in the SQL statement.  This fixes a problem introduced
  by check-in [0fdf97efe5df745510c6b] and reported by the community during
  beta-testing.


type: ci
user: dan
comment:
  Fix a problem in os_unix.c causing it to return SQLITE_CANTOPEN instead of
  SQLITE_READONLY_RECOVERY.


type: ci
user: drh
comment:
  Allow the use of ".ar -t" without specifying an archive file or the "-z"
  option when the command-line shell is opened on a ZIP archive.


type: ci
user: drh
comment:
  Work on the ".archive" command.
  (1) Add the --dryrun option.
  (2) Do not require --file when open on a ZIP archive.
  (3) Miscellaneous code simplifications.
  This is an incremental check-in of work in progress.


type: ci
user: drh
comment:
  Enable the one-pass optimization for DELETE and UPDATE on RTree.  This is
  parked in a branch because is seems to make no measureable performance
  difference.


type: g
user: drh
comment:
  Edit [55116dc30ff87878|55116dc30f]: Move to branch [/timeline?r=mistake&nd&dp=55116dc30ff87878&unhide | mistake]. Edit check-in comment.


type: ci
user: dan
comment:
  Have the zipfile module automatically append "/" to directory names that do
  not already end with such a character. This is required for info-zip
  compatibility.


type: ci
user: drh
comment:
  The ".ar" command deduces whether or not the target file is
  a ZIP or SQLAR and does the appropropriate thing.  The "-z" option is omitted.
  The "--append" option is added to open auxiliary databases using apndvfs.


type: ci
user: drh
comment:
  Implement the ".ar --create" command using a single 
  "REPLACE INTO sqlar SELECT ... FROM fsdir();" statement.  Add the
  shell_putsnl() SQL function for providing --verbose output.


type: ci
user: dan
comment:
  Return an SQLITE_CONSTRAINT error if an attempt is made to insert duplicate
  entries into a zip archive.


type: ci
user: drh
comment:
  In the fileio.c extension, change the filetype(MODE) function into lsmode(MODE).
  Use the new lsmode(MODE) function in shell.c.


type: ci
user: drh
comment:
  Add the lsmode(MODE) function in the fileio.c extension and use that function
  in the .archive implementation.  Add the --append and --dryrun options to
  the .archive command and remove the --zip option, making it automatic.


type: ci
user: drh
comment:
  Modify the new "--append" option to the .archive so that it takes a filename
  argument, the same as "--file".


type: ci
user: drh
comment:
  Add the ".once -e" and ".once -x" commands to the CLI, and the ".excel" command
  that is an alias for ".once -x".


type: ci
user: drh
comment:
  Update the .help screen in the CLI.  Make sure the temporary files for
  ".open" are not deleted too soon.


type: ci
user: drh
comment:
  Add the sqlite3_vtab_nochange() method which virtual table implementations
  can use to optimize UPDATEs.


type: ci
user: drh
comment:
  On unix, the "PRAGMA fsync_interval=N" command causes an extra fdatasync()
  after writing N bytes of content, to force a write-queue flush in the
  underlying OS.  This is an experimental hack that is not expected to land
  on trunk.


type: ci
user: drh
comment:
  Always use utimes() instead of utimensat() since the latter is not available
  even on some recent unix systems.


type: ci
user: dan
comment:
  Add a test to ensure that the sqlite3changeset_apply() function ignores tables
  that do not have the expected primary keys.


type: ci
user: dan
comment:
  Include changes made to the sqlite_stat1 table in changesets
  generated by the sessions module. sqlite_stat1 entries in such changesets are
  ignored by legacy clients.


type: ci
user: dan
comment:
  Experimental change to include changes made to the sqlite_stat1 table in
  changesets generated by the sessions module. sqlite_stat1 entries in such
  changesets are ignored by legacy clients.


type: ci
user: drh
comment:
  Add the experimental sqlite3_value_nochange() interface usable by xUpdate
  methods of virtual tables to see if a column has actually changed values.


type: ci
user: drh
comment:
  Add the sqlite3_value_nochange() API, usable from within the xUpdate method
  of a virtual table to discover whether or not a column was unchanged at the
  SQL level.


type: ci
user: dan
comment:
  Fix various problems in test scripts preventing "make test" from passing on
  F2FS file-systems with the "atomic-write" feature.


type: ci
user: dan
comment:
  Fix various problems in test scripts preventing "make test" from passing on
  F2FS file-systems with the "atomic-write" feature. Cherrypick of [56d93d07].


type: g
user: dan
comment:
  Edit [56d93d070d6b92d8|56d93d070d]: Move to branch [/timeline?r=f2fs-test-fixes&nd&dp=56d93d070d6b92d8&unhide | f2fs-test-fixes].


type: ci
user: drh
comment:
  Fully initialize the Mem object for serial-type 10, in case such a
  serial-type is found in a corrupt database file.


type: ci
user: dan
ecomment:
  Update a couple of test scripts so that they work on F2FS file-systems that
  support atomic transactions. Cherrypick of [49e58e645e].

comment:
  Update a couple of test scripts so that they work on F2FS file-systems that
  support atomic transactions.


type: ci
user: drh
comment:
  Avoid excess stack usage when a VALUES clause with lots of rows occurs
  within a scalar expression.  This fixes a problem discovered by OSSFuzz.


type: ci
user: drh
comment:
  Fix an error in the setDeviceCharacteristics() procedure for the
  (unsupported) QNX code in os_unix.c.


type: ci
user: dan
comment:
  Fix a problem in the zipfile module causing it to generate incorrect
  checksums. Remove the ability to insert compressed data into a zip archive.


type: ci
user: dan
ecomment:
  Fix a problem causing an infinite loop or other malfunction in some UPDATE
  statements with an OR term in the WHERE clause.
  Ticket [47b2581aa9bfecec]

comment:
  Fix a problem causing an infinite loop or other malfunction in some UPDATE
  statements with an OR term in the WHERE clause.


type: ci
user: dan
comment:
  Change a cat in zipfile.c from (z_const Bytef*) to just (Bytef*). This allows the module to build with older versions of zlib.


type: ci
user: drh
comment:
  Move the ZLIB version announcement in the CLI out of the default banner
  and put it in the ".version" command.


type: ci
user: dan
comment:
  Update test file fts5fault6.test to account for test tokenizers implemented in
  Tcl returning SQLITE_ERROR instead of SQLITE_NOMEM following an OOM error.


type: ci
user: dan
comment:
  Omit the single test from zipfile.test that uses json functionality in
  non-SQLITE_ENABLE_JSON1 builds.


type: ci
user: dan
comment:
  Fix main.mk so that testfixture can be built either from the amalgamation or
  from individual source files. No changes to code.


type: ci
user: dan
comment:
  Fix a problem causing the sessions module to occasionally lose track of rows
  with composite primary keys when there are two rows with the same text value
  in the leftmost column of the PK.


type: ci
user: dan
comment:
  Fix a problem in the sessions module with logging sqlite_stat1 rows for which
  (idx IS NULL) is true.


type: ci
user: dan
comment:
  Simplify the sessions preupdate-hook logic for transforming NULL to X'' for
  column sqlite_stat1.idx.


type: ci
user: drh
comment:
  Alternative implementation for the internal sqlite3Pow10() utility for MSVC,
  which is more accurate on that platform.


type: ci
user: drh
comment:
  Update the autoconf configure.ac script and Makefile.am templates so that
  ZLIB is automatically detected and used.


type: ci
user: dan
comment:
  Fix a test case in walro2.test so that it works with encryption extensions
  (when each page has a little less usable space available than usual).


type: ci
user: drh
comment:
  Slightly faster function dispatch in the virtual machine by avoiding
  unnecessary reinitialization of variables that are already correctly
  initialized.


type: ci
user: dan
comment:
  In SQLITE_ENABLE_BATCH_ATOMIC_WRITE builds on  F2FS file-systems, invoke
  SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE if an SQLITE_FCNTL_COMMIT_ATOMIC_WRITE call
  fails. Also, do not use an atomic transaction to create the initial database.
  This is because if an error occurs while writing to the db file, any changes
  to the file-size do not seem to be rolled back automatically. The only time
  this matters is when the file was 0 bytes in size to start with.


type: ci
user: drh
comment:
  Fix the modification-time setting logic in the fileio.c extension on Windows
  so that it works with utf8 filenames.


type: ci
user: dan
ecomment:
  Fix a bug causing spurious "sub-select returns N columns expected 1" errors
  in join queries with a term like "(a, b) IN (SELECT ...)" in the WHERE clause.
  Ticket [7310e2fb3d046a5f5].

comment:
  Fix a bug causing spurious "sub-select returns N columns expected 1" errors
  in join queries with a term like "(a, b) IN (SELECT ...)" in the WHERE clause.


type: ci
user: drh
comment:
  Work around a problem with GCC on 32-bit machines that cause the CAST
  operator to generate a floating-point result for strings that could be
  represented as very large integers.


type: t
user: drh
brief: Fixed ticket [7310e2fb3d046a5f|7310e2fb3d].
comment:
  Fixed ticket [7310e2fb3d046a5f|7310e2fb3d]: <i>Valid row-value syntax is rejected</i> plus 6 other changes


type: ci
user: drh
comment:
  Make the shell functional even if compiled with SQLITE_OMIT_COMPLETE.
  Omit the sqlite3_complete() call from the fuzzing interface if it is
  compiled with SQLITE_OMIT_COMPLETE.


type: ci
user: drh
comment:
  Fix the sqlite3ext.h header file so that it correctly accesses the
  new sqlite3_value_nochange() and sqlite3_vtab_collation() interfaces.


type: ci
user: drh
comment:
  Improved error message output when the btreeinfo.c extension is run in
  a connection that lacks sqlite_dbpage support.


type: ci
user: drh
comment:
  Adjust the fts3rank.test module so that it works on big-endian systems
  (hopefully - I don't have a big-endian machine to test the change on.)


type: ci
user: drh
comment:
  Interchange the numeric codes for CURSOR_VALID and CURSOR_INVALID to obtain
  a small size decrease and performance increase.


type: ci
user: drh
comment:
  Rearrange fields of the BtCursor object so that it is smaller and requires less
  initialization, for a small performance improvement.


type: ci
user: dan
comment:
  Reorganize spellfix.c to make it easier to edit automatically (e.g. using a 
  script). No changes to functionality.


type: ci
user: drh
comment:
  When unpacking a sorter record, do so from right to left instead of left to
  right, since by starting with the right-most column, the work done by
  OP_Column opcodes is reduced.


type: ci
user: drh
comment:
  Improve text-to-integer conversion in boundary cases.  The
  sqlite3Atoi64() function always returns the minimum or maximum integer
  if the magnitude of the text value is too large.  Trailing whitespace is
  now ignored.


type: ci
user: dan
comment:
  If the argument to table function zipfile() is a blob (not text), assume that
  it contains a zip file image to interpret, not the name of a file on disk.


type: ci
user: drh
comment:
  Fix the query planner so that it takes into account dependencies in the
  arguments to table-valued functions in subexpressions in the WHERE clause.
  Fix for ticket [80177f0c226ff54f6dd].


type: t
user: drh
brief: New ticket [80177f0c226ff54f|80177f0c22].
comment:
  New ticket [80177f0c226ff54f|80177f0c22] <i>Incorrect result when join condition uses a table-valued function</i>.


type: t
user: drh
brief: Fixed ticket [80177f0c226ff54f|80177f0c22].
comment:
  Fixed ticket [80177f0c226ff54f|80177f0c22]: <i>Incorrect result when join condition uses a table-valued function</i> plus 5 other changes


type: t
user: drh
brief: New ticket [ec32177c99ccac2b|ec32177c99].
comment:
  New ticket [ec32177c99ccac2b|ec32177c99] <i>Incorrect result with complex OR-connected WHERE and STAT4</i>.


type: t
user: drh
brief: Ticket [ec32177c99ccac2b|ec32177c99]: 6 changes
comment:
  Ticket [ec32177c99ccac2b|ec32177c99] <i>Incorrect result with complex OR-connected WHERE and STAT4</i> status still Open with 6 other changes


type: t
user: drh
brief: Fixed ticket [ec32177c99ccac2b|ec32177c99].
comment:
  Fixed ticket [ec32177c99ccac2b|ec32177c99]: <i>Incorrect result with complex OR-connected WHERE and STAT4</i> plus 3 other changes


type: ci
user: dan
comment:
  If a zipfile virtual table is created with no argument - "CREATE VIRTUAL TABLE
  zzz USING zipfile()" - accumulate data in memory. Support "SELECT
  zipfile_blob(z) FROM zzz LIMIT 1" to retrieve a zip archive image.


type: ci
user: dan
comment:
  Ensure the "unique-not-null" flag is set for automatic indexes on columns
  declared with "col UNIQUE NOT NULL" (where the NOT NULL comes after the
  UNIQUE).


type: ci
user: dan
comment:
  Update the omit-left-join optimization so that it works in some cases when the
  RHS is subject to a UNIQUE but not NOT NULL constraint.


type: ci
user: dan
comment:
  Add unix-only tests to check that the "unzip" program can unpack archives
  generated by the zipfile extension.


type: ci
user: dan
comment:
  Add aggregate function zipfile() to the zipfile extension. For composing new
  zip archives in memory.


type: ci
user: dan
comment:
  If a virtual table xColumn method sets an error message using
  sqlite3_result_error(), use that message in preference to any error message
  left in the sqlite3_vtab object.


type: ci
user: drh
comment:
  Improve the omit-left-join optimization so that it works in some cases 
  when the RHS is subject to a UNIQUE but not NOT NULL constraint.


type: ci
user: dan
comment:
  When creating a new archive entry, have zipfile store UTC instead of local
  time in the legacy MS-DOS format timestamp field.


type: ci
user: drh
comment:
  When an index is based on a text representation of a numeric column in the
  original table, make sure the indexed value uses the canonical text 
  representation of the numeric value in the table.
  Proposed fix for ticket [343634942dd54ab57b70].


type: ci
user: drh
comment:
  New assert() statements to help ensure that no other errors similar
  to [343634942dd54ab57b7] ever appear in the code.


type: ci
user: dan
ecomment:
  Fix a problem triggered when a zipfile virtual table is created and written to
  within the same transaction. And add other zipfile tests.

comment:
  Fix a problem triggered when a zipfile virtual table is created and written to
  within the same transaction. And add other zipfile test.


type: t
user: drh
brief: Fixed ticket [343634942dd54ab5|343634942d].
comment:
  Fixed ticket [343634942dd54ab5|343634942d]: <i>Index on expression goes corrupt from valid SQL</i> plus 6 other changes


type: ci
user: dan
comment:
  In SQLITE_ENABLE_BATCH_ATOMIC_WRITE builds on  F2FS file-systems, invoke
  SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE if an SQLITE_FCNTL_COMMIT_ATOMIC_WRITE call
  fails. Also, do not use an atomic transaction to create the initial database.
  This is because if an error occurs while writing to the db file, any changes
  to the file-size do not seem to be rolled back automatically. The only time
  this matters is when the file was 0 bytes in size to start with. Cherrypick of
  [b3122db154].


type: ci
user: dan
comment:
  Avoid running a couple of tests in crash8.test that depend on the presence of
  the journal file if running on an F2FS file-system that does not require a
  journal file. Cherrypick of [797e02e0].


type: ci
user: dan
comment:
  Fix a problem in test script thread001.test causing a spurious "-1 files were
  left open" error when run separately. Cherrypick of [1774f1c3b].


type: ci
user: drh
comment:
  Enable the ".wheretrace" and ".selecttrace" options in the shell when
  configure is run using --enable-debug.  This mirrors a similar change
  that has already occurred on trunk.


type: ci
user: dan
comment:
  Update test file walro2.test to account for systems with a page-size
  (getpagesize()) larger than 32KB.


type: ci
user: drh
comment:
  Allocation the mutex used by the unix VFS only once at initialization, instead
  of every time it is needed.


type: ci
user: mistachkin
comment:
  Allocation the mutex used by the Win32 VFS only once at initialization, instead of every time it is needed.


type: ci
user: dan
comment:
  When the final connection disconnects from a wal mode database, check that the
  database file has not been moved or unlinked before deleting the wal and shm
  files.


type: ci
user: dan
comment:
  In extensions rtree, fts3 and fts5, ensure that when dynamic buffers are bound
  to persistent SQL statements using SQLITE_STATIC, the binding is replaced with
  an SQL NULL before the buffer is freed. Otherwise, a user may obtain a pointer
  to the persistent statement using sqlite3_next_stmt() and attempt to access
  the freed buffer using sqlite3_expanded_sql() or similar.


type: ci
user: drh
comment:
  Improve the performance of the built-in REPLACE() function in cases where
  it does many substitutions that make the string larger.  OSSFuzz is reporting
  intermittant timeouts when running a test where it does a REPLACE() on a 
  930KB random blob. Perhaps this enhancement will fix that.


type: ci
user: drh
comment:
  Fix a possible infinite loop in VACUUM that can come up when the schema
  has been carefully corrupted.  Problem discovered by OSSFuzz. Test cases
  in TH3.


type: ci
user: drh
comment:
  When compiling with VDBE_PROFILE, add the sqlite3NProfileCnt global variable
  which can be used to measure per-opcode values other than elapse time, if
  non-zero.


type: ci
user: dan
comment:
  Ensure that multiple updates of the same FTS4 row (i.e. the row with the same
  rowid) within a single transaction are written to separate segments. Fix for
  [d6ec09ec].


type: ci
user: drh
comment:
  Fix an incorrect table lookup used to find the appropriate search operator
  for a WHERE clause on a row-value inequality.  The incorrect table lookup
  was causing an incorrect answer for the less-than operator.
  Fix for ticket [f484b65f3d6230593c34f11]


type: t
user: drh
brief: New ticket [f484b65f3d623059|f484b65f3d].
comment:
  New ticket [f484b65f3d623059|f484b65f3d] <i>Incorrect result from row-value comparison in WHERE clause</i>.


type: ci
user: drh
comment:
  Try to optimize spellfix1 by storing a NULL in the k1 column of %_vocab
  if it would otherwise have the same value as the word column.


type: t
user: drh
brief: Fixed ticket [f484b65f3d623059|f484b65f3d].
comment:
  Fixed ticket [f484b65f3d623059|f484b65f3d]: <i>Incorrect result from row-value comparison in WHERE clause</i> plus 6 other changes


type: ci
user: dan
comment:
  When calling fopen() in the zonefile extension, use modes "rb" and "wb"
  instead of "r" and "w". This makes no difference on unix, but is required when
  accessing binary files on other systems.


type: ci
user: drh
comment:
  Fix the --heap, --pagecache, --lookaside and other options to the command-line
  shell that invoke sqlite3_config() so that they work again.


type: ci
user: drh
comment:
  Improve performance of editdist3() by keeping the costs in sorted order.
  Also add a new regression test to editdist3().


type: ci
user: drh
comment:
  Do not allow parameters or schema references inside of WITH clause of
  triggers and views.  This fixes a bug discovered by OSSFuzz and present
  since common-table-expressions were first added in 2014-02-03.


type: ci
user: dan
comment:
  Fix a data race causing a tsan complaint with SQLITE_ENABLE_API_ARMOR builds
  on unix. The race condition is not dangerous in practice, it just upsets tsan.


type: ci
user: dan
comment:
  Modify the zonefile format in order to avoid depending on the filesize to 
  determine the extent of the final frame. See README.md for details.


type: ci
user: drh
comment:
  Fix a memory leak in the processing of nested row values.  This problem has
  existed every since row values support was added (version 3.15.0, 2016-10-14)
  but was only just now detected by OSSFuzz.


type: ci
user: drh
comment:
  Fix an assert so that it compares two CellInfo objects field by field
  instead of using memcmp().  Memcmp() does not work on x86
  because of uninitialized padding bytes.


type: ci
user: drh
comment:
  Only try to use the geteuid() interface on unix if HAVE_FCHOWN is defined.
  This fixes the build for vxWorks, we are told.


type: ci
user: dan
comment:
  Add support for invoking encryption hooks to zonefile. And mock encryption
  method "xor" for testing.


type: ci
user: drh
comment:
  In the printf() library, measure width and precision in characters rather
  than bytes if the "!" (alternate-form-2) flag is present on a %s or %z
  substitution.


type: ci
user: drh
comment:
  Make the alternate-form-2 flag ("!") change the meaning of width and precision
  from bytes to characters for the %q, %Q, and %w extensions of printf().


type: ci
user: dan
comment:
  Instead of just the frame number, store frame sizes and offsets in zonefile
  shadow table %_shadow_idx.


type: ci
user: drh
comment:
  Enhance the string formatter (used by printf()) so that the width and
  precision of string substitution operators refer to characters instead of
  bytes when the alternate-form-2 flag ("!") is used.  Also fix the %c
  substition to always work within unicode, regardless of the 
  alternate-form-2 flag.


type: ci
user: drh
comment:
  Remove a lot of the text describing extended format options from the
  documentation on sqlite3_mprintf() and friends, since that information is
  now covered by the separate printf.html document.  Provide links to that
  other document.  No changes to code.


type: ci
user: drh
comment:
  Optimize calls to sqlite3_mprintf("%z...") so that they attempt to append
  text onto the end of the existing memory allocation rather than reallocating
  and copying.


type: ci
user: drh
comment:
  In the speed-check.sh script, make WAL mode the default.  Add the --legacy
  option to do DELETE mode.  Continue to use DELETE mode for long-term performance
  graphs since WAL mode was not always available, but use WAL mode for 
  day-to-day performance measurements.


type: ci
user: drh
comment:
  Make the walIndexPage() routine about 3x faster by factoring out the seldom
  used reallocation logic into a separate subroutine.


type: ci
user: dan
comment:
  In zonefile, change the "file TEXT" column back to "fileid INTEGER". The
  fileid can be used as a key with the associated zonefile_files table, which
  contains more information than just the filename.


type: ci
user: dan
comment:
  Add extra code to log details when corruption is detected in the pointer-map
  structure maintained by the b-tree layer in begin-concurrent transactions.


type: ci
user: dan
comment:
  Have zonefile store encryption keys in a hash-table instead of a linked list.
  Add extra tests for key management.


type: ci
user: dan
comment:
  Modifications to the zonefile module to make it easier to add a cache of
  uncompressed frame content.


type: ci
user: drh
comment:
  For the "SQLite archive" link in the README.md file, point to the
  CLI .archive command documentation, not the original "sqlar" website.


type: ci
user: dan
comment:
  Fix a problem causing SQLITE_HAVE_LZ4 builds of zonefile to fail unless
  SQLITE_HAVE_ZLIB is also defined.


type: ci
user: dan
comment:
  Add extra parameter to zonefileCodecCreate() to indicate whether the new
  object will be used for mock-encryption or mock-decryption.


type: ci
user: drh
comment:
  Experimental implementation of IS TRUE and IS FALSE operators.  All TRUE and
  FALSE to act like constants if the names do not resolve to a column name.


type: ci
user: drh
comment:
  Always interpret non-zero floating-point values as true even if their
  integer part is zero.  Fix for ticket [36fae083b450e3af857a459e20].


type: t
user: drh
brief: Fixed ticket [36fae083b450e3af|36fae083b4].
comment:
  Fixed ticket [36fae083b450e3af|36fae083b4]: <i>Inconsistent interpretation of truth</i> plus 6 other changes


type: ci
user: drh
comment:
  Refactor for correct NULL handling in the IS TRUE, IS FALSE, IS NOT TRUE,
  and IS NOT FALSE operators.


type: ci
user: drh
comment:
  Add support for TRUE and FALSE keywords and for operators IS TRUE, IS FALSE,
  IS NOT TRUE, and IS NOT FALSE.  If there is are columns named TRUE or FALSE,
  then the keywords resolve to the column names, for compatibility.  The
  behavior of the "DEFAULT true" phrase is changed to mean what it says,
  rather than being an alias for "DEFAULT 'true'".


type: ci
user: drh
comment:
  Show symbolic SELECT names in EXPLAIN QUERY PLAN output when compiling with
  SQLITE_ENABLE_SELECTTRACE.


type: ci
user: drh
comment:
  Use &lt;pre&gt; around code snippets in the documentation for sessions
  interfaces.  This is a documentation change only with no changes to code.


type: ci
user: dan
comment:
  Fix some crashes in the sqlite3changeset_apply() function that could be caused
  by corrupt changeset blobs.


type: ci
user: dan
comment:
  Optimize the obscure case of running a checkpoint against a very large wal
  file for which a large percentage of the frames have already been checkpointed.


type: ci
user: dan
comment:
  In a checkpoint, figure out if it is possible to checkpoint any frames at all
  before creating the wal-iterator.


type: ci
user: drh
comment:
  A new way of doing archive commands on the command-line for the CLI.  The -A
  option means that everything that follows is a ".archive" command, including
  any suffix on the -A option.


type: ci
user: drh
comment:
  In the CLI, add a new command-line option "--archive" (also "--ar") that
  passes all subsequent arguments to the ".archive" command.


type: ci
user: drh
comment:
  Fix walIteratorInit() so that it always leaves the iterator as a NULL pointer
  if an OOM occurs.  This fixes an assertion fault introduced by 
  check-in [044b0b65e716bff].


type: ci
user: drh
comment:
  Add the sqlite3_serialize() and sqlite3_deserialize() interfaces, enabled
  when the -DSQLITE_ENABLE_DESERIALIZE compile-time option is used.


type: ci
user: dan
comment:
  Avoid running a couple of tests in crash8.test that depend on the presence of
  the journal file if running on an F2FS file-system that does not require a
  journal file.


type: ci
user: drh
comment:
  Improved documentation for sqlite3_serialize() and sqlite3_deserialize().
  Change the name of the compile-time option to enable these interfaces
  from SQLITE_ENABLE_MEMDB to SQLITE_ENABLE_DESERIALIZE.


type: ci
user: drh
comment:
  Add the sessionfuzz test program and data obtained from a week of running
  AFL.  Automatically run this test program on any "make test" on unix.


type: ci
user: drh
comment:
  Fix the zipfile extension so that it is able to create symbolic link entries
  in the ZIP file even on systems like Win32 that do not support symbolic links
  on the native filesystem.


type: ci
user: drh
comment:
  Avoid harmless left-shifts of negative numbers in the zipfile extension
  when building ZIP archives of files with pre-DOS dates.


type: ci
user: drh
comment:
  Fix the second callback argument to the "profile" response of the
  "trace_v2" method in the TCL interface so that it shows the actual
  number of nanoseconds for the command, not the address of the variable
  containing the number of nanoseconds.


type: ci
user: dan
comment:
  Improve detection of out-of-range parameters in sqlite3_stmt_status() for
  SQLITE_ENABLE_API_ARMOR builds.


type: ci
user: drh
comment:
  Fix an issue with the fsdir() table-valued function not resetting correctly
  after each pass of a join.


type: ci
user: dan
comment:
  Fix a problem in test script thread001.test causing a spurious "-1 files were
  left open" error when run separately.


type: ci
user: dan
comment:
  Fix an RBU problem causing errors when updating tables with default collation
  sequences that require quoting (e.g. COLLATE "ICU_root-u-kn-on"). Cherrypick
  of [eb4f452e].


type: ci
user: drh
comment:
  Avoid unnecessary write to the sqlite_sequence table when an insert
  is done into an autoincrement table with an application-specified rowid
  that is less than the maximum.


type: g
user: drh
comment:
  Edit [5f779ff6b48ec97e|5f779ff6b4]: Move to branch [/timeline?r=corrupt-schema&nd&dp=5f779ff6b48ec97e&unhide | corrupt-schema].


type: ci
user: drh
comment:
  Detect databases whose schema is corrupted using a CREATE TABLE AS statement
  and issue an appropriate error message.


type: ci
user: drh
comment:
  In the compile_options pragma, show the actual value of the
  SQLITE_ENABLE_CEROD compile-time option, if it exists.


type: ci
user: drh
comment:
  Disable the OR optimization based on expressions in the ON clause of a
  LEFT JOIN.  This is a temporary measure until we can devise a better fix.


type: g
user: drh
comment:
  Edit [16c22ff8189c2bea|16c22ff818]: Move to branch [/timeline?r=EQP-improvements&nd&dp=16c22ff8189c2bea&unhide | EQP-improvements].


type: ci
user: drh
comment:
  Enhance the command-line completion extension to return the names of
  triggers and views along with the names of tables.


type: ci
user: drh
comment:
  Add the ability to disable the push-down optimization using the 0x1000 bit of
  SQLITE_TESTCTRL_OPTIMIZATIONS.


type: ci
user: drh
comment:
  Closer reading of the sqlite3_db_config() documentation show that it is
  subtly incorrect.  This check-in fixes the problem.  No code changes.


type: g
user: drh
comment:
  Edit [eddc35f3057e59fd|eddc35f305]: Move to branch [/timeline?r=push-down-disable&nd&dp=eddc35f3057e59fd&unhide | push-down-disable].


type: ci
user: drh
comment:
  Add the ability to disable the push-down optimization using the 0x1000 bit 
  of SQLITE_TESTCTRL_OPTIMIZATIONS.  Also some documentation fixes and an
  enhancement to ".eqp full" in the CLI.


type: ci
user: mistachkin
comment:
  For 'zipfile', detect attempts to cause a duplicate entry via UPDATE.  Also, fix handling of 'UPDATE OR REPLACE' statements run on zipfile virtual tables.  Win32 portability fixes to the 'fileio' extension.  Miscellaneous test fixes.


type: ci
user: drh
comment:
  Improvements to the HAVING-to-WHERE optimization.  The code uses less space
  and less CPU, and there is now ".selecttrace" output.


type: ci
user: drh
comment:
  If terms of the WHERE clause require that the right table in a LEFT JOIN
  not be a null row, then simplify the LEFT JOIN into an ordinary JOIN.


type: ci
user: dan
comment:
  Fix rebasing of UPDATE changes against a set of remote changesets that feature
  both OMIT and REPLACE conflict resolution on different fields of the same row.


type: ci
user: drh
comment:
  Add the left join strength reduction optimization.  Enhance the push-down
  optimization so that it works with many LEFT JOINs.


type: ci
user: drh
comment:
  Add the optfuzz.c program for verifying the query planner using a fuzzer.
  This is an initial code check-in.


type: ci
user: dan
comment:
  Fix an RBU problem causing errors when updating tables with default collation
  sequences that require quoting (e.g. COLLATE "ICU_root-u-kn-on").


type: ci
user: drh
comment:
  Fix the ANALYZE command so that it will process tables whose names begin
  with "sqlite" as long as they do not being with "sqlite_".


type: ci
user: drh
comment:
  Fix an error in the CLI in the previous ([0249d9aecf69948]) check-in.
  Only the pattern to sqlite3_strlike() need to be escaped.


type: ci
user: dan
comment:
  Fix minor problems with passing NULL pointers to memcmp() and memcpy() found by -fsanitize=undefined.


type: ci
user: dan
comment:
  Fix typos in sqlite3session.h preventing documentation webpages from being
  generated. Also mark all new sessions functions (those related to rebasing) as
  experimental.


type: ci
user: drh
comment:
  Bug fix in the LEFT JOIN strength reduction optimization of
  check-in [dd568c27b1d76563].  The sqlite3ExprImpliesNotNull() routine was
  mistakenly assuming that a CASE expression must always be NULL if contained
  any reference to a variable that was NULL.


type: ci
user: drh
comment:
  Yet another fault in the sqlite3ExprImpliesNotNull() routine, causing errors
  in the LEFT JOIN strength reduction optimization of check-in
  [dd568c27b1d76563].


type: ci
user: drh
comment:
  Add infrastructure to support for using F_SETLKW with a timeout on system
  that support that functionality.  Requires SQLITE_ENABLE_SETLK_TIMEOUT.


type: ci
user: drh
comment:
  Provide the ability for the VFS to do a blocking wait on locks if compiled
  with SQLITE_ENABLE_SETLK_TIMEOUT.


type: ci
user: drh
comment:
  Do not inject OOM errors on SQLITE_FCNTL_LOCK_TIMEOUT calls as an OOM is
  not possible in that context.


type: ci
user: drh
comment:
  The push-down optimization was being too aggressive such that it sometimes
  generated incorrect results.  Reinstate the restriction (4) (with
  qualifications) that was removed by check-ins
  [b5d3dd8cb0b1e4] and [dd568c27b1d765].


type: ci
user: drh
comment:
  Modify the sqlite3OsFileControl() interface to detect unopened sqlite3_file
  objects and return SQLITE_NOTFOUND.


type: ci
user: dan
comment:
  Fix a test script bug causing zipfile.test to fail on systems that do not have
  the "unzip" program installed.


type: ci
user: drh
comment:
  Fix a bug in the spellfix extension causing it to compute suboptimal answers.
  The problem was introduced by check-in [afd6fbc01052ccfc9].


type: ci
user: dan
comment:
  Fix an assertion failure triggered by a SELECT with a compound sub-query that
  contains an incorrectly placed ORDER BY clause. This problem is just an
  assert() failure - non-DEBUG builds are not affected. Problem found by
  OSSFuzz.


type: ci
user: drh
comment: Fix a logic error discovered by OSSFuzz.
ecomment:
  Fix a logic error discovered by OSSFuzz that can cause an assert() fault
  if a LIKE operator is used on an INTEGER PRIMARY KEY.


type: ci
user: drh
comment:
  Better solution to the LIKE problem from the previous check-in that works
  even if the SQLITE_LIKE_DOESNT_MATCH_BLOBS compile-time option is used.


type: ci
user: drh
ecomment:
  Change the LEFT JOIN strength reduction optimization so that assumes that
  virtual table constraints can be true even if terms within the constraint
  are NULL.  This works around dodgy virtual table implementations.
  Fix for ticket [fac496b61722daf2].

comment:
  Change the LEFT JOIN strength reduction optimization so that assumes that
  virtual table constraints can be true even if terms within the constraint
  are NULL.  This works around dodgy virtual table implementations.


type: t
user: drh
brief: New ticket [fac496b61722daf2|fac496b617].
comment:
  New ticket [fac496b61722daf2|fac496b617] <i>Over-aggressive LEFT JOIN optimization on virtual tables</i>.


type: t
user: drh
brief: Ticket [fac496b61722daf2|fac496b617]: 6 changes
comment:
  Ticket [fac496b61722daf2|fac496b617] <i>Over-aggressive LEFT JOIN optimization on virtual tables</i> status still Open with 6 other changes


type: ci
user: drh
comment:
  Fix the generate_series virtual table so that it correctly returns no
  rows if any of its constraints are NULL.
  Ticket [fac496b61722daf28].


type: t
user: drh
brief: Ticket [fac496b61722daf2|fac496b617]: 5 changes
comment:
  Ticket [fac496b61722daf2|fac496b617] <i>Over-aggressive LEFT JOIN optimization on virtual tables</i> status still Open with 5 other changes


type: ci
user: drh
comment:
  Fix an error message in speedtest1.c and make the "trigger" testset sensitive
  to the --size parameter.


type: ci
user: drh
comment:
  Fix the sqlite3WhereTrace mechanism so that it compiles with
  the --disable-amalgamation and the --enable-debug options to ./configure
  using clang.


type: t
user: drh
brief: New ticket [093420fc0eb7cba7|093420fc0e].
comment:
  New ticket [093420fc0eb7cba7|093420fc0e] <i>Virtual Machine references an uninitialized register</i>.


type: ci
user: dan
comment:
  Fix an instance where an uninitialized VM register might be accessed. Fix for
  [093420fc0]. This problem was found by OSSFuzz.


type: ci
user: dan
comment:
  Fix a problem in the sessions module causing sqlite3session_apply_strm() to
  allocate enough memory for the entire input buffer - which defeats the point
  of a streaming interface.


type: t
user: drh
brief: Fixed ticket [093420fc0eb7cba7|093420fc0e].
comment:
  Fixed ticket [093420fc0eb7cba7|093420fc0e]: <i>Virtual Machine references an uninitialized register</i> plus 5 other changes


type: ci
user: drh
comment:
  Enhance LEMON to show precendence of symbols and all rules in the report
  that is generated in parallel to the parser.


type: ci
user: drh
comment:
  Demonstration of how the parser can be augmented to recognize a
  PostgreSQL-style UPSERT.  This check-in implements parsing only.


type: ci
user: drh
comment:
  More complete parsing of UPSERT, including UPSERT within a trigger.
  The sqlite3Insert() logic to actually perform the UPSERT is not yet
  implemented, however.


type: ci
user: dan
comment:
  Add a "flags" parameter to experimental API sqlite3changeset_apply_v2(). Also
  add the SQLITE_CHANGESETAPPLY_NOSAVEPOINT flag.


type: ci
user: dan
ecomment:
  Fix the fts5 xBestIndex method so that it is not confused by "IS", "!=",
  "REGEXP", "GLOB" or "LIKE" operators. Fix for ticket [2b8aed9f].

comment:
  Fix the fts5 xBestIndex method so that it is not confused by "IS", "!=",
  "REGEXP", "GLOB" or "LIKE" operators.


type: ci
user: drh
comment:
  Enhance the query planner so that it detects when the xBestIndex method
  of a virtual table gives out-of-sequence argvIndex values and reports an
  error.  Secondary fix for ticket [2b8aed9f7c9e6].


type: t
user: drh
brief: Fixed ticket [2b8aed9f7c9e61e8|2b8aed9f7c].
comment:
  Fixed ticket [2b8aed9f7c9e61e8|2b8aed9f7c]: <i>Misbehavior in the FTS5 xBestIndex method</i> plus 5 other changes


type: ci
user: drh
ecomment:
  Update the top-level README.md file to point to the whynotgit.html document.
  Put it on the correct branch, this time.

comment:
  Update the top-level README.md file to point to the whynotget.html document.
  Put it on the correct branch, this time.


type: ci
user: dan
comment:
  Fix a problem causing the LEFT JOIN strength reduction optimization to be
  incorrectly applied in some cases where the WHERE clause of the query contains
  a filter expression of the form NOT(x AND y). Ticket [1e39b966].


type: t
user: drh
brief: New ticket [1e39b966ae9ee739|1e39b966ae].
comment:
  New ticket [1e39b966ae9ee739|1e39b966ae] <i>LEFT JOIN strength reduction optimization causes an error.</i>.


type: t
user: drh
brief: Fixed ticket [fac496b61722daf2|fac496b617].
comment:
  Fixed ticket [fac496b61722daf2|fac496b617]: <i>Over-aggressive LEFT JOIN optimization on virtual tables</i> plus 3 other changes


type: t
user: drh
brief: Fixed ticket [1e39b966ae9ee739|1e39b966ae].
comment:
  Fixed ticket [1e39b966ae9ee739|1e39b966ae]: <i>LEFT JOIN strength reduction optimization causes an error.</i> plus 5 other changes


type: ci
user: dan
comment:
  When testing, avoid injecting an OOM fault into a file-control call made by
  SQLite on an unopened file-descriptor.


type: ci
user: dan
comment:
  Fix a problem causing the LEFT JOIN strength reduction optimization to be
  incorrectly applied in some cases where the WHERE clause of the query contains
  a filter expression of the form "lhs.x IS NOT ?".


type: ci
user: drh
comment:
  Avoid unnecessary OP_Goto instructions on an upsert of a table that only
  has a single secondary index.


type: ci
user: drh
comment:
  Prohibit bound parameters in the arguments to table-valued functions within
  a trigger.  Problem discovered by OSSFuzz.


type: ci
user: drh
comment:
  Update the upsert parsing so that it accepts conflict-target labels using
  the PostgreSQL syntax, and also accepts the MySQL "ON DUPLICATE KEY"
  syntax.


type: ci
user: drh
comment:
  Back off of the extended upsert syntax that allows multiple ON CONFLICT
  clauses.  The syntax now is exactly as in PostgreSQL and MySQL.  Add support
  for WHERE clauses on the conflict-target phrase, for partial indexes.


type: ci
user: drh
comment:
  Get the conflict-target clause parsing working correctly, with test
  cases.  This change involves an enhancement to sqlite3ExprCompare() which
  needs to be reviewed on trunk prior to merging.


type: ci
user: dan
comment:
  Experimental change to "SELECT * FROM ... ORDER BY" processing to load some
  column values from the db after sorting.


type: ci
user: drh
comment:
  Remove the MySQL upsert syntax.   As an optional alias to the insert table
  name in order to finish out PostgreSQL upsert syntax emulation.


type: ci
user: drh
comment:
  Lemon enhancements:  (1) Do not allocate space for the 'error' non-terminal
  if it is not used. (2) Fix an off-by-one problem so that 'unsigned char' can
  be used for symbol numbers if the number of symbols is 256.


type: ci
user: drh
comment:
  TK_REGISTER expressions nodes are probably not constant.  Make sure
  sqlite3ExprIsConstant() knows this.


type: ci
user: drh
comment:
  Fixes to the logic for constraint check reordering during upsert.
  Improved comments on constraint check bytecode.  Add an assert that
  prevents the same label from being resolved more than once.


type: ci
user: drh
comment:
  Add new testcase() macros and fix a bug that was revealed when trying to
  cover all the new test cases.


type: ci
user: drh
comment:
  Add checks to the CLI that issue a warning if SQLite gets initialized prior
  to the last sqlite3_config() call.


type: ci
user: drh
comment:
  Omit some code not used without SQLITE_ENABLE_SORTER_REFERENCES.  Improvements
  to comments used for documentation.


type: ci
user: drh
comment:
  Fix a problem in the sqlite3ExprCompare() function that caused two
  dissimilar expressions to match if they have the same "COLLATE name" at
  the outer layer.


type: ci
user: dan
comment:
  Add the "sorter-reference" optimization, allowing SQLite to be configured so
  that some required values may be loaded from the database after external
  sorting occurs for SELECT statements with ORDER BY clauses that are not
  satisfied by database indexes.


type: ci
user: drh
comment:
  Fix the table name aliasing on INSERT so that it occurs before the column list
  rather than afterwards, just as it does for PostgreSQL.  Add table name
  aliasing to UPDATE and DELETE.


type: ci
user: drh
ecomment:
  Add the ext/misc/templatevtab.c template for virtual tables.  This is a
  work-in-progress as it still needs improvements to the comments in order to
  be useful as a template.

comment:
  Add the ext/misc/tmeplatevtab.c template for virtual tables.  This is a
  work-in-progress as it still needs improvements to the comments in order to
  be useful as a template.


type: ci
user: dan
comment:
  Modify a test case in zipfile2.test to take into account that with some
  platform/file-system combinations it is possible to fopen() and fread() (but
  not fwrite()) a directory.


type: ci
user: drh
comment:
  Better comments on the bindvtab.c implementation.  All the two-argument
  version of the .set command.  All bindings from .set and -D are still
  string.


type: ci
user: drh
comment:
  Fix the handling of "PRAGMA count_changes=ON" with UPSERT.  Also improved
  the implementation of count_changes in other places, without changing the
  behavior.


type: ci
user: dan
comment:
  Add test cases for UPSERT. And a fix for a "REPLACE INTO ... ON CONFLICT"
  statement where the new row conflicts with both the IPK and the ON CONFLICT
  indexes.


type: ci
user: drh
comment:
  Add the %extra_context directive to lemon, as an alternative to %extra_argument.
  Use this to improve the performance of the parser.


type: ci
user: drh
comment:
  Enhance LEMON to track which symbols actually carry semantic content.
  Output the list of symbols that do not carry content at the end of the
  report, but do not (yet) do anything else with the information.


type: ci
user: drh
comment:
  Ensure that there are no bind-parameters or incorrect schema references in
  the UPSERT portions of an INSERT within a TRIGGER.


type: ci
user: drh
comment:
  In the ".selecttrace" output, include the EXPLAIN QUERY PLAN iSelectId as
  part of each Select identifier.


type: ci
user: drh
comment:
  Do not restore the iSelectId value until after the last SELECTTRACE when
  debugging Select processing.


type: ci
user: drh
comment:
  The ".selecttrace 0x2000" command causes just the top-level parse tree to
  be displayed, after all transformations, and showing the EQP iSelectId at
  each level.


type: ci
user: drh
comment:
  In EXPLAIN QUERY PLAN output, do not show an EXECUTE LIST SUBQUERY line for
  IN operators where the RHS is a list and not a subquery, since in that case
  there is no SUBQUERY to execute.


type: ci
user: drh
comment:
  Enhance the CLI to render EXPLAIN QUERY PLAN using an ASCII-art graph.
  This works with ".eqp" modes and when the query begins with exactly
  "EXPLAIN QUERY PLAN".  To see the original output format, add extra space
  characters in between words of the initial "EXPLAIN QUERY PLAN".


type: t
user: drh
brief: New ticket [7fa8049685b50b5a|7fa8049685].
comment:
  New ticket [7fa8049685b50b5a|7fa8049685] <i>Incorrect result on a LEFT JOIN when using an index</i>.


type: ci
user: dan
comment:
  Do not attempt to read values from indexes-on-expressions if the index is on
  the RHS of a LEFT JOIN. This won't work if the index cursor points at a
  null-row. Fix for [7fa80496].


type: t
user: drh
brief: New ticket [4ba5abf65c5b0f9a|4ba5abf65c].
comment:
  New ticket [4ba5abf65c5b0f9a|4ba5abf65c] <i>Index on expression leads to an incorrect LEFT JOIN</i>.


type: t
user: drh
brief: Fixed ticket [7fa8049685b50b5a|7fa8049685].
comment:
  Fixed ticket [7fa8049685b50b5a|7fa8049685]: <i>Incorrect result on a LEFT JOIN when using an index</i> plus 5 other changes


type: ci
user: drh
comment:
  Update the expert extension test cases to account for the fact that
  EXPLAIN QUERY PLAN now shows the start of each trigger in its output.


type: ci
user: drh
comment:
  Do not attempt to use terms from the WHERE clause to drive indexes on the
  right table of a LEFT JOIN.  Fix for ticket [4ba5abf65c5b0f9a96a7a40cd18b]


type: ci
user: dan
comment:
  Fix a problem with processing "LEFT JOIN tbl ON tbl.a = ? AND (tbl.b=? OR
  tbl.c=?)" in cases where there are indexes on both tbl(a, b) and tbl(a, c).


type: t
user: drh
brief: Fixed ticket [4ba5abf65c5b0f9a|4ba5abf65c].
comment:
  Fixed ticket [4ba5abf65c5b0f9a|4ba5abf65c]: <i>Index on expression leads to an incorrect LEFT JOIN</i> plus 5 other changes


type: ci
user: drh
comment:
  Avoid many unnecessary calls to sqlite3ReadSchema() and sqlite3Init() when
  the schema is known to be valid already.


type: ci
user: drh
comment:
  Add an assert() to ensure that schema mutexes are held prior to accessing
  the DB_SchemaLoaded flag inside of sqlite3Init().


type: ci
user: drh
comment:
  Add the new SQLITE_SHELL_INIT_PROC compile-time entry point to the CLI.  This
  is needed to work around the tighter sqlite3_config() constraints now in the
  CLI.


type: ci
user: drh
comment:
  Add the new DO and NOTHING keywords to the keyword lists maintained
  by various extensions and auxiliary programs.


type: ci
user: drh
comment:
  Add new interfaces for accessing the list of SQL keywords:
  sqlite3_keyword_count(), sqlite3_keyword_name(), sqlite3_keyword_check().


type: ci
user: dan
comment:
  Update the "fuzz_malloc.test" script to print SQL statements in which OOM
  handling problems are found to stdout.


type: ci
user: drh
comment:
  Clarification of the behavior of a BEFORE UPDATE trigger when the trigger
  changes the values of some of the columns used to compute new columns in
  the UPDATE.


type: ci
user: drh
comment:
  Ensure that new.* values of an UPDATE do not get clobbered after the
  BEFORE triggers run when unmodified columns of the row being updated are
  reloaded.  Fix for ticket [d85fffd6ffe856092ed8da]


type: t
user: drh
brief: Ticket [d85fffd6ffe85609|d85fffd6ff]: 6 changes
comment:
  Ticket [d85fffd6ffe85609|d85fffd6ff] <i>VDBE program uses an expired value</i> status still Open with 6 other changes


type: ci
user: dan
comment:
  When processing an "ORDER BY ... LIMIT" that does not use an index, check
  whether or not a record may appear in the final result set before adding it to
  the temp b-tree used for sorting.


type: t
user: drh
brief: Fixed ticket [d85fffd6ffe85609|d85fffd6ff].
comment:
  Fixed ticket [d85fffd6ffe85609|d85fffd6ff]: <i>VDBE program uses an expired value</i> plus 3 other changes


type: ci
user: dan
comment:
  When processing an "ORDER BY ... LIMIT" that does not use an index, check
  whether or not a record may appear in the final result set before adding it to
  the sorter.


type: ci
user: drh
comment:
  The previous fix for ticket [d85fffd6ffe856092ed8da] in check-in 
  [0a514e62ad1ebe5c12da8dae] did not completely address the
  probably in that it only worked for cases where the OP_SCopy that loaded
  the register was the last instruction in the sequence for the expression, which
  is not necessarily the case for expressions like CASE...END.  This revision
  prevents the registered that will be recomputed from being cached in the first
  place.


type: ci
user: dan
comment:
  Update test script fts3expr4.test so that it always creates fts3 tokenizers in
  the "en_US" locality.


type: ci
user: drh
comment:
  Add the ability to use bind parameters in the CLI.  The new ".set KEY=VALUE"
  dot-command works to set bindings.  Or use the "-Dkey=value" command-line
  option.  Or use the built-in shell_bindings(k,v) virtual table to set,
  delete, or changing bindings.


type: ci
user: drh
comment:
  The ".selecttrace 0x4000" command causes the AST to be output to stdout as
  a table with four columns.


type: ci
user: mistachkin
comment:
  Add comments about the intended use of the sqlite3_data_directory variable as it pertains to the sqlite3_win32_set_directory function.


type: ci
user: drh
comment:
  Add the "PRAGMA reset_database=ON|OFF" command.  When on, it causes the
  database to appear to be empty, causing the next transaction to reset it to
  an empty database.


type: ci
user: drh
comment:
  Add the SQLITE_DBCONFIG_RESET_DATABASE control as a replacement for
  the reset_database pragma.  Resetting the database should be hard enough
  to do that it cannot be done by accident.


type: ci
user: drh
comment:
  Add the SQLITE_DBCONFIG_RESET_DATABASE control for resetting a corrupt
  database file without closing any database connections.  Added the
  ".dbconfig" command to the CLI.


type: ci
user: dan
comment:
  Fix an RBU problem causing spurious SQLITE_CONSTRAINT errors when restarting
  an RBU update in which more than one source table writes to a single target
  database table.


type: ci
user: drh
comment:
  Defer loading result column values into registers on an ORDER BY LIMIT until
  we know that the LIMIT does not exclude the current row.


type: ci
user: drh
comment:
  In ORDER BY LIMIT queries, try to evaluate the ORDER BY terms first, and it
  it becomes clear that the row will not come in under the LIMIT, then skip
  evaluation of the other columns.


type: ci
user: drh
comment:
  Fix various error handling conditions on the cell overwrite optimization.
  Fix a test case so that it works with the new optimization.


type: ci
user: drh
comment:
  The SQLITE_ALLOW_SQLITE_MASTER_INDEX compile-time option allows a CREATE INDEX
  statement against the sqlite_master table.  Once created, the index works, and
  is usable by legacy instances of SQLite.


type: ci
user: drh
comment:
  Fix a dangling-else problem that was causing recursive CTEs to malfunction.
  Begin fixing test cases to work with the new EQP output.


type: ci
user: dan
comment:
  Fix a problem in the xBestIndex method of the closure extension causing it to
  allocate non-contiguous argvIndex values in some cases (an "xBestIndex
  malfunction" error).


type: ci
user: drh
comment:
  Prevent VACUUM from running any commands in sqlite_master.sql other than
  CREATE statements.  That is all that should be there anyhow.  This fixes
  a problem discovered by OSSFuzz.  Test cases in TH3.


type: ci
user: drh
comment:
  The sqlite3BtreeInsert() routine tries to overwrite an existing cell with
  modified content if the new content is the same size.  Pages are only dirtied
  if they change.  This prototype works some, but still has issues.


type: ci
user: drh
comment:
  Fix test cases so that they work with the new EXPLAIN QUERY PLAN output
  format.  Only some of the cases have been fixed.  This is an incremental
  check-in.


type: ci
user: drh
comment:
  Enhance EXPLAIN QUERY PLAN to report the generation of constant rows using
  VALUES or just a SELECT without FROM.


type: ci
user: drh
comment:
  For the amalgamation-tarball, enable FTS5 and JSON1 by default and
  provide a new --enable-debug option that actives debugging facilities.


type: ci
user: drh
comment:
  Overhaul of EXPLAIN QUERY PLAN. The output is now in the form of a tree.
  More details of the query plan are shown, and what is shown is truer to what
  actually happens.


type: ci
user: drh
comment:
  Improved security for VACUUM.  This check-in combines the fixes
  of [ab0d99d0b5ede] and [27754b74ddf646] in a way that is less likely to
  to be broken by future changes.


type: ci
user: drh
comment:
  Make a separate limb in the EXPLAIN QUERY PLAN output for the various lines
  associated with the OR-optimization.


type: ci
user: drh
comment:
  Bring the code that changes the owner of WAL and rollback files when running
  as root into alignment with trunk.


type: ci
user: drh
comment:
  In an ORDER BY LIMIT, make sure the ORDER BY expression evaluator does not
  try to reuse values from the result set if the result set has not yet
  be computed.  This fixes a bug in the recent deferred-row loading 
  optimization, check-in [c381f0ea57002a264fd958b28e].
  OSSFuzz discovered the problem.


type: ci
user: drh
comment:
  Backout change [05fee1a21ea398f1e4d6f1cf3] because it does not take into
  account the LD_LIBRARY_PATH environment variable used by dl_open().


type: ci
user: drh
comment:
  On an UPDATE, try to overwrite an existing btree cell with the modified
  content, if the old and new cell are the same size.  Use memcmp() first
  to avoid dirtying pages that are unchanged.


type: ci
user: drh
comment:
  Merge changes from trunk, especially the activation of the cell-overwrite
  optimization for indexes and WITHOUT ROWID tables.


type: ci
user: drh
comment: Add test cases for geopoly_overlap().
ecomment:
  Add test cases for geopoly_overlap().
  (Later:) This branch is closed and the development of the geopoly logic
  is moved to the [/timeline?r=rtree-geopoly|rtree-geopoly] branch.


type: t
user: drh
brief: New ticket [e63a34a0045832dc|e63a34a004].
comment:
  New ticket [e63a34a0045832dc|e63a34a004] <i>Incorrectly formatted output for the &quot;.fullschema&quot; command in the CLI</i>.


type: ci
user: drh
comment:
  Correctly format the STAT1 and STAT4 content in the output from the
  ".fullschema" command in the CLI.  Fix for ticket
  [e63a34a0045832dc850367552].


type: t
user: drh
brief: Fixed ticket [e63a34a0045832dc|e63a34a004].
comment:
  Fixed ticket [e63a34a0045832dc|e63a34a004]: <i>Incorrectly formatted output for the &quot;.fullschema&quot; command in the CLI</i> plus 5 other changes


type: ci
user: drh
comment:
  Make the internal dynamic string interface available to extensions using
  the new sqlite3_str object and its associated methods.  This is mostly just
  a renaming of internal objects and methods to use external names, through
  there are a few small wrapper functions.


type: ci
user: drh
comment:
  The translation in and out of GeoJSON automatically adds or removes the
  redundant last vertex, as necessary.


type: ci
user: dan
comment:
  Add a test case to check that the fts5 unicode64 tokenizer is dealing with
  codepoints greater than 65535 correctly.


type: ci
user: drh
comment:
  In the CLI, allow comment lines that begin with '#', but only in a context
  where a dot-command is allowed.  In other words, '#' at the beginning of a
  line in the middle of an SQL statement is just part of the SQL.


type: ci
user: drh
comment:
  The restriction on using automatic indexes for low cardinality loops only
  applies if the cardinality is restricted by a LIMIT clause.


type: ci
user: drh
comment:
  Experimental syntax enhancement for an "INDEXED" keyword following a FROM-clause
  subquery that indicates that an automatic index on that subquery is suggested.


type: ci
user: drh
comment:
  This is an untested proof-of-concept for enhancements to RTree that attempt
  to use sqlite3_value_nochange() to reduce the amount of work associated with
  UPDATE operations in cases where either the coordinates or the auxiliary data
  is unchanged.


type: ci
user: dan
comment:
  Include the value of the "flags" byte of the relevant page in the log message
  emitted when a BEGIN CONCURRENT commit conflict is detected.


type: ci
user: dan
comment:
  Instead of just the flags byte, include the first 8 bytes of the relevant page
  in an on-commit conflict log message.


type: ci
user: mistachkin
comment:
  Add SQLITE_LOCKED_VTAB and SQLITE_CORRUPT_SEQUENCE to sqlite3ErrName().  Also, use SQLITE_CORRUPT_BKPT in one more place.


type: ci
user: drh
comment:
  Enhance the sqlite3_str_new() interface so that it always returns a valid
  and non-NULL pointer even in an OOM condition.


type: ci
user: drh
comment:
  Correct output for the fullkey column of json_each() when the total JSON
  input is a simple value, not an array or object.


type: ci
user: drh
comment:
  Initial implementation of the ability to have auxiliary columns in an rtree
  virtual table that store arbitrary content.  It mostly works, but there are
  some minor issues in OOM corner cases.


type: ci
user: drh
comment:
  Do not allow auxiliary columns in the rtree to interfere with query planning.
  Begin adding test cases.


type: ci
user: drh
comment:
  Improved error and help messages for the ".archive" command and "-A" option
  to the CLI. If a memory leak in --list processing.


type: ci
user: drh
comment:
  In the CLI with the -A command, if the file does not previously exist and
  its name looks like a ZIP archive name, then create it as a ZIP archive.


type: ci
user: dan
comment:
  Evaluate multiple window functions in a single pass if they use the same
  window definition. Add xValue callbacks for other built-in aggregate
  functions.


type: g
user: drh
comment:
  Edit [ea6a03a89dc23e86|ea6a03a89d]: Move to branch [/timeline?r=int-float-compare&nd&dp=ea6a03a89dc23e86&unhide | int-float-compare].


type: ci
user: drh
comment:
  In the CLI, detect and report errors on sqlite3_close().  Clear global
  variables prior to exit to so that valgrind can better detect resource
  leaks.


type: t
user: drh
brief: New ticket [d8dc2b3a58cd5dc2|d8dc2b3a58].
comment:
  New ticket [d8dc2b3a58cd5dc2|d8dc2b3a58] <i>Crash when the schema for sqlite_sequence is corrupt</i>.


type: ci
user: drh
comment:
  Remove a branch that is no longer used due to the fix to the
  sqlite_sequence schema problem, ticket
  [d8dc2b3a58cd5dc2918a1d4acbba4676a23ada4c]


type: ci
user: drh
comment:
  Verify that the sqlite_sequence table exists and is in approximately the
  correct format prior to using it to process an autoincrement table.
  Fix for ticket [d8dc2b3a58cd5dc2918a1d4a].


type: t
user: drh
brief: Fixed ticket [d8dc2b3a58cd5dc2|d8dc2b3a58].
comment:
  Fixed ticket [d8dc2b3a58cd5dc2|d8dc2b3a58]: <i>Crash when the schema for sqlite_sequence is corrupt</i> plus 5 other changes


type: ci
user: dan
comment:
  Support other frame types that use "<expr> PRECEDING" or "<expr> FOLLOWING" as
  start or end conditions.


type: ci
user: drh
comment:
  Addition cases for rtree preformance testing in speedtest1.c.  Add the
  --nodiff option to the speed-check.sh script.


type: ci
user: drh
comment:
  In the OOM testing logic, add the sqlite3FirstFault() routine as a place to
  set a breakpoint the first time any simulated OOM fault occurs for a single
  test case.


type: ci
user: drh
comment:
  Do not allow RTree writes when a read cursor is active on the same virtual
  table, as the writes might rebalance and disrupt the read cursors.  Return
  the new SQLITE_LOCKED_VTAB error code if this happens.


type: ci
user: dan
comment:
  Fixes for "ROWS BETWEEN <expr> FOLLOWING AND <expr> FOLLOWING" and "ROWS
  BETWEEN <expr> FOLLOWING AND UNBOUNDED FOLLOWING"


type: ci
user: drh
comment:
  When doing a one-pass UPDATE or DELETE on virtual tables, close the cursor
  prior to running VUpdate.  This allows one-pass to work on virtual tables
  that do not allow concurrent reads and writes.  Enhance rtree to take
  advantage of this new capability.


type: ci
user: drh
comment:
  Forward port the geopoly extension functions into the r-tree extension,
  with the idea of creating a new spatial index based on simply polygons.


type: ci
user: drh
comment:
  Untested incremental check-in.  Basic infrastructure for geopoly in place,
  except for the MATCH operator.


type: ci
user: drh
comment:
  Store application-defined function names as lower-case to avoid the need
  for case conversions before calling xFindFunction on virtual tables.
  Avoid using lookaside to store the destructors for application defined
  functions, as lookaside should be reserved for transient allocations.


type: ci
user: drh
comment:
  Experimental change that allows overloaded functions to be analyzed by
  the xBestIndex method and used by the xFilter method of a virtual table.


type: ci
user: drh
comment:
  Untested incremental check-in.  Add the geopoly_xform() function.  Complete
  basic logic for the geopoly virtual table.


type: ci
user: drh
comment:
  When compiling with SQLITE_DEBUG, add run-time checks to ensure that no
  statement aborts unless either there have been no writes or else there is
  a statement journal.


type: g
user: drh
comment:
  Edit [5a4542dbcf17a9f7|5a4542dbcf]: Move to branch [/timeline?r=stmt-journal-testing&nd&dp=5a4542dbcf17a9f7&unhide | stmt-journal-testing].


type: ci
user: drh
comment:
  When compiling with SQLITE_DEBUG, add run-time checks to ensure that no statement aborts unless either there have been no writes or else there is a statement journal.


type: ci
user: dan
comment:
  Do not require a statement journal in cases where REPLACE conflict handling is
  used to insert a single row, so long as the REPLACE operation cannot fire any
  triggers or foreign key actions.


type: ci
user: dan
comment:
  Increase the number of database handles opened by test script oserror.test to
  provoke an "out of file-descriptors" error to 20000 (from 2000).


type: ci
user: drh
comment:
  Demonstration code on a possible technique for optimizing the use of IN
  operator on columns to the right of multicolumn indexes.  If the OP_Noop
  generated where were really a new opcode that checked to see if there existed
  any entries in the index with a matching prefix, it might prevent unnecessary
  iterations of the IN operator.


type: ci
user: dan
comment:
  Allow an entire partition to be cached in a temp table for all types of window
  frames. This is required by nth_value() and others.


type: ci
user: drh
comment:
  Ensure that sqlite3AuthRead() is only call for TK_COLUMN and TK_TRIGGER
  expression nodes.  This fixes a harmless assert() identified by OSSFuzz.
  Move the assert() into a position where it is tested even if the authorizer
  is disabled.


type: ci
user: drh
comment:
  Work around a sanitizer warning about a pointer being only 4-byte aligned
  instead of 8-byte aligned.


type: ci
user: dan
comment:
  Update a test case in malloc5.test to take into account that malloc()
  sometimes returns slightly more space than requested.


type: ci
user: drh
comment:
  Update and correct the documentation on the OP_OpenRead, OP_OpenWrite,
  and OP_ReopenIdx opcodes.  No code changes other than the addition of
  an assert().


type: ci
user: drh
comment:
  Use an OP_NotFound opcode to cancel futile IN operators early.  The current
  implementation is suboptimal because it always runs teh OP_NotFound.  This
  still needs to be enhanced to only do the OP_NotFound if no results have been
  seen on the current loop.


type: ci
user: drh
comment:
  Add the OP_IfNoHope and OP_SeekHit opcodes used to reduce the number of
  unnecessary sqlite3BtreeMovetoUnpacked() calls when checking for an early
  exit on IN-operator loops.  Futher optimizations are likely possible here.


type: ci
user: drh
comment:
  Avoid unnecessary loads of columns in an aggregate query that are not
  within an aggregate function and that are not part of the GROUP BY clause.


type: ci
user: dan
comment:
  Calculate non-aggregate expressions in the SELECT list of an aggregate query
  that does not use min() or max() once per group, instead of once per row
  visited.


type: ci
user: drh
comment:
  Attempt to optimize the resolveExprStep() routine by mapping Expr opcodes into
  a subset of opcodes that resolveExprStep() cares about and only calling the
  routine when those opcodes are encountered.  Is slightly faster, but it seems
  like the very slight performance bump is not worth the added complexity.
  Saved on a dead-end branch for historical reference.


type: ci
user: drh
comment:
  Change sqlite3BtreeBeginTrans() to return the BTREE_SCHEMA_COOKIE, for a
  small speed improvement when starting new transactions.


type: ci
user: drh
comment:
  Fix the ".archive" command in the CLI (and the corresponding -A command-line
  option) so that it silently ignores filenames that contain "../" in their
  names.  This prevents the "Zip Slip" attack.


type: ci
user: drh
comment:
  Rearrange the order of some checks in the integrity_check pragma for a very
  slight performance gain.


type: ci
user: drh
comment:
  Small performance optimization in sqlite3VdbeRecordCompareWithSkip() for
  the common case where the comparison is equal.


type: t
user: drh
brief: New ticket [7be932dfa60a8a6b|7be932dfa6].
comment:
  New ticket [7be932dfa60a8a6b|7be932dfa6] <i>Adverse interaction between .stats and .eqp in the CLI</i>.


type: ci
user: drh
comment:
  Avoid using a prepared statement for ".stats on" after it has been closed
  by the ".eqp full" logic.  Fix for ticket [7be932dfa60a8a6b3b26bcf76].


type: t
user: drh
brief: Fixed ticket [7be932dfa60a8a6b|7be932dfa6].
comment:
  Fixed ticket [7be932dfa60a8a6b|7be932dfa6]: <i>Adverse interaction between .stats and .eqp in the CLI</i> plus 5 other changes


type: ci
user: drh
comment:
  Remove the NextIfOpen and PrevIfOpen opcodes which are no longer needed
  when the IN-early-out optimization is working.


type: ci
user: drh
comment:
  The IN-early-out optimization:  When doing a look-up on a multi-column index
  and an IN operator is used on a column other than the left-most column, then
  if no rows match against the first IN value, check to make sure there exist
  rows that match the columns to the right before continuing with the next IN
  value.


type: ci
user: drh
comment:
  Consider doing a partial table scan to fulfill an IN operator rather
  than using an index.  Try to pick the plan with the lowest cost.


type: ci
user: drh
comment:
  Fix an assert() that can be false for a corrupt database and a strange query
  that uses a recursive SQL function to delete content from a corrupt database
  file while it is being queried.


type: ci
user: drh
comment:
  Only choose to scan an IN operator rather than use an index if we have
  real STAT1 data to suggest it is advantageous.


type: ci
user: drh
ecomment:
  When the query planner has the opportunity to use an IN operater constraint
  on a term of an index other than the left-most term, use the estimated number
  of elements on the right-hand side of the IN operator to determine if makes
  sense to use the IN operator with index lookups, or to just do a scan over the
  range of the table identified by the index terms to the left.   Only do this
  if sqlite_stat1 measurements are available as otherwise the performance
  estimates will not be accurate enough to discern the best plan.  Bias the
  decision slightly in favor of using index lookups on each element of the IN
  operator.

comment:
  When the query planner has the opportunity to use an IN operater constraint
  on a term of an index other than the left-most term, use the estimated number
  of elements on the right-hand side of the IN operator to determine if makes
  sense to use the IN operator with index looks, or to just do a scan over the
  range of the table identified by the index terms to the left.   Only do this
  if sqlite_stat1 measurements are available as otherwise the performance
  estimates will not be accurate enough to discern the best plan.  Bias the
  decision slightly in favor of using index lookups on each element of the IN
  operator.


type: ci
user: drh
comment:
  Avoid invoking the whereLoopAddOr() routine in the query planner if there
  are no OR operators in the WHERE clause, thus speeding up query planning
  slightly.


type: ci
user: drh
comment:
  Compute the bitmask of indexed columns for each index once when the Index
  objecct is constructed, instead of recomputing it every time it is needed.


type: ci
user: drh
comment:
  Slightly smaller and faster code by encapsulating wal-index hash table
  location information in a separate WalHashLoc object rather than passing
  around the various elements as separate variables.


type: ci
user: drh
comment:
  Always initialize the WhereClause.hasOr field that was added by check-in
  [292724ffc4].  Error detected by OSSFuzz.


type: ci
user: drh
comment:
  Strengthen the sqlite3VdbeMemAboutToChange() run-time verification mechanism
  to better detect missed calls to AboutToChange().


type: ci
user: dan
comment:
  Fix handling of window frames containing negative number of rows. e.g. "ROWS x
  PRECEDING AND y PRECEDING" where (x<y).


type: ci
user: drh
comment:
  Add the OP_SetTabCol and OP_VerifyTabCol opcodes, only when compiling with
  SQLITE_DEBUG, to do run-time verification of the column cache.


type: ci
user: drh
comment:
  Fix the column cache invalidation logic in the code for ROWID uniqueness
  constraint checking in the INSERT command.  This fixes ticket
  [c2432ef9089ee73bd].


type: t
user: drh
brief: Fixed ticket [c2432ef9089ee73b|c2432ef908].
comment:
  Fixed ticket [c2432ef9089ee73b|c2432ef908]: <i>Assertion fault due to column cache malfunction</i> plus 5 other changes


type: ci
user: drh
comment:
  Documentation updates: clarify the behavior of sqlite3_column and
  sqlite3_value interfaces following an OOM error.


type: ci
user: drh
comment:
  Documentation update: clarify that sqlite3_errcode() and related interfaces
  do not themselves modify the error code.


type: ci
user: drh
comment:
  Add the unused SQLITE_CANTOPEN_DIRTYWAL result code.  This code was used
  in some historical versions on the apple-osx branch but was removed
  by check-in [27e20d699872b2b8].  Restore it so that old code that actually
  references that result code will still compile.


type: ci
user: dan
comment:
  Check that malloc() has not already failed when invoking the xUpdate() method
  of a virtual table implementation. This fixes an assert() failure in FTS5 that
  could occur following an OOM condition.


type: ci
user: dan
comment:
  Unless SQLITE_OMIT_AUTOINIT is defined, allow sqlite3_vfs_unregister() to be called before sqlite3_initialize().


type: ci
user: dan
comment:
  Fix problem with window functions min() and max() when used with a PARTITION
  clause and a frame starting point other than "UNBOUNDED PRECEDING".


type: ci
user: dan
comment:
  Fix a bug in the lead() and lag() window functions causing them to fail when
  used in queries featuring multiple window functions.


type: ci
user: dan
comment:
  Ensure that all four callbacks are provided when registering a window function
  (otherwise SQLITE_MISUSE is returned).


type: ci
user: drh
comment:
  Initial attempt to get SQLite working with OFD locks on Linux. The code here
  does not function correctly. This is an incremental check-in for a work in
  progress.


type: ci
user: drh
comment:
  Miscellaneous cleanup of OFD logic.  Add an #if 0 to disable the use of
  OFD logic, temporarily, until I can get it to actually work.


type: ci
user: dan
comment:
  Fix a problem caused by a sub-query containing a window function in the FROM
  clause of a query that itself uses a window function.


type: ci
user: drh
comment:
  The file_control_ofd_locks TCL command in testfixture distinguishes between
  OFD locks unavailable on the platform and OFD locks not used.


type: ci
user: dan
comment:
  Add tests to improve coverage of code in window.c. Fix a problem with "SELECT
  row_number() OVER ()".


type: ci
user: drh
comment:
  Make the ieee754() a built-in function.  Add the --ieee754 option to the
  ".dump" command in the shell to cause it to output floating-point values as
  ieee754() calls, so that the floating point number will be reproduced exactly.
  Not sure yet that we want to go this way, but it is one option.


type: ci
user: drh
comment:
  Experimental change to ANALYZE so that when computing values for
  sqlite_stat1, it uses the maximum number for the number of rows
  having equivalent values, rather than the average.


type: ci
user: drh
comment:
  Introduce the concept of "weak fallback" in the parser.  A weak fallback
  only occurs if a syntax error would result otherwise.


type: ci
user: dan
comment:
  Instead of using a lemon %fallback directive, have the tokenizer try to figure
  out whether an instance of "WINDOW" should be TK_WINDOW or TK_ID.


type: ci
user: dan
comment:
  Have the tokenizer handle fallback for tokens "OVER" and "FILTER" in the same
  way as it does for "WINDOW".


type: ci
user: dan
comment:
  Merge all changes from the weak-fallback branch except those related to the
  weak-fallback feature itself.


type: ci
user: drh
comment:
  Quick patch to the Lemon parser template to avoid an array overread reported
  by OSSFuzz.  A proper fix involves enhancements to the table generators in
  Lemon to make the overread impossible.  That fix will take longer to
  implement.  The current check-in is a stop-gap.


type: ci
user: dan
comment:
  Fix a segfault caused by invoking a regular aggregate as a window-function.
  And some problems with count(*) when used as a window-function.


type: ci
user: dan
comment:
  Fix a crash caused by a LIKE pattern that consists of a single escape
  character.

ecomment:
  Fix a crash caused by a LIKE pattern that consists of a single escape
  character. Problem found by OSSFuzz.


type: ci
user: dan
comment:
  Fix a segfault caused by having identical window functions in the select-list
  and ORDER BY clause of a SELECT statement.


type: ci
user: dan
comment:
  Test that a race condition can cause a "BEGIN EXCLUSIVE" to return
  SQLITE_BUSY_SNAPSHOT in wal mode.


type: ci
user: dan
comment:
  Experimental planner change to avoid a skip-scan if a regular index scan on
  the same index columns can be done instead.


type: ci
user: dan
comment:
  In wal mode, if a "BEGIN EXCLUSIVE" command (or any other command that
  upgrades from no transaction directly to a write transaction) hits an
  SQLITE_BUSY_SNAPSHOT error, change the error code to SQLITE_BUSY to indicate
  to the caller that the condition may be transient.


type: g
user: dan
comment:
  Edit [221ff63e7902226e|221ff63e79]: Move to branch [/timeline?r=exp-busy-snapshot-fix&nd&dp=221ff63e7902226e&unhide | exp-busy-snapshot-fix].


type: ci
user: drh
comment:
  Fix the .dump command in the command-line shell so that it does not show
  extraneous SELECT statements when ".echo on" is enabled.


type: ci
user: drh
comment:
  Use separate opcodes, OP_AggValue and OP_AggInverse, for the new callbacks
  associated with Window Functions, for improved readability of EXPLAIN
  output.


type: ci
user: dan
ecomment:
  Return an error if DISTINCT is used with a window-function (e.g.
  "count(DISTINCT <expr>) OVER (...)").

comment:
  Return an error if DISTINCT is used with a window-function (.i.e.
  "count(DISTINCT <expr>) OVER (...)".


type: ci
user: dan
comment:
  Remove some bad assert() statements from the implementations of window
  functions percent_rank() and cume_dist().


type: ci
user: dan
comment:
  Prevent "UNBOUNDED FOLLOWING" from being used as the starting boundary of a
  window-frame. And "UNBOUNDED PRECEDING" from being used as the ending
  boundary.


type: ci
user: drh
comment:
  Add an assert() to help verify that OP_AggInverse is never called on an
  accumulator that has not previously been processed by OP_AggStep.


type: ci
user: drh
comment:
  Add ALWAYS() macros on results of sqlite3_aggregate_context() calls in
  xInverse() implements, since they can never fail.


type: ci
user: drh
comment:
  Identify specific FuncDef objects for window functions using the pointer to
  the function name (FuncDef.zName) rather than the pointer to the xStep method.
  This allows xStep method pointer to be replaced with a single noopStepFunc()
  procedure, and thus save having lots of different no-op step functions.


type: ci
user: drh
comment:
  During WITHOUT ROWID table creation, if the sqlite3CreateTable() call fails
  due to an authorizer denying the INSERT into the sqlite_master table, then
  detect this fact and abort the CREATE TABLE early, to avoid an assertion
  fault.


type: ci
user: drh
comment:
  Simplification to the logic that detects misuse of the application-defined
  function creation interfaces.


type: ci
user: drh
comment:
  Simplification to the grammar rules for window functions.  Fix a memory
  leak that can follow an OOM while parsing a comma-separated list of
  window definitions.


type: ci
user: dan
comment:
  Avoid leaving view-definitions with an incomplete set of column names/types in
  the in-memory schema if an OOM strikes while allocating the same.


type: ci
user: drh
comment:
  Enhance the TreeView mechanism so that it shows the window function
  data structures as part of the abstract syntax tree.


type: ci
user: drh
comment:
  Enhance the sqlite3ExprCompare() routine so that it knows to compare the
  OVER clause of window functions.


type: ci
user: drh
comment:
  Assert that if two functions compare equal in every other way, then they
  must both have OVER clauses, or neither has an OVER clause.  Use this fact
  to simplify expression comparison.


type: ci
user: drh
comment:
  Fix a harmless warning about comment formatting in the previous
  check-in.  Simplify the ORDER BY dereferencing logic so that it avoids
  unreachable branches.


type: ci
user: drh
comment:
  Further improvements to bytecode branch testing.  Fix cases where the
  macros said a branch could not be taken when in fact it could be.  Alter
  some window function branch coverage macros to indicate that comparison
  operands cannot be NULL.


type: ci
user: drh
comment:
  Enhancements and improved documentation to the byte-code branch coverage
  testing logic.  Provide new macros that allow the code to specify that
  some branch instructions can never take the NULL path and that the OP_Jump
  opcode is only interested in equal/not-equal.  The
  SQLITE_TESTCTRL_VDBE_COVERAGE file control callback now works slightly
  differently (it provides the callback with a bitmask of the branch action,
  rather than an integer).


type: ci
user: dan
comment:
  Modify tests in window3.test to be tolerant of rounding errors when comparing
  floating point values.


type: ci
user: drh
comment:
  Identify Select objects within a single statement using small sequential
  integers rather than "0x%p".  This is more readable and yields the same result
  on successive runs.


type: ci
user: drh
comment:
  Minor comment changes.  Add ALWAYS() macros on some unreachable branches
  in the xStep() methods of built-in window functions.


type: ci
user: drh
comment:
  Adjustments to VdbeCoverage macros to deal with byte-code branches that
  can never be taken in some directions.


type: ci
user: drh
comment:
  On an UPSERT when the order of constraint checks is rearranged, make sure
  that the affinity transformations on the inserted content occur before
  any of the constraint checks.  Fix for ticket [79cad5e4b2e219dd197242e9e5f4e].


type: t
user: drh
brief: Ticket [79cad5e4b2e219dd|79cad5e4b2]: 6 changes
comment:
  Ticket [79cad5e4b2e219dd|79cad5e4b2] <i>UPSERT results in a corrupt database</i> status still Open with 6 other changes


type: t
user: drh
brief: Ticket [79cad5e4b2e219dd|79cad5e4b2]: 3 changes
comment:
  Ticket [79cad5e4b2e219dd|79cad5e4b2] <i>UPSERT results in a corrupt database</i> status still Open with 3 other changes


type: ci
user: dan
comment:
  Add a test case to check that SQLITE_DBCONFIG_RESET_DATABASE can be used with
  wal mode databases even if there are active readers.


type: t
user: drh
brief: Fixed ticket [79cad5e4b2e219dd|79cad5e4b2].
comment:
  Fixed ticket [79cad5e4b2e219dd|79cad5e4b2]: <i>UPSERT results in a corrupt database</i> plus 4 other changes


type: ci
user: dan
comment:
  If an SQLITE_IOERR error is encountered as part of an atomic commit on an F2FS
  file-system, retry the commit in legacy journal mode.


type: ci
user: dan
comment:
  If an SQLITE_IOERR error is encountered as part of an atomic commit on an F2FS file-system, retry the commit in legacy journal mode.


type: ci
user: drh
comment:
  Fix a harmless compiler warning in the pager.  Enhance the docs for
  sqlite3_changes() and sqlite3_total_changes() to refer to the data_version
  pragma.


type: ci
user: dan
comment:
  Experimental fix for resetting databases that have been deemed read-only due
  to a corrupt "read-version" header field.


type: ci
user: drh
comment:
  Allow the VACUUM following SQLITE_DBCONFIG_RESET_DATABASE to proceed even
  if the write-version in the header indicates that the database file is not
  writable.


type: ci
user: drh
comment:
  Avoid a branch in the commit logic that is unreachable when compiled
  without SQLITE_ENABLE_BATCH_ATOMIC_WRITE.


type: ci
user: drh
comment:
  Change the SQLITE_Stat34 bit of the optimization test-control so that it
  prevents STAT4 data from being used but allows it to be loaded into the
  Index objects.  This permits STAT4 to be turned on and off on a per-statement
  basis.


type: ci
user: dan
comment:
  Fix the macros used to generate the output of "PRAGMA compile_options" so that
  they handle valid values for the SQLITE_DEFAULT_LOOKASIDE macro (which
  contain a "," character).


type: ci
user: drh
comment:
  First attempt at reducing mutex contention in the unix VFS by providing
  a separate mutex for each unixInodeInfo object.


type: ci
user: drh
comment:
  In the unix VFS, give every unixInodeInfo object its own mutex, rather
  than using the global VFS mutex, to improve concurrency in cases where there
  are many threads operating on separate database files.


type: ci
user: drh
comment:
  Do not abort running queries due to a CREATE INDEX statement.  Allow them
  to run to completion before being reprepared.  Fix for ticket
  [c694113e50321afdf9].


type: t
user: drh
brief: Fixed ticket [c694113e50321afd|c694113e50].
comment:
  Fixed ticket [c694113e50321afd|c694113e50]: <i>Unnecessary ABORT with unhelpful error message</i> plus 5 other changes


type: ci
user: mistachkin
comment:
  Keep generated opcode values grouped together when required, even when they do not correspond to a token.


type: ci
user: drh
comment:
  Generalize the constant propagation optimization so that it applies on every
  WHERE close, not just those that contain a subquery.  This then demonstrates
  that the current implementation is inadequate since it does not take into
  account collating sequences.


type: ci
user: drh
comment:
  The WHERE-clause constant propagation optimization attempts to use
  transitive laws to replace column values with constants in the WHERE
  clause in order to help to query planner make more aggressive optimizations.


type: ci
user: drh
comment:
  Constant propagation is now restricted to just the WHERE clause. The
  mechanism is changed to take affinity and collation into account.  This
  seems to give correct answers.  But the search for constant propagation
  costs 4 million cycles in the speed test.


type: ci
user: drh
comment:
  Only run the constant propagation optimization on joins since that is the
  only scenario where it is useful.  This saves prepare time for the common
  case of a simple query.


type: ci
user: drh
comment:
  Performance improvement to sqlite3ExprCollSeq().  With this change, the
  performance of speed-check.sh is within 400,000 cycles of trunk.


type: ci
user: drh
comment:
  Minor grammar changes that help the parser run faster by reducing the
  number of NUL rule reductions.


type: ci
user: drh
comment:
  Improvements to the parser to increase coverage.  Fix the parser so that
  at least one expresssion is required after PARTITION BY and within the
  list of expressions on VALUES().


type: ci
user: drh
comment:
  Add assert() statements to sqlite3ExprDelete() that prove various symmetry
  properties of the Expr object that might be exploited to make the Expr object
  smaller and faster.


type: ci
user: dan
ecomment:
  Fix a heap-corruption causing race condition in os_unix.c that could occur
  when one thread wal opening a database file while another is unlocking the
  same file. Edit: Let's go in a slightly different direction with this fix.

comment:
  Fix a heap-corruption causing race condition in os_unix.c that could occur
  when one thread wal opening a database file while another is unlocking the
  same file.


type: ci
user: drh
comment:
  Fix an assert() statement that was made obsolete by the constant
  propagation enhancement.  Problem discovered by OSSFuzz.


type: ci
user: drh
comment:
  Do not allow a column reference that is converted into a constant by the
  WHERE-clause constant propagation optimization to be moved to the init-time
  constant expression list, as the table reference will not work there.
  This fixes a problem found by OSSFuzz.


type: ci
user: drh
comment:
  Add a small cost penalty to sorting to bias the query planner in favor of
  plans that do not require a final sorting pass.


type: ci
user: drh
ecomment:
  Fix the OP_SeekRowid opcode so that it has no type-change side-effects on the
  key register in P3.  This fixes an obcure problem that arises when doing
  equi-joins between a table with a TEXT column against another table with
  an INTEGER PRIMARY KEY.  The original problem was discovered when OSSFuzz
  created such a query and hit an assert() in OP_VerifyTabCol that was
  specifically designed to catch these kinds of errors at run-time.  Test cases
  for this fix are in TH3.

comment:
  Fix the OP_SeekRowid opcode so that it has no type-change side-effects on the
  key register in P3.  This fixes an obcure problem that arises when doing
  equi-joins between a table with a TEXT column against another table with
  an INTEGER PRIMARY KEY.  The original problem was discovered when OSSFuzz
  created such a query and hit an assert() in OP_VerifyTabCol that was
  specifically designed to catch these kinds of errors at run-time.


type: ci
user: dan
comment:
  Fix the handling of sub-queries with LIMIT clauses by the optimization
  activated by compile-time symbol SQLITE_COUNTOFVIEW_OPTIMIZATION.


type: ci
user: drh
ecomment:
  Completely remove the column cache logic, which has been a persistent source
  of bugs for many years.  Due to recent enhancements to the performance of the
  OP_Column opcode, removing the column cache actually makes speed-check.sh
  run faster.  Removing the column cache also saves about 1,800 bytes of code space.

comment:
  Completely remove the column cache logic, which has been a persistent source
  of bugs for many years.  We recent enhancements to the performance of the
  OP_Column opcode, the removing the column cache actually makes speed-check.sh
  run faster.  It also saves about 1,800 bytes of code space.


type: ci
user: drh
comment:
  Ensure that all expressions that are to be evaluated once at the start of
  a prepared statement (the Parse.pConstExpr expressions) pass the
  sqlite3ExprIsConstantNotJoin() test. It is not sufficient to pass just the
  sqlite3ExprIsConstant() test as that would allow through column references
  that are bound to constants by the WHERE clause in the constant propagation
  optimization.  This fixes a problem discovered by OSSFuzz.


type: ci
user: drh
comment:
  Remove the column-cache from the code generator.  The column-cache has been
  a persistent source of bugs for years and with recent improvements
  in the performance of OP_Column, it no longer provides a benefit.  After
  the column cache is removed, the binary is almost 2KB smaller and the
  speed-check.sh performance test is over 3 million cycles faster.


type: ci
user: drh
comment:
  Remove more column-cache residue:  The OP_SetColTab and OP_VerifyColTab
  opcodes and the associated SQLITE_DEBUG_COLUMNCACHE logic.


type: ci
user: drh
comment:
  Remove a testcase() that is no longer reachable without the column cache.
  Provide an assert() to help prove that the testcase is no longer reachable.


type: ci
user: drh
comment:
  Enhance the edit() function so that it converts text from \r\n back into \n
  only if the original unedited copy contained no \r\n values.


type: ci
user: dan
comment:
  Allow sqlite3_snapshot_open() to be called to change the snapshot after a
  read transaction is already open on database.


type: ci
user: dan
comment:
  Allow sqlite3_snapshot_open() to be called to change the snapshot after a read
  transaction is already open on database.


type: ci
user: drh
comment:
  When a column must be a constant due to WHERE clause and the value of that
  column is being coded as a constant, make sure the affinity is correct.


type: ci
user: dan
comment:
  Fix a problem with renaming columns on tables with REFERENCES clauses that
  specify a large number of columns.


type: ci
user: drh
comment:
  Fix the isLikeOrGlob() routine in the WHERE clause processing logic so that
  it avoids signed/unsigned character comparisons, as that can lead to an
  incorrect answer if the ESCAPE clause is an invalid UTF8 string.  Problem
  found by OSSFuzz.


type: ci
user: dan
comment:
  When a column is renamed, update any references to it in REFERENCES clauses
  that belong to other tables.


type: ci
user: dan
comment:
  Reload the entire schema after renaming a column in order to ensure that the
  schema for any tables for which parent key definitions were changed are
  reloaded.


type: ci
user: dan
comment:
  Fix a bug causing all ALTER TABLE RENAME COLUMN commands to fail if ANALYZE
  had been run on the database. Also prevent the user from renaming the columns
  of system tables.


type: ci
user: dan
comment:
  Fix a bug causing ALTER TABLE RENAME COLUMN to fail when renaming an IPK
  column that is used in a CHECK constraint.


type: ci
user: dan
comment:
  If the new column name in an ALTER TABLE RENAME COLUMN statement is quoted,
  then also use quotes for the column name in the edited SQL statements.


type: ci
user: drh
comment:
  Add the "atrc" test program.   "Atrc" is short for "ALTER TABLE RENAME COLUMN".
  See the header comment on the program itself for further information.


type: ci
user: drh
comment:
  Reduce the size of Expr to 64-bytes.  This works somewhat, but there are
  test failures.  More importantly, the size reduction from 80- to 64-bytes has
  not lowered the schema memory usage, but it has made the code a little bigger
  and a little slower.  So the initial evidence is that this Expr refactoring
  experiment is not working...


type: ci
user: drh
comment:
  Fix legacy comments on Token.  Begin commenting the new ALTER TABLE RENAME
  COLUMN code.  Fix a memory leak in the sqlite_rename_column() SQL function.


type: ci
user: drh
comment:
  Make the sqlite_rename_column() SQL function resistant to problems caused
  by OOMs and/or malformed parameters submitted by hostile application code.
  Also add additional comments to the RENAME COLUMN logic.


type: ci
user: dan
comment:
  Fix ALTER TABLE RENAME COLUMN in cases where the column being renamed is an
  IPK declared with a separate PRIMARY KEY clause - "CREATE TABLE x(y INTEGER,
  PRIMARY KEY(y))".


type: g
user: drh
comment:
  Edit [2447e0fd9830b4de|2447e0fd98]: Move to branch [/timeline?r=unix-lock-fix-attempt&nd&dp=2447e0fd9830b4de&unhide | unix-lock-fix-attempt]. Mark "Closed". Edit check-in comment.


type: ci
user: drh
comment:
  Stop requiring the global VFS mutex to access the unixInodeInfo.pUnused field.
  The unixInodeInfo mutex is sufficient.


type: ci
user: drh
comment:
  Take extra precautions to ensure access to unixInodeInfo.pUnused is protected
  by all necessary mutexes.


type: ci
user: drh
comment:
  Fix UPSERT so that it checks the target-constraint first and fires the
  DO UPDATE if that constraint is violated regardless of whether or not
  other constraints are in violation.  This aligns SQLite behavior with
  what PostgreSQL does. Fix for ticket [908f001483982c43cdb476dfb590a1a].


type: t
user: drh
brief: Ticket [908f001483982c43|908f001483]: 6 changes
comment:
  Ticket [908f001483982c43|908f001483] <i>UPSERT does not work like PostgreSQL</i> status still Open with 6 other changes


type: t
user: drh
brief: Fixed ticket [908f001483982c43|908f001483].
comment:
  Fixed ticket [908f001483982c43|908f001483]: <i>UPSERT does not work like PostgreSQL</i> plus 3 other changes


type: ci
user: drh
comment:
  Fix a harmless unused-variable compiler warning that only came up in certain
  compile-time configurations.


type: ci
user: dan
comment:
  Ensure that CREATE VIEW, TRIGGER or INDEX statements can be edited by ALTER
  TABLE RENAME COLUMN even if they use collation-sequences or
  user-defined-functions that are not available.


type: ci
user: dan
comment:
  Allow an ALTER TABLE RENAME COLUMN to proceed even if the schema contains a
  virtual table for which the module is unavailable.


type: ci
user: dan
comment:
  Minor changes to function tokenExpr() in order to claw back cycles lost to the
  rename-column change.


type: ci
user: dan
comment:
  Rationalize some duplicated code in alter.c. Also improve error messages for
  ALTER TABLE RENAME COLUMN in some cases.


type: ci
user: dan
comment:
  Rename internal function sqlite3RenameToken() to sqlite3RenameTokenMap() and
  sqlite3MoveRenameToken() to sqlite3RenameTokenRemap().


type: ci
user: drh
comment:
  Automatically detect when compiling for AArch64 on windows and set
  SQLITE_BYTEORDER to little-endian to avoid compile-time testing.


type: ci
user: drh
comment:
  Fix harmless compiler warnings in the ALTER TABLE logic.  Rephrase an
  error message to use active voice.


type: ci
user: drh
comment:
  Add the "atrc" test program to the Makefiles.  Fix a typo in the instructions
  in the header comment of the atrc program.


type: ci
user: dan
comment:
  Avoid incorrectly replacing tokens that refer to a column being renamed via an
  alias. For example, do not overwrite "xyz" when "a" is renamed in "CREATE VIEW
  v1 AS SELECT a AS xyz FROM tbl WHERE xyz=1"


type: ci
user: dan
comment:
  After modifying and reparsing the schema as part of an ALTER TABLE RENAME
  COLUMN, check that no new schema errors have been introduced (e.g. ambiguous
  column names in views) before committing the operation.


type: ci
user: dan
comment:
  Fix a problem with renaming a column that occurs as an "excluded.colname"
  construction in an UPSERT that is part of a trigger program.


type: ci
user: drh
comment:
  Add support for the Geopoly extension to the R-Tree extension.  This also
  involves adding the SQLITE_INDEX_CONSTRAINT_FUNCTION capability to the 
  xFindFunction method of the sqlite3_module object, and to the
  sqlite3_index_info.aConstraint.op field in the xBestIndex implementation of
  virtual tables.


type: ci
user: dan
comment:
  Fix a problem by renaming a column when the schema contains an trigger program
  featuring an UPSERT that uses an "excluded.*" reference to a different table.


type: ci
user: drh
comment:
  Merge fixes from the alter-table-rename-column branch that occurred after
  this branch separated from that one.


type: ci
user: drh
comment:
  Provide the two-argument geopoly_within(P1,P2) routine that determines if
  polygon P2 is contained within polygon P1.  Make this function available to
  the query planner for optimized rtree lookups.  Update the visual01.txt
  script to verify that the new functionality actually works.


type: ci
user: drh
comment:
  Enhance the geopoly virtual table so that it does a better job of optimizing
  geopoly_within() queries.


type: ci
user: drh
comment:
  Split the three-argument version of geopoly_within() off into a separate
  function named geopoly_contains_point().


type: ci
user: dan
comment:
  Fix a problem causing spurious SQLITE_CORRUPT errors when using the snapshot
  API to read from old database snapshots.


type: ci
user: drh
comment:
  Disable the server1.test script on old PPC Macs due to problems in the
  pthreads implementation on those archaic machines.


type: ci
user: drh
comment:
  Free up the MEM_Frame bit in Mem.flags object.  Store VdbeFrame objects
  as MEM_Blob with a special Mem.xDel pointer instead.


type: ci
user: drh
comment:
  Also free up the MEM_RowSet bit in the Mem.flags field and have RowSet objects
  be destroyed using Mem.xDel.  This change results in faster code.


type: ci
user: drh
comment:
  Give the debugging routine print_pager_stats() external linkage in order to
  suppress harmless compiler and TSAN warnings.


type: ci
user: dan
comment:
  Test the schema after renaming a table. Ensure that temp database triggers and
  views are updated when renaming a column.


type: ci
user: drh
comment:
  Try to identify the places in WAL code where thread-safety depends on the
  underlying architecture supporting atomic load and store of aligned 32-bit
  values.


type: ci
user: dan
comment:
  Ensure b-tree mutexes are always held when sqlite3FindTable() is called. Do
  not invoke the authorizer callback when parsing schema items as part of ALTER
  TABLE commands. Fix test script issues.


type: ci
user: dan
comment:
  If a call to sqlite3_snapshot_open() fails because the requested snapshot no
  longer exists, return SQLITE_ERROR_SNAPSHOT instead of SQLITE_BUSY_SNAPSHOT.


type: ci
user: dan
comment:
  Have "ALTER TABLE ADD COLUMN" reload the entire db schema, as "RENAME COLUMN"
  and "RENAME TABLE" do.


type: ci
user: dan
comment:
  Fix a problem with renaming a column in a table that has a temp trigger that
  references another attached database.


type: ci
user: dan
comment:
  Ensure that FTS5 queries of the form "WHERE rowid BETWEEN ? AND ? AND tbl
  MATCH ? ORDER BY rank" do rowid filtering before sorting.


type: ci
user: dan
comment:
  Ensure that the tbl_name column in the sqlite_temp_master table is updated
  correctly as part of a RENAME TABLE operation.


type: ci
user: drh
comment:
  Fix a problem with geopoly trying to update both the _shape and an auxiliary
  column in the same UPDATE statement.


type: ci
user: dan
comment:
  Add an "ALTER TABLE RENAME COLUMN" command. Upgrade "ALTER TABLE RENAME TABLE"
  so that it modifies references to the renamed table embedded in SQL view and
  trigger definitions.


type: ci
user: dan
comment:
  Fix a problem with ALTER TABLE when there are views or triggers in the schema
  that contain "<expr> IS NULL" expressions.


type: ci
user: drh
comment:
  Fix an uninitialized variable in the OP_ParseSchema opcode that comes up
  only if the schema is corrupt.


type: ci
user: dan
comment:
  Fix a problem with renaming a non-temp table that has at least one temp
  trigger and shares its name with a temp table.


type: t
user: drh
brief: New ticket [9936b2fa443fec03|9936b2fa44].
comment:
  New ticket [9936b2fa443fec03|9936b2fa44] <i>Infinite loop due to the ORDER BY LIMIT optimization</i>.


type: ci
user: drh
comment:
  Fix multiple issues with the ORDER BY LIMIT optimization.  This is the
  proposed resolution to ticket [9936b2fa443fec03ff25].


type: t
user: dan
brief: Ticket [9936b2fa443fec03|9936b2fa44]: 6 changes
comment:
  Ticket [9936b2fa443fec03|9936b2fa44] <i>Infinite loop due to the ORDER BY LIMIT optimization</i> status still Open with 6 other changes


type: ci
user: drh
comment:
  Fix an unreachable branch in the new sqlite3WhereOrderByLimitOptLabel()
  function of the query planner.


type: ci
user: dan
comment:
  Fix a problem with processing a "vtab.col IS NULL" expression within
  the WHERE clause of a query when "vtab" is a virtual table on the rhs of a
  LEFT JOIN.


type: t
user: drh
brief: Ticket [c94369cae9b561b1|c94369cae9]: 6 changes
comment:
  Ticket [c94369cae9b561b1|c94369cae9] <i>Wrong answer due to the LIKE optimization</i> status still Open with 6 other changes


type: ci
user: drh
comment:
  Fix the LIKE optimization so that it is disabled when the LHS of the
  expression does not have TEXT affinity and the RHS is the pattern '/%'
  or the RHS begins with the escape character. Fix for ticket
  [c94369cae9b561b1f996d0054b].


type: t
user: drh
brief: Fixed ticket [c94369cae9b561b1|c94369cae9].
comment:
  Fixed ticket [c94369cae9b561b1|c94369cae9]: <i>Wrong answer due to the LIKE optimization</i> plus 3 other changes


type: t
user: drh
brief: Fixed ticket [9936b2fa443fec03|9936b2fa44].
comment:
  Fixed ticket [9936b2fa443fec03|9936b2fa44]: <i>Infinite loop due to the ORDER BY LIMIT optimization</i> plus 3 other changes


type: ci
user: drh
comment:
  Add the ability for loadable extensions to access the new
  sqlite3_create_window_function() interface.


type: ci
user: drh
comment:
  Do not do the byte-by-byte modifications in the resetdb.test script if the
  reserved-byte flag in the DB header is non-zero, because in that case the
  bytes will be in the wrong place and the test won't work.


type: ci
user: drh
comment:
  Fix a harmless compiler warning that arose from the ENABLE_CURSOR_HINTS
  fix of check-in [0af18674ca5b34e67e]


type: ci
user: dan
comment:
  Fix an invalid pointer comparison triggered by renaming a table column when
  there are views with explicit column names in the schema.


type: ci
user: drh
comment:
  Make sure the %z optimization for printf() is not invoked if there has been
  a prior error (SQLITE_NOMEM or SQLITE_TOOBIG) associated with the same
  printf() call.


type: ci
user: drh
comment:
  Optimization: when doing an UPDATE on a table with indexes on an expression,
  do not update the expression indexes if they do not refer to any of the
  columns of the table being updated.


type: ci
user: drh
comment:
  Improved presentation on the new code that prevents unnecessary writes to
  expressions on indexes during an UPDATE when the expression does not reference
  any of the columns that are changing.


type: ci
user: drh
comment:
  Add the new "explain" virtual table in ext/misc.  Use this virtual table
  for additional test cases for the optimization that avoids updating indexes
  on expressions when none of the columns changed by the UPDATE are in the
  expression.


type: t
user: drh
brief: Ticket [b41031ea2b537237|b41031ea2b]: 6 changes
comment:
  Ticket [b41031ea2b537237|b41031ea2b] <i>Assertion fault on ALTER TABLE</i> status still Open with 6 other changes


type: t
user: drh
brief: Ticket [b41031ea2b537237|b41031ea2b]: 3 changes
comment:
  Ticket [b41031ea2b537237|b41031ea2b] <i>ALTER TABLE returns an error on certain schemas</i> status still Open with 3 other changes


type: ci
user: dan
comment:
  Add extra test for the fix on this branch. Also fix a
  pointer-compare-after-free problem that occurs in similar cases.


type: ci
user: drh
comment:
  Fix a false-positive in the post-ALTER-TABLE schema verification logic that
  prevents ALTER TABLE from working if the table being altered has a trigger
  that references any column of a virtual table. Ticket [b41031ea2b537237].


type: ci
user: drh
comment:
  Disable the ORDER BY LIMIT optimization in queries using window functions.
  This fixes a problem that was introduced by check-in [206720129ed2fa8875a286]
  which attempted to fix ticket [9936b2fa443fec03ff25f9].  This changes is
  a fix for the follow-in tocket [510cde277783b5fb5de628].


type: t
user: drh
brief: New ticket [510cde277783b5fb|510cde2777].
comment:
  New ticket [510cde277783b5fb|510cde2777] <i>Endless loop on a query with window functions, ORDER BY, and LIMIT</i>.


type: ci
user: drh
comment:
  Further optimizations to the UPDATE logic to avoid making changes to partial
  indexes if none of the columns mentioned in the WHERE clause are modified by
  the UPDATE.


type: t
user: drh
brief: Fixed ticket [b41031ea2b537237|b41031ea2b].
comment:
  Fixed ticket [b41031ea2b537237|b41031ea2b]: <i>ALTER TABLE returns an error on certain schemas</i> plus 3 other changes


type: t
user: drh
brief: Fixed ticket [510cde277783b5fb|510cde2777].
comment:
  Fixed ticket [510cde277783b5fb|510cde2777]: <i>Endless loop on a query with window functions, ORDER BY, and LIMIT</i> plus 5 other changes


type: ci
user: dan
comment:
  Minor improvements to the permutations.test script. Most notably, a command
  like "permutations.test alter%" now runs all test scripts with names that
  match the LIKE pattern "alter%". Or, say, "permutations wal alter%" to run all
  alter% tests in wal mode.


type: ci
user: dan
comment:
  Enhance tester.tcl so that when "--malloctrace=1" is specified, the test
  generates self-contained Tcl scripts that present GUIs instead of *.sql files
  that require a separate program to interpret.


type: ci
user: dan
comment:
  Avoid incrementing the SQLITE_LOOKASIDE_MISS_SIZE stat before sqlite3_open()
  returns. Fix test script problem in lookaside.test.


type: ci
user: drh
comment:
  In the Expr object, the Expr.eX field determines what value is stored in the
  Expr.x union.  This mostly works, but there are issues identified by valgrind.


type: g
user: drh
comment:
  Edit [fc90a53de7ebca5d|fc90a53de7]: Move to branch [/timeline?r=expr-simplify-branch1&nd&dp=fc90a53de7ebca5d&unhide | expr-simplify-branch1]. Mark "Closed".


type: ci
user: drh
comment:
  Fix the "sqlite3" command in the TCL interface so that it correctly returns
  an error if invoked with no arguments.


type: ci
user: drh
comment:
  Make sure temporary Expr objects are fully initialized prior to sending them
  into sqlite3ExprCodeTemp().


type: ci
user: drh
comment:
  Reduce the size of Expr from 80 to 72 bytes moving the pRight field inside the
  "x" union.  This is an incremental check-in that still has issues.


type: ci
user: dan
comment:
  Fix a compilation issue in the "userauth" extension. Also fix a few test
  script errors that occur with SQLITE_USER_AUTHENTICATION=1 builds.


type: ci
user: dan
comment:
  By default, make all "ALTER TABLE RENAME" statements executed within a virtual
  table xRename() method exhibit the legacy behaviour.


type: ci
user: drh
comment:
  Add the "PRAGMA legacy_alter_table=ON" command to enable the pre-3.25.0
  behavior of ALTER TABLE that does not modify the bodies of triggers or
  views or the WHERE clause of a partial index.  Enable the legacy behavior
  by default when running the xRename method of virtual tables.


type: ci
user: drh
comment:
  Combine the Expr.pTab and Expr.pWin fields into a union named "y".  Add a new
  EP_WinFunc property that is only true if Expr.y.pWin is a valid pointer.
  This reduces the size of the Expr object by 8 bytes, reduces the overall
  amount of code, and shaves over 1 million cycles off of the speed test.


type: ci
user: drh
comment:
  Optimization to the OP_MakeRecord opcode makes speed-check.sh run about
  1.1 million cycles faster, and results in a slightly smaller library.


type: ci
user: drh
comment:
  Put a limit counter on the query planner that restricts the number of
  index+constraint options that can be considered for each table in a join.
  This prevents certain pathological queries from taking up too much time
  in the query planner.


type: ci
user: drh
comment:
  Enhance WhereLoopBuilder.iPlanLimit to handle a case involving the OR
  optimization discovered overnight by OSSFuzz.


type: ci
user: drh
comment:
  Fix a faulty assert() in the validation logic for the LEFT JOIN strength
  reduction optimization.  Problem found by OSSFuzz.


type: ci
user: drh
comment:
  Increase the initial value of WhereLoopBuilder.iPlanLimit to 20K.  Issue
  a warning if the iPlanLimit reaches zero.


type: ci
user: drh
comment:
  Use compile-time options SQLITE_QUERY_PLANNER_LIMIT and
  SQLITE_QUERY_PLANNER_LIMIT_INCR to control the value for
  WhereLoopBuilder.iPlanLimit, rather than embedding magic numbers in the
  code.


type: ci
user: drh
ecomment:
  Allow a writable virtual table to have a schema with an INTEGER PRIMARY KEY
  and WITHOUT ROWID.  This fixes ticket
  [f25d5ceebe1d710ff61a571e395356869d8272ef].  Test case in TH3.

comment:
  Allow a writable virtual table to have a schema with an INTEGER PRIMARY KEY
  and WITHOUT ROWID.  This fixes ticket
  [f25d5ceebe1d710ff61a571e395356869d8272ef].


type: t
user: drh
brief: New ticket [f25d5ceebe1d710f|f25d5ceebe].
comment:
  New ticket [f25d5ceebe1d710f|f25d5ceebe] <i>INTEGER PRIMARY KEY WITHOUT ROWID virtual table crash</i>.


type: t
user: drh
brief: Fixed ticket [f25d5ceebe1d710f|f25d5ceebe].
comment:
  Fixed ticket [f25d5ceebe1d710f|f25d5ceebe]: <i>INTEGER PRIMARY KEY WITHOUT ROWID virtual table crash</i> plus 5 other changes


type: ci
user: drh
comment:
  Slightly smaller and faster alternative to [507d892c3a40a0bacbd47] that
  fixes a problem with views that use window function as part of complex
  expressions.


type: ci
user: drh
comment:
  Allow a writable virtual table to have a schema with an INTEGER PRIMARY KEY
  and WITHOUT ROWID.  This fixes ticket
  [f25d5ceebe1d710ff61a571e395356869d8272ef].  Test case in TH3.


type: ci
user: drh
comment:
  Disallow the use of window functions in the recursive part of a recursive CTE.
  Fix for ticket [e8275b415a2f03bee].


type: ci
user: dan
comment:
  Tweak spellfix.c so that if SQLITE_SPELLFIX_5BYTE_MAPPINGS is defined at
  compile time the Transliteration structure has space for 5 byte (instead of 4
  byte) mappings.


type: ci
user: drh
comment:
  Begin revamping the ".help" command in the command-line shell so that it
  can accept an argument and will do a search for commands that match that
  argument.


type: ci
user: dan
comment: Disallow the use of window functions in the recursive part of a recursive CTE.
ecomment:
  Disallow the use of window functions in the recursive part of a recursive CTE.
  Fix for ticket [e8275b415a2f03bee].


type: t
user: drh
brief: New ticket [e8275b415a2f03be|e8275b415a].
comment:
  New ticket [e8275b415a2f03be|e8275b415a] <i>Assertion fault from window function inside of recursive CTE</i>.


type: t
user: drh
brief: Fixed ticket [e8275b415a2f03be|e8275b415a].
comment:
  Fixed ticket [e8275b415a2f03be|e8275b415a]: <i>Assertion fault from window function inside of recursive CTE</i> plus 5 other changes


type: ci
user: drh
comment:
  Ensure that the OP_VColumn opcode does set sqlite3_vtab_nochange() unless
  the OPFLAG_NOCHNG bit is set in P5.  Fix for ticket
  [69d642332d25aa3b7315a6d385]


type: ci
user: dan
comment:
  Ensure each ALTER TABLE statement makes just a single SQLITE_ALTER_TABLE call
  to the authorizer function.


type: ci
user: drh
comment:
  Initial prototype of a eponymous virtual table that accesses sqlite3_status64()
  and sqlite3_db_status().


type: ci
user: drh
comment:
  Enhancements to sqlite_memstat:
  (1) Add an extra "schema" column to show the schema name for ZIPVFS stats.
  (2) Only show ZIPVFS stats to schema that use ZIPVFS
  (3) Put a NULL in unused columns of the output.


type: ci
user: drh
comment:
  Add the sqlite_memstat extension - an eponymous virtual table that shows
  memory usages statistics for SQLite.


type: t
user: drh
brief: New ticket [69d642332d25aa3b|69d642332d].
comment:
  New ticket [69d642332d25aa3b|69d642332d] <i>The typeof() and length() functions fail in some virtual tables.</i>.


type: ci
user: drh
comment:
  Enhance the GeoPOLY extension so that it always stores its polygons in the
  binary format, which is faster and more compact.


type: t
user: drh
brief: Fixed ticket [69d642332d25aa3b|69d642332d].
comment:
  Fixed ticket [69d642332d25aa3b|69d642332d]: <i>The typeof() and length() functions fail in some virtual tables.</i> plus 5 other changes


type: ci
user: drh
comment:
  Fix a bug in the sqlite_memstat virtual table that was causing it to report
  the amount of memory used as zero bytes.


type: ci
user: dan
comment:
  Fix a problem with ALTER TABLE commands when the schema features an INSTEAD of
  trigger that uses NEW.* or OLD.*.


type: ci
user: drh
comment:
  Add the PRAGMA table_vinfo command (with an extra "v" before "info") that
  works like PRAGMA table_info (without the "v") except that it also shows
  hidden columns on virtual tables.


type: ci
user: drh
comment:
  Fix a potential crash that can occur while reading an index from a corrupt
  database file.  The corruption is a record-header-size that is larger than
  0x7fffffff.  Problem detected by OSSFuzz against GDAL and reported to us 
  (with a suggested fix) by Even Rouault.  The test case is in TH3.


type: ci
user: drh
comment:
  In the WHERE-constraint propagation optimization, if there are duplicate
  constraint, make sure only one of them propagates.  Proposed fix for
  ticket [cf5ed20fc8621b165].


type: ci
user: drh
comment:
  Add the "PRAGMA table_xinfo" command that works like table_info but also
  shows hidden columns in virtual tables and adds the "hidden" boolean column.


type: ci
user: drh
comment:
  Change the name of the pragma to PRAGMA table_xinfo.  Improve the
  mkpragmatab.tcl script to reuse column names where appropriate.


type: ci
user: drh
comment:
  Fix comments and refactor some names associated with shared-memory locking
  in the Unix VFS.  No logical changes.


type: t
user: drh
brief: New ticket [43ddc85a63d2ed88|43ddc85a63].
comment:
  New ticket [43ddc85a63d2ed88|43ddc85a63] <i>ALTER TABLE fails when there is an INSTEAD-OF trigger of a VIEW</i>.


type: ci
user: drh
comment:
  Additional field name changes and commit fixes associated with shared-memory
  locking in the unix VFS, to improve maintainability.  No logic changes.


type: ci
user: drh
comment:
  Add an additional assert() verifying mutex invariants on the
  unixShmSystemLock() routine in the unix VFS.


type: ci
user: dan
comment:
  Change a type in shell.c.in from "int" to "sqlite3_int64" in order to
  avoid a compiler warning and possible integer overflow.


type: ci
user: drh
comment:
  The 0x8000 optimization flag associated with SQLITE_TESTCTRL_OPTIMIZATIONS
  causes a large penalty (200) to be added to all sorting costs, which
  encourages the query planner avoid using the sorter. This flag can be
  used in experiments to help come up with a more accurate estimate of the
  true cost of sorting.


type: t
user: drh
brief: New ticket [31c6e64ff93274f1|31c6e64ff9].
comment:
  New ticket [31c6e64ff93274f1|31c6e64ff9] <i>ALTER TABLE fails if a trigger references a non-existant table.</i>.


type: ci
user: drh
comment:
  When the left-hand side of a WHERE clause contraint is a UNIQUE column,
  and that term of the WHERE clause is not used for indexing, assume that the
  term reduces the number of output rows by half.  This is one proposed fix
  for ticket [e8b674241947eb3ba4]


type: ci
user: dan
comment:
  Add test cases and assert() statements to ensure that the authorizer is being
  called as expected from within ALTER TABLE.


type: ci
user: drh
comment:
  Replace the new geopoly_reverse() function with geopoly_ccw().  The
  geopoly_ccw() function only reverses the vertex order if doing so is necessary
  to get the correct right-hand winding rule on the polygon.


type: ci
user: drh
comment:
  Add the ability to open a database connection in -reuseschema mode in the CLI.
  Adjust memory allocation accounting so that a shared schema is allocated
  across each database sharing it.


type: ci
user: drh
comment:
  In the unix VFS, fix the heap shm allocator (used for unix-excl) 
  so that it works even on systems where the page size is larger than 32KB.


type: ci
user: drh
comment:
  In the CLI, allow the SQLITE_HISTORY environment variable, if it exists,
  to specify an alternative file in which to store the shell edit history.


type: ci
user: drh
comment:
  On the first connection to a WAL-mode database that was not cleanly shut down
  and contains a left-over -shm file, truncate the -shm file to 3 bytes instead
  of to 0 bytes. Avoiding a truncation to 0 means that system monitoring tools
  can better detect if a process illegitimately tries to truncate a -shm file.
  Such a rogue process might think it is being helpful by cleaning up old files,
  but there is a race condition that can cause damage to the database.


type: ci
user: dan
comment:
  Add the SQLITE_CHANGESETAPPLY_INVERT flag to sessions. For inverting and applying a changeset in a single step.


type: ci
user: dan
comment:
  Add the sqlite3changeset_start_v2() - a new version of _start() that accepts a flags parameter - and a streaming equivalent to the sessions module. Also add the SQLITE_CHANGESETSTART_INVERT flag, used with start_v2() to invert a changeset while iterating through it.


type: t
user: drh
brief: New ticket [cf5ed20fc8621b16|cf5ed20fc8].
comment:
  New ticket [cf5ed20fc8621b16|cf5ed20fc8] <i>Incorrect join result with duplicate WHERE clause constraint</i>.


type: ci
user: dan
comment:
  Speed up xAccess() calls made on an RBU VFS when there are lots of open
  connections.

ecomment:
  Speed up xAccess() calls made on an RBU VFS when there are lots of open
  connections. Cherrypick of [310b4b65].


type: t
user: drh
brief: Fixed ticket [cf5ed20fc8621b16|cf5ed20fc8].
comment:
  Fixed ticket [cf5ed20fc8621b16|cf5ed20fc8]: <i>Incorrect join result with duplicate WHERE clause constraint</i> plus 5 other changes


type: ci
user: drh
comment:
  Fix a assert() in the query planner that can arise when doing row-value
  operations on a PRIMARY KEY that contains duplicate columns.
  Ticket [1a84668dcfdebaf12415d].


type: ci
user: dan
comment:
  Add the sqlite3session_config() interface. For configuring global parameters
  belonging to the sessions module.


type: ci
user: dan
comment:
  Prevent an == constraint specified using the table-valued-function argument
  syntax from being used to optimize any scan not related to the virtual table
  for which it was specified as an argument.


type: ci
user: drh
comment:
  Initial code for a fuzzing tool on database file that works with the
  -fsanitize=fuzzer option of clang.


type: ci
user: drh
comment:
  Add support for the SQLITE_PREPARE_NORMALIZED flag and the
  sqlite3_normalized_sql() when compiling with SQLITE_ENABLE_NORMALIZE.
  Also remove unnecessary whitespace from Makefiles.


type: ci
user: drh
comment:
  Fix a potential assertion fault that can occur while trying to DROP a table
  from a corrupted database file.


type: ci
user: drh
comment:
  Fix minor memory leak in the dbstat extension that can occur following an
  attempt to analyze a corrupt database file.


type: ci
user: drh
comment:
  In the VACUUM command, defer setting writable_schema until after it has been
  determined that the schema is not corrupt.


type: ci
user: drh
ecomment:
  Disable the use of coroutines for subqueries within a query that is the
  RHS of an IN operator, as the IN operator might be evaluated more than
  once.  Possible fix for [787fa716be3a7f65], unless we can come up with
  something better.  Later: Counter-example found.

comment:
  Disable the use of coroutines for subqueries within a query that is the
  RHS of an IN operator, as the IN operator might be evaluated more than
  once.  Possible fix for [787fa716be3a7f65], unless we can come up with
  something better.


type: g
user: drh
comment:
  Edit [3afec260142f939c|3afec26014]: Move to branch [/timeline?r=robust-against-damaged-db&nd&dp=3afec260142f939c&unhide | robust-against-damaged-db].


type: ci
user: drh
comment:
  In the CLI, when opening a file that begins with the normal SQLite prefix,
  open the file as a normal database even if it has a ZIP for AppendVFS record
  at the end.


type: ci
user: drh
comment:
  Enable sqlite3_deserialize() in the CLI.  The --deserialize option associated
  with opening a new database cause the database file to be read into memory
  and accessed using the sqlite3_deserialize() API.  This simplifies running 
  tests on a database without risk of modifying the file on disk.


type: ci
user: drh
comment:
  Improvements to the -fsanitize=fuzzer based database file fuzzer.
  (Cherrypick from the rubust-against-damaged-db branch.)


type: ci
user: drh
comment:
  Modify the CLI so that the --deserialize option is only available if it is
  compiled with SQLITE_ENABLE_DESERIALIZE.  DESERIALIZE is now off by default
  for the main.mk makefile, but on for Makefile.in and Makefile.msc.


type: ci
user: drh
comment:
  Split the SQLITE_WriteSchema flag in two flags, WriteSchema and
  SQLITE_NoSchemaError.  Set only WriteSchema on a VACUUM to avoid problems
  when trying to vacuum a corrupt database.  With this change, the size
  of the flags field on sqlite3 must grow from 32 to 64 bytes.


type: ci
user: dan
comment:
  Update comments in sqlite3session.c to describe the format of "rebase blobs",
  as well as changesets and patchsets.


type: ci
user: drh
comment:
  Deploy the sqlite3Strlen30NN() function (argument guaranteed to be non-NULL) for
  a small performance improvement.


type: ci
user: drh
comment:
  Enhance triggers so that they can use table-valued-functions that exist in
  schemas outside of the schema in which the trigger is defined.


type: ci
user: drh
comment:
  Disable the IS NOT NULL optimization when the IS NOT NULL operator is part
  of the ON clause of a LEFT JOIN. Fix for ticket [65eb38f6e46de8c75e188a17ec].


type: t
user: drh
brief: New ticket [65eb38f6e46de8c7|65eb38f6e4].
comment:
  New ticket [65eb38f6e46de8c7|65eb38f6e4] <i>Incorrect answer on LEFT JOIN when STAT4 is enabled</i>.


type: t
user: drh
brief: Fixed ticket [65eb38f6e46de8c7|65eb38f6e4].
comment:
  Fixed ticket [65eb38f6e46de8c7|65eb38f6e4]: <i>Incorrect answer on LEFT JOIN when STAT4 is enabled</i> plus 6 other changes


type: t
user: drh
brief: Fixed ticket [1a84668dcfdebaf1|1a84668dcf].
comment:
  Fixed ticket [1a84668dcfdebaf1|1a84668dcf]: <i>Assertion fault due to malformed PRIMARY KEY</i> plus 5 other changes


type: ci
user: drh
comment:
  Eponymous virtual tables appear to exist in all schemas. This is an alternative
  and improved fix to the eponymous virtual table in trigger problem that
  was previously addressed by checkin [1fa74930ab56171e].


type: ci
user: dan
comment:
  Add preliminary version of "changesetfuzz" program. For fuzzing changeset data
  without creating corrupt changesets.


type: ci
user: drh
comment:
  Make the winTruncate() method of the windows VFS be a no-op if there are
  outstanding references to the memory-mapped pages.  Otherwise, memory might
  be deleted out from under those references when the file is remapped during
  the truncate operation.


type: ci
user: drh
comment:
  Add enforcement of read-only on shadow tables.  This does not currently work
  since some virtual tables are attempting to update shadow tables using
  sqlite3_exec().


type: ci
user: drh
comment:
  Initial code to make shadow tables read-only to ordinary SQL. The now
  xShadowName method is added to the sqlite3_module object and is used
  to identify potential shadow tables.  The SQLITE_PREPARE_SHADOW argument
  to sqlite3_prepare_v3() is defined.  It is designed to permit writing to
  shadow tables, but is currently an unused placeholder.


type: ci
user: drh
comment:
  Only allow shadow table to be written from within a recursive SQL call.
  Omit the SQLITE_PREPARE_SHADOW flag.  Some tests are failing because the
  tests depend on being able to write to shadow tables.


type: ci
user: drh
comment:
  Enable DEFENSIVE mode by default for tests.  This requires lots of case of
  turning DEFENSIVE off in order to dodgy things to the database for testing
  purposes.  No all of those cases are yet handled, so "make test" does not run
  to completion.


type: ci
user: drh
comment:
  Add the SQLITE_DEFAULT_DEFENSIVE compile-time option.  Fix up test cases
  so that they work with DEFENSIVE enabled.


type: ci
user: dan
comment:
  Partially revert [3e1a2f661], as some test scripts require separate $presql
  and $dbconfig variables.


type: ci
user: drh
comment:
  Improved documentation for SQLITE_DBCONFIG_DEFENSIVE.  Add a NEVER() macro
  on an unreachable branch.


type: t
user: drh
brief: Ticket [787fa716be3a7f65|787fa716be]: 6 changes
comment:
  Ticket [787fa716be3a7f65|787fa716be] <i>Assertion fault using window functions</i> status still Open with 6 other changes


type: t
user: drh
brief: Ticket [787fa716be3a7f65|787fa716be]: 3 changes
comment:
  Ticket [787fa716be3a7f65|787fa716be] <i>Assertion fault using window functions</i> status still Open with 3 other changes


type: t
user: drh
brief: Ticket [787fa716be3a7f65|787fa716be]: 3 changes
comment:
  Ticket [787fa716be3a7f65|787fa716be] <i>Assertion fault due to IN operator</i> status still Open with 3 other changes


type: ci
user: drh
comment:
  In the treeview.c module, break out the display of SrcList into a separate
  subroutine, so that it can be invoked while debugging.


type: t
user: drh
brief: Ticket [787fa716be3a7f65|787fa716be]: 4 changes
comment:
  Ticket [787fa716be3a7f65|787fa716be] <i>Assertion fault when multi-use subquery implemented by co-routine</i> status still Open with 4 other changes


type: g
user: drh
comment:
  Edit [8d663bfaaa4656c4|8d663bfaaa]: Move to branch [/timeline?r=tkt787fa716-deadend&nd&dp=8d663bfaaa4656c4&unhide | tkt787fa716-deadend]. Mark "Closed". Edit check-in comment.


type: ci
user: drh
comment:
  Fix invalid use of unprotected sqlite3_value objects in the sqldiff utility,
  when using the --changeset option.


type: ci
user: dan
comment:
  When a table is renamed using "ALTER TABLE RENAME TO", update any REFERENCES
  clauses that refer to the table, unless "PRAGMA legacy_alter_table" is true
  and "PRAGMA foreign_keys" is set to false (i.e. so that when "PRAGMA
  legacy_alter_table" is set behaviour is still compatible with versions 3.24
  and earlier).


type: t
user: drh
brief: Fixed ticket [787fa716be3a7f65|787fa716be].
comment:
  Fixed ticket [787fa716be3a7f65|787fa716be]: <i>Assertion fault when multi-use subquery implemented by co-routine</i> plus 3 other changes


type: ci
user: drh
comment:
  Add support for read-only shadow tables on virtual tables.  Added the
  SQLITE_DEFAULT_DEFENSIVE compile-time option that can put SQLite in 
  defensive mode by default.


type: ci
user: drh
comment:
  Fix a potential buffer overread in the dbstat virtual table when processing
  a corrupt database file.


type: ci
user: drh
comment:
  Enhance the xBestIndex interface of virtual table so that if the xBestIndex
  method returns SQLITE_CONSTRAINT then that particular combination of
  constraints is considered unusable and does not participate further in
  query planning.


type: ci
user: dan
comment:
  In order to avoid exporting a symbol, use a macro instead of a function to
  replace sqlite3_complete() in the shell code when SQLITE_OMIT_COMPLETE is
  defined.


type: ci
user: drh
comment:
  Update the generate_series() table-valued function to make use of the new
  SQLITE_CONSTRAINT return from xBestIndex.


type: ci
user: dan
comment:
  Fix another name resolution problem occurring when two or more attached
  databases use the same Schema object.


type: ci
user: drh
comment:
  Attempt to make the parser a little faster by storing the ON and USING
  clause in a single OnUsing object.


type: ci
user: drh
comment:
  Improvements to the ossfuzz.c fuzz-testing module so that it works with
  -DSQLITE_OMIT_PROGRESS_CALLBACK and with -DSQLITE_OMIT_INIT.


type: ci
user: dan
comment:
  Fix problems in pragma.c causing some PRAGMA statements to test the wrong
  schema-cookie before proceeding, or to try to open cursors on the wrong
  database ("PRAGMA foreign_key_check" only).


type: ci
user: mistachkin
comment:
  Experimental changes to (optionally) allow double-quoted strings to be checked against known identifiers.


type: ci
user: drh
comment:
  Do not allow direct access to internal-use SQL functions such as
  sqlite_rename_column() and sqlite3_rename_table() except when the
  new SQLITE_TESTCTRL_INTERNAL_FUNCTIONS flag is set.


type: ci
user: drh
comment:
  Fix to the error handling logic in the Lemon parser template.  This does
  not affect SQLite since SQLite does not use that part of the Lemon parser
  template.


type: ci
user: dan
comment:
  Add an "#ifndef SQLITE_DISABLE_FTS4_DEFERRED" block around function
  fts3EvalDeferredPhrase() in fts3 in order to silence a compiler warning.


type: ci
user: drh
comment:
  Remove the sqlite3PagerUseWal() routine which was made obsolete by
  the [81629ba91475938b6ad] change.


type: ci
user: drh
comment:
  Always enable SQLITE_ENABLE_DESERIALIZE for the MSVC makefile as this is necessary
  to get releasetest.tcl to work.


type: ci
user: dan
comment:
  Remove -DSQLITE_USER_AUTHENTICATION from the "Unlock-Notify" configuration.
  Create a dedicated "User-Auth" configuration for testing this feature.


type: ci
user: drh
comment:
  Follow-up to [0bf0fd242b93c3bd30]: only reset the pager when adding a
  new codec, not when overwriting an existing codec.  Also, improve a
  comment in the pcache1 subsystem.


type: g
user: dan
comment:
  Edit [31b6aee755c81d69|31b6aee755]: Move to branch [/timeline?r=reuse-schema1&nd&dp=31b6aee755c81d69&unhide | reuse-schema1].


type: ci
user: drh
comment:
  Reduce the size of the parser tables generated by Lemon by splitting the
  yyRuleInfo structure into separate yyRuleInfoLhs and yyRuleInfoNRhs arrays.


type: ci
user: dan
comment:
  Cherrypick a couple of fixes from begin-concurrent-pnu into this branch. The
  differences between the two branches are now that this one does not have
  "PRAGMA noop_update" or the mutex-free PRNG.


type: ci
user: mistachkin
comment:
  When compiled with SQLITE_ENABLE_NORMALIZE, always have sqlite3_exec() enable the SQLITE_PREPARE_NORMALIZE flag.


type: ci
user: drh
comment:
  Performance improvement in sqlite3_step() by creating a new mTrace flag
  for the legacy xProfile pointer that is set by sqlite3_profile().


type: ci
user: dan
comment:
  Fixes for snapshots API on this branch. Also ensure that the snapshots API
  cannot be used with wal2 mode databases (for now anyhow).


type: ci
user: drh
ecomment: Bungled checkin. Ignore.
comment:
  Simplify the sqlite3_normalized_sql() implementation so that it asssumes
  well-formed SQL inputs in this sense: double-quoted names are always taken
  to be valid identifiers and never string literals.


type: ci
user: drh
comment:
  Enhance the sqlite3_normalize_sql() interface so that it works even if the
  prepared statement was not initially compiled using
  SQLITE_PREPARE_NORMALIZED.  Enhance the ".trace" command in the CLI so that
  it is able to access the full scope of functionality provided by 
  sqlite3_trace_v2() and in particular so that it is able to show normalized
  SQL output using the newly enhanced sqlite3_normalize_sql() interface.


type: ci
user: dan
comment:
  Ensure that ALTER TABLE modifies table and column names embedded in WITH
  clauses that are part of views and triggers.


type: ci
user: dan
comment:
  Fix a problem causing "PRAGMA journal_mode" to report the wrong journal mode
  (wal instead of wal2) under some circumstances.


type: ci
user: dan
comment:
  Add multi-threaded performance test program "tserver" to this branch. Fix bugs
  in the begin-concurrent/wal2 integration revealed by the same.


type: ci
user: drh
comment:
  Fix an imbalanced lock problem in sqlite3Normalize() introduced by the
  simplification in [94ea6379178e3ff6a].


type: g
user: drh
comment:
  Edit [9b6e9a6e45f3da3a|9b6e9a6e45]: Move to branch [/timeline?r=mistake&nd&dp=9b6e9a6e45f3da3a&unhide | mistake]. Edit check-in comment.


type: ci
user: drh
comment:
  Get rid of the hash table used to track IN operators in the
  sqlite3_normalized_sql() implementation.  Use simple integer variables
  instead.


type: ci
user: drh
comment:
  The sqlite3_normalized_sql() interface should not be transforming quoted
  identifier names into wildcards.  Fix this, and at the same time simplify
  the code substantially.


type: ci
user: drh
comment:
  Fix a potential NULL pointer dereference that can occur in ALTER TABLE
  following an OOM.  Test case in TH3.


type: ci
user: drh
comment:
  Fix a missing mutex in the sqlite3_normalized_sql() interface when it is
  called on a prepared statement that did not previously have a computed
  normalization of the input SQL.


type: ci
user: drh
comment:
  Invoking the sqlite3_trace() or sqlite3_trace_v2() interfaces cancels
  any sqlite3_profile() that is running.


type: ci
user: drh
comment:
  Fix the sqlite3ExprDup() function so that it correctly duplicates the
  Window object list on a Select that contains window functions.  Fix
  for ticket [f09fcd17810f65f717].


type: ci
user: drh
comment:
  When masking bits off of sqlite3.flags, make sure the mask is 64 bits
  in size so as not to accidentally mask of high-order bits.


type: ci
user: drh
comment:
  Simplify the query flattener so that it does not duplicate the WHERE clause
  of subquery that is being incorporated into the outer query - copies it
  directly.  This is more efficient.  And it also fixes the specific test case
  show for ticket [f09fcd17810f65f71789525] but it does not resolve the more
  general problem that sqlite3ExprDup() does not correctly duplicate expressions
  that contain subqueries with window functions.


type: ci
user: dan
comment:
  Experiment with using an atomic CPU primitive instead of a mutex for
  intra-process locking with the unix-excl VFS.


type: ci
user: drh
comment:
  New test case that still hits an assertion fault, just to prove that the
  previous checkin merely made the problem more obscure and did not completely
  fix it.


type: ci
user: drh
comment:
  Fix the sqlite3ExprDup() routine so that it makes complete duplications of
  subqueries containing window functions.


type: ci
user: drh
comment:
  Experimental support for new sqlite3_bind_blob() and sqlite3_bind_text()
  interfaces that take an extra void* argument that is passed into the
  destructor in front of the object that is to be destroyed.


type: ci
user: drh
comment:
  Performance improvement:  Avoid using sqlite3WalkerSelectExpr()
  and sqlite3WalkerSelectFrom() twice, so that the compiler will in-line their
  implementation.


type: t
user: drh
brief: Fixed ticket [f09fcd17810f65f7|f09fcd1781].
comment:
  Fixed ticket [f09fcd17810f65f7|f09fcd1781]: <i>Assertion fault when window functions are used.</i> plus 5 other changes


type: ci
user: drh
comment:
  Do not use a partial index as a table scan in an IN operator.
  Fix for ticket [1d958d90596593a77420e59].


type: ci
user: drh
comment:
  Remove a line of code from VACUUM that is no longer needed, due to the
  change that allows ATTACH to run within a transaction.


type: t
user: drh
brief: New ticket [1d958d90596593a7|1d958d9059].
comment:
  New ticket [1d958d90596593a7|1d958d9059] <i>Incorrect result with NOT IN operator and partial index</i>.


type: t
user: drh
brief: Fixed ticket [1d958d90596593a7|1d958d9059].
comment:
  Fixed ticket [1d958d90596593a7|1d958d9059]: <i>Incorrect result with NOT IN operator and partial index</i> plus 5 other changes


type: ci
user: dan
comment:
  Fix a problem with using "<db>-vacuum" (the default) as the state database
  when resuming an RBU vacuum.


type: ci
user: drh
comment:
  Refactor the sqlite3_normalized_sql() implementation. This is a
  work-in-progress. There are still issues.


type: ci
user: drh
comment:
  Further refinements to the sqlite3_normalized_sql() interface.  TH3 now
  gives 100% MC/DC on that interface.


type: ci
user: drh
comment:
  Remove an ALWAYS() from a branch that is not always taken.  The test case
  found by OSSFuzz has been added to TH3.


type: ci
user: drh
comment:
  OSSFuzz found a case where an assert() inside sqlite3ExprCompare() can be
  true.  Test case added to TH3.


type: ci
user: drh
comment:
  New database corruption test cases discovered by dbfuzz2.  The new cases
  have been added to test/fuzzdata7.db, but have not yet all been fixed,
  so tests will not currently pass.


type: ci
user: drh
comment:
  Add the "dbtotxt" utility program and the ability to read "dbtotxt" output
  as a deserialized input database in the CLI, using the --hexdb option to
  the ".open" command.


type: ci
user: drh
comment:
  Add extra tests for database corruption inside the defragmentPage() routine,
  as dbfuzz2 has found ways for corruption to leak into that point.  Add test
  cases in fuzzdata7.db.


type: ci
user: drh
comment:
  Fix the CLI to keep proper track of input line numbers for use in error
  messages, even after processing in-line hex database inputs using
  ".open --hexdb".


type: ci
user: drh
comment:
  Fix the CLI so that the ".open --hexdb" command works even if it is contained
  in a subscript that is read using ".read".


type: ci
user: drh
comment:
  Add the "decode_hexdb" TCL command to testfixture.  Add the dbfuzz001.test
  module to demonstration how to use decode_hexdb to deserialize a dbtotxt
  database description for use in a corruption test.


type: ci
user: drh
comment:
  Fix a problem in sqlite3BtreeDelete() in which deleting an entry from a
  corrupt database can leave a btree page with zero cells.


type: ci
user: drh
comment:
  Fix a bug in the custom in-memory VFS used by fuzzcheck.  This bug masks
  other bugs that should have caused some existing fuzzdata7.db entries to
  fail, and so this fix is initially on a branch until those other bugs can
  be repaired.


type: ci
user: drh
comment:
  Detect when an attempt is made to write to a pointer map page that is also
  being used as a btree page and report corruption.


type: ci
user: drh
ecomment:
  Report corruption when an attempt is made to write a pointer-map page that is
  also being used as a btree page. Also,
  fix a bug in fuzzcheck that cause it to overlook a pointer-map bug that was
  trigger by the fuzzcheck test data, and also fix the pointer-map bug.

comment:
  Fix a bug in fuzzcheck that cause it to overlook a pointer-map bug that was
  trigger by the fuzzcheck test data, and also fix the pointer-map bug.


type: t
user: dan
brief: New ticket [d96eba87698a428c|d96eba8769].
comment:
  New ticket [d96eba87698a428c|d96eba8769] <i>Incorrect results for OR query where both OR terms are different indexed expressions</i>.


type: ci
user: drh
comment:
  Fix a problem with bytecode generation when a query involves two or more
  indexes on expressions connected by OR.
  Ticket [d96eba87698a428c1ddd0790ea04]


type: t
user: drh
brief: Ticket [d96eba87698a428c|d96eba8769]: 7 changes
comment:
  Ticket [d96eba87698a428c|d96eba8769] <i>Incorrect results for OR query where both OR terms are different indexed expressions</i> status still Open with 7 other changes


type: ci
user: dan
comment:
  When saving the position of a cursor at the b-tree layer, allocate a few extra
  bytes at the end of the buffer used to save the key. Otherwise, if the key is
  corrupt, the code that restores the cursor position may overread the buffer by a
  little.


type: t
user: drh
brief: Fixed ticket [d96eba87698a428c|d96eba8769].
comment:
  Fixed ticket [d96eba87698a428c|d96eba8769]: <i>Incorrect results for OR query where both OR terms are different indexed expressions</i> plus 3 other changes


type: ci
user: drh
comment:
  Expand the size of the temporary page used during btree rebalancing by a
  few bytes, to avoid problems with small buffer overreads that can occur
  on corrupted database files.


type: ci
user: drh
comment:
  Avoid a buffer overread in ptrmapPutOvflPtr() that can occurs in a
  corrupt database file that has large entries and uses autovacuum.


type: ci
user: drh
comment:
  Back out the expansion of the temporary buffer size from
  [32754ca6f86da816] and replace it with an explicit test for buffer
  overreads.


type: ci
user: drh
comment:
  Fix possible integer overflow while running PRAGMA integrity_check on a
  database file with a badly corrupted freelist.


type: ci
user: drh
comment:
  Add a missing OP_ColumnsUsed opcode to code for expressions like "? IN (SELECT ...)" in cases where expression can use an index that may contain NULL values.
  (Backported fix from version 3.14.0).


type: ci
user: drh
comment:
  Add the OP_ColumnsUsed opcode (when compiled with
  SQLITE_ENABLE_COLUMN_USED_MASK) as a hint to the b-tree layer as to which
  columns of a btree cursor will be used.
  (Backport from 3.8.11)


type: ci
user: dan
comment:
  Add interfaces sqlite3_bind_pointer(), sqlite3_result_pointer(), and
  sqlite3_value_pointer() used to safely move pointer values through SQL without
  exposing underlying memory address information. Cherrypick from commit
  [8201f4e1] on branch-3.18.


type: ci
user: dan
comment:
  Fix a segfault caused by using the RAISE function incorrectly (library now
  returns an error instead of crashing).


type: ci
user: dan
comment:
  Change the way a comparison used to detect corrupt databases in fts3 is done
  to avoid potential pointer overflow in 32-bit builds. Cherrypick of
  [95a9a39ff7].


type: ci
user: dan
comment:
  Add new interfaces sqlite3_result_pointer(), and
  sqlite3_value_pointer() and use them to transfer the eponymous FTS3 column
  pointer to the snippet() and offsets() routines.  Cherrypick from commit
  [8201f4e1] on branch-3.18.


type: ci
user: dan
comment:
  Fix a bug in the code that detects self-referencing rows as part of foreign
  key processing. Fix for [50d2a6c2].


type: t
user: dan
brief: New ticket [50d2a6c292e3c391|50d2a6c292].
comment:
  New ticket [50d2a6c292e3c391|50d2a6c292] <i>Foreign key malfunction when parent and child are the same WITHOUT ROWID table and parent key is not also PRIMARY KEY</i>.


type: ci
user: drh
comment:
  Do not set the Cursor.seekOp test variable in the OP_NotExists opcode.
  This is a change to test logic only and does not affect deliverable builds.


type: t
user: dan
brief: Closed ticket [50d2a6c292e3c391|50d2a6c292].
comment:
  Closed ticket [50d2a6c292e3c391|50d2a6c292]: <i>Foreign key malfunction when parent and child are the same WITHOUT ROWID table and parent key is not also PRIMARY KEY</i> plus 5 other changes


type: ci
user: drh
comment:
  In RTREE, turn an assert() into an if() because the condition can
  sometimes be false when dealing with a corrupt database.


type: ci
user: drh
comment:
  Fix the RTree extension so that it correctly ignores constraints that it
  does not understand, even if they are against a dimension column.


type: ci
user: drh
comment:
  In FTS3, avoid calling memcpy() with a NULL source pointer, even if the 
  transfer amount is zero bytes.


type: ci
user: dan
comment:
  Add new sqlite3_prepare_v3() flag SQLITE_PREPARE_NO_VTAB, for preparing
  statements that are not allowed to use any virtual tables. Use this to prevent
  circular references in triggers on virtual table shadow tables from causing
  resource leaks.


type: ci
user: dan
comment:
  Add new sqlite3_prepare_v3() flag SQLITE_PREPARE_NO_VTAB, for
  preparing statements that are not allowed to use any virtual tables.
  Use this to prevent circular references in triggers on virtual table
  shadow tables from causing resource leaks.


type: ci
user: drh
comment:
  Update the dbtotxt utility program so that it does not output characters that
  are special to TCL, thus making the output of dbtotxt easier to insert into
  test scripts.


type: ci
user: drh
comment:
  The OP_Eq and OP_Ne operators have a special P5 value SQLITE_NOTNULL that
  asserts that the values are not null.  Except that is not always true for
  a corrupt database.  Adjust the assert() and add a testcase() to make this
  point clear.


type: t
user: drh
brief: New ticket [e6f1f2e34dceeb1e|e6f1f2e34d].
comment:
  New ticket [e6f1f2e34dceeb1e|e6f1f2e34d] <i>REPLACE can insert a default NULL into a NOT NULL column</i>.


type: ci
user: drh
comment:
  Do not all REPLACE to sneak a NULL value into a NOT NULL column.  Detect that
  situation and ABORT instead.  Fix for ticket [e6f1f2e34dceeb1ed61531c7e98].


type: t
user: drh
brief: Fixed ticket [e6f1f2e34dceeb1e|e6f1f2e34d].
comment:
  Fixed ticket [e6f1f2e34dceeb1e|e6f1f2e34d]: <i>REPLACE can insert a default NULL into a NOT NULL column</i> plus 5 other changes


type: ci
user: dan
comment:
  Avoid a left-shift of a negative value (undefined behaviour) when dealing with a corrupt database in
  fts3.


type: ci
user: dan
comment:
  Fix a "jump or move depends on uninitialized value" valgrind error that could
  occur in fts5 when dealing with a corrupt database.


type: ci
user: drh
comment:
  Split the code generation for the RHS of IN operators and for SELECT and
  EXISTS expressions into two separate subroutines, because there is now little
  commonality between those to functions. This is intended to help make the
  code easier to read and maintain.


type: ci
user: drh
comment:
  Experimental code that tries to put the computation of subqueries inside a
  subroutine, and reuse that subroutine if the same subquery is evaluated more
  than once.  Current code does not work for CHECK constraints.


type: ci
user: drh
comment:
  Do not generate subroutines for non-static SELECT and EXISTS expressions.
  Fix up some test cases to account for the minor changes in EXPLAIN QUERY PLAN
  output.


type: ci
user: dan
comment:
  Change the way a comparison used to detect corrupt databases in fts3 is done
  to avoid potential pointer overflow in 32-bit builds.


type: ci
user: dan
comment:
  Avoid a left-shift of a negative value (undefined behaviour) when dealing with
  a corrupt database in fts3. Cherrypick of [b851d12474].


type: ci
user: drh
comment:
  Improvements to EXPLAIN QUERY PLAN formatting.  The MULTI-INDEX OR now shows
  a separate "INDEX" subtree for each index.  SCALAR SUBQUERY entries provide
  a subquery number that is related back to the .selecttrace output.


type: ci
user: drh
comment:
  Increase the number of parameters to sqlite3WhereCodeOneLoopStart() to
  encourage the compiler to inline that routine within sqlite3WhereBegin().
  This gives a performance improvement.


type: ci
user: drh
comment:
  Here is the beginnings of an effort to factor out the implementation of
  scalar subqueries to be implemented as subroutines at the end of the main
  body of bytecode, after the jump back to the OP_Init opcode.  This is an
  incremental check-in that contains only preliminary changes.


type: t
user: drh
brief: Closed ticket [43ddc85a63d2ed88|43ddc85a63].
comment:
  Closed ticket [43ddc85a63d2ed88|43ddc85a63]: <i>ALTER TABLE fails when there is an INSTEAD-OF trigger on a VIEW</i> plus 7 other changes


type: ci
user: drh
comment:
  Fix a problem in which nested CTEs with the same table name trick the
  code generator into thinking they are the same CTE, which then tries to
  use the manifest them both into the same transient table.


type: ci
user: drh
comment:
  In the treeview debugging output, 
  provide additional details for the Table object
  associated with each FROM clause term.


type: ci
user: drh
comment:
  Modify the btree02.test module so that it does not depend on whether TCL
  interprets a value as a string or as an integer.


type: ci
user: dan
comment:
  Fix a problem causing the sqlite_master entry corresponding to a virtual table
  to be removed by a DROP TABLE even if the call to the vtabs xDestroy() method
  failed.


type: ci
user: drh
comment:
  Move the nOpAlloc field from Parse into Vdbe to avoid an extra pointer
  deference on the fast path in sqlite3VdbeAddOp3().


type: ci
user: drh
comment:
  A new implementation of sqlite3VdbeMakeLabel() is faster and makes fewer
  memory allocations by deferring memory allocation until 
  sqlite3VdbeResolveLabel() is called, at which point the code generator has
  a better idea of how big the relocation table needs to be.
  The sqlite3VdbeMakeLabel() routine now takes a Parse* parameter instead of
  Vdbe*.


type: ci
user: drh
comment:
  Fix the OP_OpenEphemeral opcode in the bytecode engine so that if it is called
  a second or subsequent time, it merely clears the existing table rather than
  creating a new one.  Proposed fix for ticket [d0866b26f83e9c55e30de0821f5d].


type: ci
user: dan
comment:
  Fix a problem causing a corrupt pager-cache if an OOM or IO error was
  encountered while committing a concurrent transacation.


type: t
user: dan
brief: New ticket [d0866b26f83e9c55|d0866b26f8].
comment:
  New ticket [d0866b26f83e9c55|d0866b26f8] <i>Window function in correlated subquery causes assertion fault</i>.


type: t
user: drh
brief: Fixed ticket [d0866b26f83e9c55|d0866b26f8].
comment:
  Fixed ticket [d0866b26f83e9c55|d0866b26f8]: <i>Window function in correlated subquery causes assertion fault</i> plus 6 other changes


type: ci
user: drh
comment:
  Remove an optimization that can no longer occur, being superceded by the
  subquery-reuse optimization.  Put an assert in place of the optimization
  to detect if the need for this optimization ever returns.


type: ci
user: drh
comment:
  Additional steps to help ensure that scalar subqueries are only evaluated
  once even if they are used in multiple places within the query.  This fixes
  a performance regression reported on the mailing list and caused by
  check-in [531eca6104e41e43] which was a fix for ticket
  [787fa716be3a7f650c]. Think of this check-in as an improved fix for
  that ticket.


type: t
user: drh
brief: Open ticket [d0866b26f83e9c55|d0866b26f8].
comment:
  Open ticket [d0866b26f83e9c55|d0866b26f8]: <i>Window function in correlated subquery causes assertion fault</i> plus 4 other changes


type: ci
user: dan
comment:
  Ensure that when a new cursor is opened by OP_OpenDup, any existing cursor
  with the same id opened by a previous OP_OpenDup is closed first.


type: t
user: drh
brief: Fixed ticket [d0866b26f83e9c55|d0866b26f8].
comment:
  Fixed ticket [d0866b26f83e9c55|d0866b26f8]: <i>Window function in correlated subquery causes assertion fault</i> plus 4 other changes


type: ci
user: dan
comment:
  Reinstate assert() statements in os_unix.c that were removed to allow
  wal-mode SHARED locks to be taken over more than one locking slot
  (this branch no longer does that, so the assert() statements can go
  back in).


type: ci
user: dan
comment:
  Reinstate assert() statements in os_unix.c that were removed to allow wal-mode
  SHARED locks to be taken over more than one locking slot (this branch no
  longer does that, so the assert() statements can go back in).


type: ci
user: dan
comment:
  Merge changes from begin-concurrent-wal2. Also modify the unix-excl shm-locks
  on this branch so that it is not an error to attempt to release an EXCLUSIVE
  lock that is not held.


type: ci
user: dan
comment:
  Fix a problem with the second and subsequent sqlite3rbu_savestate() calls made
  on an RBU vacuum handle.


type: ci
user: drh
comment:
  Fix the shmlock.test script so that it works with the Windows restriction
  that UnlockFile must exactly correspond to a prior LockFile.


type: ci
user: drh
comment:
  If the ".open" command fails in the CLI, reopen to :memory: so that at least
  some database is available for subsequent commands.


type: ci
user: drh
comment:
  Give a meaningful error on an attempt to use UPSERT on a virtual table,
  rather than simply not working.


type: ci
user: drh
comment:
  If the OP_ParseSchema opcode with a non-NULL P4 operand does not parse any
  rows out of the sqlite_master table, that indicates that the sqlite_master
  table is corrupt, so raise an SQLITE_CORRUPT error.


type: ci
user: drh
comment:
  Add the exprNodeCopy() routine that will safely memcpy() an Expr node that
  might be a size-reduced node.


type: ci
user: drh
ecomment:
  While PRAGMA full_column_names is off (the default) do not make changes to
  the short_column_names pragma when computing the column names for subqueries.

comment:
  While PRAGME full_column_names is off (the default) do not make changes to
  the short_column_names pragma when computing the column names for subqueries.


type: ci
user: dan
comment:
  For SQLITE_ENABLE_PREUPDATE_HOOK builds, disable the optimization for a
  REPLACE command on a WITHOUT ROWID table with no indexes, triggers or foreign
  key constraints that causes SQLite to clobber any existing row without
  separately checking for it. This optimization causes SQLite to omit the
  expected pre-update-hook callbacks.


type: ci
user: drh
comment:
  Enhance the ALTER TABLE RENAME COLUMN feature so that it works on tables
  that have redundant UNIQUE and/or PRIMARY KEY constraints.
  Fix for ticket [bc8d94f0fbd633fd9a051e3]


type: t
user: drh
brief: New ticket [bc8d94f0fbd633fd|bc8d94f0fb].
comment:
  New ticket [bc8d94f0fbd633fd|bc8d94f0fb] <i>RENAME COLUMN fails on tables with redundant UNIQUE constraints</i>.


type: t
user: drh
brief: Fixed ticket [bc8d94f0fbd633fd|bc8d94f0fb].
comment:
  Fixed ticket [bc8d94f0fbd633fd|bc8d94f0fb]: <i>RENAME COLUMN fails on tables with redundant UNIQUE constraints</i> plus 6 other changes


type: ci
user: dan
comment:
  Fix an out-of-bounds read in SQL function fts5_decode() that could occur if it
  was passed a corrupt record.


type: ci
user: drh
comment:
  Fix the fts3DecodeIntArray() function so that it will not read off the end
  of the buffer it is handed.  Any unread integers are set to zero.


type: ci
user: drh
comment:
  Use the new SQLITE_IDXTYPE_IPK values (3) on Index.idxType to indicate the
  fake INTEGER PRIMARY KEY index used during query planning.


type: ci
user: dan
comment:
  Avoid use-after-free and double-free errors that could occur if an fts5 table
  is modified in certain ways while there are active cursors.


type: ci
user: dan
comment:
  Fix a memory leak in fts5 that could occur if scalar function fts5_decode()
  was passed a corrupt record.


type: ci
user: dan
comment:
  Fix a problem handling a negative value in the "number-of-pages" database
  header field. Also a problem with running "REINDEX tbl" against a virtual
  table for which the SQL passed to sqlite3_declare_vtab() contains PRIMARY KEY
  or UNIQUE constraints.


type: ci
user: drh
comment:
  Fix an off-by-one error on a Goto in the code generator, that only
  causes problems for a REPLACE on an INTEGER PRIMARY KEY in non-debug
  builds.  Test case in TH3.


type: ci
user: drh
comment:
  Prevent unsigned 32-bit integer overflow from leading to a buffer overread
  inside of an assert().  The problem fixed here is no reachable in production
  code.


type: ci
user: drh
comment:
  Move a local variable declaration into the outermost scope in which it
  is used. This fixes an ASAN warning.


type: ci
user: drh
comment:
  Improved detection of database corruption while balancing pages from an
  auto_vacuum database with overflow pages.  Test cases in TH3.


type: ci
user: drh
comment:
  In dbfuzz2, avoid using a malloc in the LLVMFuzzerInitialize() initializer
  routine, so that no memory leaks are reported.  Also, show the version of
  SQLite being used when the -v option is on.


type: ci
user: drh
comment:
  When parsing a corrupt record using sqlite3VdbeRecordUnpack(), make sure
  that the resulting UnpackedRecord object is completely initialized, to avoid
  (harmless) MSAN warnings.


type: ci
user: dan
comment:
  Fix a problem causing some Tcl test cases to fail with errors like "expected: [<multiline-whitespace>], got: []".


type: ci
user: dan
comment:
  Fix a problem triggered by DELETE statements with WHERE clauses that use the
  OR-optimization on some virtual tables.


type: ci
user: dan
comment:
  Have fts5 reject attempts to insert a non-integer, non-null value into a rowid
  column with SQLITE_MISMATCH.


type: ci
user: dan
comment:
  Avoid a dangling pointer comparison when renaming a table that has a trigger
  that itself contains a window function with an (illegal) column reference in a
  FOLLOWING expression.


type: ci
user: dan
comment:
  Fix a problem with renaming a column that is used as part of an ORDER BY on a
  compound SELECT within a database view or trigger.


type: ci
user: drh
comment:
  Ensure that the variable-length integer decoder in FTS3 never tries to
  left-shift a negative number.


type: ci
user: drh
comment:
  Fix a corner-case for the logic that cause an insert of a NULL into an
  INTEGER PRIMARY KEY column to be converted into a valid integer key,
  when the NULL results from a CASE expression that lacks an ELSE clause.


type: ci
user: drh
comment:
  Limit the size of SrcList objects to 200 entries (compile-time configurable
  using -DSQLITE_MAX_SRCLIST=n).  The maximum number of tables in a join has
  always been 64, so this is not a real constraint on capability.  Limiting the
  size of a SrcList prevents DOS attacks (discovered by OSSFuzz) using crazy
  nexted CTE joins.


type: ci
user: drh
comment:
  Revamp the SrcList allocator routines to be methods of Parse instead of
  being methods of the "sqlite3" object, so that they can leave better error
  messages when the SrcList object grows too large.


type: ci
user: dan
comment:
  Fix a buffer overwrite that could occur when running an fts5 prefix query
  against a corrupt database.


type: ci
user: drh
comment:
  Add the SQLITE_ENABLE_EARLY_CURSOR_CLOSE compile-time option which causes
  read cursors to be closed after their usefulness ends during a two-pass
  UPDATE.


type: ci
user: dan
comment:
  Fix a fairly obscure problem allowing an "ALTER TABLE RENAME col TO ..." statement to modify the schema in such a way as to break a reference within a trigger program.


type: ci
user: drh
comment:
  Handle oversize floating point values carefully when converting to integers
  for the '%' binary operator.


type: ci
user: dan
comment:
  Fix a problem with using ALTER TABLE to rename a table or column when the
  database schema contains a trigger or view that itself contains an expression
   "<column> AND 0".


type: ci
user: dan
comment:
  Remove a broken assert() triggered by a "PRAGMA max_page_count = N"
  invocation, where N is larger than the number of pages in the database image,
  but smaller than the number of pages in the database file.


type: ci
user: drh
comment:
  Add the --max-data and --max-as options to dbfuzz2.  Also cause dbfuzz2 to
  show its maximum RSS size upon exit in standalone mode with the -v option.


type: ci
user: drh
comment:
  Make sure the extra bytes allocated for the saved cursor position by
  check-in [160b1e31c0f27257] are initialized to zero.


type: ci
user: dan
comment:
  Avoid deferencing a freed pointer following an OOM or SQLITE_CORRUPT error in
  the fts3 xDestroy method.


type: ci
user: drh
comment:
  Enhance the btree search routine so that it does early detection of 
  impossibly large keys and thereby avoids a large malloc() call.


type: ci
user: drh
comment:
  Ensure that a key comparison does not read a collating sequence past the
  end of the KeyInfo, even if the key field of an index is corrupted by having
  a string in the last column instead of the ROWID.


type: ci
user: drh
comment:
  Make sure cursors are opened on all indexes for an UPDATE OR REPLACE
  regardless of whether or not the indexes are partial or contain columns
  that might need to be updated.


type: ci
user: drh
comment:
  Enhancements to deserialize: (1) Add the SQLITE_FCNTL_SIZE_LIMIT file control
  to set a maximum size for an in-memory database, defaulting to 
  SQLITE_MEMDB_DEFAULT_MAXSIZE or 1GiB.  (2) Honor the SQLITE_DESERIALIZE_READONLY
  flag. (3) Enhance the TCL interface to support -maxsize N and -readonly BOOLEAN.
  (4) Add the --maxsize option to the ".open" command and on the command-line for
  the CLI.


type: ci
user: drh
comment:
  Update dbfuzz2 to set a maximum database size of 100MiB by default, but
  with the new --max-db-size N option to change that limit.


type: ci
user: drh
comment:
  Fix the SQLITE_DESERIALIZE_READONLY feature so that it does not cause
  an assertion fault in the pager.


type: ci
user: drh
comment:
  Use _strdup() instead of strdup() on Windows builds of the CLI, to avoid
  a compiler warning reported on the mailing list.


type: ci
user: mistachkin
comment:
  Add the SQLITE_ENABLE_EARLY_CURSOR_CLOSE compile-time option which causes read cursors to be closed after their usefulness ends during a two-pass UPDATE.


type: ci
user: dan
comment:
  Fix problems with sub-selects in WINDOW definitions. Also rename-column operations when the column being renamed appears in a WINDOW definition that is part of a VIEW or TRIGGER.


type: ci
user: drh
comment:
  Stricter enforcement of cell sizes when doing balancing operations on the
  btree, in order to catch file corruption sooner.


type: ci
user: dan
comment:
  Fix a problem with renaming a table within a schema that contains a composite query that uses a column alias as an ORDER BY term.


type: ci
user: drh
comment:
  Use memmove() instead of memcpy() in a place where buffers might overlap
  if the database file is badly corrupted, to prevent warnings
  from ASAN and valgrind.


type: ci
user: drh
comment:
  Change a integer variable in sqlite3VdbeRecordUnpack() to unsigned in order
  to avoid any possibility of an integer overflow.


type: ci
user: dan
comment:
  Fix a potential problem with "INSERT INTO ... SELECT * FROM" (or VACUUM) statements on a corrupted database.


type: ci
user: drh
comment:
  Make sure the column name flags are restored correctly after an error
  inside of sqlite3ResultSetOfSelect().


type: ci
user: dan
comment:
  Fix a problem with running ALTER TABLE on a schema that contains expressions of the type "col IN ()" (empty set on RHS of IN operator).


type: ci
user: drh
comment:
  Add the ability to process dbsqlfuzz cases in fuzzcheck and add an initial
  set of interesting dbsqlfuzz cases.


type: ci
user: drh
comment:
  In fuzzcheck, activate vdbe_debug for dbsqlfuzz cases when using the -vvvvv
  verbosity level or above.


type: ci
user: drh
comment:
  Fix the xFetch method of the "memdb" VFS (used by deserialize) so that it
  is robust against corrupt database file.


type: ci
user: drh
comment:
  Extend fuzzcheck so that it can process dbsqlfuzz cases. Add a collection
  of interesting dbsqlfuzz cases to the standard test suite.


type: ci
user: dan
comment:
  Add an assert_fts3_nc() macro to fts3 - for assert() conditions that are only true when it is guaranteed that the fts3 database is not corrupt.


type: ci
user: dan
comment:
  Fix asan warnings in fts5 triggered by corrupt databases - passing NULL to memcmp, out-of-range left-shift values and signed integer overflow.


type: ci
user: dan
comment:
  Fix a segfault that could follow an OOM when querying a table that has one or more columns with default values "true" or "false".


type: ci
user: drh
comment:
  Reinitialize debugging information on registers of a trigger prior to each
  invocation of the trigger.  This prevents false-positives from the
  sqlite3VdbeMemAboutToChange() test logic.


type: ci
user: drh
comment:
  Do not accidently truncate zeroblob values when doing an arithmetic
  operation.  Fix for ticket [bb4bdb9f7f654b0bb9f34cfba].


type: ci
user: drh
comment:
  Add the ".eqp trace" command to the CLI when using SQLITE_DEBUG, as a
  convenient shorthand for "PRAGMA vdbe_debug=ON" but with automatic indentation
  feature for program listings provided by the CLI.


type: t
user: drh
brief: Fixed ticket [bb4bdb9f7f654b0b|bb4bdb9f7f].
comment:
  Fixed ticket [bb4bdb9f7f654b0b|bb4bdb9f7f]: <i>Zeroblob truncated by an index on an expression</i> plus 6 other changes


type: ci
user: dan
comment:
  Roll back the transaction if a write statement fails with OE_Abort but there is no open statement transaction.


type: ci
user: dan
comment:
  Fix "PRAGMA journal_mode" so that if it fails because there is a transaction open, it does not roll that transaction back.


type: g
user: dan
comment:
  Edit [d536be698d1c6479|d536be698d]: Move to branch [/timeline?r=rollback-abort&nd&dp=d536be698d1c6479&unhide | rollback-abort].


type: ci
user: dan
comment:
  If a write statement fails with OE_Abort, but there is no statement journal, roll the entire transaction back instead.


type: ci
user: drh
comment: Version 3.27.2
ecomment:
  This was originally intended to be the 3.27.2 release, but then I
  realized that I left out an important patch.


type: g
user: dan
comment:
  Edit [75a8ed7a4227493c|75a8ed7a42]: Move to branch [/timeline?r=rollback-abort&nd&dp=75a8ed7a4227493c&unhide | rollback-abort].


type: ci
user: drh
comment:
  Ensure that the btree cursor is correctly set up prior to backing it up
  as part of a delete operation on a divider cell in an index.


type: ci
user: dan
comment:
  Fix a broken assert() in fts3. Also some test script issues causing failures with builds that do not support fts3.


type: ci
user: drh
comment:
  Update fuzzcheck so that with the --load-dbsql options it screens its
  inputs to ensure that they are valid dbsqlfuzz cases.  Add new dbsqlfuzz
  finds to the test/fuzzdata8.db database.


type: ci
user: drh
comment:
  Window functions that can abort should indicate this, so that if they are
  used in DML statement, a statement journal will be used.


type: ci
user: drh
comment:
  Improvements to the ".eqp trace" command in the CLI so that it ensures that
  the schema has been read prior to activing the tracing feature, to avoid
  cluttering the output with a trace of the schema parse.


type: ci
user: drh
comment:
  Change the definition of the BtCursor.skipNext field so that it is undefined
  for states CURSOR_VALID and CURSOR_INVALID.


type: ci
user: dan
comment:
  Do not assume that text parameters passed to fts4aux queries do not contain embedded nul characters.


type: ci
user: drh
comment:
  Set a low limit on the length of strings and blobs in the OSSFuzz module,
  in an effort to avoid timeouts when the fuzzer does things like
  "randomblob(1e12)".


type: ci
user: dan
comment:
  Avoid a crash when the fts5 snippet() function (or similar) is used with a special query pattern, like '*id' or '*reads'.


type: ci
user: drh
comment:
  Fix an off-by-one error when parsing the names of indexes that do not have
  arguments in the index_usage utility.


type: ci
user: drh
comment:
  Detect if two indexes of the same table share a common rootpage while
  parsing the schema, and throw an error immediately.


type: ci
user: dan
comment:
  When parsing the schema, check for duplicate index root page numbers before adding the index to the schema hash table.


type: ci
user: drh
comment:
  Improvements to "PRAGMA parser_trace=ON": Make it a flag pragma, and then
  use the flag to show the complete SQL text at the beginning of the parse.


type: ci
user: drh
comment:
  If the amalgamation file "sqlite3.c" is generated using the
  SQLITE_ENABLE_UPDATE_DELETE_LIMIT option, but then subsequently (mis-)compiled
  without that option, and then a particular syntax error could cause
  a memory leak, but for this fix.


type: ci
user: dan
comment:
  Fix another buffer overrun that could occur when quering a corrupt database using an fts5vocab table.


type: ci
user: drh
comment:
  Add the SQLITE_CONFIG_MEMDB_MAXSIZE configuration option for configuring
  the default maximum size of an in-memory database created using
  sqlite3_deserialize().  This is necessary to make the interface reasonably
  testable.


type: ci
user: drh
comment:
  Improve the strict enforcement of cell sizes in balancing from
  check-in [12713f320b2c1def] so that it also works with table-btrees
  in addition to index-btrees.


type: ci
user: drh
comment:
  Ensure that the Walker.pParse structure is initialized when walking the
  source tree to gather the WINDOW clauses on a query with window functions.


type: ci
user: drh
comment:
  Prevent the printf formatter from doing large memory allocations - larger
  than either the size of the static buffer for interfaces like
  sqlite3_snprintf(), or larger than SQLITE_LIMIT_LENGTH for interfaces that
  are associated with a database connection.  This helps to prevent DOS
  attacks on products that let hostile sources inject arbitrary SQL.  It also
  helps fuzzers run faster and more effectively.


type: ci
user: drh
comment:
  Slight adjustment to the printf formatter large memory allocation detector
  so that it does not overestimate the amount of space needed for
  oversize %d conversions.


type: ci
user: drh
comment:
  Give a link to the URI Filename document in the documentation to the
  various sqlite3_uri_parameter() interfaces.


type: ci
user: dan
comment:
  Try new approach ensuring that each Schema object is only used by one connection/database at any one time.


type: ci
user: dan
comment:
  Fix problems with SAVEPOINT and related commands within transactions on a corrupt database that include fts5 or some other virtual tables.


type: ci
user: drh
comment:
  Ensure that the sqlite3_exec() callback gets the correct number of columns
  for a query, even if the schema changes out from under it.


type: ci
user: drh
comment:
  Enhance dbfuzz2 so that with the -v option it shows the return code and
  error message for any failing SQL statements.


type: ci
user: drh
comment:
  Keep the temp_store_directory and data_store_directory pragmas even when
  compiling with SQLITE_OMIT_DEPRECATED.


type: ci
user: drh
comment:
  The IS NOT NULL operator does not imply that the operand is never NULL.
  Fix for ticket [5948e09b8c415bc45da5cf]


type: t
user: drh
brief: Fixed ticket [5948e09b8c415bc4|5948e09b8c].
comment:
  Fixed ticket [5948e09b8c415bc4|5948e09b8c]: <i>Incorrect result from LEFT JOIN</i> plus 5 other changes


type: ci
user: drh
comment:
  Omit the ".progress" command from the shell if it is compiled with the
  SQLITE_OMIT_PROGRESS_CALLBACK option.


type: ci
user: drh
comment:
  Back out check-in [008112bcef561a8], reenabling deprecated PRAGMAs when the
  SQLITE_OMIT_DEPRECATED compile-time option is used, because way too many
  TH3 tests depend on those deprecated PRAGMAs.


type: ci
user: drh
comment:
  When extending the size of SrcList objects, do not attempt to use
  extra space on the end of the allocation, as that provides scarcely any
  performance benefit but does greatly complicate cross-platform testing.


type: ci
user: dan
comment:
  Ensure all bytes of the PgHdr1 structure are initialized. This avoids a valgrind error when running corruptI.test.


type: ci
user: drh
comment:
  In the fuzzcheck test program, make sure the isspace() and related routines
  are not given values outside the range of -1 to 255.


type: ci
user: drh
comment:
  Merge the fix for ticket [4e8e4857d32d401f], so that this branch now contains
  release 3.27.1 plus the extra patch to preserve ROWID values on VACUUM.


type: t
user: drh
brief: New ticket [4e8e4857d32d401f|4e8e4857d3].
comment:
  New ticket [4e8e4857d32d401f|4e8e4857d3] <i>Crash on query using an OR term in the WHERE clause</i>.


type: ci
user: drh
comment:
  Give the sqlite3 object a pointer to the current Parse so that if an OOM
  occurs, it can automatically set the Parse.rc value to SQLITE_NOMEM.  This
  avoids a frequent extra test of db.mallocFailed in the innermost parser loop.


type: ci
user: drh
comment:
  Do not do the optimization that attempts to pull expression values from
  an index on that expression when processing a multi-index OR
  (see check-in [a47efb7c8520a0111]) because the expression transformations
  that are applied become invalid when the processing moves off of the current
  index and on to the next index.  Fix for ticket [4e8e4857d32d401f].


type: t
user: drh
brief: Fixed ticket [4e8e4857d32d401f|4e8e4857d3].
comment:
  Fixed ticket [4e8e4857d32d401f|4e8e4857d3]: <i>Crash on query using an OR term in the WHERE clause</i> plus 6 other changes


type: ci
user: drh
comment:
  When an IN operator drives a query loop, mark it as "CODED" so that it
  will not be used afterwards for a (pointless) membership test.


type: ci
user: drh
comment:
  Change the sqlite3VdbeMemGrow() routine so that it no longer guarantees a
  minimum size of 32 bytes.  That minimum is no longer required, and without
  the extra check for the minimum size, the routine runs faster.


type: ci
user: drh
comment:
  Small performance improvement and size reduction for pageFindSlot() - the
  routine in btree.c that locates a free slot for a cell on a btree page.


type: ci
user: drh
comment:
  Defer computing the MemPage.nFree value of an in-memory btree page
  until it is actually needed, since for many pages it is never needed.
  This checkin works sufficiently to prove the concept, but still has issues
  with exception handling.


type: ci
user: dan
comment: Avoid using non-ANSI return statement in void function sqlite3WalSnapshotUnlock().
ecomment:
  Avoid using a "return void_function();" statement in void function sqlite3WalSnapshotUnlock(). It provokes a warning from some compilers.


type: ci
user: drh
comment:
  Change an assert() into a NEVER(), since the condition is difficult to prove
  with certainty.  Improved comment on the MemPage.nFree field.


type: ci
user: drh
comment:
  Defer computing the number of bytes of free space on a btree page until that
  value is actually needed.


type: ci
user: drh
comment:
  Enhancement the progress callback mechanism so that the progress callback
  is always invoked at least once at the end of a prepared statement if the 
  opcode count has been exceeded.  This makes the progress callback more
  effective at limiting run times.  This check-in also includes and unrelated
  performance enhancement to OP_Column.


type: ci
user: drh
comment:
  Ensure that the nProgressLimit variable is always initialized in
  sqlite3VdbeExec(), even if the routine jumps to its exit processing early.


type: ci
user: drh
comment:
  Rearrange the code in the VDBE to help out the C-compiler optimizer.
  And fix a harmless compiler warning.


type: ci
user: dan
comment:
  Revert the rearrangement of VDBE code in [219b39e14] so that vdbe.c matches trunk. Since the new call to sqlite3Init() in OP_ParseSchema was removed, the rearrangement no longer provides any performance advantage.


type: ci
user: dan
comment:
  Fix a problem with eponymous virtual tables and SHARED_SCHEMA databases. Also, after preparing statements that require all database schemas (REINDEX, ANALYZE, CREATE, DROP and some PRAGMA statements), do not allow the database connection to return more than one schema to each schema-pool.


type: ci
user: dan
comment:
  Enhance the virtual table in test_schemapool.c so that it can be used to check that SHARED_SCHEMA connections are not allocating and freeing schemas when they should not be.


type: ci
user: dan
comment:
  Ensure that creating temp schema items does not cause an OPEN_SHARABLE_SCHEMA connection to load all schemas into memory.


type: ci
user: dan
comment:
  Support some "ROWS BETWEEN N PRECEDING AND M FOLLOWING" window functions without caching entire partitions.


type: ci
user: drh
comment:
  Fix a potential memory leak in RBU if the rbu_fossil_delta() SQL function is
  misused.  Misuse never happens in a working RBU system, so this is not a 
  particularly important fix.


type: ci
user: drh
comment:
  Enhance the xBestIndex method on delta_parse() to return SQLITE_CONSTRAINT if
  no delta argument is supplied.


type: ci
user: drh
comment:
  Back off the optimization of check-in [e130319317e76119] slightly so that
  it only applies to IN operators that are used for membership tests.
  Proposed fix for ticket [df46dfb631f75694].


type: g
user: drh
comment:
  Edit [b5f90bfe6295ab3a|b5f90bfe62]: Move to branch [/timeline?r=tkt-df46dfb631&nd&dp=b5f90bfe6295ab3a&unhide | tkt-df46dfb631].


type: ci
user: drh
comment:
  When an IN operator drives a query loop, mark it as "CODED" so that it
  will not be used afterwards for a (pointless) membership test.  This is
  a better fix for ticket [df46dfb631f75694] than the previous fix that is
  now on a branch as it preserves the full optimization of
  check-in [e130319317e76119].


type: t
user: drh
brief: Fixed ticket [df46dfb631f75694|df46dfb631].
comment:
  Fixed ticket [df46dfb631f75694|df46dfb631]: <i>Assertion fault in self-join with a IN constraint</i> plus 6 other changes


type: ci
user: drh
comment:
  Import from trunk the new fix to ticket [df46dfb631f75694] in which
  all ephemeral tables used as the RHS of an IN operator be index btrees
  and never table btrees so that they can always be reused.


type: ci
user: drh
comment:
  Avoid the use of function pointers in columnName(), as function pointers
  appear to be a source of consternation to LLVM.


type: ci
user: drh
comment:
  Progress handler improvements:
  (1) Invoke the callback after OP_Program opcodes
  (2) Invoke the callback multiple times in a row to catch up after a
  long run of no progress checks.


type: ci
user: drh
comment:
  Changes to the unix VFS that allegedly enable it to build of Fuchsia.
  We have no way of testing this.


type: ci
user: drh
comment:
  Detect oversized strings in the OP_String opcode even if the P4 argument
  is originally UTF8 and has to be converted to UTF16 to match the database
  file and that conversion causes the string to become shorter and cross
  below SQLITE_LIMIT_LENGTH threshold.  This might fix an OSSFuzz problem
  that we have been so far unable to reproduce.


type: g
user: drh
comment:
  Edit [e6e9dd5c17405a3e|e6e9dd5c17]: Move to branch [/timeline?r=nested-parse-oom&nd&dp=e6e9dd5c17405a3e&unhide | nested-parse-oom].


type: ci
user: drh
comment:
  In sqlite3NestedParse() be sure to detect all SQLITE_NOMEM and SQLITE_TOOBIG
  errors and to distinguish between them.


type: ci
user: drh
comment:
  Modify sqlite3_str_finish() and sqlite3VMPrintf() so that they always
  return NULL on any OOM or SQLITE_LIMIT_LENGTH error.


type: ci
user: drh
comment:
  Check-in [fa792714ae62fa980] is not a valid fix for ticket
  [df46dfb631f75694], as the new test case in this check-in demonstrates.
  The fix here causes test cases for the [df46dfb631f75694] bug to fail
  again, so this check-in is on a branch.  A new fix is needed for
  [df46dfb631f75694].


type: ci
user: dan
comment:
  Internally, remove all references to a Window object that belongs to an expression in an ORDER BY clause if that expression is converted to an alias of a result-set expression. Fix for [4feb3159c6].


type: ci
user: drh
comment:
  Make all ephemeral tables built to hold the RHS of an IN operator be
  index-btrees, never table-btrees, regardless of whether or not they are
  used as IN_INDEX_LOOP or IN_INDEX_MEMBERSHIP.  That way, the same ephmerial
  table can be reused for both cases.


type: t
user: drh
brief: Open ticket [df46dfb631f75694|df46dfb631].
comment:
  Open ticket [df46dfb631f75694|df46dfb631]: <i>Assertion fault in self-join with a IN constraint</i> plus 4 other changes


type: t
user: drh
brief: Fixed ticket [4feb3159c6bc3f7e|4feb3159c6].
comment:
  Fixed ticket [4feb3159c6bc3f7e|4feb3159c6]: <i>Crash due to misuse of window functions.</i> plus 5 other changes


type: ci
user: drh
comment:
  Remove a testcase() macro which is now unreachable due to the contraction of
  the use of IN_INDEX_ROWID.


type: ci
user: drh
comment:
  Check-in [fa792714ae62fa98] is incorrect.  Add a test case to refute it and
  also a fix to make it right. 
  Then add an alternative fix to ticket [df46dfb631f75694] in which
  all ephemeral tables used as the RHS of an IN operator be index btrees
  and never table btrees so that they can always be reused.


type: t
user: drh
brief: Fixed ticket [df46dfb631f75694|df46dfb631].
comment:
  Fixed ticket [df46dfb631f75694|df46dfb631]: <i>Assertion fault in self-join with a IN constraint</i> plus 3 other changes


type: g
user: drh
comment:
  Edit [6c5e5e2ee0c38d03|6c5e5e2ee0]: Move to branch [/timeline?r=mistake&nd&dp=6c5e5e2ee0c38d03&unhide | mistake]. Edit check-in comment. Cancel background color.


type: ci
user: drh
comment:
  Internally, remove all references to a Window object that belongs to an expression in an ORDER BY clause if that expression is converted to an alias of a result-set expression.


type: ci
user: drh
comment:
  Enhance the command-line shell to accept bound parameters, using the
  TEMP table named "$Parameters" to look up the values for bound parameters.


type: ci
user: dan
comment:
  Add the ".shared-schema check|fix DB1 DB2..." command to the shell tool. For checking if a database is eligible to share an in-memory with the main database, and for fixing small problems that prevent it from being so.


type: ci
user: drh
comment:
  Use unsigned integers to count the number of pages in a freelist during
  an integrity_check, to avoid any possibility of a signed integer overflow.


type: ci
user: drh
comment:
  Allocate a few extra bytes for the pager temp page as an overrun buffer while
  processing corrupt database files.


type: ci
user: drh
comment:
  Fix the readfile() UDF so that it returns an empty BLOB, not an OOM error,
  when reading an empty file.


type: ci
user: drh
comment:
  Enable the LIKE optimization when the ESCAPE keyword is present and the
  PRAGMA case_sensitive_like pragma is ON.


type: ci
user: dan
comment:
  Avoid an assert() failure and an undefined left-shift operation in the fts3 snippet() function that could occur if the database was corrupt.


type: ci
user: drh
comment:
  In a query that uses a partial index, the expression that is the WHERE clause
  of the partial index must always be true.  Use this fact to avoid evaluating
  identical terms in the WHERE clause of the query.


type: ci
user: drh
comment:
  The fts3_tokenizer() function returns NULL if the
  SQLITE_DBCONFIG_ENABLE_FTS_TOKENIZER setting is disabled, which is is
  by default.


type: ci
user: drh
comment:
  If the initial byte of a record is a large value, then always used the
  generalized record comparison routine sqlite3VdbeRecordCompare() rather than
  one of the specialized versions that are optimized for shorter records.


type: ci
user: drh
comment:
  Fix a potential 32-bit integer overflow in the "showdb" utility program when
  it is trying to interpret a corrupt database file.


type: ci
user: drh
comment:
  Add an "|| CORRUPT_DB" term to an assert() that might be false if the database
  is corrupt.  Also add a branch to have sqlite3PagerMovepage() return
  SQLITE_CORRUPT in that case.


type: ci
user: drh
comment:
  Detect an attempt to drop a btree that is not within the bounds of the
  database file and abort early with an SQLITE_CORRUPT error, to avoid
  problems later on in the process.


type: ci
user: dan
comment:
  Modify new window functions function so that cursors are stepped immediately after each operation, instead of immediately before.


type: ci
user: drh
comment:
  Patch makes balance_nonroot() slightly smaller and faster and more robust
  against corrupt databases.


type: ci
user: drh
comment:
  Experimental change to apply affinity before running CHECK constraints on
  an INSERT.  Note that in the CHECK constraints, REAL affinity really is
  REAL affinity, and not numeric affinity. This causes failures in some tests
  that are assuming affinity is applied after CHECK constraints.


type: ci
user: dan
comment:
  Simplify the windows frame code some. Add a comment explaining some of the VM code generated by sqlite3WindowCodeStep().


type: ci
user: dan
comment:
  Remove "cache mode" from the window frame code generator. Handle the same cases by editing the window frame specification itself.


type: ci
user: dan
comment:
  Expand on header comment for sqlite3WindowCodeStep(). Further simplify the implementation of the same.


type: ci
user: dan
comment:
  Fix a crash that could occur if the RHS of an IN expression is a correlated sub-query that refers to the outer query from within a window frame definition only.


type: ci
user: dan
comment:
  When deserializing a database (sqlite3_deserialize()), do not attempt to parse the schema before the data is loaded.


type: ci
user: dan
comment:
  Avoid allocating excessive registers for the PARTITION BY expressions when processing window functions.


type: ci
user: drh
comment:
  Technical improvements to the documentation for sqlite3_bind_blob() and
  sqlite3_bind_text().  No changes to code.


type: t
user: dan
brief: New ticket [596d059af77f2493|596d059af7].
comment:
  New ticket [596d059af77f2493|596d059af7] <i>Committing a transaction with a failed ALTER TABLE may subtly corrupt schema</i>.


type: t
user: dan
brief: Ticket [596d059af77f2493|596d059af7]: 6 changes
comment:
  Ticket [596d059af77f2493|596d059af7] <i>Committing a transaction with a failed ALTER TABLE may subtly corrupt schema</i> status still Open with 6 other changes


type: t
user: dan
brief: Ticket [596d059af77f2493|596d059af7]: 3 changes
comment:
  Ticket [596d059af77f2493|596d059af7] <i>Committing a transaction with a failed ALTER TABLE may subtly corrupt schema</i> status still Open with 3 other changes


type: t
user: dan
brief: Closed ticket [596d059af77f2493|596d059af7].
comment:
  Closed ticket [596d059af77f2493|596d059af7]: <i>Committing a transaction with a failed ALTER TABLE may subtly corrupt schema</i> plus 4 other changes


type: ci
user: drh
comment:
  Update the README.md file at the top level to talk about how to deal with
  version names and how to verify the code in Git mirrors.


type: ci
user: dan
comment:
  In order to identify the first row of each partition, check if the rowid in the ephemeral table is 1 instead of using a dedicated flag register.


type: ci
user: dan
comment:
  Always evaluate window functions using the alternative path usually only used by EXCLUDE frames if the SQLITE_QueryFlattener test flag is set.


type: ci
user: dan
comment:
  Revert the OP_MustBeInt opcode implementation on this branch so that it again matches trunk. The extra functionality is no longer required.


type: ci
user: drh
comment:
  When computing the amount of scratch memory needed during a rebalance operation,
  assume the worst case for the number of cells per page, rather than relying
  on the BtPage.nCell value, which might be incorrect for a corrupt database.


type: ci
user: dan
comment:
  Add tests to ensure that the window functions implementation is not generating code for unnecessary sorts.


type: ci
user: dan
comment:
  Remove assert() statements based on the counter-factual proposition that 0 is not a valid cursor number.


type: ci
user: drh
ecomment:
  Enhance the rtreenode() function of rtree (used for testing) so that it
  uses the newer sqlite3_str object for better performance and improved
  error reporting.  Test cases added to TH3.

comment:
  Enhance the rtreenode() function of rtree (used for testing) so that it
  uses the newer sqlite3_str object for better performance and improved
  error reporting.


type: ci
user: dan
comment:
  Fix a potential dangling pointer deference in an ALTER TABLE run on a schema that contains constructs of the form "PRIMARY KEY(column COLLATE collation)".


type: ci
user: dan
comment:
  Fix a problem with a window function in a correlated sub-query where at least one reference to the outer SELECT appears in a FROM clause sub-select.


type: ci
user: drh
comment:
  We learn that readdir_r() is deprecated in favor of plain old readdir(), which
  is now suppose to be threadsafe using thread-local storage.  So remove the
  use of readdir_r() from the test code.  (SQLite itself never calls readdir()
  or readdir_r()).


type: ci
user: drh
comment:
  For the ".archive --update" command in the CLI, only update files if their
  mtime or mode has changed.  To force an update, use the new --insert instead.


type: ci
user: dan
comment:
  Add support for new window functions related features - GROUPS frames, RANGE frames with logical start and end points, the EXCLUDE clause and window chaining.


type: ci
user: drh
comment:
  Fix the writefile() SQL function implemented by ext/misc/fileio.c such that
  any directories created have standard umask permissions, not permissions
  of the file that is to be written.


type: ci
user: drh
comment:
  Fix a faulty assert() statement in balance_nonroot() - the assert() should use
  get2byteNotZero() instead of get2byte() for the corner case where the
  number cells is zero on a 65536-byte page.


type: ci
user: drh
comment:
  Change the name of the parameter table in the CLI to "sqlite_parameters".
  Doing so involves adding SQLITE_DBCONFIG_WRITABLE_SCHEMA and allowing the
  creation of tables whose names begin with "sqlite_" and that are indexed
  while writable_schema is on.


type: ci
user: drh
comment:
  In the CLI, code the "sqlite_parameters" name directly rather than using a
  macro, for clarity of presentation for users who are reading the code for
  the purpose of seeing how the CLI implements parameter binding.


type: ci
user: drh
comment:
  Use the mutex-free PRNG in this branch, since anybody using this branch is
  probably interested in high concurrency.


type: ci
user: drh
comment:
  If the string formatter in sqlite3NestedParse() fails due to an over-length
  string, make sure this error is recorded by the parser so that it knows to
  fail.


type: ci
user: drh
comment:
  Improved TreeView display of Window objects.
  Change the Window.eType field to Window.eFrmType to avoid confusion with
  other "eType" values.


type: ci
user: drh
comment:
  More improvements to TreeView output for Window objects:
  (1) Show when the frame-spec is implied rather than explicit.
  (2) Move the FILTER clause out from within the OVER clause, making it
  a sibling of the OVER clause, to match syntax.


type: ci
user: dan
comment:
  Prevent aliases of window functions expressions from being used as arguments to aggregate or other window functions.


type: ci
user: drh
comment:
  The two-argument version of fts3_tokenizer() works regardless of the
  value of SQLITE_DBCONFIG_ENABLE_FT3_TOKENIZER as long as the second
  argument is a bind parameter.


type: ci
user: drh
comment:
  Change the fts3_tokenizer() function to always return the pointer as a BLOB
  as long as the first argument is a bound parameter, regardless of the
  SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER setting.


type: ci
user: dan
comment:
  Fix a fairly obscure problem causing the planner to sometimes choose sub-optimal plans for a query with a single virtual table in the FROM clause, and at least one IN(...) constraint in the WHERE clause.


type: ci
user: drh
comment:
  Fix typos in the comments of the sessions extension, one of which affects
  the generated documentation. No code changes.


type: ci
user: drh
comment:
  The defragmentPage() routine detects corruption in the first-free-slot fields
  at offset 1 in the header and throws an error, rather than asserting.


type: ci
user: drh
comment:
  Add a call to sqlite3FaultSim(410) inside of btreeRestoreCursorPosition()
  to simplify testing of error scenarios.


type: ci
user: drh
comment: Enhanced VdbeCoverage() macros in the new windows function code.
ecomment:
  Enhanced VdbeCoverage() macros in the new windows function code.
  Later: This check-in causes an assertion fault.


type: g
user: drh
comment:
  Edit [f24066f8dd847dfb|f24066f8dd]: Move to branch [/timeline?r=oops&nd&dp=f24066f8dd847dfb&unhide | oops]. Edit check-in comment.


type: ci
user: drh
comment:
  Improved comments on the VDBE branch coverage testing logic.  Fix the
  VDBE branch coverage measurement on the OP_MustBeInt opcode.


type: ci
user: drh
comment:
  Frame range comparisons can never be NULL because the values will have
  been checked for NULL prior to the test.


type: ci
user: dan
comment:
  If the library is built with SQLITE_VDBE_COVERAGE defined, have the Tcl tests generate a vdbe coverage report in file testdir/vdbe_coverage.txt.


type: ci
user: drh
comment:
  Make sure the MEM_FromBind bit inthe Mem.flags field is not included in
  the MEM_TypeMask.  This critical changes was omitted from the previous two
  check-ins by mistake, and so those check-ins are not fully functional.


type: ci
user: drh
comment:
  Including the phrase EXCLUDE NO OTHERS in the frame-spec of a window function
  (which is the default setting for EXCLUDE) silently disables the xInverse
  optimization.  This is a feature, but we will keep it undocumented for now
  in case we later decide it is a bad idea.


type: ci
user: drh
comment:
  Use a separate bit on db->dbOptFlags to disable the xInverse optimization on
  window functions, rather than reusing the query-flattener disable bit.


type: ci
user: drh
comment:
  Small optimizations to the grammar for window functions save about 120 bytes
  of space in the parser tables.


type: ci
user: drh
comment:
  Only preserve rowid values for VACUUM INTO.  Keep the legacy behavior of
  renumbering rowids for ordinary VACUUM.


type: ci
user: drh
comment:
  Simplification of the recent VACUUM changes that make the code more like
  what it was before the change.  Also, make the VACUUM command a no-inline
  procedure to work around a performance regression.


type: ci
user: drh
comment:
  Fix a typo in the documentation for sqlite3_value_frombind().  Also add a new
  hyperlink to that same documentation.  No code changes.


type: ci
user: drh
comment:
  Add the ability to override the new corruption detection logic
  of the previous checkin, in order to exercise downstream corruption
  detection during testing.


type: ci
user: drh
comment:
  In the xfer-optimization, do early detection of when the source and destination
  index share the same btree, to avoid a long delay prior to reporting the
  database corruption.


type: ci
user: dan
comment:
  In the test_vfs.c VFS, if a Tcl xWrite script returns "SQLITE_OMIT", silently omit the write() call.


type: ci
user: drh
comment:
  Eliminate the tool/addopcodes.tcl script.  The purpose of that script was to
  keep the number of parser codes below 256 in order to save parser table space.
  But we have long since blown through that ceiling so the addopcodes.tcl script
  was just needless complexity. There is no longer any reason to keep it around.


type: ci
user: dan
comment:
  Fix a problem caused by a small SQLITE_LIMIT_LENGTH value and a CREATE TABLE with a very large name.


type: ci
user: drh
comment:
  Do not place arbitrary restrictions on the length of the failure message
  for a uniqueness constraint.


type: ci
user: drh
comment:
  Further refinement of the sqlite3VdbeMEmExpandBlob() fix of check-in
  [df58774e994bd] to prevent a reference to an unused variable - problem
  discovered by Valgrind.


type: ci
user: dan
comment:
  Fix RBU so that it does not write rows that should be excluded into partial indexes (corrupting the database).


type: ci
user: dan
comment:
  Further tweaks to wapptest.tcl. Add the ability to run the extra (n)debug tests that releasetest.tcl runs.


type: ci
user: drh
comment:
  Remove the vfslog.c extension from the testfixture target in main.mk, as
  that extension has no TCL bindings and is inaccessible.


type: ci
user: dan
comment:
  Add the test/wapptest.tcl script, an alternative to releasetest.tcl that uses wapp to provide the user-interface.


type: ci
user: dan
comment:
  Tweaks to wapptest.tcl: Ensure that the "Debug" checkbox is disabled unless the app is in "config" state, and have Debug variants run "test" instead of "fulltest".


type: ci
user: dan
comment:
  Partially revert the test file changes in [4371a0c46e]. It is no longer required following [93ae382e97c23c90].


type: ci
user: drh
comment:
  Fix the fts3varint.test script so that it works even on versions of TCL
  for which Tcl_GetWideIntFromObj() does not work.


type: ci
user: drh
comment:
  Update tool/symbols.sh to ignore symbols from sessions and rebaser and to not
  try to compile with ICU which is not available on all platforms.


type: ci
user: dan
comment:
  Avoid a sanitizer error in test1.c. Have releasetest.tcl/wapptest.tcl create a file called "makecommand.sh" that can be used to rerun a test from the command line.


type: ci
user: drh
comment:
  In the "pgidx" command of the showdb utility, try to identify orphaned pages
  and show when pages have been zeroed out.


type: ci
user: dan
comment:
  Add the sqlite_dbptr virtual table to the dbdata extension. For querying the links between b-tree pages.


type: ci
user: dan
comment:
  Add the ".recovery" command to the shell tool. For recovering the maximum amount data from corrupt databases. Still needs work.


type: t
user: drh
brief: New ticket [f00d7b651aa3cc3e|f00d7b651a].
comment:
  New ticket [f00d7b651aa3cc3e|f00d7b651a] <i>ALTER TABLE corrupts the schema for tables that start with &quot;sqlite&quot;</i>.


type: t
user: drh
brief: Fixed ticket [f00d7b651aa3cc3e|f00d7b651a].
comment:
  Fixed ticket [f00d7b651aa3cc3e|f00d7b651a]: <i>ALTER TABLE corrupts the schema for tables that start with &quot;sqlite&quot;</i> plus 5 other changes


type: g
user: drh
comment:
  Edit [9b888fcc5a8dabcc|9b888fcc5a]: Move to branch [/timeline?r=mistake&nd&dp=9b888fcc5a8dabcc&unhide | mistake]. Mark "Closed". Edit check-in comment.


type: ci
user: drh
comment:
  Improvement on the previous check-in.  Parse.rc is less reliable than
  Parse.nErr for detecting SQLITE_TOOBIG errors.


type: ci
user: drh
comment:
  Changes to the --hexdb decoder option in the shell (and also in the TCL
  test code) so that it works on systems where sscanf() does not recognize
  "%hhx" as wanting to delivery results into a character-size variable.


type: ci
user: mistachkin
comment:
  Fix the count-of-view optimization so that it is (correctly) disabled for a query that includes a WHERE clause or a GROUP BY clause.  Cherrypick of [05897ca48a40c6771].


type: ci
user: mistachkin
comment:
  Minor simplification of NULL value handling for STAT4.  Cherrypick of [69bad9257f8db6a2] from trunk.


type: ci
user: drh
comment:
  Add the sqlite3_hard_heap_limit64() interface and the corresponding
  "PRAGMA hard_heap_limit=N" command.


type: ci
user: dan
comment:
  Unless the "--freelist-corrupt" option is specified, do not have the .recover command attempt to recover data from pages that are on the database free-list.


type: ci
user: dan
comment:
  Have .recover store all orphaned rows in a single table, with extra columns to indicate the orphaned page and sub-tree they were discovered within.


type: ci
user: drh
comment:
  An experimental interface for retrieving the estimated cost and estimated
  number of output rows for a query.


type: ci
user: dan
comment:
  Fix a problem in the .recover command with recovering WITHOUT ROWID tables where the PK columns are not the leftmost in the CREATE TABLE statement.


type: ci
user: dan
comment:
  Add the "--lost-and-found" option to the ".recover" command. For setting the name of the orphaned rows table.


type: ci
user: dan
comment:
  Add the ".recover" command to the shell tool. For recovering as much data as possible from corrupt databases.


type: ci
user: drh
comment:
  Take collating sequence into account when removing redundant columns from
  indexes on WITHOUT ROWID tables.  This is the first proof-of-concept fix
  for ticket [3182d3879020ef3]. More testing needed.


type: t
user: drh
brief: New ticket [3182d3879020ef3b|3182d38790].
comment:
  New ticket [3182d3879020ef3b|3182d38790] <i>COLLATE nocase index on a WITHOUT ROWID table malfunctions</i>.


type: ci
user: dan
comment:
  Fix a stack overflow that could occur when renaming a table that has a trigger containing a window function invocation that itself contains a specific syntax error.


type: ci
user: drh
comment:
  Do not de-duplicate columns index columns associated with a WITHOUT ROWID table
  if the columns have different collating sequences.  This is the fix for
  ticket [3182d3879020ef3b2].  There is one test case added, but most of the
  tests are done in TH3.


type: ci
user: drh
comment:
  Changes to oserror.test so that it works even on systems that allow
  an unusually large number of file descriptors.


type: t
user: drh
brief: Fixed ticket [3182d3879020ef3b|3182d38790].
comment:
  Fixed ticket [3182d3879020ef3b|3182d38790]: <i>COLLATE nocase index on a WITHOUT ROWID table malfunctions</i> plus 5 other changes


type: ci
user: dan
comment:
  Fix a problem allowing a Table object to be deleted from within a call to the xDestroy method of the associated virtual table, causing a use-after-free error.


type: ci
user: dan
comment:
  Update wapptest.tcl to use a simpler slave script. And to leave scripts wapptest_configure.sh and wapptest_make.sh in each test directory.


type: t
user: drh
brief: New ticket [a340eef47b0cad59|a340eef47b].
comment:
  New ticket [a340eef47b0cad59|a340eef47b] <i>PRAGMA case_sensitive_like can corrupt some databases.</i>.


type: t
user: drh
brief: New ticket [ae0f637bddc5290b|ae0f637bdd].
comment:
  New ticket [ae0f637bddc5290b|ae0f637bdd] <i>REINDEX fails on a UNIQUE index on the GLOB operator of a REAL column</i>.


type: t
user: drh
brief: New ticket [3be1295b264be2fa|3be1295b26].
comment:
  New ticket [3be1295b264be2fa|3be1295b26] <i>Inconsistent behavior of a unique constraint on a boolean expression.</i>.


type: ci
user: dan
comment:
  Update wapptest.tcl so that it deletes extra files if the "Keep files:" checkbox is clear. Set it by default.


type: ci
user: drh
comment:
  Avoid unwelcomed side effects on the input operands in the OP_Concat
  operator.  Fix for ticket [3be1295b264be2fac49b681]


type: t
user: drh
brief: Fixed ticket [3be1295b264be2fa|3be1295b26].
comment:
  Fixed ticket [3be1295b264be2fa|3be1295b26]: <i>Inconsistent behavior of a unique constraint on a boolean expression.</i> plus 5 other changes


type: ci
user: drh
comment:
  When values have real affinity and are converted into strings for CHECK
  constraints or index expressions, do the conversions into a real-number format
  even if the values are stored as integers for efficiency.
  This appears to fix ticket [ae0f637bddc5290b446].


type: ci
user: drh
comment:
  Fix an issue (discovered by OSSFuzz) in the enhanced OP_Concat operator
  from check-in [713caa382cf7dd] earlier today.


type: t
user: drh
brief: Fixed ticket [ae0f637bddc5290b|ae0f637bdd].
comment:
  Fixed ticket [ae0f637bddc5290b|ae0f637bdd]: <i>REINDEX fails on a UNIQUE index on the GLOB operator of a REAL column</i> plus 5 other changes


type: ci
user: drh
ecomment:
  The "LIKE Optimization" (which converts a LIKE into a BETWEEN operator that is
  able to use an index) does not work and cannot be used if
  the collating sequence of the column is not TEXT and if the pattern
  starts with a "+" sign.  This is another case of ticket
  [c94369cae9b561b1f996d005].  The new test case was discovered by Manuel Rigger.

comment:
  The collating sequence of the column must be TEXT if the LIKE or GLOB pattern
  starts with a "+" sign.  This is another case of ticket
  [c94369cae9b561b1f996d005] that was discovered by Manuel Rigger.


type: ci
user: dan
comment:
  Add options to wapptest.tcl similar to those supported by releasetest.tcl. Also add the -noui switch, for running without wapp altogether.


type: ci
user: drh
comment:
  Earlier detection of a database corruption case in balance_nonroot(), to
  prevent a possible use of an uninitialized variable.


type: ci
user: drh
comment:
  Ensure that the typeof() function always returns SQLITE_FLOAT for floating
  point values even when the value is stored as an integer to save space.


type: ci
user: drh
comment:
  Make MEM_IntReal a completely independent type, meaning a floating point
  value stored as an integer.  This fixes a problem with arithmetic within
  arguments to string functions on indexes of expressions.  But it is a big
  change and needs lots of new testcase() macros for MC/DC and so it is
  initially put on this branch.


type: ci
user: drh
comment:
  Improved comments on the elements of the array constant used to implement
  the sqlite3_value_type() interface.


type: ci
user: drh
comment:
  Add the SQLITE_TESTCTRL_RESULT_INTREAL test-control and use it to create
  the intreal() SQL function in testfixture.  Write a few simple tests to
  prove this all works.  TH3 will hold most of the INTREAL tests, probably.


type: ci
user: drh
comment:
  Ensure that UTF16 strings are properly zero-terminated before returning them
  in an sqlite3_value_text16() request, even if the string is invalid UTF16
  because it was formed from an arbitrary and/or odd-length BLOB.


type: ci
user: drh
comment:
  In the sqlite3_value or Mem object, make the MEM_IntReal type completely
  independent from MEM_Int and MEM_Real. This helps avoid problems when
  inserting non-float values into a "REAL" column.


type: ci
user: drh
comment:
  Fix the NOT NULL logic in the theorem prover that determines when a partial
  index can be used.  Ticket [5c6955204c392ae763a95].


type: t
user: drh
brief: New ticket [5c6955204c392ae7|5c6955204c].
comment:
  New ticket [5c6955204c392ae7|5c6955204c] <i>Incorrect result on a table scan of a partial index</i>.


type: t
user: drh
brief: Ticket [5c6955204c392ae7|5c6955204c]: 6 changes
comment:
  Ticket [5c6955204c392ae7|5c6955204c] <i>Incorrect result on a table scan of a partial index</i> status still Open with 6 other changes


type: t
user: drh
brief: Fixed ticket [5c6955204c392ae7|5c6955204c].
comment:
  Fixed ticket [5c6955204c392ae7|5c6955204c]: <i>Incorrect result on a table scan of a partial index</i> plus 4 other changes


type: ci
user: dan
comment:
  Fix a problem with renaming an INTEGER PRIMARY KEY column of a WITHOUT ROWID table using ALTER TABLE.


type: ci
user: drh
comment:
  On an INSERT or UPDATE, generate the new table record prior to running
  foreign key checks, in case the foreign key checks changes datatypes on
  the registers holding column values.  Proposed fix for ticket
  [e63cbcfd3378afe6980d626].


type: t
user: dan
brief: New ticket [e63cbcfd3378afe6|e63cbcfd33].
comment:
  New ticket [e63cbcfd3378afe6|e63cbcfd33] <i>Database table/index contents mismatch (corruption) caused by FK processing</i>.


type: t
user: dan
brief: Ticket [e63cbcfd3378afe6|e63cbcfd33]: 6 changes
comment:
  Ticket [e63cbcfd3378afe6|e63cbcfd33] <i>Database table/index contents mismatch (corruption) caused by FK processing</i> status still Open with 6 other changes


type: ci
user: drh
comment:
  Generate all records for INSERT or UPDATE prior to running foreign key
  constraint checks, since the FK checks might modify the datatype of registers
  used to generate the records.  Fix for ticket [e63cbcfd3378afe6980d6].


type: ci
user: drh
comment:
  Earlier detections of errors in the byte-offset-to-cell-content integer at 
  offset 5 in the header of a btree page.


type: t
user: drh
brief: Fixed ticket [e63cbcfd3378afe6|e63cbcfd33].
comment:
  Fixed ticket [e63cbcfd3378afe6|e63cbcfd33]: <i>Database table/index contents mismatch (corruption) caused by FK processing</i> plus 3 other changes


type: ci
user: drh
comment:
  Remove a NEVER() that was added in the previous check-in because it is in fact
  reachable.

ecomment:
  Remove a NEVER() that was added in the previous check-in [a0819086a521f]
  because it is in fact reachable.


type: ci
user: drh
comment:
  Remove an ALWAYS() that was previously added by check-in [a0819086] but
  which turns out can sometimes be false.


type: ci
user: dan
comment:
  Fix VDBE opcodes OP_SeekLT and OP_SeekLE so that they work on intkey tables with non-numeric text values.


type: t
user: dan
brief: New ticket [9cf6c9bb51e53bde|9cf6c9bb51].
comment:
  New ticket [9cf6c9bb51e53bde|9cf6c9bb51] <i>&quot;&lt;&quot; or &quot;&lt;=&quot; comparison of rowid and non-numeric text value sometimes gets the wrong answer.</i>.


type: t
user: dan
brief: Ticket [9cf6c9bb51e53bde|9cf6c9bb51]: 6 changes
comment:
  Ticket [9cf6c9bb51e53bde|9cf6c9bb51] <i>&quot;&lt;&quot; or &quot;&lt;=&quot; comparison of rowid and non-numeric text value sometimes gets the wrong answer.</i> status still Open with 6 other changes


type: ci
user: dan
ecomment:
  Fix VDBE opcodes OP_SeekLT and OP_SeekLE so that they work on intkey tables with non-numeric text values. Fix for [9cf6c9bb].

comment:
  Fix VDBE opcodes OP_SeekLT and OP_SeekLE so that they work on intkey tables with non-numeric text values.


type: ci
user: drh
comment:
  Provide the SQLITE_OMIT_CASE_SENSITIVE_LIKE_PRAGMA compile-time option to
  omit the case_sensitive_like pragma.  This change, in combination with
  documentation changes, is the current solution to ticket
  [a340eef47b0cad5].


type: t
user: dan
brief: Closed ticket [9cf6c9bb51e53bde|9cf6c9bb51].
comment:
  Closed ticket [9cf6c9bb51e53bde|9cf6c9bb51]: <i>&quot;&lt;&quot; or &quot;&lt;=&quot; comparison of rowid and non-numeric text value sometimes gets the wrong answer.</i> plus 3 other changes


type: t
user: dan
brief: Ticket [9cf6c9bb51e53bde|9cf6c9bb51]: 3 changes
comment:
  Ticket [9cf6c9bb51e53bde|9cf6c9bb51] <i>&quot;&lt;&quot; or &quot;&lt;=&quot; comparison of rowid and non-numeric text value sometimes gets the wrong answer.</i> status still Closed with 3 other changes


type: t
user: drh
brief: Ticket [9cf6c9bb51e53bde|9cf6c9bb51]: 4 changes
comment:
  Ticket [9cf6c9bb51e53bde|9cf6c9bb51] <i>&quot;&lt;&quot; or &quot;&lt;=&quot; comparison of rowid and non-numeric text value sometimes gets the wrong answer.</i> status still Closed with 4 other changes


type: t
user: drh
brief: Deferred ticket [a340eef47b0cad59|a340eef47b].
comment:
  Deferred ticket [a340eef47b0cad59|a340eef47b]: <i>PRAGMA case_sensitive_like can corrupt some databases.</i> plus 6 other changes


type: t
user: drh
brief: Closed ticket [a340eef47b0cad59|a340eef47b].
comment:
  Closed ticket [a340eef47b0cad59|a340eef47b]: <i>PRAGMA case_sensitive_like can corrupt some databases.</i> plus 2 other changes


type: ci
user: drh
comment:
  Avoid an excess register allocation in UPDATE, when possible.  This improves
  speed (slightly) and reduces the code footprint.


type: ci
user: drh
comment:
  Fix another pattern for which the LIKE optimization does not work for a
  non-TEXT affinity.  Case found by Manuel Rigger.


type: ci
user: drh
comment:
  This is part of the previous check-in that didn't get committed for some
  reason - probably because I failed to press the "Save" button on the text
  editor.


type: ci
user: drh
ecomment:
  Ensure that the sqlite3BtreeLast() interface initializes the *pRes return
  to zero if the cursor is already sitting on the last entry of the table.
  Manuel Rigger found the obscure test case for which this makes a difference.

comment:
  Ensure that the sqlite3BtreeLast() interface initializes the *pRes return
  to zero if the cursor is already sitting on the last entry of the table.


type: ci
user: dan
comment:
  Fix a problem in the new code introduced by [658b84d7] causing corruption and other errors to be ignored.


type: ci
user: dan
comment:
  Avoid reading outside a record buffer when extracting an SQL value in the sqlite_dbdata virtual table code.


type: t
user: drh
brief: New ticket [6c1d3febc00b22d4|6c1d3febc0].
comment:
  New ticket [6c1d3febc00b22d4|6c1d3febc0] <i>REAL PRIMARY KEY leads to a missing entry in the index.</i>.


type: ci
user: drh
comment:
  Disable the optimization where a REAL value with no fractional part
  is stored as an INTEGER when the integer uses as much space as the real
  value it proposes to stand in for (8 bytes).  This avoids corner cases
  of comparing integers against real values that are beyond the resolution
  of an IEEE 754 double.  Fix for ticket [6c1d3febc00b22d457c78c2]


type: ci
user: dan
comment:
  Fix a crash in the sqlite_dbdata module that could occur if a pointer within an overflow chain in a corrupt database pointed past the end of the db.


type: t
user: drh
brief: Fixed ticket [6c1d3febc00b22d4|6c1d3febc0].
comment:
  Fixed ticket [6c1d3febc00b22d4|6c1d3febc0]: <i>REAL PRIMARY KEY leads to a missing entry in the index.</i> plus 5 other changes


type: ci
user: dan
comment:
  Fix a problem in the ".recover" command allowing a circular loop of b-tree pages in a database file to cause an infinite loop.


type: ci
user: drh
comment:
  Fix the previous check-in [db9acef14d492121] so that the amalgamation build
  works for systems for which lack HAVE_ISNAN.


type: ci
user: drh
comment:
  Improved comments and extra assert() statements on the OP_Savepoint opcode,
  just to make the code a little easier to read and reason about.


type: ci
user: dan
comment:
  Treat integer values in window definition ORDER BY clauses as constants, not as references to another expression.


type: ci
user: dan
comment:
  Do not assume that "x IS NOT ?" implies "x NOT NULL" when considering partial indexes. Fix for ticket [8025674847].


type: t
user: dan
brief: New ticket [80256748471a01a6|8025674847].
comment:
  New ticket [80256748471a01a6|8025674847] <i>Incorrect use of &quot;WHERE x NOT NULL&quot; index for query with a &quot;WHERE x IS NOT ?&quot; term</i>.


type: t
user: dan
brief: Ticket [80256748471a01a6|8025674847]: 6 changes
comment:
  Ticket [80256748471a01a6|8025674847] <i>Incorrect use of &quot;WHERE x NOT NULL&quot; index for query with a &quot;WHERE x IS NOT ?&quot; term</i> status still Open with 6 other changes


type: ci
user: dan
comment:
  When considering partial indexes, do not assume that a "CASE x ..." expression implies "x IS NOT NULL".


type: t
user: dan
brief: Closed ticket [80256748471a01a6|8025674847].
comment:
  Closed ticket [80256748471a01a6|8025674847]: <i>Incorrect use of &quot;WHERE x NOT NULL&quot; index for query with a &quot;WHERE x IS NOT ?&quot; term</i> plus 4 other changes


type: ci
user: drh
comment:
  A new implementation for the sqlite3ExprImpliesExpr() theorem prover that
  does a better job of answering TRUE to "(NOT A) OR B" when B is a NOT NULL
  expression.


type: ci
user: drh
comment:
  Disable index seek optimizations on REINDEX when the order of primary keys
  in the index differs from the main table.
  Fix for ticket [bba7b69f9849b5bf11b4].


type: t
user: dan
brief: New ticket [bba7b69f9849b5bf|bba7b69f98].
comment:
  New ticket [bba7b69f9849b5bf|bba7b69f98] <i>REINDEX on WITHOUT ROWID table with DESC PRIMARY KEY corrupts automatic UNIQUE index</i>.


type: t
user: drh
brief: Ticket [bba7b69f9849b5bf|bba7b69f98]: 7 changes
comment:
  Ticket [bba7b69f9849b5bf|bba7b69f98] <i>REINDEX on WITHOUT ROWID table with DESC PRIMARY KEY corrupts automatic UNIQUE index</i> status still Open with 7 other changes


type: t
user: drh
brief: Fixed ticket [bba7b69f9849b5bf|bba7b69f98].
comment:
  Fixed ticket [bba7b69f9849b5bf|bba7b69f98]: <i>REINDEX on WITHOUT ROWID table with DESC PRIMARY KEY corrupts automatic UNIQUE index</i> plus 3 other changes


type: ci
user: dan
comment:
  Fix a problem with the fix for [9cf6c9bb51] (commit [658b84d7]) that could cause a cursor to be left in an invalid state following a (rowid < text-value) search.


type: ci
user: drh
comment:
  Fix the count-of-view optimization so that it is (correctly) disabled for
  a query that includes a WHERE clause or a GROUP BY clause.


type: ci
user: drh
comment:
  Make sure the OP_Concat opcode always correctly zero-terminates a UTF16
  string, even if the input strings are ill-formed.  This is a followup to
  check-in [3a16ddf91f0c9c516a7] that fixes a case the previous check-in missed.
  Also add assert()s to prove correct zero termination.


type: ci
user: drh
comment:
  Fix a harmless use-of-initialized-value fault in the assert() logic added
  by check-in [d612fb7873cf59d]


type: t
user: dan
brief: Ticket [3c27b97e319a263a|3c27b97e31]: 6 changes
comment:
  Ticket [3c27b97e319a263a|3c27b97e31] <i>REAL rounding seems to depend on FROM clause</i> status still Open with 6 other changes


type: t
user: drh
brief: Ticket [3c27b97e319a263a|3c27b97e31]: 3 changes
comment:
  Ticket [3c27b97e319a263a|3c27b97e31] <i>REAL rounding seems to depend on FROM clause</i> status still Open with 3 other changes


type: ci
user: drh
comment:
  Initialize the 18-byte overrun area on the buffer used to reconstruct
  overflow btree cells during a btree search, to avoid a harmless
  jump-depends-on-uninit-values warning.


type: ci
user: dan
comment:
  Always store a REAL value in a column with REAL affinity if the integer equivalent would require 8 bytes of storage. Fix for [3c27b97e3].


type: t
user: mrigger
brief: New ticket [f4ec250930342e0c|f4ec250930].
comment:
  New ticket [f4ec250930342e0c|f4ec250930] <i>Malformed image when using no journal mode, zero cache size, and failing when creating an index.</i>.


type: ci
user: drh
comment:
  Disable PRAGMA journal_mode=OFF when SQLITE_DBCONFIG_DEFENSIVE is turned on.
  Ticket [f4ec250930342e0c].


type: t
user: drh
brief: Fixed ticket [3c27b97e319a263a|3c27b97e31].
comment:
  Fixed ticket [3c27b97e319a263a|3c27b97e31]: <i>REAL rounding seems to depend on FROM clause</i> plus 3 other changes


type: ci
user: dan
comment:
  Avoid including the comment in the output of "PRAGMA table_info" in situations where there is a comment following a DEFAULT value within a CREATE TABLE statement.


type: t
user: drh
brief: Closed ticket [f4ec250930342e0c|f4ec250930].
comment:
  Closed ticket [f4ec250930342e0c|f4ec250930]: <i>Malformed image when using no journal mode, zero cache size, and failing when creating an index.</i> plus 6 other changes


type: ci
user: dan
comment:
  Fix an assert() failure that could occur in a join query if the RHS of an IN() operator is a list containing correlated expressions. This problem was introduced by checkin [e130319317e7611938] which was part of the fix for ticket [787fa716be3a7f650c] - so this commit is part of that ticket's fix too.


type: t
user: mrigger
brief: Ticket [787fa716be3a7f65|787fa716be]: 3 changes
comment:
  Ticket [787fa716be3a7f65|787fa716be] <i>Assertion fault when multi-use subquery implemented by co-routine</i> status still Fixed with 3 other changes


type: ci
user: dan
comment:
  Update the sqlite3ExprCompare() routine so that it does not think "? IS NOT TRUE" is the same as "? IS TRUE". Fix for [d3e7f2ba5b3].


type: t
user: mrigger
brief: New ticket [9b78184be266fd70|9b78184be2].
comment:
  New ticket [9b78184be266fd70|9b78184be2] <i>Index on non-existing column results in a fabricated value being fetched</i>.


type: t
user: mrigger
brief: New ticket [d3e7f2ba5b3ba4fb|d3e7f2ba5b].
comment:
  New ticket [d3e7f2ba5b3ba4fb|d3e7f2ba5b] <i>Nested boolean formula with IN operator computes an incorrect result</i>.


type: t
user: dan
brief: Ticket [d3e7f2ba5b3ba4fb|d3e7f2ba5b]: 6 changes
comment:
  Ticket [d3e7f2ba5b3ba4fb|d3e7f2ba5b] <i>Nested boolean formula with IN operator computes an incorrect result</i> status still Open with 6 other changes


type: ci
user: dan
comment:
  Disallow string constants enclosed in double-quotes within new CREATE TABLE and CREATE INDEX statements. It is still possible to enclose column names in double-quotes, and existing database schemas that use double-quotes for strings can still be loaded. This addresses ticket [9b78184b].


type: t
user: mrigger
brief: Ticket [d3e7f2ba5b3ba4fb|d3e7f2ba5b]: 3 changes
comment:
  Ticket [d3e7f2ba5b3ba4fb|d3e7f2ba5b] <i>Nested boolean formula with IN operator computes an incorrect result</i> status still Open with 3 other changes


type: t
user: drh
brief: Fixed ticket [d3e7f2ba5b3ba4fb|d3e7f2ba5b].
comment:
  Fixed ticket [d3e7f2ba5b3ba4fb|d3e7f2ba5b]: <i>Nested boolean formula with IN operator computes an incorrect result</i> plus 5 other changes


type: ci
user: drh
comment:
  A minor variation on check-in [1685610ef8e0dc] which (hopefully) makes the
  logic a little easier to follow.  Also disallows the use of the double-quoted
  string hack in the query expression used for VACUUM INTO, which is not
  strictly required, but moves us toward the goal of disallowing the double-quoted
  string hack everywhere.


type: t
user: dan
brief: Closed ticket [9b78184be266fd70|9b78184be2].
comment:
  Closed ticket [9b78184be266fd70|9b78184be2]: <i>Index on non-existing column results in a fabricated value being fetched</i> plus 6 other changes


type: ci
user: drh
comment:
  Improvements to the automatic compile-time selection of byte-order, as
  suggested on the mailing list by Seb Kemper.


type: ci
user: dan
comment:
  Fix a segfault that could occur in sqlite3session_diff() if NULL were passed as the pzErrMsg argument.


type: ci
user: dan
comment:
  Use a statement journal for all CREATE INDEX statements in case an indexed exprsesion throws an exception when it is evaluated. Fix for [b5ca442a].


type: t
user: mrigger
brief: New ticket [b5ca442af9fadf5e|b5ca442af9].
comment:
  New ticket [b5ca442af9fadf5e|b5ca442af9] <i>&quot;Malformed database schema&quot; when creating a failing index within a transaction</i>.


type: t
user: mrigger
brief: Ticket [b5ca442af9fadf5e|b5ca442af9]: 6 changes
comment:
  Ticket [b5ca442af9fadf5e|b5ca442af9] <i>&quot;Malformed database schema&quot; when creating a failing index within a transaction</i> status still Open with 6 other changes


type: t
user: dan
brief: Closed ticket [b5ca442af9fadf5e|b5ca442af9].
comment:
  Closed ticket [b5ca442af9fadf5e|b5ca442af9]: <i>&quot;Malformed database schema&quot; when creating a failing index within a transaction</i> plus 3 other changes


type: ci
user: drh
comment:
  Combine the implementations of the key and hexkey pragmas into a single
  case.  Have both pragmas return "ok" if they are implemented.


type: ci
user: drh
comment:
  Renumber the Select.selId values in the copies of SELECT statements that
  implement VIEWs when the VIEW is expanded, so that when the same VIEW is
  used twice in the same join, each expansion as a distinct selId.
  This fixes ticket [ce823231949d3abf42453c8].


type: ci
user: drh
comment:
  New test case for check-in [74ef97bf51dd531a] that takes the fix in the
  previous check-in into account.


type: t
user: drh
brief: Fixed ticket [ce823231949d3abf|ce82323194].
comment:
  Fixed ticket [ce823231949d3abf|ce82323194]: <i>Duplicate CTE name gives incorrect result</i> plus 5 other changes


type: ci
user: drh
comment:
  Improvements to the view-self-join optimization so that it works on all
  VIEWs, not just on Common Table Expressions.


type: ci
user: drh
comment:
  The ".shared-schema" command in the CLI requires the sqlite_dbpage table,
  so disable it if the build does not include that extension.


type: ci
user: drh
comment:
  Add new cases to speedtest1 for measuring performance of binary to/from decimal
  conversions of floating point values.


type: t
user: mrigger
brief: New ticket [e8bedb2a184001bb|e8bedb2a18].
comment:
  New ticket [e8bedb2a184001bb|e8bedb2a18] <i> Incorrect result when subtracting a large integer number from a TEXT value</i>.


type: ci
user: drh
comment:
  Fix an error message on the blobread() extension function so that it says
  "read" instead of "write".


type: ci
user: dan
comment:
  Fix an assert() in fts3 that could fail when processing corrupt records. Also some minor sanitizer warnings.


type: ci
user: drh
comment:
  Fix the query flattener optimization so that it preserve the "SF_Compound"
  bit when flattening a compound subquery into a non-compound outer query.
  Failure to preserve that bit could allow subsequent flattenings which are
  not valid. Fix for ticket [c41afac34f15781fe09cd].


type: t
user: drh
brief: Fixed ticket [c41afac34f15781f|c41afac34f].
comment:
  Fixed ticket [c41afac34f15781f|c41afac34f]: <i>LIMIT applied globally rather than locally</i> plus 5 other changes


type: ci
user: drh
comment:
  Much faster implementation of applyNumericAffinity() by avoiding some
  unnecessary calls to sqlite3Atoi64().


type: ci
user: drh
comment:
  Smaller and faster sqlite3IsNaN() implementation makes deserialization of
  floating point values much faster.


type: ci
user: mistachkin
comment:
  Fix a problem where self-joins on views that are aggregate queries may return the wrong result.  Cherrypick of [74ef97bf51dd531a].


type: ci
user: drh
comment:
  In the CLI, add a small delay (0.1 seconds) after launching the output
  command for ".once" before deleting the temporary file.


type: ci
user: dan
comment:
  Also upgrade script config.sub to the latest version. This should have been part of the previous commit.


type: ci
user: drh
comment:
  When casting string values into numeric and the string has a prefix that looks
  like a number but total string is not a well-formed number, then take extra
  care that the result is either integer or real depending on what the prefix
  looks like.  Fix for tickets [e8bedb2a184001] and [4c2d7639f076aa].


type: ci
user: drh
comment:
  Remove code in the round() SQL function that became unreachable due to
  the optimization of check-in [e95138f5f4febde5]


type: t
user: drh
brief: Fixed ticket [e8bedb2a184001bb|e8bedb2a18].
comment:
  Fixed ticket [e8bedb2a184001bb|e8bedb2a18]: <i> Incorrect result when subtracting a large integer number from a TEXT value</i> plus 6 other changes


type: t
user: drh
brief: Fixed ticket [4c2d7639f076aa7c|4c2d7639f0].
comment:
  Fixed ticket [4c2d7639f076aa7c|4c2d7639f0]: <i>CAST(&#39;-&#39; AS NUMERIC) computes 0.0</i> plus 6 other changes


type: ci
user: dan
comment:
  Do not attempt the LIKE optimization on a column with numeric affinity if the rhs of the operator begins with whitespace. Fix for ticket [fd76310a5e].


type: t
user: mrigger
brief: New ticket [fd76310a5e843e07|fd76310a5e].
comment:
  New ticket [fd76310a5e843e07|fd76310a5e] <i>TEXT value interpreted as column name in an index with empty list in an IN expression</i>.


type: t
user: mrigger
brief: New ticket [b1d8c79314f59383|b1d8c79314].
comment:
  New ticket [b1d8c79314f59383|b1d8c79314] <i>LIKE malfunctions for INT PRIMARY KEY COLLATE NOCASE column</i>.


type: ci
user: dan
ecomment:
  Handle renaming a column or table when the schema contains a (meaningless) index on the constant expression ('text' IN ()) or ('text' NOT IN()). Fix for [fd76310a].

comment:
  Handle renaming a column or table when the schema contains a (meaningless) index on the constant expression ('text' IN ()) or ('text' NOT IN()).


type: t
user: dan
brief: Fixed ticket [b1d8c79314f59383|b1d8c79314].
comment:
  Fixed ticket [b1d8c79314f59383|b1d8c79314]: <i>LIKE malfunctions for INT PRIMARY KEY COLLATE NOCASE column</i> plus 6 other changes


type: ci
user: drh
comment:
  Make sure a CAST to "NUMERIC" results in an integer if the value can be
  losslessly expressed as an integer, as the documentation requires.
  Ticket [dd6bffbfb6e61db9].


type: t
user: dan
brief: Closed ticket [fd76310a5e843e07|fd76310a5e].
comment:
  Closed ticket [fd76310a5e843e07|fd76310a5e]: <i>TEXT value interpreted as column name in an index with empty list in an IN expression</i> plus 5 other changes


type: t
user: mrigger
brief: New ticket [533010b8cacebe82|533010b8ca].
comment:
  New ticket [533010b8cacebe82|533010b8ca] <i>Illegal argument to LIKELIHOOD() does not result in error when combined with &quot;IN ()&quot;</i>.


type: t
user: drh
brief: Ticket [dd6bffbfb6e61db9|dd6bffbfb6]: 7 changes
comment:
  Ticket [dd6bffbfb6e61db9|dd6bffbfb6] <i>CAST to NUMERIC no longer converts to INTEGER</i> status still Open with 7 other changes


type: t
user: drh
brief: Fixed ticket [dd6bffbfb6e61db9|dd6bffbfb6].
comment:
  Fixed ticket [dd6bffbfb6e61db9|dd6bffbfb6]: <i>CAST to NUMERIC no longer converts to INTEGER</i> plus 3 other changes


type: t
user: drh
brief: Closed ticket [31c6e64ff93274f1|31c6e64ff9].
comment:
  Closed ticket [31c6e64ff93274f1|31c6e64ff9]: <i>ALTER TABLE fails if a trigger references a non-existant table.</i> plus 6 other changes


type: ci
user: dan
comment:
  Have ALTER TABLE commands ignore the lhs of "expr IN ()" and "expr NOT IN ()" expressions, just as other queries do. Fix for [533010b8ca].


type: t
user: drh
brief: Fixed ticket [5e0423b058fa5adf|5e0423b058].
comment:
  Fixed ticket [5e0423b058fa5adf|5e0423b058]: <i>xAccess behaviour is not documented, changed in Windows 3.7.0</i> plus 3 other changes


type: ci
user: drh
comment:
  A string consisting of a single '.' is not a floating point literal with extra
  text at the end.  Fix for ticket [412bba9b22c677da]


type: t
user: dan
brief: Closed ticket [533010b8cacebe82|533010b8ca].
comment:
  Closed ticket [533010b8cacebe82|533010b8ca]: <i>Illegal argument to LIKELIHOOD() does not result in error when combined with &quot;IN ()&quot;</i> plus 6 other changes


type: t
user: mrigger
brief: New ticket [412bba9b22c677da|412bba9b22].
comment:
  New ticket [412bba9b22c677da|412bba9b22] <i>CAST(&#39;.&#39; AS NUMERIC) computes 0.0 rather than 0</i>.


type: t
user: mrigger
brief: Open ticket [533010b8cacebe82|533010b8ca].
comment:
  Open ticket [533010b8cacebe82|533010b8ca]: <i>Illegal argument to LIKELIHOOD() does not result in error when combined with &quot;IN ()&quot;</i> plus 3 other changes


type: t
user: drh
brief: Fixed ticket [412bba9b22c677da|412bba9b22].
comment:
  Fixed ticket [412bba9b22c677da|412bba9b22]: <i>CAST(&#39;.&#39; AS NUMERIC) computes 0.0 rather than 0</i> plus 6 other changes


type: ci
user: drh
comment:
  The ALTER TABLE command should not attempt to rename objects that are 
  contained within an expression tree that has been optimized out because
  it is the other branch of an "AND false" expression.
  Ticket [533010b8cacebe82]


type: ci
user: drh
comment:
  Add the new sqlite3ExprUnmapAndDelete() function and use it in place of
  separate calls to sqlite3RenameExprUnmap() and sqlite3ExprDelete().


type: t
user: drh
brief: Fixed ticket [533010b8cacebe82|533010b8ca].
comment:
  Fixed ticket [533010b8cacebe82|533010b8ca]: <i>Illegal argument to LIKELIHOOD() does not result in error when combined with &quot;IN ()&quot;</i> plus 3 other changes


type: t
user: drh
brief: Fixed ticket [d60b3cd7cb0bdff8|d60b3cd7cb].
comment:
  Fixed ticket [d60b3cd7cb0bdff8|d60b3cd7cb]: <i>COLLATE expression has an affinity</i> plus 8 other changes


type: ci
user: dan
comment:
  Have the ALTER TABLE code handle the case where an entire expression that includes a sub-select is excluded from a view, trigger or index.


type: t
user: mrigger
brief: New ticket [57353f8243c637c0|57353f8243].
comment:
  New ticket [57353f8243c637c0|57353f8243] <i>COLLATE expression in the right side of an IN operator results in an affinity conversion</i>.


type: t
user: drh
brief: Fixed ticket [1819598c0908207f|1819598c09].
comment:
  Fixed ticket [1819598c0908207f|1819598c09]: <i>-&#39;1.0&#39; computes -1.0 rather than -1</i> plus 7 other changes


type: t
user: mrigger
brief: New ticket [afdc5a29dc169779|afdc5a29dc].
comment:
  New ticket [afdc5a29dc169779|afdc5a29dc] <i>Lossless conversion when casting a large TEXT number to NUMERIC is not performed</i>.


type: t
user: drh
brief: Closed ticket [afdc5a29dc169779|afdc5a29dc].
comment:
  Closed ticket [afdc5a29dc169779|afdc5a29dc]: <i>Lossless conversion when casting a large TEXT number to NUMERIC is not performed</i> plus 8 other changes


type: ci
user: drh
comment:
  Make sure the affinity of the RHS of an IN operator does not affect the
  outcome even if the RHS expression contains a COLLATE clause.
  Ticket [57353f8243c637c0]


type: t
user: drh
brief: Fixed ticket [57353f8243c637c0|57353f8243].
comment:
  Fixed ticket [57353f8243c637c0|57353f8243]: <i>COLLATE expression in the right side of an IN operator results in an affinity conversion</i> plus 6 other changes


type: t
user: mrigger
brief: New ticket [0c620df60bffd9ef|0c620df60b].
comment:
  New ticket [0c620df60bffd9ef|0c620df60b] <i>LIKELY(), UNLIKELY() and LIKELIHOOD() have affinities</i>.


type: ci
user: dan
comment:
  Handle expressions like "expr IS TRUE COLLATE xyz" in the same way as "expr IS TRUE". Fix for [4d01eda8115b10d1].


type: t
user: drh
brief: Fixed ticket [0c620df60bffd9ef|0c620df60b].
comment:
  Fixed ticket [0c620df60bffd9ef|0c620df60b]: <i>LIKELY(), UNLIKELY() and LIKELIHOOD() have affinities</i> plus 6 other changes


type: t
user: mrigger
brief: New ticket [4d01eda8115b10d1|4d01eda811].
comment:
  New ticket [4d01eda8115b10d1|4d01eda811] <i>IS TRUE operator malfunctions with COLLATE and REAL value</i>.


type: t
user: mrigger
brief: New ticket [674385aeba91c774|674385aeba].
comment:
  New ticket [674385aeba91c774|674385aeba] <i>CAST(&#39;-0.0&#39; AS NUMERIC) computes 0.0 rather than 0</i>.


type: t
user: drh
brief: Ticket [674385aeba91c774|674385aeba]: 7 changes
comment:
  Ticket [674385aeba91c774|674385aeba] <i>CAST(&#39;-0.0&#39; AS NUMERIC) computes 0.0 rather than 0</i> status still Open with 7 other changes


type: t
user: dan
brief: Closed ticket [4d01eda8115b10d1|4d01eda811].
comment:
  Closed ticket [4d01eda8115b10d1|4d01eda811]: <i>IS TRUE operator malfunctions with COLLATE and REAL value</i> plus 6 other changes


type: t
user: mrigger
brief: Ticket [674385aeba91c774|674385aeba]: 3 changes
comment:
  Ticket [674385aeba91c774|674385aeba] <i>CAST(&#39;-0.0&#39; AS NUMERIC) computes 0.0 rather than 0</i> status still Open with 3 other changes


type: t
user: drh
brief: Fixed ticket [b148fa61059fb6c2|b148fa6105].
comment:
  Fixed ticket [b148fa61059fb6c2|b148fa6105]: <i>CAST takes implicit COLLATE of its operand</i> plus 8 other changes


type: t
user: drh
brief: Fixed ticket [674385aeba91c774|674385aeba].
comment:
  Fixed ticket [674385aeba91c774|674385aeba]: <i>CAST(&#39;-0.0&#39; AS NUMERIC) computes 0.0 rather than 0</i> plus 4 other changes


type: ci
user: drh
comment:
  Do not use the %lld printf conversion in the platform printf() as some
  legacy platforms do not support it.


type: ci
user: drh
comment:
  Refactor the LIKE optimization decision logic so that it uses
  sqlite3AtoF() on both boundary keys to determine if the optimization can be
  used when the LHS is something that might not have TEXT affinity.
  Ticket [ce8717f0885af975].  See also [c94369cae9b561b1],
  [b043a54c3de54b28], [fd76310a5e843e07], and [158290c0abafde67].


type: t
user: mrigger
brief: New ticket [f1580ba1b574e9e9|f1580ba1b5].
comment:
  New ticket [f1580ba1b574e9e9|f1580ba1b5] <i>Row is not fetched in WITHOUT ROWID table and a composite primary key</i>.


type: ci
user: drh
comment:
  Fix the implementation of the built-in RTRIM collating sequence so that
  it works for control characters at the end of the string.
  Ticket [f1580ba1b574e9e9]


type: t
user: drh
brief: Fixed ticket [ce8717f0885af975|ce8717f088].
comment:
  Fixed ticket [ce8717f0885af975|ce8717f088]: <i>LIKE malfunctions for UNIQUE COLLATE NOCASE column</i> plus 6 other changes


type: ci
user: drh
comment:
  Deprecate the SQLITE_ALLOW_COVERING_INDEX_SCAN compile-time option when it is
  turned off.  This probably will impact no-one.  If it does, they will get an
  error message instructing them to contact developers, so that we can get
  feedback that somebody is actually using this feature.  Start-time disabling
  of covering index scan is not affected.


type: t
user: drh
brief: Fixed ticket [f1580ba1b574e9e9|f1580ba1b5].
comment:
  Fixed ticket [f1580ba1b574e9e9|f1580ba1b5]: <i>Built-in RTRIM collating sequence yields incorrect comparisons</i> plus 8 other changes


type: ci
user: drh
comment:
  Ensure that sqlite3RenameExprUnmap() does an unmap of the result set alias
  names in subqueries when ALTER TABLE fails because of a syntax error in a
  trigger.


type: ci
user: dan
ecomment:
  Avoid transforming TK_COLLATE or TK_UNLIKELY Expr nodes to TK_REFERENCE. Instead, transform the uppermost Expr node in the expression tree that is not of this type. Fix for [e1e07ef2].

comment:
  Avoid transforming TK_COLLATE or TK_UNLIKELY Expr nodes to TK_REFERENCE. Instead, transform the uppermost Expr node in the expression tree that is not of this type.


type: ci
user: drh
comment:
  Avoid transforming TK_COLLATE or TK_UNLIKELY Expr nodes to TK_REFERENCE.
  Instead, transform the uppermost Expr node in the expression tree that
  is not of this type. Fix for [e1e07ef2].


type: ci
user: drh
comment:
  New sqlite3_db_config() options:
  SQLITE_DBCONFIG_LEGACY_ALTER_TABLE,
  SQLITE_DBCONFIG_DQS_DML, and
  SQLITE_DBCONFIG_DQS_DDL.


type: t
user: drh
brief: Fixed ticket [e1e07ef2028c3c22|e1e07ef202].
comment:
  Fixed ticket [e1e07ef2028c3c22|e1e07ef202]: <i>COLLATE in BETWEEN expression is ignored</i> plus 6 other changes


type: ci
user: dan
comment:
  Fix a problem with handling with handling quoted path elements in extension functions json_set() and json_insert() reported on the mailing list.


type: ci
user: dan
comment:
  Fix a typo in an option name for the .dbconfig command in shell.c.in: s/wriable_schema/writable_schema/


type: ci
user: dan
comment:
  Ensure that when an ephemeral cursor is reopened with a second invocation of to OP_OpenEphemeral, the sequence counter is reset and the cache marked as stale. Fix for [9cdc5c46].


type: t
user: dan
brief: New ticket [9cdc5c4662d40637|9cdc5c4662].
comment:
  New ticket [9cdc5c4662d40637|9cdc5c4662] <i>Incorrect result from second execution of correlated scalar sub-query that uses a partial sort</i>.


type: ci
user: drh
comment:
  Use the OP_Sequence opcode for generating unique rowid values for an
  autoindex on a co-routine implementation of a subquery.


type: t
user: drh
brief: Fixed ticket [9cdc5c4662d40637|9cdc5c4662].
comment:
  Fixed ticket [9cdc5c4662d40637|9cdc5c4662]: <i>Incorrect result from second execution of correlated scalar sub-query that uses a partial sort</i> plus 6 other changes


type: ci
user: dan
comment:
  Fix a race condition that could occur in SQLITE_ENABLE_MEMORY_MANAGEMENT builds when two threads simultaneously open the first two database connections in the process.


type: ci
user: drh
comment:
  Restore the legacy behavior of enabling double-quoted string literals in
  all contexts.  But also provide a new compile-time option (SQLITE_DQS) to 
  change the default to something more restrictive.


type: ci
user: dan
comment:
  Have ALTER TABLE detect and error out for the case where renaming a column changes a the interpretation of a double-quoted identifier in the database schema from an SQL literal to a column reference.


type: ci
user: dan
comment:
  As it requires wal mode support, do not run test file chunksize.test as part of the "journaltest" permutation.


type: t
user: dan
brief: New ticket [9ece23d2caf8853a|9ece23d2ca].
comment:
  New ticket [9ece23d2caf8853a|9ece23d2ca] <i>Default collation sequences and affinities lost when window function added to query</i>.


type: t
user: dan
brief: Ticket [9ece23d2caf8853a|9ece23d2ca]: 6 changes
comment:
  Ticket [9ece23d2caf8853a|9ece23d2ca] <i>Default collation sequences and affinities lost when window function added to query</i> status still Open with 6 other changes


type: t
user: dan
brief: Ticket [9ece23d2caf8853a|9ece23d2ca]: 3 changes
comment:
  Ticket [9ece23d2caf8853a|9ece23d2ca] <i>Default collation sequences and affinities lost when window function added to query</i> status still Open with 3 other changes


type: t
user: dan
brief: Closed ticket [9ece23d2caf8853a|9ece23d2ca].
comment:
  Closed ticket [9ece23d2caf8853a|9ece23d2ca]: <i>Default collation sequences and affinities lost when window function added to query</i> plus 3 other changes


type: ci
user: dan
comment:
  Update rtree.c so that SQLITE_DEBUG is required to turn on assert() statements, even if it is compiled separately from the amalgamation.


type: ci
user: dan
comment:
  Modify the bits used for special flags on this branch to account for the fact that some of them are now used for other purposes.


type: ci
user: drh
comment:
  Move the sqlite3VdbeSerialType() routine in-line in the OP_MakeRecord opcode.
  Optimizing compilers were doing this already.  By doing it manually, we can
  omit some redundant tests and make the whole thing run a million cycles faster
  and use about 80 bytes less code space.


type: ci
user: drh
comment:
  Improved comments and extra testcase() macros on the serial-type computation
  logic in the OP_MakeRecord opcode.


type: ci
user: dan
comment:
  Fix a problem that could cause a crash if a blob handle were closed after the associated database handle was closed using sqlite3_close_v2().


type: ci
user: drh
comment:
  Enhance the "PRAGMA index_info()" and "PRAGMA index_xinfo()" statements so that
  they allow a WITHOUT ROWID table as their argument, and in that case show
  the structure of the underlying index used to implement the WITHOUT ROWID
  table.


type: t
user: drh
brief: New ticket [fd3aec0c7e3e2998|fd3aec0c7e].
comment:
  New ticket [fd3aec0c7e3e2998|fd3aec0c7e] <i>Valgrind warning if PK has more columns than the table.</i>.


type: ci
user: drh
comment:
  New test cases for PRAGMA index_xinfo on a WITHOUT ROWID table.  And new
  testcases using index_xinfo to verify that WITHOUT ROWID tables are
  constructed correctly.


type: ci
user: drh
comment:
  Fix the WITHOUT ROWID table logic so that it generates a correct KeyInfo
  object for tables that have a PRIMARY KEY containing the same column used
  more than once with different collating sequences.  Enhance the index_xinfo
  pragma to assist in testing the above. Fix for ticket [fd3aec0c7e3e2998].


type: ci
user: dan
comment:
  When processing a BETWEEN or CASE expression, avoid transforming a node of the original expression into a TK_REGISTER node. Instead, take a copy and use it instead. Fix for [1be72aab9].


type: t
user: drh
brief: Fixed ticket [fd3aec0c7e3e2998|fd3aec0c7e].
comment:
  Fixed ticket [fd3aec0c7e3e2998|fd3aec0c7e]: <i>Valgrind warning if PK has more columns than the table.</i> plus 5 other changes


type: t
user: drh
brief: New ticket [1be72aab929187d1|1be72aab92].
comment:
  New ticket [1be72aab929187d1|1be72aab92] <i>CHECK constraint using COLLATE with CASE or BETWEEN</i>.


type: t
user: drh
brief: Ticket [1be72aab929187d1|1be72aab92]: 6 changes
comment:
  Ticket [1be72aab929187d1|1be72aab92] <i>CHECK constraint using COLLATE with CASE or BETWEEN</i> status still Open with 6 other changes


type: t
user: drh
brief: Ticket [1be72aab929187d1|1be72aab92]: 3 changes
comment:
  Ticket [1be72aab929187d1|1be72aab92] <i>CHECK constraint using COLLATE with CASE or BETWEEN</i> status still Open with 3 other changes


type: ci
user: drh
comment:
  Improvement to the hexdb interpreter built into the CLI and into the
  TCL test harness: Round the "size" up to the next multiple of the "pagesize".


type: t
user: drh
brief: Fixed ticket [1be72aab929187d1|1be72aab92].
comment:
  Fixed ticket [1be72aab929187d1|1be72aab92]: <i>CHECK constraint using COLLATE with CASE or BETWEEN</i> plus 3 other changes


type: ci
user: drh
comment:
  Fix a new problem in the BETWEEN operator when applied to a window function.
  The problem was introduced yesterday by check-in [7ef7b23cbb1b9ace].
  This cherry-pick also needed to remove an assert from sqliteExprDelete().


type: ci
user: drh
comment:
  Fix a new problem in the BETWEEN operator when applied to a window function.
  The problem was introduced yesterday by check-in [7ef7b23cbb1b9ace].


type: ci
user: dan
comment:
  Fix a faulty assert() in walker.c that could fail when processing an ALTER TABLE statement on a schema containing invalid table references that are part of a WINDOW definition.


type: ci
user: dan
comment:
  Fix a problem with renaming tables when the schema contains WINDOW definitions with (illegal) non-numeric expressions as part of a PRECEDING or FOLLOWING clause.


type: ci
user: dan
comment:
  Fix a problem with renaming a table when the schema contains an invocation of a window function that is not currently registered.


type: ci
user: drh
comment:
  Make sure any window definitions in an ORDER BY clause are removed from
  the SELECT statement if the ORDER BY clause gets optimized out.


type: ci
user: dan
comment:
  Remove Window objects from the corresponding Select.pWin list when they are deleted, as they are, for example, when the ORDER BY clause is optimized out.


type: ci
user: dan
comment:
  Fix a problem with renaming tables when the schema contains an invocation of a currently unregistered aggregate with a FILTER clause.


type: ci
user: drh
comment:
  The sqlite3_set_authorizer() interface should only expire prepared statements
  when it is setting a new authorizer, not when clearing the authorizer.  And
  statements that are running when sqlite3_set_authorizer() is invoked should be
  allowed to continue running to completion.


type: ci
user: dan
comment:
  Improve the ".recover" command in the shell tool so that it is not confused by auto-vacuum databases. And so that it can recover tables for which one or more of the column names are SQL keywords.


type: ci
user: dan
comment:
  Improve the ".recover" command so that it handles intkey pages linked into non-intkey b-trees, and vice-versa, better.


type: t
user: drh
brief: New ticket [c52b09c7f38903b1|c52b09c7f3].
comment:
  New ticket [c52b09c7f38903b1|c52b09c7f3] <i>Assertion fault in the query planner on a deeply nested query</i>.


type: t
user: drh
brief: Ticket [c52b09c7f38903b1|c52b09c7f3]: 7 changes
comment:
  Ticket [c52b09c7f38903b1|c52b09c7f3] <i>Assertion fault in the query planner on a deeply nested query</i> status still Open with 7 other changes


type: t
user: drh
brief: Fixed ticket [c52b09c7f38903b1|c52b09c7f3].
comment:
  Fixed ticket [c52b09c7f38903b1|c52b09c7f3]: <i>Assertion fault in the query planner on a deeply nested query</i> plus 4 other changes


type: t
user: mrigger
brief: New ticket [ba2f4585cf495231|ba2f4585cf].
comment:
  New ticket [ba2f4585cf495231|ba2f4585cf] <i>Query with ORDER BY results in &quot;database disk image is malformed&quot; error</i>.


type: ci
user: drh
comment:
  Fix the OP_Affinity operator so that when applying REAL affinity, it
  only sets MEM_IntReal if the integer value will fit in 6 bytes or less.
  Fix for ticket [ba2f4585cf495231]


type: t
user: drh
brief: Closed ticket [18ab5da2c05ad57d|18ab5da2c0].
comment:
  Closed ticket [18ab5da2c05ad57d|18ab5da2c0]: <i>Issue with DISTINCT and COLLATE</i> plus 7 other changes


type: ci
user: dan
comment:
  When using an index for both DISTINCT and ORDER BY, do not confuse the number of columns required for distinctness with the number required to get the correct sort order. Fix for [6749cb3c].


type: t
user: drh
brief: Fixed ticket [ba2f4585cf495231|ba2f4585cf].
comment:
  Fixed ticket [ba2f4585cf495231|ba2f4585cf]: <i>Query with ORDER BY results in &quot;database disk image is malformed&quot; error</i> plus 6 other changes


type: t
user: mrigger
brief: New ticket [ccbe5759fbd63b11|ccbe5759fb].
comment:
  New ticket [ccbe5759fbd63b11|ccbe5759fb] <i>ANALYZE causes DISTINCT to malfunction in CROSS JOIN</i>.


type: t
user: dan
brief: Closed ticket [ccbe5759fbd63b11|ccbe5759fb].
comment:
  Closed ticket [ccbe5759fbd63b11|ccbe5759fb]: <i>ANALYZE causes DISTINCT to malfunction in CROSS JOIN</i> plus 5 other changes


type: t
user: mrigger
brief: New ticket [ced41c7c7d6b4d36|ced41c7c7d].
comment:
  New ticket [ced41c7c7d6b4d36|ced41c7c7d] <i>Query with DISTINCT does not fetch all distinct rows</i>.


type: ci
user: drh
comment:
  Improved fix for ticket [ced41c7c7d6b4d36] that keeps skip-scan enabled,
  but avoids identifying a skip-scan as order-distinct (because it is not)
  and thus forces a separate b-tree to implement the DISTINCT clause of a
  query.  This undoes check-in [a871d69c6de65038] and substitutes a new fix.


type: t
user: drh
brief: Fixed ticket [ced41c7c7d6b4d36|ced41c7c7d].
comment:
  Fixed ticket [ced41c7c7d6b4d36|ced41c7c7d]: <i>Query with DISTINCT does not fetch all distinct rows</i> plus 6 other changes


type: ci
user: dan
comment:
  Update "releasetest_data.tcl" so that it is a standalone script that generates sh or batch scripts to run each tcl test run at release time. Update wapptest.tcl to use it.


type: ci
user: dan
comment:
  Fix a problem in ALTER TABLE triggered by views or triggers that include the construction "ORDER BY true" or "ORDER BY false".


type: ci
user: dan
comment:
  If a query like "SELECT min(a), b FROM t1" visits no rows where "a" is not null, extract a value for "b" from one of the rows where "a" is null. Possible fix for ticket [41866dc37].


type: ci
user: dan
comment:
  If a query like "SELECT min(a), b FROM t1" visits no rows where "a" is not null, extract a value for "b" from one of the rows where "a" is null. Fix for ticket [41866dc37].


type: t
user: dan
brief: Closed ticket [41866dc37389d88f|41866dc373].
comment:
  Closed ticket [41866dc37389d88f|41866dc373]: <i>MIN() malfunctions for UNIQUE column</i> plus 6 other changes


type: ci
user: drh
comment:
  Give the SQLITE_TESTCTRL_PRNG_SEED two arguments.  The second argument if not
  NULL is a pointer to a database connection which seeds the connection from
  its schema cookie.  In this way, fuzzers can control the PRNG seed.


type: t
user: mrigger
brief: New ticket [71e183cab6c0444a|71e183cab6].
comment:
  New ticket [71e183cab6c0444a|71e183cab6] <i>MIN() malfunctions for a query with ISNULL condition</i>.


type: ci
user: drh
comment:
  Add the SQLITE_TESTCTRL_PRNG_SEED which can control the PRNG seed either
  directly or through the schema cookie of a supplied database connection.


type: ci
user: drh
comment:
  In the ".wheretrace 0x100" debugging mode, show the structure of the
  main parameters to sqlite3WhereBegin() calls.


type: t
user: dan
brief: Ticket [71e183cab6c0444a|71e183cab6]: 6 changes
comment:
  Ticket [71e183cab6c0444a|71e183cab6] <i>MIN() malfunctions for a query with ISNULL condition</i> status still Open with 6 other changes


type: t
user: drh
brief: Ticket [71e183cab6c0444a|71e183cab6]: 4 changes
comment:
  Ticket [71e183cab6c0444a|71e183cab6] <i>MIN() malfunctions for a query with ISNULL condition</i> status still Open with 4 other changes


type: ci
user: dan
comment:
  Fix a problem with queries of the form "SELECT min(<expr>) ... WHERE <expr>=?" where there is an index on <expr>. Fix for [71e183ca].


type: t
user: dan
brief: Closed ticket [71e183cab6c0444a|71e183cab6].
comment:
  Closed ticket [71e183cab6c0444a|71e183cab6]: <i>MIN() malfunctions for a query with ISNULL condition</i> plus 4 other changes


type: ci
user: dan
comment:
  Prevent an fts5 table from being its own content table, or part of a view that is the content table.


type: ci
user: dan
comment:
  Fix a problem with renaming a table when a view or trigger within the schema uses a FILTER with an aggregate function that is not currently registered with the database.


type: t
user: drh
brief: Fixed ticket [d52a29a9e6bc55c5|d52a29a9e6].
comment:
  Fixed ticket [d52a29a9e6bc55c5|d52a29a9e6]: <i>Unexpected affinity conversion in view</i> plus 8 other changes


type: ci
user: drh
comment:
  Refactor field Expr.affinity into Expr.affExpr to avoid confusion with other
  fields and variables named "affinity" and display affExpr it in
  sqlite3TreeViewExpr() output.


type: ci
user: drh
comment:
  One of two options on how to address ticket [61c853857f40da49].  In this
  mode, we back out the documentation change of
  [https://www.sqlite.org/docsrc/info/07b7749da88d54e5|&#91;07b7749da88d54e5&#93;]
  and change the core to work as it has been documented to work since 2017,
  rather than how it has actually worked since 2009.


type: ci
user: drh
comment:
  The second option for [61c853857f40da49]:  In this mode, columns of VIEWs
  and subqueries that are formed by expressions have affinity BLOB rather than
  affinity none, as has usually been the case for a while.  But this mode fixes
  a couple of corner cases involving query flattening and the push-down
  optimization where that rule was violated.


type: t
user: drh
brief: Ticket [d52a29a9e6bc55c5|d52a29a9e6]: 4 changes
comment:
  Ticket [d52a29a9e6bc55c5|d52a29a9e6] <i>Unexpected affinity conversion in view</i> status still Fixed with 4 other changes


type: ci
user: dan
ecomment:
  Ensure that columns of views and sub-queries that are expressions with no affinity are not assigned BLOB affinity. This matches the documentation. Fix for [61c853857f40da49].  (On a branch because there are still subtle issues.)

comment:
  Ensure that columns of views and sub-queries that are expressions with no affinity are not assigned BLOB affinity. This matches the documentation. Fix for [61c853857f40da49].


type: ci
user: drh
comment:
  Use 0x40 (ASCII '@') instead of 0x00 to mean "no affinity" so that columns
  with no affinity can appear in a zero-terminated string.  Use the new
  SQLITE_AFF_NONE macro for this new magic number.


type: g
user: drh
comment:
  Edit [e15a0977ddfad3d0|e15a0977dd]: Move to branch [/timeline?r=pending&nd&dp=e15a0977ddfad3d0&unhide | pending]. Edit check-in comment.


type: ci
user: dan
comment:
  Fix a bug causing "no such table" and other similar sqlite3_prepare*() errors to return SQLITE_SCHEMA instead of SQLITE_ERROR in shared-schema mode when there is an attached database for which the schema has never been loaded.


type: ci
user: drh
comment:
  Ensure that columns of views and sub-queries that are expressions with 
  no affinity are comparied without any type conversions, as required in the
  documentation.  Tickets [61c853857f40da49] and [d52a29a9e6bc55c5].


