# event

type: ci
user: drh
comment:
  Return a suitable error message if the mode= argument to a URI specifies
  a higher mode than what is allowed by context.  Other minor cleanups for
  the URI parsing logic.


type: ci
bgcolor: #ffc0d0
user: drh
comment:
  Provide the ability to specify an alternative mutex subsystem at
  compile-time.

ecomment:
  Provide the ability to specify an alternative mutex subsystem at 
  compile-time.  -  This check-in should have gone on the trunk, not
  on the 3.7.6 branch.


type: g
user: dan
comment:
  Tag changes on [/timeline?dp=bb59f9862da45d25&n=4 | bb59f9862da45d25]: Add propagating bgcolor=#e0e0e0.


type: ci
user: dan
comment:
  Have flags passed to sqlite3_open_v2() apply to the main and any attached databases. And change things so that any "mode=xxx" or "cache=xxx" options specified as part of a URI for the main database do not also apply to attached databases.


type: ci
bgcolor: #c0c0c0
user: dan
comment:
  Only open a read-only connection to shared-memory if the "readonly_shm=1" option is specified as part of the database file URI (and if a read-write connection fails).


type: ci
user: drh
comment:
  Improvements to documentation hyperlinks.  Change the value of
  SQLITE_OPEN_URI to an unreserved value.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=bb59f9862da45d25&n=4 | bb59f9862da45d25]: Add propagating bgcolor=#c0c0c0.


type: ci
bgcolor: #95b28e
user: drh
comment:
  Pull in the patches to support read-only WAL databases into a new branch
  off of the apple-osx branch.  This also pulls in all the other pending
  3.7.7 changes such as URI support.


type: ci
bgcolor: #ffc0d0
user: drh
ecomment:
  Rather than document goofy behavior, it seems better to make the behavior
  less goofy.  (Was: <i>
  Updates to the sqlite3_last_insert_rowid() documentation - to make it clear
  that the function does not work for virtual tables.</i>)

comment:
  Updates to the sqlite3_last_insert_rowid() documentation - to make it clear
  that the function does not work for virtual tables.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=f88dfac383fca828&n=4 | f88dfac383fca828]: Add propagating branch=mistake. Add propagating symbolic tag "mistake". Add bgcolor=#ffc0d0. Add closed. Add comment. Cancel symbolic tag "trunk".


type: ci
user: drh
comment:
  Make arrangements so that virtual table inserts into shadow tables do
  not modify the sqlite3_last_insert_rowid() return.  Document that this
  is how sqlite3_last_insert_rowid() works.


type: ci
user: drh
comment:
  Enhance WAL mode so that the WAL file honors the journal size limit set
  by PRAGMA journal_size_limit.


type: ci
user: drh
comment:
  Avoid exceeding array bounds when reading a corrupt database file in
  autovacuum mode.  Fixes a problem discovered by John Regehr and Peng Li
  using a customized clang compiler.


type: ci
user: dan
comment:
  Add extended return code SQLITE_CORRUPT_VTAB. Returned when the tcontents of the sqlite tables used internally by a virtual table module are invalid or inconsistent.


type: ci
user: drh
comment:
  Add the ability to limit filenames to 8+3 using the
  SQLITE_ENABLE_8_3_NAMES compile-time option together with a URI
  parameter of "8_3_names=1".


type: ci
user: shaneh
comment:
  Update multiplex VFS to handle empty filenames which can occur for during vacuuming (temp file names.)


type: ci
user: drh
comment:
  Enable URI filenames in the command-line shell.  Add a check to the
  beginning of the shell to make sure it is compiled with the same
  SQLite source and header.


type: ci
user: drh
comment:
  When committing a WAL transaction, make sure at least one page is
  written to the WAL file so that the WAL subsystem will have a page
  on which to set the commit flag.
  Ticket [2d1a5c67dfc236].


type: ci
bgcolor: #80bbd6
user: drh
ecomment:
  Backport the [67bf1c9a88] fix for vanishing WAL transactions due to small
  cache spillage.  Ticket [2d1a5c67dfc236].  Also bump the version number
  to 3.7.6.3 in preparation for patch release.

comment:
  Backport the [67bf1c9a88] fix for vanishing WAL transactions due to small
  cache spillage.  Ticket [2d1a5c67dfc236].  Also bump the version number
  to 3.7.6.3 in preparation for patch release.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=489c453d4ebb0358&n=4 | 489c453d4ebb0358]: Add propagating bgcolor=#ffc0d0. Add propagating branch=mistake. Add propagating symbolic tag "mistake". Add closed. Add comment. Cancel symbolic tag "branch-3.7.6".


type: ci
user: drh
comment:
  Pull all the latest trunk changes, and especially the fix for WAL cache
  spills causing transactions to disappear, into the apple-osx branch.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=e4d0f7ace83370e9&n=4 | e4d0f7ace83370e9]: Add propagating bgcolor=#80bbd6. Add comment.


type: ci
bgcolor: #95b28e
user: drh
comment:
  Bring the apple-wal-readonly branch up to date with the latest changes
  in apple-osx, and especially the fix for disappearing WAL transactions.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Merge all the latest trunk changes into the sessions branch, especially
  the disappearing WAL transaction fix.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=ed1da510a239ea76&n=4 | ed1da510a239ea76]: Add bgcolor=#ffc0ff. Add comment. Add symbolic tag "release".


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=ed1da510a239ea76&n=4 | ed1da510a239ea76]: Add symbolic tag "version-3.7.6.3".


type: ci
user: drh
comment:
  Minor cleanups to the header comments on various test_*.c file, to make
  the suitable for programmer-level documentation.


type: ci
bgcolor: #a8d3c0
user: dan
comment:
  If the fts4 option prefix=1 is specified, have the fts4 module maintain an index of prefixes as well as terms.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=b5bdc639898ee22e&n=4 | b5bdc639898ee22e]: Add propagating bgcolor=#a8d3c0.


type: ci
user: drh
comment:
  Do not invoke the xRollbackTo or xRelease methods of a virtual table without
  having first invoked an appropriate xSavepoint method.  Add assert() statements
  to FTS3/4 to verify that this is happening in all cases.


type: ci
bgcolor: #a8d3c0
user: dan
comment:
  Change fts4 so that the prefix= parameter is passes a comma-separated list of integers. For each integer N, a separate index of all prefixes of length N bytes is created.


type: ci
user: dan
comment:
  Fix a case where a malloc() error could lead to mismatched virtual-table xBegin/xCommit/xRollback callbacks.


type: ci
bgcolor: #a8d3c0
user: dan
comment:
  If a prefix index of size N is not present, use a prefix index of size N+1 along with the terms index for queries for prefixes of length N.


type: ci
user: drh
comment:
  Make sure the P5 argument to the OP_VUpdate opcode is always set to a
  valid conflict resolution code.


type: ci
user: drh
comment:
  Update the documentation to state that any parameter that is optimized out
  of a prepared statement becomes an anonymous parameter for which
  sqlite3_bind_parameter_name() returns NULL.


type: ci
user: drh
comment:
  Fix a problem in the sqlite3TestErrorName() function (used only for testing)
  that appears to have originated from a bad merge.


type: ci
bgcolor: #8ea7b2
user: drh
ecomment:
  Toward version 3.7.5.1.  This check-in updates the version number and also
  patches the pager so that it never spills cache while in WAL mode.  The
  latter patch fixes ticket [2d1a5c67dfc23] and also prevents excessive WAL
  file sizes if the pager cache starts thrashing.  A few test cases fail.

comment:
  Toward version 3.7.5.1.  This check-in updates the version number and also
  patches the pager so that it never spills cache while in WAL mode.  The
  latter patch fixes ticket [2d1a5c67dfc23] and also prevents excessive WAL
  file sizes if the pager cache starts thrashing.  A few test cases fail.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=2e5a912ad781f755&n=4 | 2e5a912ad781f755]: Add propagating bgcolor=#8ea7b2. Add comment.


type: ci
bgcolor: #c0c0c0
user: drh
comment:
  Simplify the wal-readonly branch so that it does not require changes to
  anything other than os_unix.c and wal.c and a couple of new error codes.


type: ci
bgcolor: #c0c0c0
user: drh
ecomment:
  Make use of the sqlite3GetBoolean() interface for more robust processing
  of the readonly_shm query parameter inside of unixShmMap().

comment:
  Make use of the sqlite3GetBoolean() interface for more robust processing
  of the readonly_shm query parameter inside of unixShmMap().


type: ci
user: drh
comment:
  Refactor the SQL parameter processing so that parameter names for values
  that are optimized out of the prepare statement are not forgotten.


type: ci
user: drh
comment:
  Merge the read-only shared memory branch into trunk.  After this merge, an
  unprivileged process can open WAL-mode databases owned by another user as
  long as a database connection with write permission exists on the database
  file and if the readonly_shm=1 URI query parameter is supplied.


type: ci
user: drh
comment:
  Merge the latest trunk changes, including the read-only shared memory
  enhancement, into the apple-osx branch.


type: ci
bgcolor: #a8d3c0
user: dan
comment:
  Changes to improve performance and support LIMIT clauses on fts3 tables. This branch is unstable for now.


type: ci
user: drh
comment:
  Add shell scripts used for testing compiler warnings (tool/warnings.sh),
  for verifying that the library exports the correct symbols (tool/symbols.sh),
  and to demonstrate building a full-featured command-line shell
  (tool/build-shell.sh).


type: ci
bgcolor: #a8d3c0
user: dan
comment:
  FTS changes: Remove unreachable code. Fix bugs. When processing a large doclist incrementally, read from disk incrementally too.


type: ci
user: drh
comment:
  Create and use a function especially for adding the ParseSchema opcode.
  This gives a small reduction in code and a small performance increase.


type: ci
user: drh
comment:
  Performance improvements on memory copies inside of btree by moving 2 bytes
  at a time instead of just 1 byte at a time.


type: ci
bgcolor: #a8d3c0
user: dan
comment:
  Allow the "order=DESC" and "order=ASC" parameters in FTS4 "CREATE VIRTUAL TABLE" statements. Tables created with "order=DESC" store all doclists in descending order, which allows optimizations normally applied to "ORDER BY docid ASC" queries to be used with "ORDER BY docid DESC" queries instead.


type: ci
user: drh
comment:
  Add assert() statements to verify that u16 pointers associated with
  the enhancement in [897f56a158] are always 2-byte aligned.


type: ci
bgcolor: #a8d3c0
user: dan
comment:
  Modify fts3rnd.test to run tests for both "ORDER BY docid ASC" and "ORDER BY docid DESC" with both order=ASC and order=DESC FTS tables. Fixes for some bugs found.


type: ci
user: dan
comment:
  Fix a line in pcache1.c where a global data structure is accessed without using the GLOBAL() macro. This causes a subtle malfunction on test systems that use SQLITE_OMIT_WSD.


type: ci
user: dan
comment:
  Fix minor problems with foreign key constraints where the parent table is the same as the child table.


type: ci
user: dan
comment:
  When updating a field that requires foreign key constraints be checked, ensure that the indexes and tables are consistent when the FK logic is run. Otherwise, it may detect the inconsistency and report database corruption.


type: ci
user: drh
comment:
  Use only unsigned values in the implementatin of LIKE and GLOB so that
  values won't overflow to negative when dealing with malformed UTF8.


type: ci
bgcolor: #ffc0d0
user: dan
comment:
  Add an interface to better test incremental loading of doclists by FTS4. Also some tests for this and term prefix queries.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=7a3813138d1a5c5d&n=4 | 7a3813138d1a5c5d]: Add propagating bgcolor=#ffc0d0. Add propagating branch=broken-build. Add propagating symbolic tag "broken-build". Cancel symbolic tag "trunk".


type: ci
user: drh
comment:
  Merge the improved incremental doclist loading test from the
  broken-build branch (which is now fixed) into trunk.


type: ci
user: drh
comment:
  Changes to #ifdefs so that the build goes correctly if the only FTS macro
  defined is SQLITE_ENABLE_FTS4.


type: ci
user: drh
comment:
  Do not run test tkt-2d1a5c67d.test in the inmemory_journal permutation
  since that test requires WAL mode which does not work with inmemory_journal.


type: ci
user: dan
comment:
  Fix a problem where FTS test code was not being included in the testfixture build when SQLITE_ENABLE_FTS4 was defined.


type: ci
user: shaneh
ecomment:
  Update a couple test scripts to account for more floating point display variation in Windows-based versions of TCL.

comment:
  Update a couple test scripts to account for more floating point variation under various Windows-based versions of TCL.
  Update a couple test scripts to account for more floating point display variation in Windows-based versions of TCL.


type: ci
user: drh
comment:
  Fix compiler warnings in lemon by removing some of the code added by
  Ryan Gordon in [1e8b842039cc0].


type: ci
user: drh
comment:
  Add a new AWK script in the tool/ folder for converting text files into
  C string literals.  Use it for building sqlite3_analyzer.


type: ci
user: dan
ecomment:
  Fix an error made in the previous commit. The parameters to localtime_s() were accidentally reversed.  Ticket [bd484a090c807].

comment:
  Fix an error made in the previous commit. The parameters to localtime_s() were accidentally reversed.


type: t
user: dan
brief: Ticket [bd484a090c]: 4 changes
comment:
  Ticket [bd484a090c] <i>Date/time functions do not detect failure of localtime_r()</i> status still Open with 4 other changes


type: ci
user: dan
comment: Change the error message returned when localtime_r() fails to "local time unavailable".
ecomment:
  Change the error message returned when localtime_r() fails to "local time unavailable".  Ticket [bd484a090c8077]


type: ci
user: drh
comment:
  Simplifications to the localtime() interface.  Fix the case where
  localtime_r() is available so that it works.  Ticket [bd484a090c8077].


type: ci
user: drh
comment:
  Rework the localtime logic yet again in order to make all branches reachable
  and to follow GNU standards for HAVE_LOCALTIME_R-type macros.
  Ticket [bd484a090c8077].


type: ci
user: dan
comment:
  Initialize a variable introduced as part of the fix for [bd484a090c8077] in order to silence a compiler warning.


type: ci
user: dan
comment:
  Modify the implementation of the test code in test_vfs.c so that test VFS objects may be invoked recursively.


type: ci
user: drh
comment:
  Provide the SQLITE_MAX_SCHEMA_RETRY compile-time parameter for adjusting the
  number of reparse attempts after a schema change.


type: ci
user: drh
comment:
  Do not do affinity transformations on inserts into an index for the
  manifestation of a view or subquery.  Fix for ticket [91e2e8ba6ff2e2].


type: t
user: drh
brief: Fixed ticket [91e2e8ba6f].
comment:
  Fixed ticket [91e2e8ba6f]: <i>Automatic indices cause undesirable type conversions</i> plus 2 other changes


type: ci
user: drh
comment:
  Add a bit to the SQLITE_TESTCTRL_OPTIMIZATIONS setting that will disable
  affinity when writing to any index, regardless of whether or not the index
  is on a manifestation of a view.  This allows better testing of the fix
  for ticket [91e2e8ba6ff2e2].


type: g
user: dan
comment:
  Tag changes on [/timeline?dp=8230d83120e0f4d2&n=4 | 8230d83120e0f4d2]: Add propagating bgcolor=#e0e0e0.


type: g
user: dan
comment:
  Tag changes on [/timeline?dp=4374b7e83ea0a3fb&n=4 | 4374b7e83ea0a3fb]: Add comment. Add symbolic tag "release".


type: g
user: dan
comment:
  Tag changes on [/timeline?dp=4374b7e83ea0a3fb&n=4 | 4374b7e83ea0a3fb]: Add bgcolor=#d0c0ff. Add symbolic tag "version-3.7.7".


type: ci
user: dan
comment:
  Explicitly cast an argument to printf() to (int), in case the result of the pointer arithmetic expression is a 64-bit integer on some platforms.


type: ci
user: mistachkin
comment:
  Support using nmake via cmd.exe, allow Tcl related variables to be overridden via the environment, and add 'dll' to the 'all' target.


type: ci
user: drh
comment:
  Modifications to the "like.test" script in order to expose the problem
  reported by ticket [25ee81271091ec27a8c5].


type: ci
user: drh
comment:
  Make sure all new statements begin life unexpired, even if they registered
  functions or did other actions during preparation that would have expired
  all statements.  Fix for ticket [25ee81271091]


type: ci
user: dan
comment:
  Add a case to permutations.test to run the veryquick test suite using sqlite3_prepare() instead of sqlite3_prepare_v2(). This helps to test the fix for bug [25ee812710].


type: ci
bgcolor: #80bbd6
user: drh
comment:
  Create a branch that contains just the fix for the case_sensitive_like
  pragma bug, ticket [25ee81271091ec].


type: g
user: dan
comment:
  Tag changes on [/timeline?dp=af0d91adf497f5f3&n=4 | af0d91adf497f5f3]: Add bgcolor=#d0c0ff. Add comment. Add symbolic tag "release".


type: g
user: dan
comment:
  Tag changes on [/timeline?dp=af0d91adf497f5f3&n=4 | af0d91adf497f5f3]: Add symbolic tag "version-3.7.7.1".


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=de8ad5f8176d5573&n=4 | de8ad5f8176d5573]: Add symbolic tag "version-3.7.7.1".


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=de8ad5f8176d5573&n=4 | de8ad5f8176d5573]: Cancel symbolic tag "release". Cancel symbolic tag "version-3.7.7.1".


type: ci
user: drh
comment:
  Ignore the database name on the target table when parsing a CREATE TABLE
  statement out of the sqlite_master table.  This is a fix for
  ticket [d6ddba6706353] that preserves backwards compatibility.


type: g
user: dan
comment:
  Tag changes on [/timeline?dp=f7ba0219ef2f2355&n=4 | f7ba0219ef2f2355]: Add propagating bgcolor=#c0ffc0.


type: g
user: dan
comment:
  Tag changes on [/timeline?dp=f7ba0219ef2f2355&n=4 | f7ba0219ef2f2355]: Add propagating bgcolor=#c0f0ff.


type: ci
user: dan
comment:
  Add a target to main.mk that will fail if the amalgamation contains any exported symbols that do not begin with "sqlite3_". Run this target from within releasetest.tcl. Add "static" to a couple of private functions in mem3.c.


type: t
user: dan
brief: New ticket [54844eea3f].
comment:
  New ticket [54844eea3f] <i>Incorrect caching of sub-query results in the FROM clause of a scalar sub-query.</i>.


type: t
user: dan
brief: Ticket [54844eea3f]: 3 changes
comment:
  Ticket [54844eea3f] <i>Incorrect caching of sub-query results in the FROM clause of a scalar sub-query.</i> status still Open with 3 other changes


type: ci
user: drh
comment:
  Change the default chunk size on test_multiplex.c to 2147418112 bytes
  (formerly 1073741824 bytes) and make the default configurable at compile-time
  using SQLITE_MULTIPLEX_CHUNK_SIZE and at run-time using the "chunksize"
  URI query parameter.  Add support fo test_multiplex to the shell.


type: t
user: drh
brief: Ticket [54844eea3f]: 1 change
comment:
  Ticket [54844eea3f] <i>Incorrect caching of sub-query results in the FROM clause of a scalar sub-query.</i> status still Open with 1 other change


type: ci
user: drh
comment:
  In where.c::findIndexCol - make sure that the Expr.op is TK_COLUMN before
  accessing the Expr.iColumn and Expr.iTable fields.  Also fix a couple of
  unreachable branches.


type: ci
bgcolor: #c0ffc0
user: drh
ecomment:
  Here is an attempted enhancement to the query planner that didn't work out.
  But it seems good to save this change for historical reference, even if it
  does not belong on the trunk.

comment:
  Here is an attempted enhancement to the query planner that didn't work out.
  But it seems good to save this change for historical reference, even if it
  does not belong on the trunk.


type: ci
user: drh
ecomment:
  Change the windows backend to retry read and write requests if the encounter
  ERROR_LOCK_VIOLATION and ERROR_SHARING_VIOLATION errors - which we think
  sometimes happens due to aggressive anti-virus software.

comment:
  Change the windows backend to retry read and write requests if the encounter
  ERROR_LOCK_VIOLATION and ERROR_SHARING_VIOLATION errors - which we think
  sometimes happens due to agressive anti-virus software.


type: ci
user: drh
comment:
  Update the TCL commands for setting windows manditory locks.
  Add test cases for manditory lock delays under windows.


type: ci
bgcolor: #d0c0ff
user: drh
ecomment:
  Update the anti-virus retry logic for DeleteFile().  Invoke sqlite3_log()
  for each anti-virus retry.  Make the retry delay configurable at
  compile-time.

comment:
  Update the anti-virus retry logic for DeleteFile().  Invoke sqlite3_log()
  for each anti-virus retry.  Make the retry delay configurable at
  compile-time.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=89f1848d7f7d98b4&n=4 | 89f1848d7f7d98b4]: Add propagating bgcolor=#d0c0ff. Add propagating branch=av-defense. Add propagating symbolic tag "av-defense". Add comment. Cancel symbolic tag "trunk".


type: g
user: dan
comment:
  Tag changes on [/timeline?dp=30dbf0feab032325&n=4 | 30dbf0feab032325]: Add propagating bgcolor=#c0ffc0.


type: ci
bgcolor: #b1d3a8
user: dan
comment:
  Add the xFilter callback to the sqlite3changeset_apply() function. This callback allows the application to accept or reject changes on a per-table basis when applying a changeset.


type: ci
user: drh
comment:
  Added the SQLITE_FCNTL_WIN32_AV_RETRY file control for configuring the
  retry counts and delays in the windows VFS.


type: ci
user: drh
comment:
  Do not try to use STAT2 to refine the row estimate of a query that
  uses a unique or nearly-unique index.


type: ci
user: drh
comment:
  Cherrypicked from trunk:  Do not try to use STAT2 for row estimates if the
  index is unique or nearly so.


type: t
user: anonymous
brief: New ticket [534aa198e1].
comment:
  New ticket [534aa198e1] <i>Build error: missing manifest.uuid file in 3.7.4 downloadable source code</i>.


type: t
user: drh
brief: Closed ticket [534aa198e1].
comment:
  Closed ticket [534aa198e1]: <i>Build error: missing manifest.uuid file in 3.7.4 downloadable source code</i> plus 3 other changes


type: ci
bgcolor: #b1d3a8
user: dan
comment:
  Note in the documentation that when iterating through a changeset, all changes to a single table are grouped together. Also add the sqlite3session_isempty() function.


type: ci
bgcolor: #b1d3a8
user: dan
comment:
  Fix the sqlite3session_isempty() method so that it returns, as documented, non-zero when no changes have been recorded by the session object.


type: ci
user: drh
comment:
  Formatting changes on the multiplexor code - make sure no lines exceed 80
  characters.  No logical changes.


type: ci
user: drh
comment:
  When the multiplexor opens an auxiliary file, it now persists the name of that
  file until it is closed, as it should.  Remove the limit on the number of
  auxiliary files used by the multiplexor.


type: ci
user: drh
comment:
  For an existing multiplexed database, try to set the chunk size automatically
  based on the sizes of the preexisting pieces.


type: ci
user: drh
comment:
  Compile with the SQLITE_ENABLE_8_3_NAME macro set to 2 to force 8+3 filenames
  to be on all the time.


type: ci
bgcolor: #d0c0ff
user: drh
ecomment:
  Add retry logic for AV defense to winAccess().  Also allow OS tracing to be
  enabled by a compile-time option.

comment:
  Add retry logic for AV defense to winAccess().  Also allow OS tracing to be
  enabled by a compile-time option.


type: ci
user: drh
comment:
  Prototype change for a new sqlite3_file_control() that will cause the
  -wal and -shm files to persist after the last database connection closes.


type: ci
user: mistachkin
comment:
  Remove redundant sub-expression from retry loop invariant in winAccess.  Also, make check for SQLITE_ACCESS_READWRITE formally correct.


type: ci
user: mistachkin
comment:
  Merge changes for the new sqlite3_file_control() that will cause the -wal and -shm files to persist after the last database connection closes.


type: t
user: drh
brief: Fixed ticket [6c14288a47].
comment:
  Fixed ticket [6c14288a47]: <i>Virtual tables do not handle IS NOT NULL correctly</i> plus 2 other changes


type: ci
user: mistachkin
comment:
  Add retry logic for AV defense to winOpen.  Also, refactor test suite to allow the key Tcl file operations (e.g. copy and delete) to be retried.


type: ci
user: drh
comment:
  Omit backcompat.test from the journaltest permutation because it uses WAL
  mode which is incompatible with journaltest.


type: ci
user: drh
comment:
  Also exclude backcompat.test from inmemory_journal since inmemory_journal
  is not compatible with WAL mode.


type: ci
user: mistachkin
comment:
  Correct subtle timing issues in the win32lock test cases and in the lock_win32_file Tcl command.  Also, eliminate superfluous MSVC compiler warnings.


type: ci
user: drh
comment:
  Update the OP_Move opcode to shift the pScopyFrom pointer of aliases when
  compiled with SQLITE_DEBUG.  Ticket [d63523637517386191].


type: t
user: drh
brief: Fixed ticket [d635236375].
comment:
  Fixed ticket [d635236375]: <i>Assertion fault on a join with a repeated column</i> plus 2 other changes


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Avoid segfaulting on an incremental blob write if SQLITE_ENABLE_PREUPDATE_HOOK
  set but no pre-update hooks are defined.


type: ci
user: drh
comment:
  Merge the winopen-retry-logic branch into trunk.  The biggest change here
  is to test scripts, which should now use such as copy_file and
  delete_file from tester.tcl rather than the raw file commands of TCL.


type: ci
bgcolor: #c0ffc0
user: dan
comment:
  Change to using packed-memory-arrays instead of b-trees when performing an offline merge-sort for CREATE INDEX. This makes it easier to control the number of disc seeks required when merging.


type: ci
user: drh
ecomment:
  Add a column to the sqlite_stat2 table that contains the number of entries
  with exactly the same key as the sample.  We do not yet do anything with this
  extra value.  Some tests in analyze2.test are failing.

comment:
  Add a column to the sqlite_stat2 table that contains the number of entries
  with exactly the same key as the sample.  We do not yet do anything with this
  extra value.  Some tests in analyze2.test are failing.


type: ci
user: drh
comment:
  Fix a compiler warning when STAT2 is off.  More test cases.  Fix legacy tests
  to deal with the new STAT2 logic.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=eb434228277c4bbb&n=4 | eb434228277c4bbb]: Add propagating branch=query-planner-tweaks. Add propagating symbolic tag "query-planner-tweaks". Add comment. Cancel symbolic tag "trunk".


type: ci
bgcolor: #c0ffc0
user: dan
comment:
  In temp files used for merge sorting, store the size of each packed-memory-array at the start of the array itself. This is to avoid having to store the offsets of all arrays in the (potentially very large) file in main-memory.


type: ci
user: drh
comment:
  The sqlite_stat2.cnt field is parsed if it is present.  But it is not yet
  used.  A large comment added to analyze.c to explain the format of the
  ANALYZE system tables.


type: ci
user: drh
ecomment:
  Add code to actually use the sqlite_stat2.cnt field in the query planner.
  This changes some plans resulting in a few failures in analyze5.test.

comment:
  Add code to actually use the sqlite_stat2.cnt field in the query planner.
  This changes some plans resulting in a few failures in analyze5.test.


type: ci
user: drh
comment:
  In os_unix.c, do not open the directory containing the database file when
  the database file is opened.  Instead, wait until time to fsync() the
  directory.  And do not report an error if the open fails, since some
  systems (Ex: AIX and a chromium sandbox) are unable to open and fsync
  directories.


type: ci
user: drh
comment:
  Add command-line utilities "offsets.c" and "extract.c" for use in
  low-level analyzsis of database files.


type: ci
user: drh
comment:
  Make the openDirectory routine in os_unix.c overrideable so that it can
  be turned into a harmless no-op for the chromium sandbox.


type: ci
user: drh
comment:
  Begin a branch that experimentally replaces sqlite_stat2 with a new table
  called sqlite_stat3 that will hopefully facilitate better query
  planning decisions.


type: ci
bgcolor: #c0ffc0
user: dan
comment:
  Remove an unused parameter from a function in vdbesort.c. Fix some comments and other details in the same file.


type: ci
user: drh
comment:
  The ANALYZE command picks for 15 samples for sqlite_stat3 with the largest
  nEq fields, plus 5 other evenly spaced samples.


type: ci
user: drh
comment:
  Fix the header comment on the implementation of the
  file_control_sizehint_test TCL command in test1.c.


type: ci
user: drh
comment:
  Add the sqlite_stat3.nDLT field.  Use an linear congruence PRNG to choose
  which samples to select from among those with the same nEq field.


type: ci
user: drh
comment:
  Further testing and bug fixing for sqlite_stat3.  Added the Index.avgEq
  field to index statistics.  Fixed several problems in the query planner
  associated with stat3.


type: ci
user: drh
comment:
  New makefile target "sqlite3-debug.c" builds an amalgamation that include
  appropriate "#line" macros relating the code back to the original source
  files.


type: ci
user: dan
comment:
  When opening a temporary file to use in a merge-sort, pass SQLITE_OPEN_TEMP_JOURNAL instead of SQLITE_OPEN_TEMP_DB. This is a better fit, as merge-sort files are written and read sequentially like journal files.


type: ci
user: drh
comment:
  Allow the sqlite3VdbeJumpHere() routine to accept a negative or zero address
  if a prior memory allocation error has occurred.  The new sqlite_stat3 logic
  needs this.


type: ci
user: drh
comment:
  Fix a few harmless compiler warnings.  Add SQLITE_ENABLE_STAT3 to the
  standard compiler warning script.


type: ci
user: drh
comment:
  Use OP_Sort rather than OP_Rewind in order to sort the content of a new
  index on the CREATE INDEX statement.  Add an ALWAYS() to the merge sort
  logic to document an unreachable branch.


type: ci
user: drh
ecomment:
  Fix the stat3 analysis loader to be compatible with sqlite3_db_status().
  Also fix some OOM issues with the stat3 analysis loader.

comment:
  Fix the stat3 analysis loader to be compatible with sqlite3_db_status().
  Also fix some OOM issues with the stat3 analysis loader.


type: ci
user: dan
comment:
  Ensure that the Tcl "db onecolumn" command returns an empty string if the SELECT statement returns zero rows.


type: ci
user: drh
comment:
  When retrying a write() after an EINTR error on unix, be sure to also
  rerun the previous lseek().  Ticket [e59bdf6116036a]


type: ci
user: dan
comment:
  Experimental change: If SQLITE_PAGECACHE_BLOCKALLOC is defined, instead of allocating pages one at a time, allocate blocks of between 15 and 63 pages in a single allocation.


type: t
user: dan
brief: Ticket [b1d3a2e531]: 3 changes
comment:
  Ticket [b1d3a2e531] <i>Erroneous FK constraint failure when dropping table.</i> status still Closed with 3 other changes


type: t
user: dan
brief: Ticket [b1d3a2e531]: 1 change
comment:
  Ticket [b1d3a2e531] <i>Erroneous FK constraint failure when dropping table.</i> status still Closed with 1 other change


type: t
user: dan
brief: Closed ticket [b1d3a2e531].
comment:
  Closed ticket [b1d3a2e531]: <i>Erroneous FK constraint failure when dropping table.</i> plus 1 other change


type: ci
user: dan
ecomment:
  Change to test instrumentation of os_unix.c: Regard IO errors that occur within SQLITE_FCNTL_SIZE_HINT requests as benign.  (This check-in was intended for trunk
  and went onto the branch accidentally.)

comment:
  Change to test instrumentation of os_unix.c: Regard IO errors that occur within SQLITE_FCNTL_SIZE_HINT requests as benign.


type: t
user: dan
brief: New ticket [af95b8c609].
comment:
  New ticket [af95b8c609] <i>Vacuuming a WAL database resets the file header read and write versions to 1.</i>.


type: ci
user: dan
comment:
  When copying a rollback mode database over a WAL database using the backup API, leave the destination database in WAL mode (instead of switching it to rollback mode). Fix for [af95b8c609].


type: t
user: dan
brief: Closed ticket [b1d3a2e531].
comment:
  Closed ticket [b1d3a2e531]: <i>Erroneous FK constraint failure when dropping table.</i> plus 2 other changes


type: ci
user: drh
comment:
  If the application-defined openDirectory() function returns SQLITE_CANTOPEN,
  then silently ignore the error.  This allows the chromium sandbox to disallow
  opening of directories without causing errors.


type: ci
user: dan
comment:
  Have the "crash" VFS used by the tcl tests (test6.c) handle SQLITE_FCNTL_SIZE_HINT internally, instead of passing it directly through to the underlying VFS. This is important if the crash VFS is simulating non-default device characteristics such as SQLITE_DEVCAP_SEQUENTIAL or ATOMIC.


type: ci
user: drh
comment:
  Simplifications to the SQLITE_PAGECACHE_BLOCKALLOC logic.  Reduce the number
  of difficult-to-reach branches.


type: ci
user: drh
comment:
  Changes to test_quota.c to make quota groups persistent even after files
  are closed.  Files remain a part of the quota group until they are
  deleted.


type: ci
user: drh
comment:
  Cherrypick the [d4f6437f8d] change so that SQLITE_FCNTL_SIZE_HINT is always
  honored and never undone by memory pressure on windows.


type: ci
user: mistachkin
comment:
  In the MSVC makefile, support several levels of debugging, each one building on the previous.  Also, add comment about the SQLITE_WIN32_MALLOC_VALIDATE macro.


type: ci
user: mistachkin
comment:
  Add comments for the various debug levels.  When debugging, disable optimizations.  Prevent the win32lock tests from spinning forever.


type: ci
user: drh
comment:
  Disable external merge source when SQLITE_TEMP_STORE==3.  Add documentation
  to the OP_OpenSorter opcode.


type: ci
user: dan
comment:
  Replace an assert() that a condition may not occur in backup.c with code to handle that condition, which can occur.


type: ci
user: drh
comment:
  Create a new pager type, PAGER_SORTER, for use in the external merge sort.
  Such pagers are always held in memory but do report when they are under
  memory pressure by calling pagerStress.


type: ci
user: mistachkin
comment:
  In the MSVC makefile, allow symbols to be enabled without NDEBUG defined.  Also, for the win32lock test, make sure the database is closed prior to shutdown.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=0df04f920b3e6cfe&n=4 | 0df04f920b3e6cfe]: Add propagating branch=stat3-3.7.2. Add propagating symbolic tag "stat3-3.7.2". Add comment.


type: ci
user: drh
comment:
  Get stat3 working after import from trunk-based the stat3-enhancement branch.
  There is still a problem in the wal2 test.


type: ci
user: drh
comment:
  Cherrypick the recursion fix to test_vfs.c from [065e5a5ea4f82].
  Also fix the nan.test module to handle upper/lower case changes in TCL.


type: ci
user: drh
comment:
  Merge the stat3-enhancement branch with trunk, but keep the resulting merge
  in a separate branch for now.


type: ci
user: drh
comment:
  Correctly display P4_ADVANCE values on opcode traces.  Mark an always-taken
  branch in OP_Column as such.


type: ci
user: drh
comment:
  About a 1% overall performance improvement by using a macro to avoid
  no-op calls to sqlite3MemReleaseExternal().


type: ci
user: drh
comment:
  Change the build process so that it does not require the unix "sort"
  command.  This avoids confusion between ms-sort and mingw-sort on
  windows systems.


type: ci
user: drh
comment:
  Add checks to make sure cells in corrupt database files 
  do not overflow a page when doing autovacuum.
  Problem detected by valgrind.


type: ci
user: drh
comment:
  Backslash escaping is not working right in tostr.awk on the latest ubuntu.
  The easiest fix is to simply not use any backslashes in the spaceanal.tcl
  script.


type: ci
user: drh
comment:
  The server1.test script should only run if mutexes are functional.
  Fix to the #ifdef change of check-in [9e6a4c1473].


type: ci
user: drh
comment:
  Add the SQLITE_MAX_SCHEMA_RETRY compile-time option to the set of options
  understood by "PRAGMA compile_options;" and by the 
  "sqlite_compileoption_used()" function.


type: ci
user: drh
comment:
  Formerly, we enabled fdatasync() on linux only.  But now we learn that
  fdatasync() is not supported on Android.  So we disable fdatasync() on
  Linux too.  It can be reenabled at compile-time for those who really need it.


type: ci
user: dan
comment:
  Instead of a temporary b-tree, use a linked-list and merge-sort to sort records in main memory in vdbesort.c.


type: ci
user: dan
comment:
  If all data being sorted fits in memory, avoid writing any data out to temporary files in vdbesort.c.


type: ci
user: drh
comment:
  The build works again with -DSQLITE_OMIT_MERGE_SORT.  The merge-sorter now
  avoids spilling to disk (letting the in-memory linked list grow without
  bound) if PRAGMA temp_store=3.


type: ci
user: drh
comment:
  Performance improvements to the external merge-sorter.  Keep content on an
  in-memory linked lists rather than an ephemeral table prior to spilling to
  disk.  Use the external merge-sorter to implement ORDER BY and GROUP BY
  in addition to CREATE INDEX.


type: t
user: dan
brief: Ticket [56be976859]: 3 changes
comment:
  Ticket [56be976859] <i>Buffer overrun in FTS prefix queries</i> status still Open with 3 other changes


type: ci
user: drh
comment:
  Remove code from vdbesort.c that was made unreachable by the recent
  sqlite3VdbeRecordUnpack() optimizations.


type: ci
user: drh
comment:
  Remove unused parameters from internal routines in vdbesort.c.  This is
  an additional simplification made possible by recent optimizations.


type: ci
user: mistachkin
comment:
  Remove 'const' from a variable that might actually be written when an OOM error occurs. Also, fix a couple MSVC/Win32 compiler warnings.


type: ci
user: drh
ecomment:
  Materialize subqueries using a subroutine and invoke that subroutine
  prior to each use of the materialization.  Fix for
  ticket [002caede898aee4]

comment:
  Materialize subqueries using a subroutine and invoke that subroutine
  prior to each use of the subqueries manifestation.  Fix for
  ticket [002caede898aee4]


type: ci
user: drh
ecomment:
  Add the new OP_Once opcode.  Use it to clean up and simplify various
  one-time initialization sections in the code, including the fix for
  ticket [002caede898ae].

comment:
  Add the new OP_Once opcode.  Use it to clean up and simplify various
  one-time initialization sections in the code, including the fix for
  ticket [002caede898ae].


type: ci
user: drh
comment:
  When analyzing the right-hand side of IN operators to see if the IN operator
  can work with an index, be sure to decend into nested subqueries.
  Fix for ticket [1a1308d2538d7]


type: t
user: drh
brief: Fixed ticket [002caede89].
comment:
  Fixed ticket [002caede89]: <i>LEFT JOIN with OR terms in WHERE clause causes assertion fault</i> plus 2 other changes


type: t
user: drh
brief: Fixed ticket [1a1308d253].
comment:
  Fixed ticket [1a1308d253]: <i>Nested correlated subquery fails when indices used</i> plus 2 other changes


type: ci
user: mistachkin
comment:
  Silence harmless compiler warning about redefinition of the _CRT_SECURE_NO_WARNINGS macro by shell.c.


type: ci
user: mistachkin
comment:
  Fix #if's in winSync to avoid compiler warnings about unused local variables.  Also, update version numbers in the MSVC makefile.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=3e0da808d2f5b4d1&n=4 | 3e0da808d2f5b4d1]: Add bgcolor=#d0c0ff. Add comment. Add date=2011-09-19 18:00:00. Add symbolic tag "version-3.7.8".


type: t
user: rogerb
brief: Ticket [bd484a090c]: 1 change
comment:
  Ticket [bd484a090c] <i>Date/time functions do not detect failure of localtime_r()</i> status still Closed with 1 other change


type: ci
user: drh
comment:
  Minor comment change in the description of the different memory allocator
  options.  No changes to code.


type: ci
user: dan
comment:
  Add SQLITE_STMTSTATUS_CACHE_HIT/MISS and SQLITE_DB_STATUS_CACHE_HIT/MISS. For querying the number of pager cache hits and misses on a statement or connection basis.


type: ci
user: mistachkin
comment:
  Integrate build changes for sqlite3_analyzer into the MSVC makefile.  Also, more cleanup of build files, including sqlite3_analyzer, for all makefiles.


type: g
user: dan
comment:
  Tag changes on [/timeline?dp=646db971885bb7b6&n=4 | 646db971885bb7b6]: Add propagating branch=mistake. Add propagating symbolic tag "mistake". Add bgcolor=#e0e0e0.


type: ci
user: dan
comment:
  Add the SQLITE_DB_STATUS_CACHE_HIT and MISS options. For querying the number of cache hits and misses on a per-connection basis.


type: ci
user: drh
comment:
  Fix an issue in ANALYZE when STAT3 is disabled but both sqlite_stat2 and
  sqlite_stat3 tables exist.  Also add testability tweaks to the STAT3 code.


type: ci
user: drh
comment:
  Add the -DBUILD_sqlite option to the compiler when building testfixture.exe
  using the configure script.


type: t
user: rogerb
brief: New ticket [57c971fc74].
comment:
  New ticket [57c971fc74] <i>Some user defined string functions do not operate correctly on strings with embedded nuls</i>.


type: ci
user: drh
comment:
  Changes to sqlite3_analyzer to try to avoid integer overflow problems 
  when linking against older versions of TCL.


type: t
user: rogerb
brief: New ticket [d1d84037b9].
comment:
  New ticket [d1d84037b9] <i>import doesn't work on attached databases due to unnecessary quoting</i>.


type: t
user: rogerb
brief: Ticket [d1d84037b9]: 3 changes
comment:
  Ticket [d1d84037b9] <i>import doesn't work on attached databases due to unnecessary quoting</i> status still Open with 3 other changes


type: ci
user: drh
comment:
  Enhance the stat VFS to report out the total size of all pages used by
  a table, even if the ZIPVFS compression backend is in play.  Update
  the sqlite3_analyzer logic to use these new outputs.


type: t
user: drh
brief: Fixed ticket [d1d84037b9].
comment:
  Fixed ticket [d1d84037b9]: <i>import doesn't work on attached databases due to unnecessary quoting</i> plus 2 other changes


type: t
user: dan
brief: Ticket [c48d99d690]: 1 change
comment:
  Ticket [c48d99d690] <i>Crash in "INSERT INTO ... SELECT" when "PRAGMA count_changes=1" is configured</i> status still Open with 1 other change


type: t
user: dan
brief: New ticket [c48d99d690].
comment:
  New ticket [c48d99d690] <i>Crash in &quot;INSERT INTO ... SELECT&quot; when &quot;PRAGMA count_changes=1&quot; is configured</i>.


type: t
user: dan
brief: Closed ticket [c48d99d690].
comment:
  Closed ticket [c48d99d690]: <i>Crash in "INSERT INTO ... SELECT" when "PRAGMA count_changes=1" is configured</i> plus 2 other changes


type: t
user: dan
brief: Ticket [c48d99d690]: 3 changes
comment:
  Ticket [c48d99d690] <i>Crash in "INSERT INTO ... SELECT" when "PRAGMA count_changes=1" is configured</i> status still Open with 3 other changes


type: ci
user: dan
comment:
  Add tests to check that modifying the schema of an FTS content table does not cause a crash in the FTS module. Also disable the deferred token optimization for content=xxx FTS tables.


type: ci
user: dan
comment:
  Change FTS4 so that if both the content=xxx option and column names are specified, the virtual table assumes that the named columns correspond to columns of table xxx.


type: ci
user: drh
comment:
  When finding the appropriate file permissions for journal files with
  SQLITE_ENABLE_8_3_NAMES, ignore "-" characters in the name of the
  containing directory.


type: ci
user: drh
comment:
  Update the sqlite3_analyzer utility program to provide more details about
  the compression performance of ZIPVFS database files.


type: ci
user: drh
comment:
  Enhance the sqlite3_data_count() routine so that it can be used to determine
  if SQLITE_DONE has been seen on the prepared statement.


type: ci
user: drh
comment:
  Begin an effort to enhance the query planner to do a better job with OR terms
  in the WHERE clause.  This change allows ANDs outside of the OR to be factored
  into the OR terms if that is helpful in finding better indices.


type: ci
user: drh
comment:
  Prevent infinite recursion of in the query planner for some pathological
  test cases by disabling OR-clause processing upon first recursion.


type: ci
user: dan
comment:
  Add the SQLITE_FCNTL_OVERWRITE file-control. Used by SQLite to indicate to the OS layer that the current transaction will overwrite the entire file.


type: ci
user: drh
comment:
  Change the ANALYZE command so that it no longer tried to delete unused
  sqlite_stat2 and sqlite_stat3 tables.  Change the DROP TABLE command so
  that it is able to drop those tables.


type: ci
user: drh
comment:
  Enhance sqlite3_analyzer so that it is able to deal with multiplexed databases
  that have 8+3 filenames.


type: ci
user: drh
ecomment:
  Cherrypick the sqlite_data_count() changes from [d4f95b3b6e] and
  [9913996e7b] into the apple-osx branch for version 3.7.7.

comment:
  Cherrypick the sqlite_data_count() changes from [d4f95b3b6e] and
  [9913996e7b] into the apple-osx branch for version 3.7.7.


type: ci
user: drh
comment:
  Forward port the Apple-specific changes from [db5b7b778c] in the
  apple-osx-377 branch.  Fix this up so that it will compile and run on Linux.


type: ci
user: adam
comment:
  Merging in cherry picked diffs for persist wal, alloc padding, wal-safe vacuum and sqlite3_file_control based lockstate checking


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Merge all the latest trunk changes into the sessions branch - especially
  the SQLITE_ENABLE_STAT3 enhancements.


type: ci
user: drh
comment:
  Remove all precision and width limits from formatting fields in the
  sqlite3_mprintf() family of functions. Malloc for space as necessary.
  The prevents a stack overflow on very large numbers using %f.


type: ci
user: drh
comment:
  Change the behavior of the readonly_shm=1 query parameter so that it never
  attempts to open the -shm file read/write.


type: ci
user: drh
comment:
  Simplify the readonly_shm implementation so that it conforms to the
  implementation on trunk.  Update the test cases to agree with the new
  behavior.


type: ci
user: drh
comment:
  The date/time functions return NULL if the xCurrentTime or
  xCurrentTimeInt64 VFS methods fail.
  Ticket [0b803bff856c644c]


type: t
user: drh
brief: Fixed ticket [0b803bff85].
comment:
  Fixed ticket [0b803bff85]: <i>Return (error code) of xCurrentTime is always ignored</i> plus 2 other changes


type: ci
user: drh
comment:
  The sqlite3_overload_function() interface returns an error if it is unable
  to create the overload function.  Ticket [20f9d4fbbff3a3]


type: ci
user: drh
comment:
  Be sure to allocate plenty of space for error messages coming out of
  sqlite3_load_extension(), so that filenames and procedure names are
  not truncated.  Ticket [7d32c69b50f89d]


type: ci
user: drh
comment:
  If errors are encountered while processing the ".dump" command in the
  command-line shell, print error messages as comments in the output and
  ROLLBACK at the end rather than committing.
  Ticket [ee19e690ec9a5a2]


type: t
user: drh
brief: Fixed ticket [ee19e690ec].
comment:
  Fixed ticket [ee19e690ec]: <i>If shell is interrupted while dumping it still produces commit (and invalid dump)</i> plus 2 other changes


type: t
user: drh
brief: Closed ticket [3338b3fa19].
comment:
  Closed ticket [3338b3fa19]: <i>ambiguous column name when using multiple JOIN USING clauses and WHERE clause</i> plus 2 other changes


type: t
user: drh
brief: Closed ticket [b2d64a52a0].
comment:
  Closed ticket [b2d64a52a0]: <i>pkgIndex.tcl is being deleted by 'make clean' but it is not created by 'make'</i> plus 2 other changes


type: ci
user: drh
comment:
  Make sure the query optimizer for aggregate queries knows that expressions
  (x='a') and (x='A') are different.  Ticket [fa7bf5ec94801e7e]


type: t
user: drh
brief: Fixed ticket [fa7bf5ec94].
comment:
  Fixed ticket [fa7bf5ec94]: <i>String literal case confusion in aggregate query</i> plus 3 other changes


type: ci
user: drh
comment:
  Enable large-file support for fopen() and friends in the command-line shell.
  Ticket [92af7da36b6fbd]


type: ci
user: drh
comment:
  Change the command-line shell to do the ".dump" inside of a SAVEPOINT
  rather than a transaction, since this allows it to be run from within
  a transaction.


type: t
user: drh
brief: Ticket [3671265894]: 3 changes
comment:
  Ticket [3671265894] <i>No error reporting on file open failure</i> status still Open with 3 other changes


type: t
user: drh
brief: Closed ticket [ab7498f2f6].
comment:
  Closed ticket [ab7498f2f6]: <i>54 seconds to sort two(2) rows only when LIKE operator is used in WHERE clause and the query also contains an order-by clause</i> plus 1 other change


type: t
user: drh
brief: Closed ticket [4c9223e34e].
comment:
  Closed ticket [4c9223e34e]: <i>Vacuum fails within transaction but also rolls it back</i> plus 2 other changes


type: t
user: dan
brief: Ticket [9fd058691b]: 4 changes
comment:
  Ticket [9fd058691b] <i>Problem with updating an FTS table that contains a single row</i> status still Open with 4 other changes


type: t
user: dan
brief: Ticket [9fd058691b]: 1 change
comment:
  Ticket [9fd058691b] <i>Problem with updating an FTS table that contains a single row</i> status still Open with 1 other change


type: t
user: dan
brief: Closed ticket [9fd058691b].
comment:
  Closed ticket [9fd058691b]: <i>Problem with updating an FTS table that contains a single row</i> plus 1 other change


type: t
user: dan
brief: Ticket [9fd058691b]: 1 change
comment:
  Ticket [9fd058691b] <i>Problem with updating an FTS table that contains a single row</i> status still Closed with 1 other change


type: ci
user: drh
comment:
  Simplifications to the upper() and lower() SQL functions.
  Updates to documentation on sqlite3_bind_text() and sqlite3_result_text()
  to make it clear that users should not try to create strings with
  embedded NULs and that if they do the result of expression on those strings
  is undefined.  Ticket [57c971fc74524a]


type: t
user: drh
brief: Fixed ticket [57c971fc74].
comment:
  Fixed ticket [57c971fc74]: <i>Some user defined string functions do not operate correctly on strings with embedded nuls</i> plus 3 other changes


type: ci
user: drh
comment:
  Change the makefile to delete both plain and ".exe" variants of build tools.
  Ticket [92bd6eaf04e117]


type: t
user: drh
brief: Closed ticket [9861b74ab9].
comment:
  Closed ticket [9861b74ab9]: <i>Fts3 offsets() function may report SQLITE_CORRUPT with empty string.</i> plus 3 other changes


type: t
user: drh
brief: Closed ticket [d214d7b114].
comment:
  Closed ticket [d214d7b114]: <i>FTS3 virtual table fails when names are quoted</i> plus 3 other changes


type: t
user: drh
brief: Fixed ticket [f1c2a689c6].
comment:
  Fixed ticket [f1c2a689c6]: <i>configure script ignores ``--with-tcl'' option when tclsh8.4 is installed.</i> plus 3 other changes


type: t
user: drh
brief: Fixed ticket [991789d9f3].
comment:
  Fixed ticket [991789d9f3]: <i>ext/fts? code uses tolower() when parsing tokens, which is problematic when using certain locales, such as tr_TR.UTF-8.</i> plus 1 other change


type: t
user: drh
brief: Fixed ticket [35c54c8749].
comment:
  Fixed ticket [35c54c8749]: <i>Some os win symbols should be declared static</i> plus 2 other changes


type: ci
user: drh
comment:
  Make sure the page_count and quick_check pragmas work properly even when
  their names are capitalized.  Fixes a problem reported on the mailing list.


type: ci
user: drh
comment:
  Do the ".dump" command inside of a transaction to prevent other processes
  from modifying the database while the dump is underway.
  Ticket [2466653295e65]


type: t
user: drh
brief: Fixed ticket [54844eea3f].
comment:
  Fixed ticket [54844eea3f]: <i>Incorrect caching of sub-query results in the FROM clause of a scalar sub-query.</i> plus 1 other change


type: t
user: drh
brief: Fixed ticket [e59bdf6116].
comment:
  Fixed ticket [e59bdf6116]: <i>Possible database corruption following EINTR on unix</i> plus 2 other changes


type: t
user: drh
brief: Ticket [f817a45752]: 3 changes
comment:
  Ticket [f817a45752] <i>CantOpen doesn't include name of file that can't be opened</i> status still Open with 3 other changes


type: t
user: drh
brief: Fixed ticket [aa92c76cd4].
comment:
  Fixed ticket [aa92c76cd4]: <i>Problem with GROUP BY and the distinction between real and integer values</i> plus 2 other changes


type: ci
user: drh
comment:
  Adjust the symbols.sh script for STAT3.  Add the symbols-mingw.sh script for
  testing on windows with MinGW.


type: t
user: drh
brief: Closed ticket [5483170346].
comment:
  Closed ticket [5483170346]: <i>H35230 & H35240 refer incorrectly to H35230 - should be H35220</i> plus 2 other changes


type: t
user: drh
brief: Closed ticket [4776dee07a].
comment:
  Closed ticket [4776dee07a]: <i>Documentation and code about registering functions</i> plus 1 other change


type: t
user: drh
brief: Fixed ticket [af95b8c609].
comment:
  Fixed ticket [af95b8c609]: <i>Vacuuming a WAL database resets the file header read and write versions to 1.</i> plus 2 other changes


type: t
user: drh
brief: Fixed ticket [26ff0c82d1].
comment:
  Fixed ticket [26ff0c82d1]: <i>Incorrect result when using unnamed "?" bindings</i> plus 2 other changes


type: t
user: drh
brief: Fixed ticket [fc62af4523].
comment:
  Fixed ticket [fc62af4523]: <i>Executing "PRAGMA journal_mode" may delete journal file while it is in use.</i> plus 1 other change


type: ci
user: drh
comment:
  Add assert() statements and eliminate needless variable assignments in order
  to get the clang scan-build utility to report zero problems against the
  SQLite core.  Clang's static analysis did find one real problem - but it was
  in the command-line shell, not in the SQLite core.


type: ci
user: drh
comment:
  Added the tool/warnings-clang.sh script.  Changes so that there are no
  warnings with either gcc or clang even including FTS4 and RTREE and
  both with and without SQLITE_THREADSAFE=0.


type: t
user: drh
brief: Closed ticket [6e1086fb2c].
comment:
  Closed ticket [6e1086fb2c]: <i>"create table as select" and "pragma *_column_names"</i> plus 1 other change


type: ci
user: drh
comment:
  Avoid 32-bit integer overflow when evaluating the exponent of a floating point
  value during ascii to binary conversion.


type: ci
user: drh
comment:
  Change the OP_JournalMode implementation so that it works even if a
  substitute sqlite3PagerFilename() that might return NULL is used.


type: ci
user: dan
comment:
  Fix a floating-point exception that can occur when an FTS4 query contains a large number of tokens connected by AND or NEAR operators.


type: ci
user: dan
comment:
  If a token within an FTS query is prefixed with a '^' character, it must be the first token in a column of data to match.


type: t
user: drh
brief: Fixed ticket [3338b3fa19].
comment:
  Fixed ticket [3338b3fa19]: <i>ambiguous column name when using multiple JOIN USING clauses and WHERE clause</i> plus 1 other change


type: ci
user: drh
comment:
  Fix the virtual table rename logic so that it works even if the database
  encoding is something other than UTF8.
  Ticket [8290242b2a9a81683]


type: t
user: drh
brief: Fixed ticket [8290242b2a].
comment:
  Fixed ticket [8290242b2a]: <i>ALTER TABLE RENAME fails if the database encoding is not UTF8</i> plus 2 other changes


type: ci
user: dan
comment:
  Change the way ^ tokens work in FTS so that the filtering is done as part of reading the FTS index instead of waiting until an entire doclist has been retrieved and then filtering it.


type: ci
user: drh
comment:
  Enhancements to the omittest.tcl script used to verify that the
  SQLITE_OMIT compile-time options are working.


type: ci
user: dan
comment:
  If an error occurs while writing to the database file during a VACUUM, discard the contents of the in-memory cache. This is required as if the database is a zipvfs database, the contents of the cache may be inconsistent with respect to the database as stored on disk.


type: ci
user: drh
comment:
  Avoid a harmless reference to an uninitialized variable following an
  error in FTS3.  This is not a bug.  The change is to silence a valgrind
  warning.


type: ci
user: drh
comment:
  Cherrypick the [3513bf6ee090d9] so that the sqlite_source_id() function works correctly even with newer versions of Fossil


type: ci
user: dan
comment:
  If an error occurs within sqlite3_step() on a statement prepared using sqlite3_prepare_v2(), transfer both the error code and error message to the database handle before sqlite3_step() returns (so that they are available via sqlite3_errcode() and sqlite3_errmsg(). Prior to this commit, only the error code was transfered. The error message was not available until after either sqlite3_reset() or sqlite3_finalize() had been called on the statement handle.


type: ci
user: drh
comment:
  Avoid reporting a NOMEM error if a memory allocation fails while copying
  the error message from a prepared statement into the database connection.


type: t
user: dan
brief: New ticket [48f299634a].
comment:
  New ticket [48f299634a] <i>Crash in SAVEPOINT within a transaction that writes to then drops an FTS table</i>.


type: t
user: dan
brief: Ticket [48f299634a]: 3 changes
comment:
  Ticket [48f299634a] <i>Crash in SAVEPOINT within a transaction that writes to then drops an FTS table</i> status still Open with 3 other changes


type: ci
user: dan
comment:
  Avoid attempting to call savepoint related methods on deleted sqlite3_vtab objects. Fix for [48f299634a].


type: t
user: dan
brief: Closed ticket [48f299634a].
comment:
  Closed ticket [48f299634a]: <i>Crash in SAVEPOINT within a transaction that writes to then drops an FTS table</i> plus 2 other changes


type: t
user: dan
brief: Ticket [48f299634a]: 1 change
comment:
  Ticket [48f299634a] <i>Crash in SAVEPOINT within a transaction that writes to then drops an FTS table</i> status still Closed with 1 other change


type: ci
user: dan
comment:
  Update fkey_malloc.test to account for the sqlite3_errmsg() related changes in [8f88cc4e61] and [dcb7879347].


type: ci
user: dan
comment:
  Update fts3fault.test to account for the sqlite3_errmsg() related changes in [8f88cc4e61] and [dcb7879347].


type: t
user: drh
brief: Closed ticket [57c971fc74].
comment:
  Closed ticket [57c971fc74]: <i>Some user defined string functions do not operate correctly on strings with embedded nuls</i>


type: t
user: drh
brief: Closed ticket [f1c2a689c6].
comment:
  Closed ticket [f1c2a689c6]: <i>configure script ignores ``--with-tcl'' option when tclsh8.4 is installed.</i>


type: t
user: drh
brief: Closed ticket [3338b3fa19].
comment:
  Closed ticket [3338b3fa19]: <i>ambiguous column name when using multiple JOIN USING clauses and WHERE clause</i>


type: ci
user: drh
comment:
  Fix the os_unix.c source file so that it will build as part of an
  amalgamation on non-apple platforms.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=c7c6050ef060877e&n=4 | c7c6050ef060877e]: Add bgcolor=#d0c0ff. Add symbolic tag "release".


type: ci
user: drh
comment:
  If the read() system call in unix returns fewer bytes than expected, retry
  it until it either returns zero or an error.


type: ci
user: drh
comment:
  Make sure the INSERT INTO ... SELECT statement works correctly even when
  the destination table contains an INTEGER PRIMARY KEY ON CONFLICT... column.
  Ticket [676bc02b87176125].


type: t
user: drh
brief: New ticket [676bc02b87].
comment:
  New ticket [676bc02b87] <i>Incorrect xfer optimization with INTERGER PRIMARY KEY ON CONFLICT REPLACE</i>.


type: t
user: drh
brief: Fixed ticket [676bc02b87].
comment:
  Fixed ticket [676bc02b87]: <i>Incorrect xfer optimization with INTERGER PRIMARY KEY ON CONFLICT REPLACE</i> plus 2 other changes


type: ci
user: drh
comment:
  Enhance the shell so that the ".schema" command works with case insensitive
  LIKE patterns even with PRAGMA cache_sensitive_like=ON.


type: ci
user: drh
comment:
  Use mkdir() and rmdir() rather than open() and unlink() to create the lock
  files with the unix-dotlock VFS.  The change is backwards compatible and,
  we are told, works better on some network filesystems.


type: ci
user: dan
comment:
  Change a memcpy() in sqlite3FileSuffix() to memmove() on the grounds that the source and destination may overlap.


type: ci
user: drh
comment:
  Update the xfer optimization code so that the xfer optimization can be used
  with INTEGER PRIMARY KEY ON CONFLICT ... as long as the destination table
  is initially empty.  Improvements to the comments on the xfer optimization.
  New test cases added.


type: ci
user: dan
comment:
  Move function sqlite3PagerClearCache() out of the "ifndef SQLITE_OMIT_WAL" block and into an "ifndef SQLITE_OMIT_VACUUM" block.


type: ci
user: drh
comment:
  Change the default file format from 1 to 4.  This means that, unless
  PRAGMA legacy_file_format=ON is used first,
  new databases will not be readable by versions prior to 3.3.0 (2006-01-10).


type: ci
user: drh
comment:
  Amplify the restriction on commit-hooks that they cannot recursively
  run SQL on the same database connection.


type: ci
user: dan
comment:
  Experimental change to the pcache interface to allow page buffers to be allocated separately from their associated container structures.


type: ci
user: drh
comment:
  For the mem1.c system malloc implementation, use the malloc_usable_size()
  function if the HAVE_MALLOC_USABLE_SIZE macro is defined.  Update autoconf
  to look for that function when configuring.


type: ci
user: drh
comment:
  Update the API documentation for the new pcache2 interface.  Change the
  order of parameters on the xCreate method of pcache2.


type: ci
user: drh
comment:
  A negative value N for the cache_size pragma adjusts the number of cache
  pages to use approximately N kibibytes of memory.


type: ci
user: drh
comment:
  Omit an unnecessary Sleep() call in windows pending-lock retry
  logic.  Enhance the comment on that logic to discourage people
  from copying it into other VFSes.


type: ci
user: drh
comment:
  Use sqlite3MallocSize() to get the actual size of the memory allocation
  used for lookaside cache and increase the size of the cache to use the
  full allocation.


type: ci
user: drh
comment:
  Follow-on to the previous check-in to prevent a division by zero if the
  lookahead slot size is something goofy like 6 on a 32-bit machine.


type: ci
user: mistachkin
comment:
  In winAccess, save the Win32 last error value prior to invoking user logging callback.  Also, explicitly pass the Win32 last error value to winLogError in order to keep it accurate.  Fixes a problem reported on the mailing list.


type: ci
user: mistachkin
comment:
  Expand passing of a last error argument to the getLastErrorMsg function.  Also, remove unused SQLITE_W32_THREADS define.


type: ci
user: mistachkin
comment:
  Remove use of malloc and free from the Windows VFS.  Also, prevent sqlite3BtreeOpen from assuming that sqlite3OsFullPathname cannot fail.


type: ci
user: mistachkin
comment:
  Make sure to flag benign malloc failures in the Windows VFS as such.  Expand use of the DO_OS_MALLOC_TEST to cover the VFS functions that can now return an out of memory error.  Support an experimental --match option to the test suite that will run only those tests matching the specified pattern.


type: ci
user: drh
comment:
  Remove a couple of incorrect assert statements so that the test suite will
  run with -DSQLITE_DEFAULT_CACHE_SIZE=0.


type: ci
user: drh
comment:
  Attempt to modify btree.c so that it assumes that calls to sqlite3PagerWrite()
  will reallocate the page buffer.  As there is not good way to test this
  assumption yet, probably a few spots were missed.


type: ci
user: drh
comment:
  Add a version number to the sqlite3_pcache_methods2 object.  Other PCACHE2
  documentation improvements.


type: ci
user: drh
comment:
  Begin making experimental changes to use mmap() for reading content from
  a database.  The code compiles, but crashes on the test suite.


type: ci
user: dan
comment:
  Update memsubsys1.test to account for the recently increased size of the MemPage structure in btreeInt.h.


type: ci
user: dan
comment:
  Where possible, take advantage of the rowid at the end of index records to optimize range constraints (<, >, <=, >=) on the rowid column.


type: ci
user: drh
comment:
  Restore the test for sqlite3OsFullPathname() failure that was mistakenly 
  removed when [ceee03c79a] was backed out by [69ec53fc1c].


type: ci
user: drh
comment:
  Remove unused fields from the Parse object.  Documentation and formatting
  improvements on data structure definitions.


type: ci
user: drh
comment:
  Add a prototype implementation of stdio-like routines for accessing the VFS.
  This is intended as documentation.  The code is untested. There is no
  guarantee that any of this will ever make it into trunk.  Substantial
  revision is possible prior to reaching trunk, if it ever does.


type: ci
user: drh
comment:
  Add stdio-like I/O interfaces to the test_quota VFS.  This is a prototype
  change for discussion and is mostly untested.  This is an alternative to
  adding stdio-like I/O interfaces in the core.  There is no guarantee that
  this code will make it into the trunk.  If it does get to trunk, there
  could be many changes to the interface first.


type: ci
user: drh
comment:
  Add the sqlite3_quota_fflush() interface.  Enhance sqlite3_quota_remove()
  so that it can remove entire directories.


type: t
user: dan
brief: New ticket [3a77c9714e].
comment:
  New ticket [3a77c9714e] <i>Malfunction involving temporary registers and sub-queries implemented by vdbe sub-routines.</i>.


type: ci
user: drh
comment:
  Do not reuse temp registers originally allocated to a subroutine within
  the main body of the program logic, since if the subroutine is called
  while the reused temp registers are in use, their values will get clobbered.
  Candidate fix for ticket [3a77c9714e63330]


type: ci
user: dan
comment:
  Add file tkt-3a77c9714e.test, containing tests to verify that the problem documented by ticket [3a77c9714e] has been fixed.


type: t
user: drh
brief: Fixed ticket [3a77c9714e].
comment:
  Fixed ticket [3a77c9714e]: <i>Malfunction involving temporary registers and sub-queries implemented by vdbe sub-routines.</i> plus 2 other changes


type: ci
user: drh
comment:
  Improvements to the data-structure explain subsystem.  Most queries now
  give a reasonably detailed graph of their parse tree.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=79ae51c5b1b20ed0&n=4 | 79ae51c5b1b20ed0]: Add propagating branch=tree-explain. Add propagating symbolic tag "tree-explain". Cancel symbolic tag "trunk".


type: ci
user: mistachkin
comment:
  Follow the previously established pattern for detecting preprocessor defines for specific flavors of Windows (for NT in this case).


type: ci
user: drh
comment:
  In persistent WAL mode, truncate the WAL file to the size specified by the
  journal_size_limit pragma when disconnecting from the WAL.


type: t
user: dan
brief: New ticket [7bbfb7d442].
comment:
  New ticket [7bbfb7d442] <i>Problem with using stale auto-indexes created on materialized sub-selects within trigger programs</i>.


type: ci
user: dan
comment:
  Modify the OP_Once opcode so that it works correctly in trigger sub-programs. This is a candidate fix for [7bbfb7d442].


type: ci
user: drh
comment:
  Take out the OP_JumpOnce opcode.  Revert compound SELECT to use OP_IfNot,
  which is the correct behavior.  Mark trigger registers as initially
  invalid.


type: ci
user: drh
comment:
  Change the VDBE so that all registers are initialized to "Invalid" instead of
  NULL and report errors on any attempted read of an Invalid register.  This
  will help prevent future bugs similar to [7bbfb7d442].


type: ci
user: drh
comment:
  Always use _msize() to get memory allocation sizes on windows, without having
  to do anything special in the makefile.


type: t
user: drh
brief: Fixed ticket [7bbfb7d442].
comment:
  Fixed ticket [7bbfb7d442]: <i>Problem with using stale auto-indexes created on materialized sub-selects within trigger programs</i> plus 2 other changes


type: ci
user: drh
comment:
  Import the experimental parse-tree explainer, with fixes, from the
  tree-explain branch.

ecomment:
  Import the experimental parse-tree explainer, with fixes, from the
  tree-explain branch.  Disabled by default.  Use SQLITE_ENABLE_TREE_EXPLAIN
  to turn it on.


type: ci
user: drh
comment:
  Allow UNION ALL compounds to be promoted up to replace a simple wrapper
  SELECT even if the compounds are joins.


type: ci
user: drh
comment:
  Minor cleanups of the compound-subquery flattening logic.  New test cases
  added for joins the compound subquery.


type: ci
user: drh
comment:
  Fix STAT3 so that it works with the new uninitialized register logic of
  the VDBE.  Ticket [7bbfb7d4422ff]


type: ci
user: drh
comment:
  In the multiplexor shim, when using 8+3 filenames, begin numbering journal
  overflow files with 101 instead of 001 to avoid name collisions with the
  main database file.


type: ci
user: dan
comment:
  Fix os_unix.c so that, unless 8.3 filenames are actually in use, journal and wal file permissions are assigned correctly even if SQLITE_ENABLE_8_3_NAMES is defined.


type: ci
user: drh
comment:
  Backport a minimal set of changes needed to get 8+3 filenames and the
  multiplexor shim playing well together.


type: ci
user: dan
comment:
  Fix for the xFileSize method of test_multiplex.c when used on a file opened with the DELETEONCLOSE flag set.


type: ci
user: drh
comment:
  Add magic comments to shell.c to make it easier for scripts to 
  insert additional version information displays for custom builds.


type: ci
user: drh
comment:
  Add a compile-time shutdown procedure to be called by sqlite3_shutdown() 
  to undo the effects of the compile-time initialization procedure.


type: ci
user: drh
comment:
  When the multiplexor FileSize procedure fails to open the file, assume that
  the file is zero bytes in size.


type: ci
user: drh
comment:
  When an sqlite3_auto_extension() function fails, report back its actual
  error code, not the generic SQLITE_ERROR.


type: ci
user: dan
comment:
  Change the way IO errors are handled in the xFileSize method of the multiplexor VFS. Add test file multiplex3.test.


type: ci
user: dan
ecomment:
  This branch merged with nx-devkit and from there into trunk.  Was:
  In the multiplexor, instead of generating a unique file-name when SQLite opens a temp file, allow the underlying VFS to generate a different temp file for each chunk. Given the changes to the xFileSize method, it is no longer necessary for the different chunks of a temp file to use the same base name.

comment:
  In the multiplexor, instead of generating a unique file-name when SQLite opens a temp file, allow the underlying VFS to generate a different temp file for each chunk. Given the changes to the xFileSize method, it is no longer necessary for the different chunks of a temp file to use the same base name.


type: ci
user: drh
comment:
  Move the multiplexor changes in the experimental branch
  (check-ins [255d21499b] and [199f52bced]) into the nx-devkit branch.


type: ci
user: drh
comment:
  Update the multiplex.test script to conform to that found in the "experimental"
  branch off of trunk.


type: ci
user: drh
comment:
  Change the SQLITE_EXTRA_INIT routine to take a single argument which is a
  pointer to a string.  Call SQLITE_EXTRA_INIT with a NULL argument.
  Fixes to multiplexor to treat the VFS properly in corner cases.  Fix the
  initialization of multiplex3.test.


type: ci
user: dan
comment:
  Add a hard limit to the number of chunks a multiplexed database may consist of if ENABLE_8_3_NAMES is defined.


type: ci
user: drh
comment:
  Enhancements to test_quota.c:  Remove the external dependency on 
  sqlite3_win32_utf8_to_msbc().  Add an extra parameter to quota_fflush()
  that will also do an fsync (or the equivalent).


type: ci
user: mistachkin
comment:
  Treat a zero return value from the Win32 APIs MultiByteToWideChar and WideCharToMultiByte as an error condition.


type: ci
user: drh
comment:
  Add a file-control that will discover the name of the bottom-level VFS and
  all the shims in between.


type: ci
user: drh
comment:
  In the multiplexor, do not try to delete overflow files that do not exist.
  And assume all but the last overflow file is the size of the chunk size.


type: ci
user: drh
comment:
  Make sure the chunksize in test_multiplex does not cause the pending byte
  to fall near the end of a chunk.  Adjust the chunksize upward as necessary
  to prevent this.


type: ci
user: drh
comment:
  Use _commit() rather than FlushFileBuffers() as a substitute for fsync()
  on windows.  Also cast for C++ and add support for SQLITE_FCNTL_VFSNAME.


type: ci
user: drh
comment:
  Make sure the antipenultimate character of master-journal filenames is a "9"
  in order to avoid collisions with other files in 8+3 filename mode.  Also,
  limit the number of attempts at finding a unique master-journal filename.


type: ci
user: drh
comment:
  A better solution to being unable to find a unique master-journal filename:
  just delete an existing master-journal and reuse it.


type: ci
user: drh
comment:
  The xTruncate method for the multiplexor now changes surplus overflow
  files to zero-length by default.  Or if the "truncate" query parameter 
  is used, it actually deletes the surplus overflow files.  This allows
  VACUUM to shrink the database again.


type: ci
user: drh
comment:
  Fix a potential infinite loop (inserted by the previous check-in)
  on the multiplexWrite() method of the multiplexor.


type: t
user: dan
brief: New ticket [a1fa75cbdd].
comment:
  New ticket [a1fa75cbdd] <i>Database corruption following unlucky application crash in WAL mode with &quot;PRAGMA journal_size_limit&quot;</i>.


type: t
user: dan
brief: Ticket [a1fa75cbdd]: 3 changes
comment:
  Ticket [a1fa75cbdd] <i>Database corruption following unlucky application crash in WAL mode with "PRAGMA journal_size_limit"</i> status still Open with 3 other changes


type: ci
user: drh
comment:
  Merge the fix for [a1fa75cbdd02] from the experimental branch.  Also
  fix the persistent-wal mode feature of truncating the WAL on close so that
  it always truncates the WAL to zero bytes.


type: ci
user: drh
comment:
  Enhance the WAL header sync so that it honors the various synchronous
  pragmas, settings, and device characteristics.


type: ci
user: drh
comment:
  Make sure the Salt-1 value in the WAL file is sequentially numbered at
  each checkpoint, as it says it should be in the documentation.


type: ci
user: drh
comment:
  Merge in changes that cause the first sector of the WAL file to be synced
  when the WAL restarts.  This is a fix for the power-loss corruption
  problem described in ticket [ff5be73dee086]


type: t
user: drh
brief: Ticket [ff5be73dee]: 4 changes
comment:
  Ticket [ff5be73dee] <i>Database corruption following power-loss in WAL mode</i> status still Open with 4 other changes


type: t
user: drh
brief: Ticket [ff5be73dee]: 1 change
comment:
  Ticket [ff5be73dee] <i>Database corruption following power-loss in WAL mode</i> status still Open with 1 other change


type: ci
user: drh
comment:
  Add support for statvfs() in os_unix.c, for determining the sector size.
  This causes many TCL test failures under Linux.


type: ci
user: drh
comment:
  Add SQLITE_IOCAP_ZERO_DAMAGE and enable it for both unix and windows.  Use
  this device characteristic to reduce the required work in journaling.
  A side effect is that this changes the default page exists back to 1024
  even with the use of statvfs().


type: ci
user: drh
comment:
  For improved clarity of presentation, 
  refactor some of the code associated with ZERO_DAMAGE and sector-size.


type: ci
user: drh
comment:
  Some fixes to the test suite so that it works with ZERO_DAMAGE set to true.
  Still lots more problems remain.


type: ci
user: drh
comment:
  Assert that the isCommit parameter to sqlite3WalFrames() is zero if and
  only if the nTruncate parameter is zero.


type: ci
user: drh
comment:
  Refactor the sqlite3WalFrames() routine for clarity of presentation.
  Do the padded transaction sync as the write pointer crosses the final
  sector boundary instead of at the end, for efficiency.  Always sync
  the WAL header immediately after it is written.


type: ci
user: drh
comment:
  Remove the code that tries to detect OOO header writes on a WAL recovery.
  The code is made obsolete by syncing the WAL header.


type: ci
user: drh
comment:
  Add the ability to enable or disable SQLITE_IOCAP_ZERO_DAMAGE using a URI
  parameter for both unix and windows.  Add a file-control to query or disable
  the ZERO_DAMAGE setting.  Add the -uri option to the "sqlite3" TCL command
  in tclsqlite3.c.  Allow the sqlite3_uri_parameter() interface to accept a
  NULL pointer for its first parameter.


type: t
user: drh
brief: New ticket [ac0ff496b7].
comment:
  New ticket [ac0ff496b7] <i>Database corruption due to integer overflow with SQLITE_DIRECT_OVERFLOW_READ</i>.


type: ci
user: dan
comment:
  Avoid 32-bit overflow when calculating the byte offset of an overflow page in SQLITE_DIRECT_OVERFLOW_READ code. Fix for [ac0ff496b7].


type: ci
user: dan
ecomment:
  Fix other problems where 32-bit integer overflow may cause a problem. Two that require an improbably large sub-journal and two in test harness code.
  Ticket [ac0ff496b7e2]

comment:
  Fix other problems where 32-bit integer overflow may cause a problem. Two that require an improbably large sub-journal and two in test harness code.


type: ci
user: drh
ecomment:
  Cherry-pick the SQLITE_DIRECT_OVERFLOW_READ fix for ticket
  [ac0ff496b7e] of changes [c5256b59ad] and [c723e3e18a] 
  into the nx-devkit branch.

comment:
  Cherry-pick the SQLITE_DIRECT_OVERFLOW_READ fix for ticket
  [ac0ff496b7e3] of changes [c5256b59ad] and [c723e3e18a] 
  into the nx-devkit branch.


type: t
user: drh
brief: Fixed ticket [ac0ff496b7].
comment:
  Fixed ticket [ac0ff496b7]: <i>Database corruption due to integer overflow with SQLITE_DIRECT_OVERFLOW_READ</i> plus 2 other changes


type: ci
user: drh
comment:
  Backport the fixes for Coverity-discovered problems 
  in [1c27d84216], [676acce274], and [f9c4a7c8f4] from trunk to the
  3.7.6 branch.


type: ci
user: drh
comment:
  Check the return code from sqlite3_initialize() called from within
  sqlite3_soft_heap_limit64() and return an error from sqlite3_soft_heap_limit64()
  if sqlite3_initialize() fails.


type: ci
user: drh
comment:
  Add interfaces sqlite3_uri_boolean() and sqlite3_uri_int64() which are
  wrappers around sqlite3_uri_parameter() combined with internal routines for
  converting strings to booleans and 64-bit integers.


type: ci
user: drh
comment:
  Change the name ZERO_DAMAGE to the more descriptive POWERSAFE_OVERWRITE.
  The query parameter used to control this device characteristic is now "psow".


type: ci
user: drh
comment:
  Update the text of requirements associated with sqlite3_pcache_methods2.
  Update requirements marks embedded in code.  All of the above are comment
  changes only; there are no changes to code in this check-in.


type: ci
user: dan
comment:
  Change dbstatus.test to account for the fact that the value reported by DBSTATUS_SCHEMA_USED may be slightly lower than the actual memory used on osx


type: ci
user: drh
comment:
  Make sure large negative arguments to PRAGMA cache_size do not cause
  32-bit signed integer overflow.  Also correct a requirements mark.


type: ci
user: drh
comment:
  Remove the code that attempts to find the sector size from the OS and
  hardcode the xSectorSize methods of the unix and windows VFSes to return
  SQLITE_DEFAULT_SECTOR_SIZE, which is now set to 4096 unless overridden.


type: ci
user: drh
comment:
  Make sure filenames passed into sqlite3OsOpen() always have the extra
  zero-terminators needed by sqlite3_uri_parameter().


type: ci
user: drh
comment:
  Remove the SQLITE_FCNTL_SYNC_OMITTED cases from the unix and windows VFSes
  as they are no longer needed because of check-in [fd3822f1f2].


type: ci
user: drh
ecomment:
  Ensure 8-byte alignment of Index.aiRowEst elements even if the size of
  an Index object is not a multiple of 8 bytes.

comment:
  Ensure 8-byte alignment of Index.aiRowEst[] elements even if the size of
  an Index object is not a multiple of 8 bytes.


type: ci
user: drh
comment:
  Change the unix VFS so that it ignores all but the least-significant bit
  of the syncDir flag to xDelete.  Add an assert to prove that the core only
  ever uses that one bit.


type: ci
user: drh
comment:
  Make sure the name of the shared memory file has two zero-terminators in the
  UNIX VFS, so that sqlite3_uri_parameter() will work correctly on that name.


type: ci
user: drh
comment:
  Combine various boolean variables in the BtShared structure into a single
  boolean vector.  Also make performance improvement simplifications to
  sqlite3BtreeMovetoUnpacked().


type: ci
user: drh
comment:
  Add missing finish_test to the end of the zerodamage.test module.  Disable
  the zerodamage module if virtual tables are omitted from the build.


type: ci
user: drh
comment:
  Fix a bug in lemon in computation of which non-terminals can generate an
  empty string.  This bug and the fix make absolutely no difference for the
  grammar used by SQLite, but it can make a difference when lemon is used
  in other grammars.


type: ci
user: drh
comment:
  Make sure the shared-memory filename sythesized by os_win.c is
  double-zero terminated, so that it can be used with
  sqlite3_uri_parameter().


type: ci
user: dan
comment:
  Have test_multiplex.c add a second nul-terminator byte to the strings that it passes to the xOpen method of the underlying VFS, in case that VFS passes the string to sqlite3_uri_parameter() or similar.


type: ci
user: drh
comment:
  Cherry-pick the fix to surplus overflow files in the multiplexor,
  check-in [1238619756c0c] in the trunk.


type: ci
user: drh
comment:
  Remove the BenignMalloc() from around the call to FCNTL_OVERWRITE.  Add
  new ones around sqlite3OsDelete().  Fix an assert that causes problems for
  the nx-devkit.


type: ci
user: drh
comment:
  Check the return code from sqlite3OsFileControl() in sqlite3BtreeCopyFile()
  and report any errors that it generates.


type: ci
user: dan
comment:
  Add function sqlite3OsFileControlNoFail(), which is the same as sqlite3OsFileControl() except that it does not simulate OOM errors. This saves adding calls to the BenignMalloc() functions around each of the invocations of sqliteOsFileControl() that ignore the return code.


type: ci
user: dan
comment:
  Avoid passing strings with a single nul-terminator (two are required) to the VFS xOpen() method from within the code that checks to see if a master-journal file may be safely deleted.


type: ci
user: drh
comment:
  Only require double-zero terminators on database filenames, not any every
  files supplied to the xOpen method.  This backs out [2544f233f1].  Also
  refactor the fillInUnixFile() routine in os_unix.c to reduce the number
  of parameters.


type: ci
user: drh
comment:
  Make sure filenames handed to the VFS by the fake_big_file test procedure
  are double-zero terminated.


type: ci
user: mistachkin
comment:
  Prevent winOpenSharedMemory from masking the real return code from its call to winOpen.  Also, add asserts to check the double-zero termination of database file names.


type: ci
user: dan
comment:
  Fix the sqlite3_quota_file() function in test_quota.c so that it adds the second nul-terminator to all file names that will be passed to a VFS xOpen method.


type: ci
user: drh
comment:
  Make the pager less vulnerable to problems caused by shifting sector sizes
  when rolling back a hot journal.


type: ci
user: dan
comment:
  Fix issues in test cases so that they work with DEFAULT_AUTOVACUUM defined. And with a small default cache-size.


type: ci
user: dan
comment:
  Do not throw an error from within test_journal.c if a database file size is not an integer multiple of the page-size.


type: ci
user: dan
comment:
  Fix backup2.test so that it passes on OpenBSD (which produces a slightly different error message in one case).


type: ci
user: drh
comment:
  Update the documentation for the sqlite3_uri_*() routines to make it clear
  that there argument must be a database filename passed into xOpen().
  No changes to code.


type: ci
user: drh
comment:
  Add the -uri option to the usage comment that is printed by the "sqlite3"
  TCL command when an unknown command-line option is supplied.


type: ci
user: drh
comment:
  In the multiplexor routine that determines the size of an overflow file,
  return 0 and leave the error code unchanges if there were prior errors.
  This prevents some I/O errors from going unreported in nx-devkit tests.


type: ci
user: mistachkin
comment:
  Make sure the EXTERN macro is properly defined when building targets that require it (e.g. on MinGW).


type: t
user: drh
brief: Fixed ticket [a1fa75cbdd].
comment:
  Fixed ticket [a1fa75cbdd]: <i>Database corruption following unlucky application crash in WAL mode with "PRAGMA journal_size_limit"</i> plus 1 other change


type: t
user: drh
brief: Fixed ticket [ff5be73dee].
comment:
  Fixed ticket [ff5be73dee]: <i>Database corruption following power-loss in WAL mode</i> plus 1 other change


type: ci
user: drh
comment:
  Rebuild the configure script using autoconf 2.68 since autoconf 2.65
  (previously used) appears to build incorrect scripts for Mac.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=ebd01a8deffb5024&n=4 | ebd01a8deffb5024]: Add bgcolor=#d0c0ff. Add symbolic tag "release".


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=21b720cc9b9f88b8&n=4 | 21b720cc9b9f88b8]: Add bgcolor=#d0c0ff. Add symbolic tag "version-3.6.10".


type: ci
user: drh
comment:
  Add the SQLITE_WITHOUT_MSIZE and SQLITE_WITHOUT_ZONEMALLOC macros in mem1.c
  to disable the use of _msize() on windows and the zone memory allocator
  on Apple products, respectively.


type: ci
user: drh
comment:
  Avoid overriding the malloc_usable_size symbol using the C preprocessor as
  this might be confusing the build on some systems.


type: ci
user: drh
comment:
  Make the use and function of SQLITE_DYNAMIC clearer.  Add assert() statement
  to help ensure that SQLITE_DYNAMIC is not misused.


type: ci
user: dan
comment:
  Changes to the async-io module so that the xFileControl method returns SQLITE_NOTFOUND when a file-control is not recognized and so that it adds the second nul-terminator byte to filenames passed to the xOpen method of the underlying VFS.


type: ci
user: dan
ecomment:
  Fix an FTS problem triggered by querying for an N character prefix using an N+1 character prefix index after rows have been deleted from the FTS table. Fix for [edb497982c].

comment:
  Fix an FTS problem triggered by querying for an N character prefix using an N+1 character prefix index after rows have been deleted from the FTS table.


type: t
user: dan
brief: New ticket [edb497982c].
comment:
  New ticket [edb497982c] <i>FTS n-character prefix query returns incorrect results when using an n+1 character prefix index.</i>.


type: ci
user: drh
comment:
  Only invalidate the schema when the OP_ParseSchema opcode fails, not
  on any general failure of a vdbe program.


type: ci
user: drh
comment:
  Update the .dump command of the command-line shell so that it (1) avoids
  putting the semicolon of a DDL statement on the same line as a comment,
  (2) avoids long expression, even when dumping a table with many columns, and
  (3) avoids unnecessary quoting of the table name.  This fixes tickets
  [c04a8b8a4f] and [232637c465].  
  Shell change only; no changes to the SQLite core.


type: t
user: drh
brief: Fixed ticket [c04a8b8a4f].
comment:
  Fixed ticket [c04a8b8a4f]: <i>Trailing comments not stripped from views, invalid dumps</i> plus 2 other changes


type: t
user: rogerb
brief: New ticket [5f41597f7c].
comment:
  New ticket [5f41597f7c] <i>sqlite3_uri_boolean defaults to true, documented as false, is a mess</i>.


type: ci
user: drh
comment:
  Do not rely on the _WIN32_WINNT macro as vs2005 does not define it by default.
  Instead, always assume winNT unless the makefile explicitly sets
  SQLITE_OS_WINNT=0.


type: ci
user: drh
comment:
  Bring the documentation and implementation of sqlite3_uri_boolean() into
  closer agreement.  Ticket [5f41597f7c9c]


type: t
user: drh
brief: Fixed ticket [5f41597f7c].
comment:
  Fixed ticket [5f41597f7c]: <i>sqlite3_uri_boolean defaults to true, documented as false, is a mess</i> plus 2 other changes


type: t
user: drh
brief: New ticket [ae6794effd].
comment:
  New ticket [ae6794effd] <i>ALTER TABLE RENAME fails for triggers that use the table name with a different case</i>.


type: ci
user: drh
comment:
  Fix ALTER TABLE RENAME so that it correctly handles triggers that attach
  to the table using the name in a different case.
  Ticket [ae6794effd404].


type: t
user: drh
brief: Fixed ticket [ae6794effd].
comment:
  Fixed ticket [ae6794effd]: <i>ALTER TABLE RENAME fails for triggers that use the table name with a different case</i> plus 2 other changes


type: ci
user: drh
comment:
  Fix a possible segfault after an OOM fault.  This has been in the code for ages
  but only expressed itself following the previous check-in.


type: ci
user: drh
comment:
  Data structure cleanup.  Remove unused fields.  Rearrange other files for
  tighter packing and reduced memory usage.


type: ci
user: drh
comment:
  For queries of the form "SELECT p, max(q) FROM t1", the value of column p
  returned is the one on the same row that holds the maximum value of q.


type: ci
user: drh
comment:
  Fix a problem with NULL handling in aggregate min/max when returning
  values from the row containing the min or max.


type: ci
user: drh
comment:
  When non-aggregate columns occur in an aggregate query with a single min()
  or max(), then the values of the non-aggregate columns are taken from 
  one of the rows that was the min() or max().


type: ci
user: drh
comment:
  Command-line shell enhancements:  Reorganize the "usage" comment so that
  options are in alphabetical order.  Add the new "--cmd" option.  Allow
  either "--option" or "-option" for options.


type: ci
user: drh
comment:
  Add an autoconf test for malloc.h and use the results of that test to 
  conditionally #include the malloc.h header file.


type: ci
user: drh
comment:
  Fix an important bug in the handling of EINTR in unixRead().  Never came
  up on x86 but crashes on sparc.


type: ci
user: drh
comment:
  Disable the ability to have multiple values in the VALUES clause of an
  INSERT statement when SQLITE_OMIT_COMPOUND_SELECT is used.


type: ci
user: drh
comment:
  When creating journal files (including -wal and -shm files) try to set the
  ownership to be the same as the original database.  This will prevent root
  from locking out the original owner of the file.


type: ci
user: mistachkin
comment:
  Revise the preprocessor directives used to handle malloc.h and _msize, in order to detect and handle the MSVC special-case automatically.


type: ci
user: drh
comment:
  Generalize the interrupt mechanism so that individual statements can be
  interrupted and so that codes other than just SQLITE_INTERRUPT can be
  returned as a consequence of an interrupt.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=922bcbb42361b5a2&n=4 | 922bcbb42361b5a2]: Add propagating branch=generalize-interrupt. Add propagating symbolic tag "generalize-interrupt". Cancel symbolic tag "trunk".


type: ci
user: drh
comment:
  Change the ROLLBACK command so that pending statements to not block it.  The
  pending statements instead return SQLITE_ABORT upon next access.  Note: This
  causes separate shared-cache connections in read_uncommitted mode to abort as
  well.


type: ci
user: drh
comment:
  Add the new SQLITE_ABORT_ROLLBACK extended error code to be returned for
  statements that are cancelled due to a rollback.


type: ci
user: drh
comment:
  On unix, ignore the umask when creating journal files.  That way, journal files
  will have exactly the same permissions as the original database and any
  process that has permission to write to the database can also recover
  hot journals.


type: ci
user: dan
comment:
  Fix a case in test_fuzzer.c causing transformations from the wrong ruleset to be applied in some cases.


type: ci
user: dan
comment:
  Change the way the fuzzer (test_fuzzer.c) works so that it loads its configuration from a database table.


type: ci
user: drh
comment:
  Updates to the instructions in the header comment of the fuzzer implementation.
  New test cases for the fuzzer.


type: ci
user: drh
comment:
  Make benign any malloc failures inside the sqlite3_file_control() call within
  PRAGMA parsing.  Add a couple simple tests for SQLITE_FCNTL_PRAGMA.


type: ci
user: drh
comment:
  If the SQLITE_FCNTL_PRAGMA file-control returns anything other than
  SQLTIE_NOTFOUND and SQLITE_OK, then treat the result as an error.


type: ci
user: drh
comment:
  If the SQLITE_FCNTL_PRAGMA file control returns something other than
  SQLITE_NOTFOUND, then skip the rest of Pragma code generation.


type: ci
user: drh
comment:
  Separate multiplexor overflow pages for -wal and -journal files into
  separate namespaces when in 8+3 filename mode.


type: ci
user: drh
comment:
  Fix the xDelete implementation of the multiplexor VFS so that it correctly
  deletes overflow WAL files.


type: ci
user: dan
comment:
  Fix spurious errors that may occur if an empty database is opened and then initialized as a WAL database by a second connection.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=c0891296b49fb959&n=4 | c0891296b49fb959]: Add propagating branch=winrt. Add propagating symbolic tag "winrt". Cancel symbolic tag "trunk".


type: ci
user: dan
comment:
  Add the "languageid=" option to fts4. This code is still largely untested and alsmost certainly buggy.


type: ci
user: drh
comment:
  Add recognition of the SQLITE_OS_WINRT compile-time option.  
  Use InitializeCriticalSectionEx() under winRT.


type: ci
user: drh
comment:
  Do not run the large file tests if a file named "skip-big-file" exists
  in the test directory.  This enables tests to be run much faster on
  systems that lack sparse file support.


type: ci
user: mistachkin
comment:
  Add new Win32 APIs used to the system call table.  Add error handling code for SetFilePointerEx.  Make sure the last error number is saved from the call to GetFileInformationByHandleEx.


type: ci
user: mistachkin
comment:
  When running on Windows with an NT-based kernel, always use the LockFileEx/UnlockFileEx functions (with the correct flags).


type: ci
user: mistachkin
comment:
  When compiled for WinRT, avoid using the FORMAT_MESSAGE_ALLOCATE_BUFFER flag to FormatMessage (i.e. because LocalFree is unavailable).


type: ci
user: drh
comment:
  Fix a bug [3557ad65a07] that causes incorrect DISTINCT processing on
  an indexed query involving the IN operator.


type: t
user: drh
brief: Ticket [3557ad65a0]: 3 changes
comment:
  Ticket [3557ad65a0] <i>Incorrect DISTINCT on an indexed query with IN</i> status still Open with 3 other changes


type: t
user: drh
brief: Fixed ticket [3557ad65a0].
comment:
  Fixed ticket [3557ad65a0]: <i>Incorrect DISTINCT on an indexed query with IN</i> plus 1 other change


type: ci
user: mistachkin
comment:
  When compiled for WinRT, avoid using MapViewOfFile and GetFileAttributes.  Also, reset the private 'sleep' event handle when the VFS is cleaned up.


type: ci
user: mistachkin
comment:
  When creating the event used to sleep on WinRT, request the minimum access rights required for the desired operations on it (i.e. SYNCHRONIZE).


type: ci
user: mistachkin
comment:
  Add compile-time define to indicate if the VFS supports the concept of a current directory (as WinCE and WinRT do not).  Avoid using the GetTempPath and GetFullPathName APIs on WinRT.  Some tests still need adjustments.


type: ci
user: mistachkin
comment:
  When compiled for WinRT, use the CreateFile2 and LoadPackagedLibrary functions instead of CreateFile and LoadLibrary.


type: ci
user: mistachkin
comment:
  On Windows, make sure the current directory value used by the test suite is 'normalized' to what the parent command shell sees.  Also, clean the test directories used by the quota2.test file.


type: ci
user: drh
comment:
  Candidate fix for the optimizer problem described in ticket 
  [b7c8682cc17f3] which can causes a LEFT JOIN to be changed
  into a INNER JOIN if there are OR terms in the WHERE clause.


type: t
user: drh
brief: Fixed ticket [b7c8682cc1].
comment:
  Fixed ticket [b7c8682cc1]: <i>Incorrect result from LEFT JOIN with OR in the WHERE clause</i> plus 2 other changes


type: ci
user: mistachkin
comment:
  More changes required to compile for WinRT using VS 11 beta.  Also, replace more APIs with their WinRT alternatives.


type: ci
user: mistachkin
comment:
  Defer creation of the sleep event object until it is needed.  Added sqlite3_win32_write_debug and sqlite3_win32_sleep APIs to assist in portability to WinRT.


type: t
user: drh
brief: Ticket [b7c8682cc1]: 1 change
comment:
  Ticket [b7c8682cc1] <i>Incorrect result from LEFT JOIN with OR in the WHERE clause</i> status still Fixed with 1 other change


type: ci
user: mistachkin
comment:
  Add experimental support for resolving relative database file paths using a fixed user-defined directory.


type: ci
user: dan
comment:
  Avoid allocating a large object on the stack in the incremental merge code. Use sqlite3_malloc() instead.


type: ci
user: mistachkin
comment:
  Avoid redefining macros.  Enable use of the Win32 native heap on WinRT.  Use the syscall table to call OutputDebugStringW and fix type casting warnings.


type: ci
user: mistachkin
comment:
  Add SQLITE_WIN32_HEAP_CREATE compiler define to control whether or not the Win32 native allocator will create an isolated heap for all allocated data.


type: ci
user: drh
comment:
  Add the sqlite3_db_readonly() interface.  This is still tentative, pending
  a closer look at other ideas to accomplish the same thing.


type: ci
user: mistachkin
comment:
  Reset the sqlite3_data_directory and sqlite3_temp_directory variables when the sqlite3_shutdown function is called since they may refer to memory allocated by the heap subsystem that was just shutdown.


type: ci
user: dan
comment:
  In pager1.test, use "file attr test.db -readonly 0" before "file attr test.db -perm rw-rw-rw-", not after.


type: ci
user: dan
comment:
  Fix various incorrect and missing comments and other style issues in and around the FTS incremental merge code.


type: ci
user: mistachkin
comment:
  Add SQLITE_OMIT_SHUTDOWN_DIRECTORIES compile-time option to disable clearing the sqlite3_data_directory and sqlite3_temp_directory variables during sqlite3_shutdown.  Also, only clear the variables if the heap was actually shutdown.


type: ci
user: dan
comment:
  Ensure that compatible malloc and free functions are used with stat3 data if SQLITE_ENABLE_STAT3 is defined.


type: ci
user: drh
comment:
  Fix out-of-bounds array references in the "echo" virtual table module
  used for testing.  No changes to the SQLite core.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=00bb9c9ce4f465e6&n=4 | 00bb9c9ce4f465e6]: Add bgcolor=#d0c0ff. Add symbolic tag "release".


type: ci
user: drh
comment:
  Remove the _SafeInit() entry points from the TCL interface.  They have long
  been no-ops.  Removing them completely avoids confusion as to why they
  don't work.


type: ci
user: dan
comment:
  Add fts4merge3.test, for testing that older versions of FTS4 may interoperate with incr-merge capable versions.


type: ci
user: drh
comment:
  Always quote the names of tables in the output of the shell's ".dump" command,
  even if the name is pure alphabetic text, in case the name is a keyword.


type: ci
user: dan
comment:
  Following an incr-merge operation that does not completely consume its input segments, store context in the rowid==1 row of the %_stat table that allows the next incr-merge to pick up where the previous left off.


type: ci
user: dan
comment:
  When an incremental blob cursor is invalidated (occurs when an SQL statement modifies or deletes the row the blob cursor points to) release all page references held by the cursor. Otherwise, the presence of these references may cause other code in btree.c to incorrectly infer that the database is corrupt.


type: ci
user: dan
comment:
  Add SQLITE_DBSTATUS_CACHE_WRITE. Used to query a database connection for the cumulative number of database pages written.


type: ci
user: dan
comment:
  Modify the way the number of leaves written and the maximum relative level are calculated in the auto-incr-merge code.


type: ci
user: drh
comment:
  Enable fts3 tables to use incremental merge by automatically creating the
  %_stat table when it is needed.


type: ci
user: dan
comment:
  Modify the FTS integrity-check so that the checksums do not depend on the results of signed integer overflow, which is undefined in C.


type: ci
user: drh
comment:
  Minor correct errors in the file format description for FTS3/4 contained in
  the fts3.c header comment.


type: ci
user: dan
comment:
  Allow multiple incremental merges to proceed concurrently. This is required to prevent a large crisis-merge from occuring while an even larger incremental-merge is underway.


type: ci
user: drh
comment:
  In the fts3view utility, label the blank segments used to mark the end of a
  segment sequence for a level/idx as "null".  Improve the alignment of root
  segment names.


type: ci
user: dan
comment:
  Remove the fts3merge.test script in favour of changing the fts4merge.test script so that it runs tests using both fts4 and fts3. Fix some problems with incr-merge and FTS3 tables.


type: ci
user: drh
comment:
  Add output of PRAGMAs auto_vacuum and encoding to the "schema" command of the
  fts3view utility program.


type: ci
user: drh
comment:
  Evaluate typeof(X) and length(Y) where X is any column and Y is a blob column
  without actually loading X and Y from disk.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=b899dbeb60752843&n=4 | b899dbeb60752843]: Add propagating branch=faster-typeof-and-length. Add propagating symbolic tag "faster-typeof-and-length". Cancel symbolic tag "trunk".


type: ci
user: drh
comment:
  Fix the typeof() and length() optimization so that it works for aggregates
  as well as scalar queries.


type: ci
user: drh
comment:
  Improvements to comments.  Minor changes to code in the hot path of
  OP_Column - with the hope of get a few cycles of performance improvement.


type: ci
user: drh
comment: Futher tweaks to the OP_Column opcode for clarity of presentation.
ecomment:
  This change turned out to the code slower.  Side track it.  Was:
  Tweaks to the OP_Column opcode for clarity of presentation.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=4d516240d2e465b2&n=4 | 4d516240d2e465b2]: Add propagating branch=mistake. Add propagating symbolic tag "mistake". Add closed. Add comment. Cancel symbolic tag "faster-typeof-and-length".


type: ci
user: drh
comment:
  Avoid loading overflow pages just to satisfy typeof() or length() functions
  if the correct result can be computed without the extra page fetches.


type: ci
user: dan
comment:
  Disable the LIKE optimization if the column on the left-hand-side of the LIKE operator belongs to a virtual table.


type: ci
user: drh
ecomment:
  In the ".output" command of the shell, if the first character of the output
  filename is '|' then use popen() instead of fopen().

comment:
  In the ".output" command-line shell, if the first character of the output
  filename is '|' then use popen() instead of fopen().


type: ci
user: drh
comment:
  Change the name of a local variable from "not" to "bNot" to lessen the
  chances of it colliding with some prior #define in the appliation.


type: t
user: drh
brief: Ticket [27ca74af3c]: 3 changes
comment:
  Ticket [27ca74af3c] <i>Nested SAVEPOINT release causes pending query abort</i> status still Open with 3 other changes


type: ci
user: drh
comment:
  Do not abort pending queries on a RELEASE of a nested SAVEPOINT.
  This is a candidate fix for ticket [27ca74af3c083f787].


type: ci
user: drh
comment:
  Test cases for RELEASE and ROLLBACK TO of a nested savepoint while queries
  are pending.

ecomment:
  Test cases for RELEASE and ROLLBACK TO of a nested savepoint while queries
  are pending.  Ticket [27ca74af3c083]


type: t
user: drh
brief: Fixed ticket [27ca74af3c].
comment:
  Fixed ticket [27ca74af3c]: <i>Nested SAVEPOINT release causes pending query abort</i> plus 1 other change


type: ci
user: drh
comment:
  The SQLITE_RTREE_INT_ONLY compile-time option causes the RTree extension 
  to use only integer math and store only integer coordinates.


type: ci
user: adam
comment:
  Merge in latest changes, autologging options, read only file system wal support, test config conditionalization, WAL frame write prebuffering


type: ci
user: drh
comment:
  Enhance the "showdb" utility program with the "pgidx" option.  Now requires
  linkage with the amalgamation.


type: ci
user: dan
comment:
  Modify the integrity-check code to reduce the size of the large allocation from 4 bytes to 1 bit for each page in the database file.


type: ci
user: dan
ecomment:
  Cherrypick commit [1d5e744cc6] from the trunk in order to avoid leaving a file-descriptor open in test scripts capi3.test and capi3c.test.
  This is the version of SQLite that ships by default on the original 
  Mountain Lion release.

comment:
  Cherrypick commit [1d5e744cc6] from the trunk in order to avoid leaving a file-ddescriptor open in test scripts capi3.test and capi3c.test.


type: ci
user: drh
comment:
  Performance improvements for the RowSet object when it undergoes many
  cycles between RowSetInsert and RowSetTest.


type: ci
user: drh
comment:
  Fix the application-defined function logic so that functions with a variable
  number of parameters can be replaced or deleted correctly.  Also refactor
  some of the function-finder code for clarity of presentation.


type: ci
user: drh
comment:
  Add new interfaces to the test_quota.c module:  sqlite3_quota_ftruncate(),
  sqlite3_quota_file_size(), sqlite3_quota_file_truesize(), and
  sqlite3_quota_file_mtime().


type: ci
user: drh
comment:
  Fix harmless static-analysis warnings, mosting having to do with memory
  leaks in the command-line shell.  Add a clang analysis of the command-line
  shell to the "warnings-clang.sh" script.  Other minor cleanups to the
  command-line shell code.


type: ci
user: drh
comment:
  Add a testcase() macro to ensure that the sqlite3AuthCheck() call inside
  the query flattener really is effective.


type: ci
user: drh
comment:
  In the unix VFS, always set every open file to close-on-exec using either
  O_CLOEXEC at open (preferred) or FD_CLOEXEC in an ioctl after opening.  Before
  this changes, many files were done this way, but not all.


type: ci
user: drh
comment:
  Fix a bug in the command-line shell logic that attempts to continue with a
  ".dump" even after encountering database corruption.


type: ci
user: drh
comment:
  Add an undocumented and possibly ephemeral ".breakpoint" command to the 
  command-line shell, to call a no-op routine on which it is convenient to 
  set a symbolic debugger breakpoint.


type: ci
user: mistachkin
comment:
  Import all the latest trunk changes into the WinRT branch.  Refactor and/or remove WinCE-specific macros and functions used for file locking to improve clarity of presentation.


type: ci
user: mistachkin
comment:
  Merge build tool updates from trunk.  Also, modify MSVC makefile to allow for debugging of build tool issues.


type: ci
user: drh
comment:
  Fix harmless compiler warnings on x64 MSVC, mostly in test code, but also in
  tclsqlite.c and in the FTS4 module.


type: ci
user: drh
comment:
  Fix a harmless compiler warning in tclsqlite.c for MSVC x64.  Fix a test
  case associated with the FTS4 merge feature.


type: t
user: dan
brief: New ticket [2a5629202f].
comment:
  New ticket [2a5629202f] <i>Malfunctioning interaction between a multi-term ORDER BY clause and UNIQUE index containing NULL values</i>.


type: t
user: dan
brief: Ticket [2a5629202f]: 3 changes
comment:
  Ticket [2a5629202f] <i>Malfunctioning interaction between a multi-term ORDER BY clause and UNIQUE index containing NULL values</i> status still Open with 3 other changes


type: t
user: dan
brief: Ticket [2a5629202f]: 1 change
comment:
  Ticket [2a5629202f] <i>Malfunctioning interaction between a multi-term ORDER BY clause and UNIQUE index containing NULL values</i> status still Open with 1 other change


type: ci
user: dan
ecomment:
  Fix for [2a5629202f]. When considering whether or not a UNIQUE index may be used to optimize an ORDER BY clause, do not assume that all index entries are distinct unless there is some reason to believe that the index contains no NULL values.

comment:
  Fix for 2a5629202f. When considering whether or not a UNIQUE index may be used to optimize an ORDER BY clause, do not assume that all index entries are distinct unless there is some reason to believe that the index contains no NULL values.


type: t
user: dan
brief: New ticket [385a5b56b9].
comment:
  New ticket [385a5b56b9] <i>A DISTINCT SELECT optimized using a UNIQUE index may allow duplicate NULL values.</i>.


type: t
user: dan
brief: Ticket [385a5b56b9]: 3 changes
comment:
  Ticket [385a5b56b9] <i>A DISTINCT SELECT optimized using a UNIQUE index may allow duplicate NULL values.</i> status still Open with 3 other changes


type: t
user: dan
brief: Ticket [385a5b56b9]: 1 change
comment:
  Ticket [385a5b56b9] <i>A DISTINCT SELECT optimized using a UNIQUE index may allow duplicate NULL values.</i> status still Open with 1 other change


type: ci
user: dan
comment:
  Do not consider a DISTINCT clause redundant unless a subset of the result-set is collectively subject to a UNIQUE constraint and it can be guaranteed that all columns of the subset are NOT NULL (either due to NOT NULL constraints WHERE clause terms). Fix for [385a5b56b9].


type: t
user: dan
brief: Closed ticket [2a5629202f].
comment:
  Closed ticket [2a5629202f]: <i>Malfunctioning interaction between a multi-term ORDER BY clause and UNIQUE index containing NULL values</i> plus 1 other change


type: t
user: dan
brief: Ticket [2a5629202f]: 1 change
comment:
  Ticket [2a5629202f] <i>Malfunctioning interaction between a multi-term ORDER BY clause and UNIQUE index containing NULL values</i> status still Closed with 1 other change


type: t
user: dan
brief: Closed ticket [385a5b56b9].
comment:
  Closed ticket [385a5b56b9]: <i>A DISTINCT SELECT optimized using a UNIQUE index may allow duplicate NULL values.</i> plus 3 other changes


type: ci
user: mistachkin
comment:
  Merge the latest trunk changes into the WinRT branch (fixes for tickets [2a5629202f] and [385a5b56b9]).


type: ci
user: drh
ecomment:
  If terminating interactive input to the command-line shell with ^D, issue
  an extra \n to move the cursor to the next line before exiting.
  This check-in also accidently adds the test_spellfix.c file to the source tree.

comment:
  If terminating interactive input to the command-line shell with ^D, issue
  an extra \n to move the cursor to the next line before exiting.


type: ci
user: drh
comment:
  Update the ".table" command in the shell to show all tables in all
  attached databases, and to avoid using the deprecated sqlite3_get_table()
  function.


type: ci
user: drh
comment:
  Move the shell test scripts into the test/ subfolder so that they are
  run automatically by "make test".


type: ci
user: drh
ecomment:
  Allow virtual table constructors to be invoked recursively.  A test case for
  this has been added to TH3.

comment:
  All virtual table constructors to be invoked recursively.  A test case for
  this has been added to TH3.


type: ci
user: drh
comment:
  Enhance the do_test proc in the test suite so that if the expected result
  is of the form "/.../" or "~/.../" then regular expression matching is done
  between result and the "..." part of the expectation.  In the ~/.../ case,
  we expect there to be no match.


type: ci
user: drh
comment:
  Enhance the processing of ORDER BY clauses on compound queries to better
  match terms of the order by against expressions in the result set, in order
  to enable better query optimization.


type: ci
user: drh
comment:
  Add an experimental tokenizer to FTS3/4: one that transliterates latin,
  greek, cyrillic, and hebrew characters into pure ascii.


type: ci
user: drh
comment:
  Do not do the AV retry loop on open if the file that is attempting to be
  opened is really a directory.


type: ci
user: drh
comment:
  Adjust the parser so that certain legacy schema constructs (that are not
  valid according to the syntax diagram) continue to be accepted, so that
  older databases that happen to use those constructs are still readable.
  This fixes an issue introduced by check-in [1b75f301affac6]


type: ci
user: adam
comment:
  Added support for SQLITE_ENABLE_PERSIST_WAL compile time macro, retrieving lastErrno from WAL file and setting last errno when writes fail due to space constraints


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Merge in the windows AV-defense enhancements for open() and the table
  constraint parser fixes for legacy schemas, all from trunk.


type: t
user: dan
brief: Ticket [bdc6bbbb38]: 3 changes
comment:
  Ticket [bdc6bbbb38] <i>Problem with FTS aux. functions when used with OR queries.</i> status still Open with 3 other changes


type: t
user: dan
brief: Ticket [bdc6bbbb38]: 1 change
comment:
  Ticket [bdc6bbbb38] <i>Problem with FTS aux. functions when used with OR queries with enhanced query syntax enabled</i> status still Open with 1 other change


type: ci
user: dan
comment:
  Have the FTS auxiliary functions correctly handle terms that appear in non-matching branches of the FTS expression. Fix for [bdc6bbbb38].


type: t
user: dan
brief: Closed ticket [bdc6bbbb38].
comment:
  Closed ticket [bdc6bbbb38]: <i>Problem with FTS aux. functions when used with OR queries with enhanced query syntax enabled</i> plus 1 other change


type: ci
user: drh
comment:
  Parser bug fix:  Make sure the table constraints allowed by prior releases
  can still be parsed, even if they are technically not allowed by the
  syntax diagram.


type: ci
user: drh
comment:
  Add an assert() that verifies that the statement pointer from 
  the sqlite3_prepare() family of functions is always NULL if the routines
  return other than SQLITE_OK.


type: ci
user: drh
comment:
  The former sqlite3ResetInternalSchema() routine was really two different 
  routines, selected by parameter, each with a confused mission.  So split
  this routine up into three separate smaller routines, calling each
  separately as needed.  Hopefully this will make further refactoring and
  schema reset collateral damage containment easier.


type: ci
user: dan
comment:
  When a connection disconnects from a shared-cache database, only delete the in-memory schema if there are no other connections.


type: ci
user: dan
comment:
  Return SQLITE_MISUSE if an application attempts to register a virtual table module with the same name as an existing module.


type: ci
user: adam
comment:
  Improve error reporting from sqlite3_file_control, SQLITE_FCNTL_REPLACE_DATABASE shouldn't copy file security/ACL metadata, bad bit mask fixed


type: ci
user: drh
comment:
  Stylistic fixes: limit source code line length to 80 characters.  C89-style
  comments only, not C++/C99 style.


type: ci
user: drh
comment:
  Fix a test case in the shell1.test script so that it works even for very
  long pathnames.

ecomment:
  Check-in included unrelated debugging code by mistake.  Was:
  Fix a test case in the shell1.test script so that it works even for very
  long pathnames.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=0c0a03987cc144fa&n=4 | 0c0a03987cc144fa]: Add propagating branch=mistake. Add propagating symbolic tag "mistake". Add comment. Cancel symbolic tag "trunk".


type: t
user: drh
brief: New ticket [cfe84e8683].
comment:
  New ticket [cfe84e8683] <i>The &quot;.schema&quot; command outputs nested VIEWS in the wrong order</i>.


type: ci
user: drh
comment:
  Change the ".schema" command of the shell to output VIEWs in declared order,
  rather than alphabetical order, so that nested views will appear in the 
  correct order.  Fix for ticket [cfe84e86839e59e8].


type: t
user: drh
brief: Fixed ticket [cfe84e8683].
comment:
  Fixed ticket [cfe84e8683]: <i>The ".schema" command outputs nested VIEWS in the wrong order</i> plus 2 other changes


type: t
user: mistachkin
brief: Ticket [c2ad16f997]: 3 changes
comment:
  Ticket [c2ad16f997] <i>Segfault on query involving deeply nested aggregate views</i> status still Open with 3 other changes


type: t
user: drh
brief: Ticket [c2ad16f997]: 1 change
comment:
  Ticket [c2ad16f997] <i>Segfault on query involving deeply nested aggregate views</i> status still Open with 1 other change


type: ci
user: drh
comment:
  Convert the NameContext object from using u8 booleans to using individual
  bits in a single u8 as its booleans.  This change might become a basis for
  a fix for [c2ad16f997ee9c].


type: t
user: drh
brief: Fixed ticket [c2ad16f997].
comment:
  Fixed ticket [c2ad16f997]: <i>Segfault on query involving deeply nested aggregate views</i> plus 1 other change


type: ci
user: dan
comment:
  Add an experimental tokenizer to fts4 - "unicode". This tokenizer works in the same way except that it understands unicode "simple case folding" and recognizes all characters not classified as "Letters" or "Numbers" by unicode as token separators.


type: ci
user: dan
comment:
  Add special fast paths to sqlite3FtsUnicodeTolower() and Isalnum() for codepoints in the ASCII range.


type: ci
user: dan
comment:
  Change the name of the "unicode" tokenizer to "unicode61" to emphasize that the case folding and separator-character identification routines are based on unicode version 6.1.


type: ci
user: drh
comment:
  Enable the use of shared cache for an in-memory database, so that separate
  database connections can share the same in-memory database.


type: ci
user: drh
comment:
  Only allow :memory: databases to share cache if there are created using a
  URI filename.  This minimizes the risk of breakages in legacy applications
  that have shared-cache enabled but also use :memory: databases which they
  expect to keep separate.


type: ci
user: drh
comment:
  Have user interfaces report out the filename of in-memory databases as an
  empty string, as it always has.  This simplifies the changes.


type: ci
user: drh
comment:
  Add the mode=memory option to URI filenames, which when present forces the
  database to be an in-memory database.  This enables named in-memory databases.


type: ci
user: drh
comment:
  Fix Makefile.in so that it works with the new unicode tokenizer of FTS3/4.
  Update the version number to 3.7.13.


type: ci
user: drh
comment:
  Updates regarding URI query parameters and shared cache in the documentation
  derived from comments in sqlite.h.in.  No changes to code.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Merge the unicode61 tokenizer and the shared-cache-memory database changes
  into the sessions branch.


type: ci
user: drh
comment:
  When converting 64-bit floating point coordinates to 32-bit in RTree, take
  care to round the values such that the size of the bounding box is enlarged.


type: ci
user: drh
comment:
  In the RTree module, make sure all double-to-float conversions round in a
  direction to increase the size of element bounding boxes.


type: ci
user: drh
comment:
  Changes some NDEBUG macros to SQLITE_DEBUG in os_unix.c.  The is a notational
  change only and really should not effect the code.


type: ci
user: drh
comment:
  Link the NDEBUG macro to SQLITE_DEBUG so that when SQLITE_DEBUG is defined,
  NDEBUG is automatically undefined an dwhen SQLITE_DEBUG is undefined
  NDEBUG is automatically defined.


type: ci
user: drh
comment:
  Revert sqlite3_close() to legacy behavior.  Create a new sqlite3_close_v2()
  interface that exhibits the deferred-close behavior.  This minimizes the
  chance of breakage in legacy apps.


type: ci
user: drh
comment:
  The sqlite3_close() interface returns SQLITE_OK even if there are outstanding
  sqlite3_stmt and sqlite3_backup objects.  The connection becomes a zombie.
  Resource deallocation is deferred until the last sqlite3_stmt or 
  sqlite3_backup object closes.  This is intended to help SQLite play nicer
  with garbage collectors.


type: ci
user: drh
comment:
  Add sqlite3_quota_ferror() and sqlite3_quota_file_available() interfaces to
  test_quota.c.  Change sqlite3_quota_fwrite() to use a const input buffer.


type: ci
user: drh
comment:
  Make sure the Index.azColl pointers do not point to connection-specific memory.
  Also, remove an unnecessary reinitialization to sqlite3.pDfltColl.


type: ci
user: drh
comment:
  Avoid resetting the shared-cache schema when on of the connections using
  the shared cache closes.  Delay resetting the schema until the last connection
  closes.


type: ci
user: dan
comment:
  Have the FTS unicode61 strip out diacritics when tokenizing text. This can be disabled by specifying the tokenizer option "remove_diacritics=0".


type: ci
user: dan
comment:
  Disable FTS unicode61 by default. It is enabled by specifying compile time option SQLITE_ENABLE_FTS4_UNICODE61.


type: ci
user: drh
comment:
  Provide an (undocumented) compile-time option to disable the page cache
  overflow counter, in order to avoid a mutex.


type: ci
user: dan
comment:
  Fix a malloc/free mismatch in pager.c (sqlite3_free() called on a buffer allocated by sqlite3DbMalloc()).


type: ci
user: dan
comment:
  Add the "tokenchars=" and "separators=" options, for customizing the set of characters considered to be token separators, to the unicode61 tokenizer.


type: ci
user: dan
comment:
  Fix a problem in vtab1.test causing it to fail when run with any permutation that executes SQL within the tcl "sqlite3" command.


type: ci
user: drh
comment:
  Fix an obscure memory leak in FTS3 that can come about when two memory
  allocations are immediately adjacent to one another.


type: ci
user: drh
comment:
  In Lemon, when comparing the output to the *.h file to see if it has changed,
  make sure that the proposed new output and the preexisting output are the
  same size before deciding that they are the same.


type: ci
user: drh
comment:
  Add the ieee754() SQL function that interprets a blob as a big-endian double.
  Arrange for the quote() SQL function to emit ieee754() functions in its output
  so that floating-point values in the database are exactly preserved by a
  ".dump" command in the shell.


type: ci
user: dan
comment:
  Fix a problem with identifying white-space characters outside of the ascii range in the ICU tokenizer.


type: ci
user: drh
comment:
  Improved accuracy on text-to-real and real-to-text conversions.  Most
  conversions now round-trip correctly.  Still need to fix some corner
  cases.


type: ci
user: drh
comment:
  Round-trip conversions of real->text->real are now lossless on x64 with GCC.
  Untested on other platforms so far.  Still a corner-case problem with round().


type: ci
user: drh
comment:
  Fix an incorrect testcase for the round() function.  All tests are passing
  now, including new real->text->real round-trip tests.


type: ci
user: dan
comment:
  Add tests to check that the "unicode61" and "icu" tokenizers both identify white-space codepoints outside the ASCII range.


type: ci
user: mistachkin
comment:
  When linking to the MSVC runtime library, use the debug library when necessary.  Also, link dynamically to the MSVC runtime library when required (e.g. WinRT) or requested via the USE_CRT_DLL build macro.


type: ci
user: drh
comment:
  Merge changes to trunk that ensure that floating point values are exactly
  preserved on a round-trip through ".dump".


type: ci
user: drh
comment:
  Add the sqlite3_close_v2() interface (from the deferred-close branch) that
  allows close operations to happen out-of-order in bindings to
  garbage-collected langauges.


type: ci
user: drh
comment:
  Remove code that was incorrectly changing SQLITE_MISUSE errors into SQLITE_OK
  in sqlite3_finalize().


type: ci
user: mistachkin
comment:
  Make use of the predefined nmake command macro CC when possible instead of the literal string 'cl.exe'.  Improve support for cross-compilation.  Eliminate problematic use of double quotes in macro preprocessing expressions.


type: ci
user: dan
comment:
  If a specific database is nominated as part of a "PRAGMA integrity_check" or "PRAGMA quick_check" command, search for problems in the nominated database only. i.e. "PRAGMA main.quick_check" now only scans the main database, not all attached databases as before.


type: ci
user: dan
comment:
  Fix a bug in the phonetic-hash routine in spellfix1: Even if the first character of a word is deemed to be "silent", do not apply the special handling intended for the first character of each word to the second.


type: ci
user: drh
comment:
  Fix compiler warnings about unused code in spellfix.  Fix the editDist3Core()
  routine to return the matchlen in characters instead of bytes.


type: ci
user: drh
comment:
  Amplification of a comment in wal.c.  Change the aReadMark[] processing so
  that one read mark is left at zero when a WAL resets.


type: ci
user: dan
comment:
  Ensure that there is always at least one aReadMark slot usable by an unprivileged reader while a checkpoint is running. Also, if one or more transactions are recovered from a log file, initialize one of the aReadMark slots to contain mxFrame as part of the recovery process.


type: ci
user: drh
comment:
  Cherrypick [8c9ee1d78f] and [e416359633] from trunk:
  Ensure that there is always at least one aReadMark slot usable by an unprivileged reader while a checkpoint is running. Also, if one or more transactions are recovered from a log file, initialize one of the aReadMark slots to contain mxFrame as part of the recovery process.


type: ci
user: dan
comment:
  Reorganize code to remove a few of the branches introduced into the critical sqlite3DbMallocXXX() path by the previous commit.


type: ci
user: drh
comment:
  Add an internal interface that allows the code to take advantage of multiple
  cores by pushing subcomputations off into separate threads.  The interface
  is not currently used.


type: ci
user: mistachkin
comment:
  Add Win32 support to the internal threads interface.  Also, add several asserts and fix a few typos.


type: ci
user: dan
comment:
  Modify the code in vdbesort.c so that most reads and writes to temporary files are aligned page-sized blocks.


type: ci
user: mistachkin
comment:
  Improve consistency in handling of build outputs and native library paths in the multi-platform build tool for MSVC.


type: ci
user: mistachkin
comment:
  Fix typos of function names sqlite3_result_error_toobig and sqlite3_result_error_nomem in the documentation. No changes to code.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=86b8481be7e76ccc&n=4 | 86b8481be7e76ccc]: Add comment. Add symbolic tag "mountain-lion".


type: ci
user: dan
comment:
  When reusing pages as part of creating a new index, allocate the leaves from each free-list trunk page in ascending order, instead of trying to maximize localization for each individual allocation. This increases the chance that pages will be written to disk in ascending order by a large CREATE INDEX statement, improving overall performance.


type: ci
user: dan
comment:
  Merge the sorter-coalesce-writes branch into the trunk. This improves CREATE INDEX performance on some platforms.


type: ci
user: drh
comment:
  Parser bug fix:  Make sure the table constraints allowed by prior releases
  can still be parsed, even if they are technically not allowed by the
  syntax diagram.  This is a cherry-pick of
  [a1c014d8a87c8940b3], [38bf90af1ede6ee64e], and [e536ac041815b118c4].


type: ci
user: dan
comment:
  Do not run test script spellfix.test if SQLITE_OMIT_VIRTUAL_TABLE is defined. Fix walro.test so that it works if DEFAULT_AUTOVACUUM is defined.


type: ci
user: dan
comment:
  When building a b-tree as part of a CREATE INDEX or REINDEX statement, attempt to pack keys into pages as tightly as possible.


type: ci
user: dan
comment:
  When populating an index b-tree as part of a CREATE INDEX or REINDEX statement, distribute cells between up to three siblings in balance_nonroot() instead of four. This produces identical database files, but is slightly faster.


type: ci
user: mistachkin
comment:
  Refer to the WaitForSingleObjectEx and SetFilePointerEx Win32 functions only for platforms where they are going to be used.


type: ci
user: drh
comment:
  Change autoconf so that the --with-tcl=DIR option will override the
  TCL configuration that is found using tclsh.


type: ci
user: drh
ecomment:
  Attempt to use two cores to do sorting.  Unfortunately, instead of making sorts
  go faster as was hoped, this changes slows sorting down by about 10%.
  (Later:) The previous measurement was compiled using -pg.  When compiled using
  -Os, this new code is roughly 10% faster than the original.

comment:
  Attempt to use two cores to do sorting.  Unfortunately, instead of making sorts
  go faster as was hoped, this changes slows sorting down by about 10%.


type: ci
user: mistachkin
comment:
  Skip defining some WAL specific things in the Win32 VFS code when compiling without WAL support.  Also, fix an example command line in the MSVC makefile.


type: ci
user: drh
comment:
  Add a command-line program to tool/ that will check source code files for
  the presence of tabs, carriage-returns, whitespace at the ends of lines,
  and blank lines at the ends of files.


type: ci
user: drh
comment:
  Change the checkSpacing utility program to ignore whitespace at end-of-line
  unless the --wseol option is used.


type: ci
user: drh
comment:
  Update the spellfix virtual table so that all OOM errors are reported out
  to the application.

ecomment:
  Update the spellfix virtual table so that all OOM errors are reported out
  to the application.  ERROR:  A single edit was missed in spellfix1 which
  means that this particular check-in won't build "make test".


type: ci
user: drh
comment:
  Cherry-pick [555fc07]: 
  Changes to the thread routines to disable them when threading is turned
  off using sqlite3_config().  Also merge all recent trunk changes.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=c2cf498513c2633b&n=4 | c2cf498513c2633b]: Add propagating branch=mistake. Add propagating symbolic tag "mistake". Add comment. Cancel symbolic tag "trunk".


type: ci
user: mistachkin
comment:
  Add assert to check that the memory block for the previous directory value was allocated via sqlite3_malloc or related function.


type: ci
user: drh
comment:
  Add test cases and fix bugs associated with the previous check-in
  enhancements to nested aggregate subquery processing.


type: ci
user: dan
comment:
  Experimental change to support the covering index optimization for queries with OR terms in the WHERE clause that search a single index more than once.


type: ci
user: drh
comment:
  Additional test cases for OR-optimization with covering indices, including
  one test case that currently fails.


type: ci
user: drh
comment:
  Remove a NEVER() that is in fact reachable on an OOM.  This probably
  has nothing to do with the multi-or-covering-index change but just happened
  to be found while testing that change.


type: ci
user: drh
comment:
  When the same index is used for all OR-terms in a WHERE clause, then try to
  use that index as a covering index.


type: ci
user: drh
comment:
  Backport check-in [62678be3df35cd]:
  When the same index is used for all OR-terms in a WHERE clause, then try to
  use that index as a covering index.


type: ci
user: drh
comment:
  Fix an incorrect assert in the virtual table logic - it could fire following
  an I/O error after sqlite3_close_v2() was added.


type: ci
user: drh
comment:
  Add to #undef statements to the command-line shell, go make sure that the
  macros definitions that follow do not collide with system definitions.


type: ci
user: drh
comment:
  Formatting changes to the C code example in the documentation for
  sqlite3_temp_directory().  No changes to code.


type: ci
user: dan
comment:
  Fix a case where SQLite was failing to detect a syntax error in queries like "SELECT ... FROM (<select-1> UNION ALL <select-2>)" when <select-1> and <select-2> return different numbers of result columns.


type: ci
user: drh
comment:
  Exclude the atof1.test test script from the valgrind permutations test since
  valgrind sets up the floating point hardware in an unusual way that makes
  atof1 fail.


type: ci
user: drh
comment:
  Add resources describing the version number and other information to EXEs
  and DLLs generated using MSVC.


type: ci
user: drh
comment:
  Avoid repeating calls to the sqlite3_trace() callback when the same statement
  is evaluted multiple times by sqlite3_step() due to an SQLITE_SCHEMA
  reprepare.


type: ci
user: drh
comment:
  Add an experimental busy_timeout pragma to facilitate access to the
  sqlite3_busy_timeout() interfaces for programmers that are working from
  behind a language wrapper that does not expose that interface.


type: ci
user: mistachkin
comment:
  Refine error messages in the sqlite3 Tcl command when a NULL database connection is returned from sqlite3_open_v2.


type: ci
user: drh
comment:
  Remove the stale implementation of the ifnull and coalesce functions - code
  that has been commented out for ages.  No functional changes.


type: ci
user: drh
comment:
  Add an implementation of the REGEXP operator and function.  Only defined
  if compiled with SQLITE_ENABLE_REGEXP.


type: ci
user: drh
comment:
  Change boolean fields in the Column object from unsigned characters into
  bits in a single bit mask variable.


type: ci
user: drh
comment:
  Reduce the size of the Table object by 16 bytes on 64-bit machines, mostly
  by avoiding intermixing pointer fields with integer fields.


type: ci
user: drh
comment:
  Factor out the code that generates a co-routine for evaluating the SELECT
  on the RHS of an INSERT statement so that the same code can potentially
  be reused in other places.


type: ci
user: drh
comment:
  Make sure the name of rollback journal files are double-zero terminated
  when they are passed into the VFS.


type: ci
user: drh
comment:
  Attempt to use a covering index even on a full table scan, under the theory
  that the index will be smaller and require less disk I/O and thus be faster.


type: ci
user: drh
comment:
  Make sure the KeyInfo.aSortOrder array is always allocated so that we never
  have to test for KeyInfo.aSortOrder==0 in performance-critical loops.


type: ci
user: drh
comment:
  Remove obsolete bits from the bitvector that defines disabled optimizations
  in the SQLITE_TESTCTRL_OPTIMIZATIONS verb of sqlite3_test_control().


type: ci
user: drh
comment:
  Add the ability to disable the covering-index-scan optimization at compile-time,
  start-time, or at run-time.  Add test cases to check this configurability.


type: ci
user: drh
comment:
  Add the stack_usage.tcl script for analyzing the output of objdump on the
  amalgamation and estimating the sizes of stack frames on each function.


type: ci
user: drh
comment: Omit an unnecessary OP_IfNull that immediately follows an OP_Rowid.
ecomment:
  This change generates incorrect code when there are two or more IN operators
  in the WHERE clause that are both used by the same index.  Was:
  Omit an unnecessary OP_IfNull that immediately follows an OP_Rowid.


type: ci
user: drh
comment:
  Enhance IN processing to allow efficient use of indices with numeric affinities.
  Add test cases for IN processing that would have spotted the error in the
  [2be661a48023f4] check-in.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=2be661a48023f414&n=4 | 2be661a48023f414]: Add propagating branch=mistake. Add propagating symbolic tag "mistake". Add closed. Add comment. Cancel symbolic tag "trunk".


type: ci
user: drh
comment:
  Update the vdbe-compress.tcl script so that it accepts variable declarations
  inside of #ifdef...#endif.
  This enhancement is needed due to the change of check-in [39866c0ede5d6ef4].


type: ci
user: drh
comment:
  Continuing incremental enhancements of SELECT code generation:
  Remove the Select.affinity field.  Use SelectDest.affSdst instead.


type: ci
user: drh
comment:
  Refactoring of DISTINCT code.  Change the name of the local variable
  "distinct" to "distinctTab".  Generate cleaner code w/o unnecessary P4
  and P5 values on the OP_Null for WHERE_DISTINCT_ORDERED.


type: ci
user: drh
comment:
  Consolidate more of the DISTINCT processing logic into a single spot in the
  code.  Reduce the number of OP_Column operations needed to perform a
  WHERE_DISTINCT_ORDERED.


type: ci
user: drh
comment:
  Command-line shell enhancements:  Added the ".print" command.  Enhanced
  the ".width" command so that negative widths will right-justify.


type: ci
user: drh
comment:
  Enable query planner tracing using the new (and undocumented) ".wheretrace 1"
  command in the command-line shell if both the shell and the core are
  compiled with SQLITE_DEBUG and SQLITE_ENABLE_WHERETRACE.  This is not a 
  supported API. Use for testing and debugging only.


type: ci
user: drh
comment:
  Change the internal sqlite3WhereBegin() to report that the ORDER BY clause
  is satisfied by indices using the WhereInfo.nOBSat field of the returned
  structure.


type: ci
user: drh
comment:
  Remove an unused subfunction parameter and an obsolete comment from the
  query planner logic in where.c.


type: ci
user: drh
comment:
  Pass information around between the major routines of the query planner
  using a single pointer to a structure rather than a long list of parameters.


type: ci
user: drh
comment:
  Augment the WhereBestIdx structure to pass down into the query planner 
  information that might be used to better detect ORDER BY and DISTINCT
  optimizations spanning multiple tables of a join.


type: ci
user: drh
comment:
  Further refactoring of the ORDER BY related query-planning logic in order
  to make it easier to extend to support optimizing out ORDER BY on joins.
  No actual behavior changes, yet.


type: ci
user: drh
comment:
  Test cases and bug fixes applied to the ORDER BY optimization for joins.
  Some test cases fail, but except for the new orderby1.test failures, all
  failures appear to be issues with the tests, not with the core code.


type: ci
user: drh
comment:
  Add more bits to the bit vector that is used to disable optimizations for
  built-in test.  Add specific bit patterns to disable ORDER BY using an
  index in general and for joins.  Use macros to test for bits in the 
  disabled-optimization bit vector, in order to make the code clearer.


type: ci
user: drh
comment:
  Query planner enhancements to be more agressive about optimizing out ORDER BY
  clauses - in particular the query planner now has the ability to omit ORDER BY
  clauses that span multiple tables in a join.


type: ci
user: mistachkin
comment:
  Modify generation of resource header file for MSVC so that it can work from outside the working directory.


type: ci
user: drh
comment:
  Fix some corner case behavior in the new ORDER BY optimization logic.
  Remove the SQLITE_OrderByIdx bit from the 
  SQLITE_TESTCTRL_OPTIMIZATIONS mask, since enabling it caused many
  TH3 tests to fail when the NO_OPT configuration parameter was engaged,
  and since there really isn't any need to turn that optimization off.
  The SQLITE_OrderByIdxJoin bit remains.


type: ci
user: drh
comment:
  Merge the latest trunk changes (PRAGMA busy_timeout and the ORDER BY
  query planner enhancements) into the apple-osx branch.


type: ci
user: dan
comment:
  Avoid calling sqlite3BtreeEnter() in a corner case where the corresponding database handle mutex (sqlite3.mutex) may not be held. This prevents a potential deadlock or crash that can occur if the backup API, shared-cache mode and SQLITE_HAVE_CODEC are all in use.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Merge the latest trunk changes (especially "PRAGMA busy_timeout" and the
  ORDER BY query planner optimizations) into the sessions branch.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Update the sessionfault-9.1 and -9.2 tests to account for the change in
  version 3.7.11 in which a pending statement no longer blocks ROLLBACK but
  instead causes the next call on that statement to return SQLITE_ABORT.


type: ci
user: dan
comment:
  Ensure that the value returned by xSectorSize() is reasonable (currently defined as between 2^5 and 2^16 bytes) before using it to calculate the amount of padding to add to a wal file.


type: ci
user: drh
comment:
  Make sure the size parameter to read and write VFS methods in the unix VFS
  do not become too big or go negative.  This was not actually possible in the
  current code.  The checks are added to make sure some future bug does not
  make it possible.


type: ci
user: dan
comment:
  Add SQLITE_FCNTL_BUSYHANDLER. Invoked to provide access to the busy-handler callback to custom VFS implementations.


type: ci
user: drh
comment:
  Make sure the outer loop cursor numbers are recorded in time for them to be
  used by the ORDER BY optimizer.


type: ci
user: drh
comment:
  Factor an invariant out the loop termination condition for the ORDER BY
  satisfied-by-index analyzer routine.


type: ci
user: drh
comment:
  More lenient handling of ORDER BY optimization in joins with mixed ASC/DESC.
  This is a better and less restrictive fix for the problem addressed by
  the previous check-in.


type: ci
user: drh
comment:
  Only continue an ORDER BY optimization into inner loops if the equality
  constraints on the inner loop match terms of an outer ordered index that
  are actually used by the ORDER BY clause.


type: ci
user: drh
comment:
  Fix the TCL interface so that SQL functions implemented in TCL honor the
  "nullvalue" setting.  Also remove from the TCL interface some unused 
  legacy UTF8 translation code left over from SQLite2.


type: ci
user: drh
comment:
  Fix a query planner problem that only occurs when covering-index-scan is
  disabled.  Fix to tests whose output changed due to the new and more
  aggressive ORDER BY optimization.


type: ci
user: drh
comment:
  Update the query planner to recognize more cases where ORDER BY clauses
  can be optimized out.  Add test cases to verify correct behavior of the
  ORDER BY optimization when the covering-index-scan optimization is disabled.
  Fix a harmless compiler warning in the TCL interface.


type: ci
user: mistachkin
comment:
  Add experimental sqlite3_reconfig() interface to more fully support the SQLITE_CONFIG_READONLY option.


type: ci
user: drh
comment:
  Fix an out-of-order memset() that occurs before all variable declarations
  are finished.  Also fix a line that exceeds the 80-character line length
  limit.


type: ci
user: drh
comment:
  Yet another refactoring of ORDER BY logic in the query planner.  This
  particular check-in works mostly, but still has a few minor issues.


type: t
user: drh
brief: Fixed ticket [d02e1406a5].
comment:
  Fixed ticket [d02e1406a5]: <i>LEFT JOIN with an OR in the ON clause causes segfault</i> plus 2 other changes


type: ci
user: drh
comment:
  Increase the version number to 3.7.14.1.  The version of autoconf used is
  different from the previous release so there are huge differences in the
  generated "configure" script.


type: ci
user: dan
comment:
  Fix a problem with shared-cache mode and CHECK constraints causing one db handle to invoke a collation sequence function registered with another.


type: ci
user: dan
comment:
  Fix a problem in shared-cache mode where a COMMIT statement might cause a busy-handler belonging to a shared-cache connection other than the current writer to be invoked.


type: ci
user: mistachkin
comment:
  Changes for WinRT compatibility.  Also, allow version resource compilation and embedding to be disabled at compile-time.


type: ci
user: drh
comment:
  Continued refactoring of the ORDER BY optimization logic.  This check-in
  is close to working, but it still has issues.  A few test cases fail.


type: ci
user: drh
comment:
  Further tweaks to the ORDER BY optimizer, to fix a bug and to get the 
  optimizer to recognize some additional cases.


type: ci
user: drh
comment:
  All test cases (veryquick.tcl and min.rc) pass.  A few branch operations in
  ORDER BY optimization logic are untested by min.rc.


type: ci
user: drh
comment:
  Bring some comments up to date in the query planner, and especially the
  ORDER BY optimizer.  Also add testcase() macros.


type: ci
user: drh
comment:
  Avoid an assertion fault and/or freeing memory while it is still in use when
  an error occurs during virtual table construction.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Merge the latest trunk changes, especially the ORDER BY optimizer enhancements
  but also other fixes, onto the sessions branch.


type: ci
user: dan
comment:
  Move a couple of WAL-related function declarations in sqliteInt.h and pager.h into "#ifndef SQLITE_OMIT_WAL" blocks. Otherwise, the amalgamation fails to build using some compilers with SQLITE_OMIT_WAL (static function declared but not defined).


type: ci
user: dan
comment:
  Ensure that when the source of a backup is a database that is zero bytes in size, the final destination database consists of at least one page. Truncating it to zero bytes is equivalent to zeroing the schema cookie and change counter, which can cause problems for existing clients.


type: ci
user: drh
comment:
  Ensure that when the source of a backup is a database that is zero bytes 
  in size, the final destination database consists of at least one page. 
  Truncating it to zero bytes is equivalent to zeroing the schema cookie 
  and change counter, which can cause problems for existing clients.


type: ci
user: drh
comment:
  Change the ICU tokenizer so that it does not attempt to call strlen(NULL).
  This is a cherry-pick of the fix in [04298f1ac42c40c] on 2012-03-31 first
  appearing in release 3.7.12.


type: ci
user: drh
comment:
  An optimization that converts "a IN (b)" into "a==b".  Seems to work, but needs
  additional test cases.


type: ci
user: mistachkin
comment:
  Add detailed comments to the build tools used to generate the VSIX package.  Also, allow the build configurations and native library directories to be overridden for the multi-platform build tool for MSVC.


type: ci
user: drh
comment:
  Initial check-in of a test VFS designed to simulate a NAND-flash SSD for the
  purpose of measuring and subsequently minimizing write amplification caused
  by SQLite.  The code in this check-in compiles but does not run.


type: ci
user: drh
comment:
  Improvements to the command-line argument parsing in the 
  command-line shell.  Command-line options can now occur either before
  or after the database name and first command and are still accepted and
  processed.  Command-line options are processed even if no database name
  is given (and :memory: is assumed).


type: ci
user: dan
comment:
  Fix a bug in fts3 causing it to return SQLITE_NOMEM when NEAR, OR and some auxiliary functions were used together. Also a segfault in vtab.c that could follow an OOM condition.


type: ci
user: drh
comment:
  Merge the command-line shell enhancements from trunk.  Other edits toward
  trying to get ssdsim to run.


type: ci
user: drh
comment:
  Use a constant string "BINARY" for the unspecified collating sequence.
  This is part of check-in [635e3a762dd] that is being back-ported.


type: ci
user: mistachkin
comment:
  Fix typo in usage text for the command-line shell.  Also, in the same usage text, make the file name argument to -init uppercase for consistency.


type: ci
user: drh
comment:
  Make sure all virtual table cursors have been closed on a prepared statement
  prior to unlinking the perpared statement from its database connection.
  The test case for this is in TH3, in the main39.test module.


type: ci
user: drh
comment:
  Make sure all virtual table cursors have been closed on a prepared statement
  prior to unlinking the perpared statement from its database connection.


type: ci
user: drh
comment:
  Further work on getting ssdsim to run.  This is an incremental checkin to
  save my place while jumping off to work on other things.


type: ci
user: drh
comment:
  Make sure the automatic index optimization is checked even if the 
  covering index scan optimization was previously selected.


type: ci
user: drh
comment:
  Add QNX-specific performance tweaks to the unix VFS. (Cherry-pick merge of
  [b02849e7bde458].)
  Put auxiliary libraries after libsqlite3.a in the testfixture target of
  the "main.mk" makefile.  (Cherry-pick merge of [8fc8548f52ab8fcfb5].)


type: ci
user: dan
comment:
  Fix a 32-bit integer overflow problem that could cause an error in a CREATE INDEX statement that writes more than 16GB of data.


type: ci
user: drh
comment:
  Add an optimization that attempts to run a subquery as a coroutine rather
  than manifesting it into a temporary table.


type: ci
user: drh
comment:
  Make it possible to disable the subquery-by-coroutine optimization using
  sqlite3_test_control().  Remove an always-false conditional.


type: ci
user: drh
comment:
  Merge the omit-wal-fix branch into branch-3.7.9 where it belongs, and in so
  doing get branch-3.7.9 working with SQLITE_OMIT_WAL.


type: ci
user: mistachkin
comment:
  Adjust the SQLITE_DBSTATUS_STMT_USED calculation to take the modified usage of sqlite3VdbeClearObject() into account.


type: ci
user: drh
comment:
  Take into account the cost of inner loops when selecting which table of a join
  to use for the next outer loop.


type: ci
user: drh
comment:
  Disable the table selection rule that tried to prevent full table scans from
  migrating to the outer loop unless they were optimal.  The new scaling of 
  outer-loop costs by cost of inner loops obviates the need for that step.  And,
  in fact, that step causes problems with the new inner-loop cost accounting.


type: ci
user: drh
comment:
  Only log unlink() errors if the error is something other than
  SQLITE_IOERR_DELETE_NOENT.  The error is still reported up the stack, it
  is simply not added to the sqlite3_log().


type: ci
user: dan
comment:
  Change os_unix.c to propagate ENOENT errors back to sqlite as SQLITE_IOERR_DELETE_NOENT. Have SQLite ignore these where they are benign and propagate them back to the caller where they may indicate a file-system malfunction of some description.


type: ci
user: drh
comment:
  Try to take into account the cost of inner loops when selecting which table
  of a join to use for the outer loop.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Merge the latest changes from trunk: chiefly the outer/inner loop query
  optimizer scoring enhancement and the INSTR() function.


type: ci
user: drh
comment:
  Strive to use posix_fallocate() rather than ftruncate() when 
  posix_fallocate() is available.  Ticket [5eaa61ea18].


type: ci
user: drh
comment:
  When available, use posix_fallocate() rather than ftruncate() to allocate
  space for mmap()ed -shm files, since posix_fallocate() gives an error if
  no disk space is available whereas ftruncate() is silent and leaves the system
  vulnerable to a SIGBUS upon first write to the mmap()ed region.
  Ticket [5eaa61ea1881040b17449ca043b6f8fd9ca55dc3]


type: ci
user: drh
comment:
  Use preprocessor macros to automatically detect whether or not
  posix_allocate() is available.  (It is generally available on Linux
  but not on Mac.)  Ticket [5eaa61ea1881040b17449ca043b6f8fd9ca55dc3]


type: ci
user: drh
comment:
  Have the windows implementation of xDelete return SQLITE_IOERR_DELETE_NOENT
  if the file to be deleted does not exist.  The unix implementation was
  previously modified to behave this way.  The current changes simply brings
  the two implementations into alignment.


type: ci
user: mistachkin
comment:
  In winDelete, determine that a file does not exist by checking for a last error of ERROR_FILE_NOT_FOUND or ERROR_PATH_NOT_FOUND.


type: ci
user: dan
comment:
  Fix problems in test_sqllog.c. Clarify the experimental SQLITE_CONFIG_SQLLOG interface. Handle at least the more likely error conditions in test_sqllog.c.


type: ci
user: dan
comment: Fix a problem causing the "number-of-documents" field maintained by FTS4 to be set incorrectly.
ecomment:
  Fix a problem causing the "number-of-documents" field maintained by FTS4 to be set incorrectly by REPLACE queries.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Update the sessions branch to include the SQLLOG enhancement, the
  SQLITE_IOERR_DELETE_NOENT fix, and a fix for the number-of-documents
  bug in FTS4.


type: ci
user: drh
comment:
  Mark the "async" module as deprecated as its functionality has been
  superceded by WAL mode.  This closes ticket [f46ca03b55ae0e]


type: ci
user: drh
ecomment:
  Do not exit the command-line shell if a ".read" command invokes a script that
  contains two errors.  But reported on the mailing list.

comment:
  Do not exist the command-line shell if a ".read" command invokes a script that
  contains two errors.  But reported on the mailing list.


type: ci
user: drh
comment:
  Make sure that the optimization that set the maximum column that will be used
  on a particular query does not mistakenly change an opcode other than
  OP_OpenRead or OP_OpenWrite.  In particular, make sure it does not overwrite
  the P4 field of an OP_SorterOpen.


type: g
user: dan
comment:
  Tag changes on [/timeline?dp=59c233942e583086&n=4 | 59c233942e583086]: Add symbolic tag "mistake". Cancel symbolic tag "trunk".


type: ci
user: mistachkin
comment:
  Improvements to the 'tcl' shell output mode.  Escape double quotes, set separator to space when mode is set, and skip separator after final column.


type: ci
user: drh
comment:
  Improvements to the 'tcl' shell output mode. Escape doublequotes, 
  set separator to space when mode is set, and skip separator after final 
  column.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=59c233942e583086&n=4 | 59c233942e583086]: Add propagating branch=mistake. Add propagating symbolic tag "mistake".


type: ci
user: dan
comment:
  If the atomic-write property is enabled, a transaction may be committed in journal_mode=DELETE mode without ever actually creating a journal file on disk. In this case, do not attempt to unlink() the journal file when committing the transaction.


type: ci
user: dan
comment:
  Since errors are ignored anyway, use sqlite3OsFileControlHint() instead of OsFileControl() to invoke the SQLITE_FCNTL_BUSY_HANDLER file-control.


type: ci
user: dan
comment:
  Fixes to a test case in shared_err.test. The fix is to prevent sqlite3_prepare() from being called when the test intends to test the response of sqlite3_step() to an OOM condition.


type: ci
user: dan
comment:
  Modify a query in test/thread001.test to ensure that results are returned in the order expected by the test.


type: ci
user: drh
comment:
  Make sure memory is freed using a routine that is compatible with the
  routine used to allocate the memory.  The SQLITE_MEMDEBUG compile-time
  option enforces this.


type: ci
user: drh
comment:
  Stop using the TCL_LIBS configuration variable when linking with Tcl.
  Remove superfluous 'rm' command from the "clean" target.


type: ci
user: mistachkin
comment:
  For the sqlite3-all.c target, use backslashes when calling the splitter script via the MSVC makefile.


type: ci
user: mistachkin
comment:
  Stop using the TCL_LIBS configuration variable when linking with Tcl.  Remove superfluous 'rm' command.


type: ci
user: dan
comment:
  Apply the same restrictions on constant refactoring to statements within a trigger program as top-level statements. Candidate fix for [ae3c5670b6].


type: ci
user: drh
comment:
  Add the SQLITE_FCNTL_TEMPFILENAME file control that asks the underlying VFS
  to return a new temporary filename.  Per request from NSS team at Mozilla.


type: ci
user: dan
comment:
  Cherrypick [79ef8e3c77] (Apply the same restrictions on constant refactoring to statements within a trigger program as top-level statements).


type: t
user: dan
brief: Ticket [ae3c5670b6]: 3 changes
comment:
  Ticket [ae3c5670b6] <i>Bug caused by factoring of constants in trigger programs</i> status still Open with 3 other changes


type: t
user: dan
brief: Closed ticket [ae3c5670b6].
comment:
  Closed ticket [ae3c5670b6]: <i>Bug caused by factoring of constants in trigger programs</i> plus 1 other change


type: ci
user: drh
comment:
  Remove the Expr.pColl field and compute the collating sequence as it is needed.
  This fixes the test script "shared9.test", though there is still a memory leak.
  And there are other problems.  Consider this a work-in-progress.


type: ci
user: dan
comment:
  Do not run test file malloc3.test as part of the inmemory_journal permutation. Explanation is in a comment at the top of malloc3.test.


type: t
user: dan
brief: Ticket [d6b36be38a]: 3 changes
comment:
  Ticket [d6b36be38a] <i>Sub-select in LIMIT clause may access db without locks.</i> status still Open with 3 other changes


type: ci
user: dan
comment:
  Ensure the VerifyCookie sub-routine has been run before the database is accessed in an obscure case. Fix for ticket [d6b36be38].


type: ci
user: drh
comment:
  Fix the processing of ORDER BY clauses with COLLATE terms on compound
  queries.  52 veryquick test failures remain.


type: ci
user: drh
ecomment:
  Veryquick now runs to completion without segfaulting or asserting.  But there
  are still lots of errors.

comment:
  Veryquick now row to completion without segfaulting or asserting.  But there
  are still lots of errors.


type: t
user: dan
brief: Ticket [d6b36be38a]: 1 change
comment:
  Ticket [d6b36be38a] <i>Sub-select in LIMIT clause may access db without locks.</i> status still Open with 1 other change


type: t
user: dan
brief: Closed ticket [d6b36be38a].
comment:
  Closed ticket [d6b36be38a]: <i>Sub-select in LIMIT clause may access db without locks.</i> plus 1 other change


type: ci
user: drh
comment:
  Duplicating check constraint expressions prior to code generation is no
  longer required, and so it is removed.


type: ci
user: drh
comment:
  For an ORDER BY on a compound SELECT, take the collating sequence from the
  left-most term of the compound.


type: ci
user: drh
comment:
  Recognize TK_COLLATE operators that have been transformed into TK_REGISTER.
  Skip both TK_COLLATE and TK_AS operators when looking for the top of an
  expression.


type: ci
user: drh
comment:
  Fix a long-standing issue with the distinct-as-aggregate optimization that
  only expressed when the new collating-sequence logic is turned on.


type: ci
user: drh
comment:
  Adjustments to the collating-sequence refactoring to facilitate full-coverage
  testing and to fix some minor issues found by TH3.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Pull the latest trunk changes into the sessions branch, and in particular
  the collating-sequence refactorization.


type: ci
user: drh
comment:
  Refactor collating-sequence handling as a fix for ticket [71e333e7d2e642].
  The Expr.pColl field is removed from the Expr object.  The COLLATE operator
  now becomes a separate instance of Expr in the expression tree.  The code
  generator looks up the correct collating function as needed, rather than
  referring to Expr.pColl.


type: ci
user: drh
comment:
  Factor some work out of the index loop of the bestBtreeIndex() routine for
  a small performance increase.


type: ci
user: dan
comment:
  Modify releasetest.tcl so that it runs the "checksymbols" test on a build without SQLITE_DEBUG defined. If SQLITE_DEBUG is defined, the sqlite3WhereTrace variable causes the test to fail.


type: ci
user: drh
comment:
  When an arithmetic operation with two integer operands must give a 
  floating-point answer due to overflow, make sure the answer is not
  rounded back to integer by affinity.


type: ci
user: drh
comment:
  Update requirements marks and test cases for multi-VALUE INSERT and to fix
  typos in requirements text.


type: ci
user: dan
comment:
  Attempt to further generalize the min/max optimization so that, if an appropriate index exists, it can be used by any aggregate query that contains only a single aggregate of the form max(colname) or min(colname) and does not contain a GROUP BY clause.


type: ci
user: drh
comment:
  Generalize the min/max optimization so that if an appropriate index exists,
  the index it can be used by any aggregate query that contains only a single
  max() or min() and does not contain a GROUP BY clause.


type: ci
user: drh
comment:
  Fix the virtual table IN optimizer so that it work even if the virtual table
  implementation leaves the sqlite3_index_info.aConstraintUsage[].omit flag
  clear for an equality constraint that it intends to use.


type: ci
user: drh
comment:
  Fix an issue with child keys that are not INTEGER PRIMARY KEY
  referencing INTEGER PRIMARY KEY in the parent.


type: ci
user: drh
comment:
  Enhance the error message for "foreign key mismatch" to include the names of
  the child and parent tables.  Begin adding test cases for 
  PRAGMA foreign_key_check.  Make sure PRAGMA foreign_key_check gets all
  necessary table locks.


type: ci
user: drh
comment:
  Add to the foreign_key_check pragma an extra output column "parent" that
  contains the name of the parent table for the constraint that failed.


type: ci
user: drh
comment:
  Added test cases for PRAGMA foreign_key_check.  Fixed a bug that appears
  when the column order of the child and parent differ.


type: ci
user: dan
comment:
  On atomic-write capable systems, if copying the contents of an in-memory journal to disk fails, close the (on disk) journal file before returning the error to the caller. This causes the subsequent rollback operation to use the in-memory journal. Fix for [df678d738adb].


type: t
user: dan
brief: New ticket [df678d738a].
comment:
  New ticket [df678d738a] <i>Cache corruption following IO error on systems supporting atomic-write</i>.


type: ci
user: drh
comment:
  Remove old commented-out code from parse.y.  Fix some over-length source lines
  in parse.y.  No logical changes.


type: t
user: dan
brief: Closed ticket [df678d738a].
comment:
  Closed ticket [df678d738a]: <i>Cache corruption following IO error on systems supporting atomic-write</i> plus 4 other changes


type: ci
user: drh
comment:
  Resolve names in FROM-clause subqueries prior to resolving names in the
  result set expressions of a SELECT statement.


type: ci
user: drh
comment:
  Optimize the degenerate case of a FROM clause table name enclosed all by
  itself inside parentheses.  Generate code as if the parentheses did not
  exist, rather than the old behavior of manifesting the parenthesized table
  into a transient table.  Also, tag every FROM-clause SELECT subquery that is
  generated by a parenthesized FROM-clause expression using the SF_NestedFrom
  flag.  The new SF_NestedFrom flag is not yet used for anything.


type: ci
user: drh
comment:
  Better resolution of table and column names in joins where some of the
  terms of the FROM clause are parenthesized.


type: ci
user: drh
comment:
  Add commentary to the ExprList object to explain how zSpan is overloaded.
  Add test cases for the new name resolution functionality.


type: t
user: drh
brief: Ticket [a7b7803e8d]: 4 changes
comment:
  Ticket [a7b7803e8d] <i>crash when filtering twice by same predicate using aliases</i> status still Open with 4 other changes


type: t
user: drh
brief: Fixed ticket [71e333e7d2].
comment:
  Fixed ticket [71e333e7d2]: <i>COLLATE operator inside CHECK constraint fails in shared-cache mode</i> plus 5 other changes


type: t
brief: Ticket [a7b7803e8d]: 6 changes
comment:
  Ticket [a7b7803e8d] <i>crash when filtering twice by same predicate using aliases</i> status still Open with 6 other changes


type: t
user: drh
brief: Fixed ticket [a7b7803e8d].
comment:
  Fixed ticket [a7b7803e8d]: <i>crash when filtering twice by same predicate using aliases</i> plus 3 other changes


type: ci
user: drh
comment:
  Fix the segfault problem of ticket [a7b7803e8d1e869] which involved
  the use of "AS" named result columns as logical terms of the WHERE clause.


type: ci
user: drh
comment:
  Additional test cases involving the use of a result column specified by its
  "AS" name as a logical term of the WHERE clause.
  Ticket [a7b7803e8d1e8699cd].


type: ci
user: drh
comment:
  Backport to the 3.7.15 branch 
  the fix to the segfault problem of ticket [a7b7803e8d1e869] which involved
  the use of "AS" named result columns as logical terms of the WHERE clause.
  Also, change the version number to 3.7.15.1.


type: ci
user: drh
comment:
  Add PRAGMA foreign_key_check.  Name the child and parent tables as part of
  a "foreign key mismatch" error.


type: t
user: dan
brief: New ticket [0cfd98ee20].
comment:
  New ticket [0cfd98ee20] <i>Potential corruption of backup db when backing up a db last written by sqlite&lt;3.7.0</i>.


type: t
user: dan
brief: Closed ticket [0cfd98ee20].
comment:
  Closed ticket [0cfd98ee20]: <i>Potential corruption of backup db when backing up a db last written by sqlite<3.7.0</i> plus 5 other changes


type: ci
user: dan
comment:
  Ensure the database size field in the db header of a backup database is set correctly. Fix for [0cfd98ee201].


type: ci
user: drh
comment:
  Enhance the table_info pragma so that the pk column shows the order of the
  columns in a multi-column primary key.


type: t
brief: Ticket [6c266900a2]: 5 changes
comment:
  Ticket [6c266900a2] <i>shell: The column mode (and width option) does not manage correctly UTF-8</i> status still Open with 5 other changes


type: t
brief: New ticket [6c266900a2].
comment:
  New ticket [6c266900a2] <i>shell: The column mode (and width option) does not manage correctly UTF-8</i>.


type: t
brief: Ticket [5ac9b497de]: 6 changes
comment:
  Ticket [5ac9b497de] <i>Some issues with aliases, fully qualified identifiers, and *</i> status still Open with 6 other changes


type: t
user: drh
brief: Ticket [5ac9b497de]: 7 changes
comment:
  Ticket [5ac9b497de] <i>Some issues with aliases, fully qualified identifiers, and *</i> status still Open with 7 other changes


type: ci
user: drh
comment:
  When resolving result-set name collisions, make them x:1, x:2, x:3, etc.
  instead of x:1, x:1:1, x:1;1;1.


type: t
brief: Ticket [5ac9b497de]: 3 changes
comment:
  Ticket [5ac9b497de] <i>Some issues with aliases, fully qualified identifiers, and *</i> status still Open with 3 other changes


type: ci
user: drh
comment:
  Remove an incorrect assert() statement (ticket [beba9cae6345a]).  Fix other
  minor problems in the name resolution logic.


type: ci
user: drh
comment:
  Improvements to column name resolution in queries with parenthesized FROM
  clauses.  Also includes a fix for ticket [beba9cae6345a3].


type: ci
user: drh
comment:
  Bring back test_regexp changes that were made when porting to Fossil.  Also
  fix some bugs that were introduced by the Fossil port.


type: ci
user: drh
comment:
  Fix the zInit[] optimization of test_regexp.c when the initial string
  contains 3-byte UTF8 characters.


type: ci
user: drh
comment:
  Do not use umask() since it change the umask for the entire process, not just
  the thread using SQLite.  Make whatever permission changes are needed using
  fchmod() after the file is created, instead.


type: ci
user: drh
comment:
  More bug fixes to the test_regexp.c module.  Bring test_regexp.c into alignment
  with the regexp.c file in the Fossil sources.


type: ci
user: dan
ecomment:
  Do not raise an error if an unknown SQL function is found in a CHECK constraint while parsing the schema of an existing database.  This version causes a run-time
  error when processing STAT3 tables.

comment:
  Do not raise an error if an unknown SQL function is found in a CHECK constraint while parsing the schema of an existing database.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=0a1207c895d9f775&n=4 | 0a1207c895d9f775]: Add propagating branch=mistake. Add propagating symbolic tag "mistake". Add closed. Add comment. Cancel symbolic tag "trunk".


type: ci
user: drh
comment:
  Do not raise an error if an unknown SQL function is found in a CHECK
  constraint while parsing the schema of an existing database.


type: t
user: dan
brief: Ticket [c997b11c4d]: 3 changes
comment:
  Ticket [c997b11c4d] <i>ORDER BY clause ignored in 3-way join query</i> status still Open with 3 other changes


type: ci
user: drh
ecomment:
  Fix an over-aggressive optimization of ORDER BY on a three-way join where the
  second table is UNIQUE and the ORDER BY occurs on the third table.
  Ticket [c997b11c4d53a2ee].

comment:
  Fix an over-aggressive optimization of ORDER BY on a three-way join where the
  second table is UNIQUE and the ORDER BY occurs on the third table.
  Ticket [598f5f7596b0557].


type: ci
user: drh
ecomment:
  Fix an over-aggressive optimization of ORDER BY on a three-way join where the
  second table is UNIQUE and the ORDER BY occurs on the third table.
  Ticket [c997b11c4d53a2].

comment:
  Fix an over-aggressive optimization of ORDER BY on a three-way join where the
  second table is UNIQUE and the ORDER BY occurs on the third table.
  Ticket [598f5f7596b0557].


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=c0e09560d26f0a64&n=4 | c0e09560d26f0a64]: Add bgcolor=#d0c0ff. Add comment. Add symbolic tag "version-3.7.15.2".


type: t
user: dan
brief: Closed ticket [7c6a01c6c5].
comment:
  Closed ticket [7c6a01c6c5]: <i>Multi-column index is not used with IN operator</i> plus 6 other changes


type: ci
user: drh
comment:
  Fix a missing word in a comment.  Enhance the "wheretrace" debugging output
  to show the estimated cost of each table option while planning the join order.


type: ci
user: drh
comment:
  Improvements to query planning for joins:  Avoid unnecessary calls to
  "optimal scan" checks in cases where table reordering is not possible.
  Make sure optimal scan checks are carried out for CROSS JOINs and LEFT
  JOINs.


type: ci
user: drh
comment:
  Improved comments explaining the operation of the findTerm() utility routine
  in where.c.  Increase the maximum number of levels of transitivity from 4
  to 11.


type: ci
user: drh
comment:
  Avoid unnecessary collating sequence and affinity restrictions on the use
  of transitivity.  Add test cases to show that the restrictions are not 
  needed.


type: ci
user: drh
comment:
  Add the ability to disable transitive constraints using the 
  sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS) interface.


type: ci
user: drh
comment:
  Improved error messages on the RTREE virtual table.  Make the "fs" virtual
  table used for testing available on windows.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Enhancements to the query planner to exploit transitive relationships in the
  WHERE clause, and other minor changes to bring the sessions branch into
  alignment with the trunk.


type: ci
user: drh
comment:
  Further improvements to showwal.c:  Reset the checksum after each frame so that
  only individual checksum failures are shown.  And only show failures, not
  correct checksums.


type: ci
user: drh
comment:
  Add btree-page decoding logic to showwal.c.  Commands of the form:
  "showwal $FILE 123bmc" show the content of the btree page in frame
  123.  "b" means decode the btree.  "c" means show cell content.
  "m" means give a map of the btree page.


type: ci
user: drh
comment:
  Enhance the command-line shell so that adding a non-zero numeric argument
  to the ".exit" command causes an immediate exit without cleaning up.  This
  can be used (for example) to cause journal files to be left behind.


type: ci
user: drh
comment:
  Fix the test_spellfix.c extension so that it can be made loadable at run-time.
  Add spellfix to the shell when building using the build-shell.sh script.


type: ci
user: drh
comment:
  Cause the command-line shell to issue an error message if you give something
  that does not look like a boolean value to a dot-command that wants a boolean
  argument.


type: ci
user: drh
comment:
  Issue an error message and quit (rather than overflowing a reference counter)
  if the number of references to a table exceeds the maximum due to nested
  UNION views.  Fix for ticket [d58ccbb3f1].


type: t
user: drh
brief: Fixed ticket [d58ccbb3f1].
comment:
  Fixed ticket [d58ccbb3f1]: <i>Segmentation fault on a valid query with "union"</i> plus 6 other changes


type: ci
user: drh
comment:
  New debugging pragmas:  PRAGMA vdbe_debug=ON is short-hand for the sql_trace,
  vdbe_listing, and vdbe_trace pragmas.  PRAGMA vdbe_debug enables tracing of
  sqlite3VdbeAddOp() calls.  None of this is active unless compiled with
  SQLITE_DEBUG.


type: ci
user: drh
comment:
  Fix LIMIT and OFFSET so that they work and do not leak memory even on
  complex queries involving deeply nested views of UNION ALL compounds.
  Ticket [db4d96798da8].  Secondary to ticket [d58ccbb3f1b7].


type: t
user: drh
brief: Ticket [db4d96798d]: 6 changes
comment:
  Ticket [db4d96798d] <i>LIMIT does not work with nested views containing UNION ALL</i> status still Open with 6 other changes


type: t
user: drh
brief: Fixed ticket [db4d96798d].
comment:
  Fixed ticket [db4d96798d]: <i>LIMIT does not work with nested views containing UNION ALL</i> plus 3 other changes


type: ci
user: drh
comment:
  Allow an index to be used for sorting even if prior terms of the index
  are constrained by IN operators.


type: ci
user: drh
comment:
  Allow the "a=?1 OR a=?2" to "a IN (?1,?2)" transformation to work on virtual
  tables again.  This was formerly restricted because virtual tables could not
  optimize IN terms.  (See check-in [fad88e71cf195e].)  But IN terms are now
  used by virtual tables (as of check-in [3d65c70343]) so the restriction can
  now be removed.


type: ci
user: drh
comment:
  Loop through the elements on the RHS of an IN operator in reverse order when
  the ORDER BY clauses specifies DESC.


type: ci
user: drh
comment:
  Make sure the virtual tables that take advantage of IN operators sort the
  RHS of the IN operator in the correct order according to the ORDER BY
  clause.


type: ci
user: drh
comment:
  Fix a potential NULL-pointer dereference following an OOM error
  in the query planner logic for virtual tables with OR-connected terms.


type: ci
user: drh
comment:
  Rename SQLITE_CONSTRAINT_RAISE to SQLITE_CONSTRAINT_TRIGGER.  Put the 
  extended constraint error codes in alphabetical order.  Add many test cases
  for the extended constraint error codes.


type: ci
user: drh
comment:
  A bug report coming from from Firefox 
  ([https://bugzilla.mozilla.org/show_bug.cgi?id=840377])
  describes an infinite recursion.  We are unable to reproduce the problem.
  Nevertheless, this check-in should prevent the problem from ever occurring
  again.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Enhancements to the query planner to make use of indices for ORDER BY even
  when IN constraints are in the WHERE clause.  Add extended error codes for
  all SQLITE_CONSTRAINT errors.


type: ci
user: drh
comment:
  Verify that the schema has not changed before running PRAGMA table_info,
  index_list, index_info, and foreign_key_list.


type: ci
user: drh
comment:
  Add the edit_cost_table= command to the spellfix1 virtual table, permitting
  the edit distance cost table to be changed at runtime.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=6f3081a8e52beca1&n=4 | 6f3081a8e52beca1]: Add propagating branch=shunning-error. Add propagating symbolic tag "shunning-error".


type: ci
user: drh
comment:
  Do not rollback the schema if a parsing error occurs while parsing the schema
  and writable_schema is set.


type: ci
user: drh
comment:
  Enhance the pgidx of the showdb utility so that it provides better information
  even if the sqlite_master table is corrupt.


type: ci
user: drh
comment:
  Fix the showdb utility so that it displays the correct secondary usage of
  a page when reporting on an error of a page being used more than once.


type: ci
user: dan
comment:
  If a rollback mode transaction reduces the size of the database file, avoid actually truncating the file until after the transaction has been committed (but before the db has been unlocked). This means pages that are removed from the database by truncating the file need not be journalled.


type: ci
user: drh
comment:
  Strengthen the final test case in index5.test.  Also provide additional
  diagnostic information out the output.


type: ci
user: dan
comment:
  Change the way test script incrvacuum3.test copies database files in order to avoid trying to read the (locked) 512 byte 'pending-byte' region.


type: ci
user: drh
comment:
  When comparing names during name resolution, make sure the names match
  exactly and that one name isn't merely a prefix of the other.
  Fix for ticket [7a31705a7e6c95d51].


type: ci
user: drh
comment:
  Always use strncmp() rather than memcmp() when comparing strings where one
  or other string might be less than the length parameter, since optimized
  versions of memcmp() might read past the first difference and in so doing
  generate an access violation.


type: t
user: drh
brief: Fixed ticket [7a31705a7e].
comment:
  Fixed ticket [7a31705a7e]: <i>Name resolution fails when table name is a prefix of another table</i> plus 4 other changes


type: ci
user: drh
comment:
  Update the cygwin interface to use the newer 1.7 APIs instead of the
  1.5 APIs.  Also shorten over-length source code lines in os_win.c.


type: ci
user: drh
comment:
  Complete the initialization of the loadable extension thunk table.  Also
  fix other (harmless) compiler warnings.


type: ci
user: drh
comment:
  Update comments on the free-page allocator to accurately reflect the
  latest implementation.  Add new asserts to the free-page allocator.


type: ci
user: drh
comment:
  Add the test_fs.c test module to Makefile.in.  Adjust the success criteria
  on index5-1.3 so that it works under auto_vacuum configurations.


type: ci
user: dan
comment:
  Remove an assert() statement that has been incorrect since the recent incremental-vacuum related changes in [26e235b7a4].


type: ci
user: dan
comment:
  Omit a test that uses the progress handler callback from view.test if OMIT_PROGRESS_HANDLER is defined.


type: ci
user: dan
comment:
  Do not attempt to set the permissions on an existing journal or wal file. Do this only immediately after creating a new file (or opening one zero bytes in size).


type: ci
user: dan
comment:
  Add extended error code SQLITE_READONLY_ROLLBACK. Returned if a read-only connection cannot read the database because doing so would require it to roll back a hot-journal.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=4e6e07a60e543d5d&n=4 | 4e6e07a60e543d5d]: Add propagating branch=ex-robust-open. Add propagating symbolic tag "ex-robust-open". Add comment. Cancel symbolic tag "trunk".


type: ci
user: drh
comment:
  Fix a bug (ticket [fc7bd6358f59]) that caused incorrect query results in
  three way queries that involved comparing INTEGER and TEXT columns for
  equality.


type: t
user: drh
brief: Fixed ticket [fc7bd6358f].
comment:
  Fixed ticket [fc7bd6358f]: <i>Incorrect query result in a 3-way join due to affinity issues</i> plus 4 other changes


type: ci
user: drh
comment:
  Add the SQLITE_READONLY_ROLLBACK extended error code.
  Do not try to set the permissions on journal or wal files except if the
  filesize is initially zero (indicating that it is a new file.)


type: ci
user: mistachkin
comment:
  Fix two compilation issues, one warning and one error, that occur only when SQLITE_OMIT_UTF16 is defined.


type: ci
user: dan
comment:
  Avoid an assertion fault and/or freeing memory while it is still in use when
  an error occurs during virtual table construction. Cherrypick of [a02599ad85d].


type: ci
user: dan
comment:
  If SQLITE_OMIT_UTF16 is defined, avoid setting the 'enc' field of Schema objects to any value except SQLITE_UTF8. Otherwise, assert() statements may fail or spurious SQLITE_NOMEM errors may be returned at the vdbe level later on.


type: ci
user: dan
comment:
  Fix a problem with resolving "db.view.column" references that appear in UPDATE or DELETE statements executed against views.


type: ci
user: drh
comment:
  Revised fix for the DESC ORDER BY and IN constraint bug,
  ticket [4dd95f6943fbd18].  The previous check-in was incorrect.


type: ci
user: drh
comment:
  A proposed fix for the DESC ORDER BY bug of ticket [4dd95f6943fbd18].
  Seems to work, but lots more testing is needed prior to moving to trunk.


type: ci
user: drh
comment:
  Fix the ORDER BY optimization with IN constraints when the RHS of the
  IN constraint is a descending index.


type: ci
user: drh
comment:
  Add a single new test case to the ORDER BY with IN logic verify that if the
  RHS of the IN is a descending index that it still works.  Add testcase()
  macros to the ORDER BY with IN logic to help verify that corner cases are
  tested.


type: t
user: drh
brief: Fixed ticket [4dd95f6943].
comment:
  Fixed ticket [4dd95f6943]: <i>Inverted result order with ORDER BY DESC and a DESC index.</i> plus 5 other changes


type: ci
user: drh
comment:
  Fix the ORDER BY with IN constraint logic so that it works with all
  combinations of DESC on the ORDER BY clause, on the RHS of the IN operator,
  and in the index used by ORDER BY and IN.  
  Fix for ticket [4dd95f6943fbd18].


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Fix a compiler warning in sqlite3VdbePreUpdateHook().
  Add sqlite3session.c to the amalgamation.
  Fix the Makefile.in to work with sessions.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Adjust the MSVC makefile so that it correctly handles the sessions
  extension being included in the amalgamation.  Import the test case
  changes that appeared in 3.7.16 final.


type: ci
user: drh
comment:
  Clarifications to the documentation for the sqlite3_aggregate_context() API.
  Also, shorten an over-length source line in sqlite.h.in.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Include the sqlite3session.h header file in with sqlite3.h.  Make sure
  the session APIs are all public.


type: ci
user: drh
comment:
  Fix text-to-numeric type casting so that it works correctly on UTF16
  strings that contain characters where the LSB is numeric but the MSB
  is non-zero.  Ticket [689137afb6da41]


type: ci
user: dan
comment:
  Fix a problem when opening a write-transaction while there exist read-only b-tree cursors in mmap mode.


type: ci
user: dan
comment:
  Add assert statements to os_unix.c to ensure that any mapped region of the database file is not being read or written using the xRead() or xWrite() methods.


type: ci
user: drh
comment:
  Remove the SQLITE_OMIT_MERGE_SORT compile-time option and its related code.
  The merge sorter is now a required component.


type: ci
user: dan
comment:
  In fts3, when filtering lists for hits in a specific column, edit the list in place in the same way as it is for NEAR filtering. Fix for [38b1ae018f].


type: ci
user: dan
comment:
  Do not return SQLITE_IOERR when the user attempts to open a small file that is not a database with mmap enabled. Instead return SQLITE_NOTADB.


type: ci
user: dan
comment:
  Change the signature of the xUnfetch method to "int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p)".


type: ci
user: dan
comment:
  Remove unnecessary code to round the size of a memory mapping to 4KB from os_unix.c. Rename SQLITE_IOERR_MREMAP to SQLITE_IOERR_MMAP. Fix other small issues in os_unix.c.


type: ci
user: dan
comment:
  Simulate OOM errors in the sqlite3OsFetch() function. Run malloc.test as part of the "mmap" permutation.


type: ci
user: drh
comment:
  Memory-mapped I/O is now on by default.  The "PRAGMA mmap_limit(N)" can be
  used to issue a hint to the VFS to limit mmap space to N bytes.  The VFS
  is free to ignore that hint if desired.  However, if "PRAGMA mmap_limit(0)"
  is used, xFetch is never called.


type: ci
user: drh
comment:
  Previous check-in accidently left mmap turned off by default. This checkin
  fixes that.  Unfortunately, shared.test is now segfaulting.  All other
  veryquick tests appear to work, however.


type: ci
user: dan
comment:
  In btree.c, save the positions of any open cursors before moving any pages around to auto-vacuum the database on commit.


type: ci
user: drh
comment:
  Candidate fix for ticket [6bfb98dfc0c]: Make sure invalid cursors drop all
  references to database pages prior to doing any insert or update.


type: t
user: drh
brief: Ticket [a179fe7465]: 7 changes
comment:
  Ticket [a179fe7465] <i>Incorrect output order on a join with an ORDER BY</i> status still Open with 7 other changes


type: ci
user: drh
ecomment:
  A fix and test-case for the ORDER BY problem identified by ticket [a179fe7465].
  This change causes sorting to occur in some cases where it is not strictly
  necessary.  Further work is needed to avoid those extra sorts.

comment:
  A fix an test-case for the ORDER BY problem identified by ticket [a179fe7465].
  This change causes sorting to occur in some cases where it is not strictly
  necessary.  Further work is needed to avoid those extra sorts.


type: t
user: drh
brief: Ticket [a179fe7465]: 3 changes
comment:
  Ticket [a179fe7465] <i>Incorrect output order on a join with an ORDER BY</i> status still Open with 3 other changes


type: t
user: drh
brief: Fixed ticket [a179fe7465].
comment:
  Fixed ticket [a179fe7465]: <i>Incorrect output order on a join with an ORDER BY</i> plus 3 other changes


type: ci
user: drh
comment:
  In order to optimize out the ORDER BY clause, 
  outer loops must generate values for ORDER BY terms that are unique or else
  the inner loops must generate no more than a single row.
  Fix for ticket [a179fe7465].


type: ci
user: dan
comment:
  Modify various test cases so that they work if the file is extended in units of the system page-size.


type: t
user: drh
brief: Fixed ticket [6bfb98dfc0].
comment:
  Fixed ticket [6bfb98dfc0]: <i>False report of database corruption on an INSERT</i> plus 5 other changes


type: ci
user: dan
comment:
  Fix a problem in btree.c that could cause a crash following an OOM. Also various test script problems.


type: ci
user: dan
comment:
  Attempt to emulate mremap() on non-Linux systems by allocating a second mapping immediately following the first in virtual memory.


type: ci
user: drh
comment:
  Bug fix in the winMapfile() subroutine:  Be sure to record the map object
  handle in the sqlite3_file object.


type: ci
user: drh
comment:
  In windows, round down the size of the memory mapped region to the next
  smaller multiple of the page size.


type: ci
user: drh
comment:
  Add the SQLITE_CONFIG_MMAP_LIMIT configuration option for overriding the
  SQLITE_DEFAULT_MMAP_LIMIT compile-time setting.  Enhance "PRAGMA mmap_limit"
  so that without a specific database name, it sets the limit on all database
  files and changes the default for any future databases that might be added
  using ATTACH.


type: ci
user: drh
comment:
  Always send the SQLITE_FCNTL_MMAP_LIMIT pragma to the VFS, even if the limit
  is zero and even if the VFS does not support xFetch().


type: ci
user: drh
comment:
  If the SQLITE_TRACE_SIZE_LIMIT compile-time parameter is set to a positive
  integer then limit the expansion of strings and blobs in trace output to
  approximately that many bytes.


type: ci
user: dan
comment:
  Change an assert in pager.c to acknowledge that it is possible for sqlite3PagerRollback() to return SQLITE_CORRUPT.


type: ci
user: dan
comment:
  Fix a bug in mmap2.test that was leaving an invalid sqlite3_log() callback installed, causing a crash.


type: ci
user: drh
comment:
  Adjustments to mmap1.test so that it works better on windows.  It still gets
  some answers wrong, but it no longer crashes.


type: ci
user: drh
comment:
  Fix the unix driver to check defined(_BSD_SOURCE) rather than just the plain
  _BSD_SOURCE macro.  This fixes the build for OpenBSD.


type: ci
user: dan
comment:
  In btree.c, save the positions of other cursors open on the same table when writing via an incremental blob handle. Otherwise, they may be left holding an out-of-date xFetch page reference.


type: ci
user: dan
comment:
  Remove the restriction on using xFetch to load the root pages of tables and indexes. It appears to have been based on a misconception.


type: ci
user: dan
comment:
  When moving a page to make way for the root page of a new table or index in an auto-vacuum database, save the positions of any cursors that may be holding xFetch references to the page being moved.


type: ci
user: drh
comment:
  Change the mmap_limit pragma to report the new limit, or to report the
  existing limit if called with no arguments.  Report the default mmap_limit
  as part of PRAGMA compile_options.  Set the default mmmap_limit to 0 for
  all systems other than linux, mac, windows, and solaris.


type: ci
user: drh
comment:
  Add a prototype TH3-script-style test harness that starts multiple processes
  operating on the same database file at the same time.


type: ci
user: drh
comment:
  Increase the default SQLITE_MAX_SCHEMA_RETRY to 50.  Make sure that macro
  covers every case where a prepared statement might need to be reprepared due
  to a schema change.  The sqlite3_exec() interface now uses 
  sqlite3_prepare_v2().


type: ci
user: drh
comment:
  Fix the --source command so that its argument is relative to the script.
  Verify that the SQLite header and library match.  Print SQLite version
  and compile-time configuration information on startup.


type: ci
user: drh
comment:
  Merge trunk changes into the mptest branch.  The mptest needs the
  SQLITE_MAX_SCHEMA_RETRY fix in particular.


type: ci
user: drh
comment:
  Add the vfsname() and eval() SQL functions to mptest.c. 
  Enhancements to the test/config01.test script.


type: ci
user: dan
comment:
  Handle the case in os_unix.c where SQLITE_FCNTL_MMAP_LIMIT requests that the mmap limit be set to a value smaller than the current mapping.


type: ci
user: drh
comment:
  Change mptester to avoid reporting SQLITE_BUSY errors if the busy handler
  is turned off and the tracing level is set low.


type: ci
user: drh
comment:
  Still more tests using mptester.  Added test cases that leave rollback
  journals that must be recovered by other threads.


type: ci
user: drh
comment:
  In mptester, handle startScript no-change commits using a retry rather
  than grabbing an exclusive transaction.


type: ci
user: drh
comment:
  Disable the use of memory-mapped I/O if the SQLITE_DISABLE_MMAP macro is
  defined.  Automatically define this macro for OpenBSD and QNX.  Other
  systems are likely to be added to the disabled list over time.


type: ci
user: drh
comment:
  Add extra #ifndef statements in os_unix.c and os_win.c to make sure the
  memory mapped I/O really is disabled when SQLITE_DISABLE_MMAP is set.


type: ci
user: drh
comment:
  Change the rollback journal so that it invokes sqlite3_log() make a record
  of a recovery, just as the WAL journal does.


type: ci
user: dan
comment:
  Check in the instrumented code for the mptest test case that appears to show a spontaneously disappearing journal file.


type: ci
user: drh
comment:
  Add new primary error codes SQLITE_NOTICE and SQLITE_WARNING for use with
  sqlite3_log().  Add new extended error codes SQLITE_NOTICE_RECOVER_WAL and
  SQLITE_NOTICE_RECOVER_ROLLBACK to use with sqlite3_log() messages that occur
  on each recovery.


type: ci
user: drh
comment:
  Have the UNIX VFS issue warnings via sqlite3_log() if a database file is
  renamed or unlinked or linked to more than one name while the file is open.


type: ci
user: drh
comment:
  Fix pragma code generation so that it always outputs an OP_Trace opcode so
  that pragmas are shown in sqlite3_trace() output.


type: t
user: drh
brief: Ticket [7ff3120e4f]: 6 changes
comment:
  Ticket [7ff3120e4f] <i>Recovery race condition leads to database corruption on Windows</i> status still Open with 6 other changes


type: ci
user: drh
comment:
  Increase the version number to 3.7.16.2 and cherrypick the
  fix for ticket [7ff3120e4fa54abb55].  This check-in is a release
  candidate.


type: ci
user: drh
comment:
  Fix the xCheckReservedLock() method on the windows VFS so that it cannot
  return a false positive when two or more processes use it at the same time
  on the same file.  Ticket [7ff3120e4fa54abb55]


type: ci
user: drh
comment:
  In mptester: improve the way that child processes are dispatched.  Pass
  the --vfs option through to children.  Log the command used to start
  child processes when the tracing level is high enough.


type: t
user: drh
brief: Ticket [7ff3120e4f]: 3 changes
comment:
  Ticket [7ff3120e4f] <i>Recovery race condition leads to database corruption on Windows</i> status still Open with 3 other changes


type: t
user: drh
brief: Fixed ticket [7ff3120e4f].
comment:
  Fixed ticket [7ff3120e4f]: <i>Recovery race condition leads to database corruption on Windows</i> plus 4 other changes


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Fix the xCheckReservedLock() method on the windows VFS so that it cannot return a false positive when two or more processes use it at the same time on the same file. Ticket [7ff3120e4fa54abb55].  Update to version 3.7.16.2.


type: ci
user: dan
comment:
  Change the fts4aux virtual table module so that fts4aux tables created in the temp database may report on fts3/fts4 tables in any attached database.


type: ci
user: drh
comment:
  Only consider AS names from the result set as candidates for resolving
  identifiers in the WHERE clause if there are no other matches.  In the
  ORDER BY clause, AS names take priority over any column names.
  Candidate fix for ticket [2500cdb9be].


type: ci
user: drh
comment:
  Only consider AS names from the result set as candidates for resolving
  identifiers in the WHERE clause if there are no other matches.
  In the ORDER BY clause, AS names take priority over any column names.
  Fix for ticket [2500cdb9be].


type: t
user: drh
brief: Fixed ticket [2500cdb9be].
comment:
  Fixed ticket [2500cdb9be]: <i>COLLATE in ORDER BY clause breaks name resolution</i> plus 4 other changes


type: ci
user: drh
comment:
  Refactoring the mmap interface.  The controlling pragma is now "mmap_size"
  instead of "mmap_limit".  Also change SQLITE_CONFIG_MMAP_LIMIT and
  SQLITE_FCNTL_MMAP_LIMIT to SQLITE_CONFIG_MMAP_SIZE and
  SQLITE_FCNTL_MMAP_SIZE, respecctively.  
  The default mmap_size is now always 0, meaning that
  memory mapped I/O is off by default.  There is a new compile-time option
  SQLITE_MAX_MMAP_SIZE that determines a hard upper bound on the mmap_size.
  Setting SQLITE_MAX_MMAP_SIZE to zero disables the memory-mapped I/O logic
  and causes it to be omitted from the build.  An extra argument is added
  to SQLITE_CONFIG_MMAP_SIZE that can optionally lower the SQLITE_MAX_MMAP_SIZE
  at start-time. The SQLITE_MAX_MMAP_SIZE is zero for platforms where we 
  know that it does not work, meaning that it cannot be turned on by mistake
  on those platforms.


type: ci
user: drh
comment:
  Omit sqlite3_compileoption_used() entries that are not explicitly stated
  on the compiler command-line, except keep SQLITE_THREADSAFE around so that
  there is always at least one compilation option.


type: ci
user: drh
comment:
  Update the command-line shell to give an exit code of 0 when the ".quit"
  command is run from the command-line.


type: ci
user: drh
comment:
  Improvements to some of the comments that are used to render documentation
  concerning loadable extensions.  No changes to code.


type: ci
user: drh
comment:
  In the mptester, add --glob and --notglob and --testcase.  Make --exit work
  on the main thread.  Enable the load_extension() SQL function.


type: ci
user: drh
comment:
  Fix the --match command in mptester so that it checks the entire result,
  not just a prefix of the result.


type: t
user: drh
brief: New ticket [f69b96e307].
comment:
  New ticket [f69b96e307] <i>Over-aggressive optimization of ORDER BY using a virtual table with IN operator</i>.


type: ci
user: drh
comment:
  Do not suppress the ORDER BY clause on a virtual table query if an IN
  constraint is used.  Fix for ticket [f69b96e3076e].  Testing done on
  TH3 using cov1/where37.test.


type: t
user: drh
brief: Fixed ticket [f69b96e307].
comment:
  Fixed ticket [f69b96e307]: <i>Over-aggressive optimization of ORDER BY using a virtual table with IN operator</i> plus 5 other changes


type: ci
user: drh
comment:
  Experiments in making loadable extensions easier to program.  The
  shared library filename tries various operating-system specific extensions
  if the bare library name does not work.  And the entry point is derived
  from the filename is the legacy entry point name "sqlite3_extension_init"
  is not found.


type: ci
user: drh
comment:
  Make the SQLITE_EXTENSION_INIT1 and SQLITE_EXTENSION_INIT2 macros into
  no-ops if the extension is statically linked.


type: ci
user: drh
comment:
  Enhance the extension loading mechanism so that the same source code
  can be used for run-time loadable extensions and statically linked
  extensions, and to mask architectural differences in shared libraries.


type: ci
user: drh
comment:
  Add the "warning" command to the TCL test infrastructure.  Fix problems
  with the loadext.test module.


type: ci
user: drh
comment:
  Use transitivity to move constraints into the outer loops of a join whenever
  possible, thereby reducing the amount of work that needs to occur in
  inner loops.


type: ci
user: drh
comment:
  Enhanced documentation for the SQLITE_CONFIG_SQLLOG mechanism and the
  test_sqllog.c demonstration file.  No changes to code.


type: ci
user: dan
comment:
  Add virtual table module 'fts3tokenize' to fts3. fts3tokenize provides SQL access to FTS tokenizer implementations.


type: ci
user: drh
ecomment:
  Update MSVC makefile for the fts3tokenize virtual table.  Clear some
  harmless compiler warnings in the fts3tokenize code.

comment:
  Update MSCV makefile for the fts3tokenize virtual table.  Clear some
  harmless compiler warnings in the fts3tokenize code.


type: t
user: drh
brief: Ticket [ba82a4a41e]: 6 changes
comment:
  Ticket [ba82a4a41e] <i>Query optimizer removes ORDER BY when it is needed</i> status still Open with 6 other changes


type: ci
user: drh
comment:
  Do not allow a virtual table to cancel the ORDER BY clause unless all
  outer loops are guaranteed to return no more than one row result.
  Candidate fix for ticket [ba82a4a41eac1].


type: t
user: drh
brief: Fixed ticket [ba82a4a41e].
comment:
  Fixed ticket [ba82a4a41e]: <i>Query optimizer removes ORDER BY when it is needed</i> plus 3 other changes


type: ci
user: drh
comment:
  Make "test_regexp.c" into a loadable extension and move it over to
  ext/misc/regexp.c.  Add the "load_static_extension" command for testing
  purposes.


type: ci
user: drh
comment:
  Make sure the affinity and datatype of sub-subqueries are initialized
  prior to subqueries as the latter relies on the former.


type: ci
user: drh
comment:
  Convert the fuzzer virtual table into a loadable extension and move it
  to the ext/misc/fuzzer.c file.


type: ci
user: drh
ecomment:
  Merge the std-ext branch into trunk.  This merge adds several new extensions
  to the ext/misc folder, including transitive_closure, ieee754, and amatch,
  and it converts some older src/test_*.c file into extensions in the ext/misc
  folder.

comment:
  Merge the std-ext branch into trunk.  This merge adds several new extensions
  to the ext/misc folder, including transitive_closure, ieee754, and amatch,
  and it convers some older src/test_*.c file into extensions in the ext/misc
  folder.


type: ci
user: drh
comment:
  Added the nextchar.c extension.  Minor changes to the spellfix.c extension
  so that it can be appended to an amalgamation and compiled without duplicating
  symbols.


type: ci
user: dan
comment:
  Rebalance FTS expressions after parsing to limit recursion during evaluation. Avoid recursion when deleting FTS expression trees. Enforce a limit on the depth of an expression tree.


type: ci
user: dan
comment:
  Rebalance FTS expressions after parsing to limit recursion during evaluation. Avoid recursion when deleting FTS expression trees. Enforce a limit (currently 12) on the depth of an expression tree.


type: ci
user: dan
comment:
  Avoid unnecessarily reseting the pager cache after committing a transaction that takes advantage of the SQLITE_IOCAP_ATOMIC related optimization.


type: ci
user: drh
comment:
  Remove spellfix virtual table documentation from the source tree.
  Reference the separate documentation on the website instead.


type: ci
user: mistachkin
comment:
  More refinements to Windows OSTRACE usage.  Replace all usage of sqlite3TestErrorName() with sqlite3ErrName() and add missing return codes.


type: ci
user: mistachkin
comment:
  Update 'fuzzerfault' test for its new module loading command.  Fix several test names in 'io.test' and make sure the database gets closed between tests.


type: ci
user: mistachkin
comment:
  Define the sqlite3ErrName() function only when necessary. More robust handling of unknown return codes.


type: ci
user: drh
comment:
  Make sure extra parentheses around subqueries in the FROM clause are harmless.
  Ticket [28c6e830f239ea5].


type: t
user: drh
brief: Fixed ticket [28c6e830f2].
comment:
  Fixed ticket [28c6e830f2]: <i>Segfault while parsing/compiling an SQL statement</i> plus 5 other changes


type: ci
user: drh
comment:
  Update the documentation to explain that when the 3rd parameter to
  sqlite3_bind_text() and friends is NULL the result is to bind a NULL
  SQL value.  Ticket [19b44e35753ba]


type: t
user: drh
brief: Fixed ticket [19b44e3575].
comment:
  Fixed ticket [19b44e3575]: <i>sqlite3_bind_text inconsistent with NULL pointers, zero length etc</i> plus 4 other changes


type: ci
user: drh
comment:
  Do not use a transitive constraint to an IN operator where the RHS is a
  constant if there exists a direct == operator to another table in an outer
  loop.


type: ci
user: drh
comment:
  Allocate 4 bytes of unused header space for an "Application ID".  Add
  the "PRAGMA application_id" command to set and query this identifier.
  Add the "magic.txt" file to show how the posix file command might use
  this application id.


type: ci
user: drh
comment:
  Allocate meta(8) in the header as the "application ID" and add the
  "PRAGMA application_id" command to query and set it.


type: ci
user: drh
comment:
  In where.c, make findTerm() a wrapper around methods to a new WhereScan object
  which is capable of finding all suitable matching terms, not just the first.
  This check-in includes some prototype functions for building WhereLoop objects.


type: ci
user: drh
comment:
  Make sure the authorizer callback gets a valid pointer to "ROWID" for the
  column-name parameter when doing an UPDATE that changes the rowid.
  Fix for ticket [0eb70d77cb05bb2272].


type: t
user: drh
brief: Fixed ticket [0eb70d77cb].
comment:
  Fixed ticket [0eb70d77cb]: <i>Invalid pointer passed to the authorizer callback</i> plus 5 other changes


type: t
user: drh
brief: Ticket [0eb70d77cb]: 3 changes
comment:
  Ticket [0eb70d77cb] <i>Invalid pointer passed to the authorizer callback</i> status still Fixed with 3 other changes


type: ci
user: drh
comment:
  In the command-line shell, make sure the output of dot-commands goes to
  the same redirected output stream as the result of queries.
  Ticket [2f96536e7ff7dba]


type: t
user: drh
brief: Fixed ticket [2f96536e7f].
comment:
  Fixed ticket [2f96536e7f]: <i>.tables output is not redirected into .output file</i> plus 5 other changes


type: ci
user: drh
comment:
  In the command-line shell, output the elements of the schema in the order
  that they appear in the sqlite_master table.  This is necessary in some
  cases to make the schema parsable.


type: ci
user: dan
comment:
  Modify the fts3tokenize table implementation so that it does not use the SQL function fts3_tokenizer. The user may have installed an authorizer callback that prohibits this.


type: ci
user: drh
comment:
  Make sure the ORDER BY collating sequences are compatible with the
  comparison collations before using the merge algorithm for compound
  SELECT statements.  Candidate fix for ticket [6709574d2a8d8].


type: ci
user: drh
comment:
  Inserting a few WhereLoop objects without leaking memory.  Costs are
  not correct.  Inequality and IN constraints are not implemented.


type: ci
user: drh
comment:
  More bug fixes to the WhereLoop generator and the solver in NGQP.
  Now finds the best plan for TPC-H Q8.  This seems to prove the
  concept, but there is still much work to be done.


type: ci
user: drh
comment:
  Fix the wholenumber virtual table so that it returns higher costs for
  unconstrained usage.  Cherrypick from [ceff8955020cd13].


type: ci
user: drh
ecomment:
  NGQP working with virtual tables, though many legacy tests fail and there
  are yet some memory leaks.

comment:
  NGQP working with virtualt tables, though many legacy tests fail and there
  are yet some memory leaks.


type: t
user: drh
brief: Fixed ticket [6709574d2a].
comment:
  Fixed ticket [6709574d2a]: <i>COLLATE clause in ORDER BY causes incorrect EXCEPT</i> plus 5 other changes


type: ci
user: drh
comment:
  Make sure the ORDER BY collating sequences are compatible with the
  comparison collations before using the merge algorithm for compound 
  SELECT statements.  Fix for ticket [6709574d2a8d8].


type: ci
user: mistachkin
comment:
  Refine and reform all Windows OSTRACE macro usage.  Replace all usage of sqlite3TestErrorName() with sqlite3ErrName() and add missing return codes.


type: ci
user: drh
comment:
  Do not move WHERE clause terms inside OR expressions that are contained
  within an ON clause of a LEFT JOIN.  Fix for ticket [f2369304e47167e3e].


type: t
user: drh
brief: Fixed ticket [f2369304e4].
comment:
  Fixed ticket [f2369304e4]: <i>Incorrect results when OR is used in the ON clause of a LEFT JOIN</i> plus 5 other changes


type: ci
user: drh
comment:
  Add assert()s to the implementation of xRead() in the built-in VFSes to 
  verify that the offset parameter is always non-negative.


type: ci
user: dan
comment:
  Avoid deleting a b-tree "has-content" vector belonging to another shared-cache connection from within sqlite3_close().


type: ci
user: drh
comment:
  Fix an assert() in unlockBtreeIfUnused() so that it checks for the existance
  of an untripped cursor, not for the existance of any cursor at all.


type: ci
user: dan
ecomment:
  When closing a connection, avoid tripping active cursors belonging to a different shared-cache client. Also, if sqlite3_close() is called while there are still active statements belonging to the connection, return SQLITE_BUSY and do not roll back any active transaction.
  Proposed fix for ticket [e636a050b709].

comment:
  When closing a connection, avoid tripping active cursors belonging to a different shared-cache client. Also, if sqlite3_close() is called while there are still active statements belonging to the connection, return SQLITE_BUSY and do not roll back any active transaction.


type: ci
user: drh
comment:
  Fix the sharedA.test module so that it does not attempt to run TCL callbacks
  on a different thread from where the interpreter was originally created.


type: ci
user: dan
comment:
  When loading a database schema that contains an index definition that includes a COLLATE clause for which the collation sequence is unavailable, do not assume that that index uses BINARY instead. Fix for [0fc59f908b].


type: ci
user: drh
comment: Merge the shared-cache-fixes branch into trunk.
ecomment:
  Make sure an sqlite3_close() or a rollback on one shared-cache connection
  does not disrupt the operation of other connections using the same shared
  cache.  Fix for ticket [e636a050b709].


type: ci
user: drh
comment:
  The sqlite3ExprCollSeq() function can no longer be called while parse
  the schema, so remove the code path inside of sqlite3ExprCollSeq() that
  dealt with that case.


type: t
user: drh
brief: Fixed ticket [0fc59f908b].
comment:
  Fixed ticket [0fc59f908b]: <i>Missing COLLATE function does not result in an error</i> plus 5 other changes


type: ci
user: drh
comment:
  Treat identifiers in the HAVING clause the same as in the WHERE clause.
  Only consider AS names from the result set to match if there are no other
  matches.  Continuation of the fix for [2500cdb9be05].  This check-in
  fixes a bug found by [http://www.sqlite.org/sqllogictest/ | SqlLogicTest]
  during release testing for version 3.7.17.


type: ci
user: dan
comment:
  In sqlite3_close_v2(), do not attempt to roll back a transaction if there exist active statement objects. Any open transaction will be rolled back when the last of these statement objects is finalized.


type: ci
user: dan
comment:
  In os_unix.c and os_win.c, initialize the default mmap-limit of a new file descriptor to the current global default mmap-limit, not the current global maximum allowable mmap-limit.


type: ci
user: dan
comment:
  In test file test_syscall.c, include sqliteInt.h before any tcl or system include files. This ensures that the magical defines in sqliteInt.h really do enable large file support (and set things up so that sizeof(off_t)==8).


type: ci
user: drh
comment:
  Fix a bug in SQLITE_TRACE_SIZE_LIMIT that was introduced by 
  check-in [1a1cf5aa86734c8].  That check-in was to remove harmless
  compiler warnings.  So once again, we have introduced a real bug
  into SQLite by attempting to eliminate a harmless compiler warning.


type: ci
user: drh
comment:
  Improvements to ORDER BY handling in the NGQP.  Fix an "exit" mistakenly
  left in a test script during the previous check-in.


type: ci
user: drh
comment:
  Use the NGQP plan for EXPLAIN QUERY PLAN output.  This change causes 207
  errors in veryquick.test, many of which are benign.


type: ci
user: drh
comment:
  Cause the mmap_size PRAGMA to immediately change the mmap space if the
  database connection is already active.  In particular, reducing mmap_size
  will immediately free up process address space.


type: ci
user: dan
comment:
  Avoid unnecessary calls to FCNTL_SIZE_HINT. Return an error to the user if the file-control invoked by "PRAGMA mmap_size" returns a value other than SQLITE_OK or SQLITE_NOTFOUND.


type: ci
user: drh
comment:
  Record in the WhereLoop object the set of virtual table constraints that
  need not be separately checked.


type: ci
user: dan
comment:
  When writing to an FTS table, take an exclusive shared-cache lock on the %_segdir table before writing. Otherwise, an xCommit() call may report an SQLITE_LOCKED error.


type: ci
user: drh
comment:
  Many small harmless comment changes.  Removal of obsolete comments and
  fixing misspelled words.  No changes to code.


type: ci
user: drh
comment:
  Finish removing the sqlite3.inTrans field.  In the previous check-in, it was
  merely commented out because I failed to select File->Save on my text editor.


type: ci
user: drh
comment:
  Updates to the Codec interface to support codecs on attached databases and
  to allow rekeying in the middle of a transaction.  These changes are only 
  applicable if SQLite is compiled with SQLITE_HAS_CODEC.


type: ci
user: drh
comment:
  Cut over the NGQP query planner.  Remove lots of legacy code.  
  This check-in compiles but does not work.  The test suite gets incorrect
  answers and crashes.


type: ci
user: drh
comment:
  The expected result in a test case can be of the form "*glob*" or "~*glob*" to 
  match or not match the GLOB pattern.  This is useful for matching
  EXPLAIN QUERY PLAN output that contains regular expression syntax characters
  like "?", "(", and ")".


type: ci
user: drh
comment:
  Futher simplifications to the NGQP.  Fix some test cases to use
  EXPLAIN QUERY PLAN rather than the (now obsolete) sqlite_query_plan
  global variable.


type: ci
user: drh
comment:
  Enhance the shell to provide more flexibility when entering numeric arguments
  on dot-commands.  In particular, allow hex arguments to .wheretrace.


type: ci
user: drh
comment:
  Allow tracing of whereLoopInsert() when the 0x8 bit is set on ".wheretrace".
  Remove the use of sqlite_query_plan from where2.test.  Fix a bug in the
  code generator for OR clause optimizations.


type: ci
user: drh
comment:
  Remove the definitions of objects that are no longer used:  WhereCost, 
  WherePlan, and WhereBestIdx.


type: ci
user: drh
comment:
  Do not attempt to generate code in the NGQP if there have been prior errors,
  since with prior errors some of the expressions might not be fully 
  named resolved.


type: ci
user: drh
comment:
  The NGQP might not find a solution if INDEXED BY constraints on the query
  are set wrong.  If that is the case, print a "no query solution" error
  and abort before trying to use the non-existant solution.


type: ci
user: drh
comment:
  Enhance the shell to provide more flexibility when entering numeric arguments
  on dot-commands.  In particular, allow hexadecimal arguments to .wheretrace
  and .testctrl commands.  Cherrypick from [b9578c371ee5].


type: t
user: drh
brief: New ticket [bc1aea7b72].
comment:
  New ticket [bc1aea7b72] <i>Incorrect result on LEFT JOIN with OR constraints and an ORDER BY clause</i>.


type: t
user: drh
brief: Ticket [bc1aea7b72]: 6 changes
comment:
  Ticket [bc1aea7b72] <i>Incorrect result on LEFT JOIN with OR constraints and an ORDER BY clause</i> status still Open with 6 other changes


type: ci
user: drh
comment:
  Virtual tables now always report 25 rows instead of 0 rows in the 
  EXPLAIN QUERY PLAN output.  Adjust tests accordingly.


type: ci
user: drh
comment:
  Fix a bug in the transitive_closure virtual table that NGQP exposes.
  Update between.test module to avoid using sqlite_query_plan.


type: ci
user: drh
comment:
  Do not use an index fullscan for an UPDATE or DELETE or if disabled by
  sqlite3_test_control() or sqlite3_config().


type: ci
user: drh
comment:
  Pull in recent trunk changes.  Fix the ORDER BY optimizer so that it is better
  able to deal with COLLATE clauses.  Clean up ambiguities in the descidx1.test
  script.


type: ci
user: drh
comment:
  Adjust the xBestIndex methods on both the fuzzer and transitive_closure
  virtual tables so that an unused MATCH operator gets a really large cost.
  Remove ambiguities from the fuzzer test cases.


type: ci
user: drh
comment:
  Refactor the ORDER BY optimizer in the NGQP so that it is easier to maintain
  and so that it can support optimizing out GROUP BY and DISTINCT clauses.


type: t
user: drh
brief: Ticket [5ed1772895]: 6 changes
comment:
  Ticket [5ed1772895] <i>Incorrect ORDER BY on an indexed JOIN</i> status still Open with 6 other changes


type: ci
user: drh
comment:
  Update some variable names and comments in the ORDER BY optimizer.  Fix a
  bug in the ORDER BY optimizer dealing with IS NULL constraints.  Updates
  to test cases.


type: ci
user: dan
comment:
  Up until now the fts4 "unicode61" tokenizer has treated all private use codepoints except the first and last of each of the three ranges as alphanumeric (eligible to be part of tokens). This commit fixes this so that all private use codepoints are considered alphanumeric. In other words, it fixes the handling of codepoints 0xE000, 0xF8FF, 0xF0000, 0xFFFFD, 0x100000 and 0x10FFFD.


type: ci
user: drh
comment:
  Move the definitions of the WhereLevel and WhereInfo objects out of
  sqliteInt.h and into where.c.  This will facilitate future refactoring
  of the internal query planner data structures.


type: ci
user: drh
comment:
  Candidate fix for a memory leak that occurs if a CREATE TABLE statement
  contains two or more COLLATE clauses on the same column definition.


type: ci
user: drh
comment:
  Fix the memory leak in CREATE TABLE that occurs if there are two or more
  COLLATE clauses on the same column.


type: ci
user: drh
comment:
  Add a high-speed bypass for the NGQP for the common case of a simply query
  with quality constraints that outputs a single row.


type: ci
user: drh
comment:
  Fix test cases for the new EXPLAIN QUERY PLAN format.  Add the
  wherecosttest tool.  Other fixes to logarithm cost.


type: ci
user: drh
comment:
  Use a logarithmic rather than linear cost and row-count measures.
  Do not report row count estimates in EQP output.


type: ci
user: drh
comment:
  Fixes to EXPLAIN QUERY PLAN output.  Change weights back to something closer
  to what they are in legacy.  More test case fixes.


type: ci
user: drh
comment:
  Add the ability to disable future calls to virtual table methods by
  invoking sqlite3_create_module() with a NULL sqlite3_module pointer.


type: ci
user: drh
comment:
  Activate the one-pass optimization.  Update comments, especially the
  descriptions of the various objects.


type: ci
user: drh
comment:
  Add a prototype for an extension that sits in between the SQLite native code
  virtual table interface and a CLR IDisposable object.


type: ci
user: drh
comment:
  Make the MIN() and MAX() macros available in sqliteInt.h.  Add TUNING
  comments to the NGQP and adjust costs slightly.


type: ci
user: drh
comment:
  An index might be useful for ORDER BY if any indexed column is in the
  ORDER BY clause, not just the first indexed column.


type: ci
user: drh
comment:
  Make sure that disabling the covering index scan optimization does not
  prevent a covering index from being used to satisfy an ORDER BY clause.


type: ci
user: drh
comment:
  Add a new ORDER BY optimization that bypasses ORDER BY terms that are
  constrained by == and IS NULL terms of the WHERE clause.


type: t
user: drh
brief: New ticket [83e9014ec2].
comment:
  New ticket [83e9014ec2] <i>Incorrect result from sqlite3_stmt_status with SQLITE_STMTSTATUS_FULLSCAN_STEP</i>.


type: ci
user: drh
comment:
  Simplifications to the NGQP.  Add the queryplantest makefile target.  Add
  testcase() macros in the NGQP.


type: ci
user: drh
comment:
  Add in the cost of doing a table lookup on OR searches.  Make test case
  changes to deal with difference in STAT3 behavior.


type: ci
user: drh
comment:
  Merge in trunk changes to os_unix.c that allow the code to build on
  unix platforms that lack posix_fallocate().


type: ci
user: mistachkin
comment:
  The vtshim xCreate and xConnect functions need to store the pAux pointer into the newly created vtable object.  Style fixes.


type: ci
user: dan
comment:
  Fix fts handling of the case where both a rowid and docid are specified as part of an insert statement.


type: ci
user: drh
comment:
  Disable posix_fallocate() for all systems, all the time, unless the
  HAVE_POSIX_FALLOCATE compile-time macro is supplied.


type: ci
user: dan
comment:
  Add extra tests for fts with a non-zero languageid_bits setting. Fix querying by docid with the same.


type: ci
user: dan
comment:
  Add tests for modifying the docid and languageid fields of an fts table with a non-zero languageid_bits field.


type: ci
user: drh
comment:
  Modify the query planner interface so that it always passes in the result set.
  This is the first step toward adding an optimization that will omit tables
  from a join that do not contribute to the result.


type: ci
user: drh
comment:
  Attempt to disable inner loops of a join that do not generate output.
  This does not work, since the inner loops might run zero times and thus
  inhibit all output.  Needs to be enhanced to work only for LEFT JOINs
  or when we know that the inner loop will always run at least once.


type: ci
user: drh
comment:
  Only eliminate inner loops of a JOIN if they are the RHS of a LEFT JOIN
  and if they give no more than a single result.  This appears to give correct
  answers in all cases.


type: ci
user: drh
comment:
  Merge in the latest changes from trunk.  Simplify the implementation of the
  tointeger() and toreal() functions.  Fix test cases and put unambiguous
  labels on all testcase names.


type: ci
user: drh
comment:
  Fix an uninitialized variable detected by valgrind.  Unclear whether or not
  this should apply to trunk.


type: ci
user: drh
comment:
  Omit tables from the FROM clause of a join if their presence makes no difference
  in the final output.


type: ci
user: dan
comment:
  Update the boundary3.tcl script so that it can be run with tcl 8.5 or 8.6 to regenerate boundary3.test.


type: ci
user: drh
comment:
  Add the "vtshim" extension, implementing a wrapper around the virtual
  table interface to make it Disposable for the CLR.  No changes to the
  core.


type: ci
user: drh
comment:
  Update the ".import" command of the command-line shell so that it can
  accept field values that span multiple lines and so that it issues
  error messages if the input text does not strictly conform to RFC4180.


type: ci
user: dan
comment:
  Add extended error code SQLITE_BUSY_SNAPSHOT - returned in WAL mode when a read-transaction cannot be upgraded to a write-transaction because it is reading from a snapshot other than the most recently committed.


type: ci
user: drh
comment:
  The undocumented and unsupported ".selftest" command in the command-line
  shell utility is now only available if compiled with SQLITE_DEBUG.  Also
  fix a windows compiler warning in that command.


type: ci
user: drh
comment:
  Improved handling of backslash escapes on double-quoted arguments to
  dot-commands in the command-line shell.


type: ci
user: drh
comment:
  If the filename argument to the ".import" command in the command-line shell
  begins with '|' then treat it as an input pipe rather than a file.


type: ci
user: dan
comment:
  Add a test to ensure that if BEGIN IMMEDIATE fails with SQLITE_BUSY, it does not leave the user with an open read transaction (unless one was already open).


type: ci
user: drh
comment:
  Make sure that sqlite3_stmt_readonly reports false for
  PRAGMA journal_mode and PRAGMA wal_checkpoint.  Ticket [a589ec069e3].
  Also keep track of whether a prepared statement does no reading or
  writing.


type: t
user: drh
brief: Fixed ticket [a589ec069e].
comment:
  Fixed ticket [a589ec069e]: <i>sqlite3_stmt_readonly() returns an incorrect value for come PRAGMAs</i> plus 5 other changes


type: ci
user: drh
comment:
  Refactor names of fields in the sqlite3 object:  "activeVdbeCnt" becomes
  "nVdbeActive".  Related fields becomes "nVdbeRead", "nVdbeWrite", and
  "nVdbeExec".


type: ci
user: drh
comment:
  Fix an issue with the OmitNoopJoin optimization and add test cases that
  are specifically for that optimization.


type: ci
user: drh
comment:
  Add a bit to the SQLITE_TESTCTRL_OPTIMIZATIONS option for sqlite3_file_control()
  that will disable the use of SQLITE_STAT3 information in the query planner.


type: ci
user: dan
comment:
  Allow read transactions to be freely opened and closed by SQL statements run from within the implementation of user-functions if the user-function is called by a SELECT statement that does not access any database tables (e.g. "SELECT user_function();").


type: ci
user: drh
comment:
  Add the SQLITE_DEFAULT_AUTOMATIC_INDEX compile-time option, which if set to
  zero turns automatic indices off by default.  Increase the estimated cost
  of an automatic index.  Additional minor refactoring of the automatic
  index code.


type: ci
user: drh
comment:
  Issue the new SQLITE_WARNING_AUTOINDEX warning on the SQLite log whenever
  an automatic index is created.


type: ci
user: drh
comment:
  Fix the build of the command-line shell on windows.  Windows uses "_pclose"
  rather than "pclose" as the pointer to the function that closes a popen pipe.


type: ci
user: drh
comment:
  Add a missing test that prevented double LEFT JOINs with transitive
  constraints from working correctly.  Fix for ticket [868145d012].


type: ci
bgcolor: #b1d3a8
user: dan
ecomment:
  Experimental change to the handling of foreign key constraint violations when applying a changeset: all foreign keys, immediate and deferred, are deferred until the end of the transaction (or sub-transaction) opened by the sqlite3changeset_apply(). A single call to the conflict-handler (if any) is made if any FK constraint violations are still present in the database at this point. The conflict-handler may choose to rollback the changeset or to apply it, constraint violations and all.

comment:
  Experimental change to the handling of foreign key constraint violations when applying a changeset: all foreign keys, immediate and deferred, are deferred until the end of the transaction (or sub-transaction) opened by the sqlite3changeset_apply(). A single call to the conflict-handler (if any) is made if any FK constraint violations are still present in the database at this point. The conflict-handler may choose to rollback the changeset, or to apply it, constraint violations and all.


type: ci
bgcolor: #b1d3a8
user: dan
comment:
  Fix a bug preventing some FK constraint checking from being deferred until the end of changeset application.


type: ci
user: mistachkin
comment:
  Modify several extensions to use the new exported function naming.  Fix some shared library compilation issues.


type: ci
user: dan
comment:
  Replace an erroneous SQLITE_OMIT_VIRTUAL_TABLE in vdbeaux.c with SQLITE_OMIT_WAL. Also fix some test script problems.


type: ci
user: dan
ecomment:
  Drop any existing mapping of the database file when exiting the pager "error state", as it may at this point be too large for the database file. Do not invoke file-control MMAP_SIZE if the database file handle does not support xFetch and xUnfetch (on the grounds that xUnfetch(0) calls to invalidate the mapping cannot be made).

comment:
  Drop any existing mapping of the database file when exiting the pager "error state", as it may at this point be too large for the database file. Do not invoke file-control MMAP_LIMIT if the database file handle does not support xFetch and xUnfetch (on the grounds that xUnfetch(0) calls to invalidate the mapping cannot be made).


type: ci
user: drh
comment:
  Add an optional 5th parameter to the next_char() function that is the
  collating sequence to use for comparison.


type: t
user: drh
brief: New ticket [d805526eae].
comment:
  New ticket [d805526eae] <i>Incorrect join result or assertion fault due to transitive constraints</i>.


type: ci
user: drh
comment:
  Fix an adverse interaction between the IS NOT NULL optimization (available
  only with SQLITE_ENABLE_STAT3) and the transitive constraint processing.
  Fix for ticket [d805526eae253]


type: t
user: drh
brief: Fixed ticket [d805526eae].
comment:
  Fixed ticket [d805526eae]: <i>Incorrect join result or assertion fault due to transitive constraints</i> plus 5 other changes


type: ci
user: drh
comment:
  Make sure an adequate number of digits are shown for binary-to-text rendering
  of very small floating point values.


type: t
user: drh
brief: New ticket [490a4b7235].
comment:
  New ticket [490a4b7235] <i>&quot;WHERE 0&quot; on the first element of a UNION causes an assertion fault</i>.


type: ci
user: drh
comment:
  Make sure the schema is verified prior to processing a "WHERE 0" on the
  first term of a compound SELECT statement.
  Fix for ticket [490a4b723562429]


type: t
user: drh
brief: Fixed ticket [490a4b7235].
comment:
  Fixed ticket [490a4b7235]: <i>"WHERE 0" on the first element of a UNION causes an assertion fault</i> plus 5 other changes


type: ci
user: drh
comment:
  Modify several extensions to use the new exported function naming. 
  Fix some shared library compilation issues.


type: t
user: drh
brief: Fixed ticket [bc1aea7b72].
comment:
  Fixed ticket [bc1aea7b72]: <i>Incorrect result on LEFT JOIN with OR constraints and an ORDER BY clause</i> plus 3 other changes


type: t
user: drh
brief: Fixed ticket [83e9014ec2].
comment:
  Fixed ticket [83e9014ec2]: <i>Incorrect result from sqlite3_stmt_status with SQLITE_STMTSTATUS_FULLSCAN_STEP</i> plus 5 other changes


type: ci
user: drh
comment:
  Adjust the costs in the xBestIndex function of the spellfix1 virtual table
  to force the use of the MATCH term if it is available.


type: ci
user: drh
comment:
  Run progress callback checks less frequently in the main VDBE evaluation
  loop.  This makes up for the extra CPU cycles used to increment the cycle
  counter for SQLITE_STMTSTATUS_VM_STEP.


type: ci
user: drh
comment:
  Experimental "PRAGMA query_only=BOOLEAN" statement that is able to turn
  write capabilities on and off.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Rename the SQLITE_DeferForeignKeys macro to shorter SQLITE_DeferFKs.  Move
  the "defer_foreign_keys" pragma into the flagPragma() routine.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Remove the undocumented sqlite3_foreign_key_check() API and replace it with
  sqlite3_db_status(db, SQLITE_DBSTATUS_DEFERRED_FKS, ...).  Add test cases
  for the new functionality.


type: ci
user: drh
comment:
  Add the "defer_foreign_keys" pragma and the SQLITE_DBSTATUS_DEFERRED_FKS
  value for sqlite3_db_status().  This is a cherry-pick of a sequence of five
  checkins in the sessions branch between [1d44e5d3c2] and [d39e65fe70].


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Merge recent trunk changes (such as the query_only PRAGMA, the
  defer_foreign_keys PRAGMA, and the SQLITE_DBSTATUS_DEFERRED_FKS parameter
  to sqlite3_db_status()) into the sessions branch.


type: ci
user: drh
comment:
  Change the description of how sqlite3_progress_handler() works so that 
  the N parameter is "approximate".  This aligns with the current implementation.
  This is a documentation change only.  No changes to code.


type: ci
user: drh
comment:
  Make sure the shell does not try to put a zero terminator on the end of an
  unallocated zero-length string when running ".import" on an empty file.


type: ci
user: drh
comment:
  Add the sqlite3_cancel_auto_extension(X) interface which will undo a prior
  call to sqlite3_auto_extension(X).


type: ci
user: drh
comment:
  Enhance the query planner so that it looks at multiple solutions to OR
  expressions in the WHERE clause.


type: ci
user: drh
comment:
  Make sure the sqlite3_prepare16 and sqlite3_prepare16_v2 interfaces do not
  read past a zero-terminator if the nBytes parameter is too large.


type: ci
user: drh
comment:
  Clear the error string pointer in sqlite3_vtab object after the error string
  is transferred to SQLite.  Ticket [78588b938a11].


type: t
user: drh
brief: Fixed ticket [78588b938a].
comment:
  Fixed ticket [78588b938a]: <i>Virtual Table Sync frees pVtab->zErrMsg without zeroing</i> plus 5 other changes


type: ci
user: drh
comment:
  Documentation changes to warn that sqlite3_set_auxdata() might call the
  destructor even before it returns.  Also fix the regexp extension to deal
  with that case.  Ticket [406d3b2ef91c].


type: ci
user: drh
comment:
  Fix a 8-byte alignment problem in the query planner that might cause
  problems on sparc when compiled with -m32.


type: ci
user: dan
ecomment:
  Ensure that all auxiliary data registered by calls to sqlite3_set_auxdata() is destroyed when the VM is halted. Partial fix for [406d3b2ef9].
  <i>DRH adds:</i> Stray text accidentally inserted into vdbe.c just prior to
  the commit breaks the build.

comment:
  Ensure that all auxiliary data registered by calls to sqlite3_set_auxdata() is destroyed when the VM is halted. Partial fix for [406d3b2ef9].


type: t
user: drh
brief: Fixed ticket [406d3b2ef9].
comment:
  Fixed ticket [406d3b2ef9]: <i>SQL function auxdata associated with parameters is not cleared</i> plus 5 other changes


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=71effa59c98d167e&n=4 | 71effa59c98d167e]: Add propagating branch=typo. Add propagating symbolic tag "typo". Add comment. Cancel symbolic tag "trunk".


type: ci
user: dan
comment:
  Ensure that all auxiliary data registered by calls to sqlite3_set_auxdata() is destroyed when the VM is halted.


type: ci
user: drh
comment:
  Update the URI filename parser to allow (and ignore) authority names in
  unix and to pass the authority through to the OS on windows, as this
  appears to be what web-browsers are doing.


type: ci
user: drh
comment:
  Another attempt at generalizing the URI parsing so that it works with a
  wider variety of file URIs and yet remains backwards compatible.


type: ci
user: drh
comment:
  Enhance the progress handler so that it keeps track of the number of VDBE
  cycles across sqlite3_step() calls and issues callbacks when the cumulative
  instruction count reaches threshold.


type: ci
user: drh
comment:
  In the command-line shell, work around the fact that popen() and pclose()
  are not defined in stdio.h. in C89 and later.


type: ci
user: drh
comment:
  In main.mk, always recompile vdbe.o and parse.o first, since changes to either
  parse.y or vdbe.c will cause all files to be recompiled and if there are
  syntax errors in vdbe.c or parse.y we want to hit them early in the compile
  process.


type: ci
user: drh
comment:
  Here begins an experimental branch for exploring the idea of a partial index.
  This check-in is able to parse a WHERE clause on a CREATE INDEX statement, but
  does not actually do anythingn with that WHERE clause yet.


type: ci
user: drh
comment:
  Resolve names in CREATE INDEX WHERE clauses and detect errors.  Disallow
  expressions that contain variables, subqueries, or functions.
  The expression is still not used for anything, however.
  still unused.


type: ci
user: drh
comment:
  The MAX_PATH constant in windows is measured in characters, so multiple by 3
  to get the number of bytes assuming worst-case UTF8 pathnames.


type: ci
user: drh
comment:
  Add logic to the query planner to only use partial indices if the WHERE clause
  constrains the search to rows covered by the partial index.  This is just
  infrastructure.  The key routine, sqlite3ExprImpliesExpr(), is currently a
  no-op so that partial indices will never be used.


type: ci
user: mistachkin
comment:
  Limit the number of memset() calls used when determining a temporary file name on Windows.  Also, fix a harmless compiler warning.


type: ci
user: drh
comment:
  Add the logic to keep partial indices up to date through DML statements and
  when new partial indices are created.  This new logic is untested except to
  verify that it does not interfere with full indices.


type: ci
user: drh
comment:
  Fix bug in the logic that determines the end of a CREATE INDEX statement.
  Added a VACUUM test case that exposed the bug.


type: ci
user: drh
comment:
  Avoid using left-most column STAT3 samples if the left-most column has an
  equality constrain and there are inequality constraints on the second column.


type: ci
user: drh
comment:
  An improved method for avoiding the use of the STAT3 samples to compute
  the estimated number of outputs when the left-most index is equality
  constrained.  This check-in undoes the previous fix and applies a new one.


type: ci
user: drh
comment:
  Make sure signed integer overflow does not cause a segfault while attempting
  to read a corrupt database where the header size varint on a record is larger
  than the maximum 32-bit signed integer.


type: ci
user: drh
comment:
  Fix a potential buffer overread in sqlite3VdbeRecordCompare() when a
  serial_type specifies a field that starts in bounds but is much too large
  for the allocated buffer.  Mostly harmless.  The overread is unlikely to
  go more than one or two bytes past the end of the buffer.


type: ci
user: drh
comment:
  Fix the CREATE INDEX statement so that trying to create a TEMP index on
  a non-TEMP table throws an error rather than segfaulting.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Merge in the latest trunk changes, including partial indexes, the MAX_PATH
  fix in os_win.c, and the sqlite3_cancel_auto_extension() API.


type: ci
user: drh
comment:
  Improve performance of sqlite3VdbeRecordCompare() by using an approximation
  that might give false negatives and only running the more expensive exact 
  subexpression if the approximation fails.


type: ci
user: dan
comment:
  Use N separate cursors when scanning an index with N columns to collect sqlite_stat4 data. This fixes a problem with collecting incorrect nEq values from multi-column indexes.


type: ci
user: drh
comment:
  Factor all KeyInfo object allocations into a single function:
  sqlite3KeyInfoAlloc().  Always allocate enough space so that 
  sqlite3VdbeRecordCompare() can avoid checking boundaries and hence
  run faster.


type: ci
user: drh
comment:
  Performance optimization: Avoid calling convertCompoundSelecctToSubquery()
  on queries that do not use the UNION, EXCEPT, or INTERSECT operators.


type: ci
user: drh
comment:
  More than double the speed of the resolveP2Values() routine in vdbeaux.c by
  moving from an extended if-else on every opcode to a switch.  Opcodes are
  reordered in mkopcodesh.awk to put the switched opcodes close together,
  for additional performance and to reduce code footprint.


type: ci
user: drh
comment:
  For the ".import" command of the command-line shell, start a transaction
  if there is not one active already.


type: ci
user: drh
comment:
  Adjust #ifdefs in test_autoext.c so that it compiles with 
  SQLITE_OMIT_LOAD_EXTENSION.  Fix compiler warnings in two other
  test modules.  No changes to the core.


type: ci
user: dan
comment:
  When possible, use the multi-column samples in sqlite_stat4 to estimate the number of index rows scanned by a query plan.


type: ci
user: drh
comment:
  Add a guard #ifndef to test_intarray.h to prevent harm if it is #included
  more than once.  Add a comment on the closing #endif of the guards on
  sqlite3.h and test_multiplex.h.


type: ci
user: dan
comment:
  When estimating the number of rows scanned using data from the sqlite_stat4 table, avoid allocating UnpackedRecord and KeyInfo structures until they are definitely required.


type: ci
user: drh
comment:
  Fix the ".dump" command on the command-line shell so that it works for
  "sqlite_stat4" in addition to "sqlite_stat1".


type: ci
user: dan
comment:
  Replace variable Index.avgEq (average number of rows in keys for which there is no sample in sqlite_stat4) with vector Index.aAvgEq.


type: ci
user: drh
comment:
  If the SQLITE_ALLOW_URI_AUTHORITY compile-time option is set, then allow
  non-localhost authorities on URI filenames and pass them through as a UNC
  to the underlying VFS.


type: ci
user: dan
comment:
  Fix a segfault in "ALTER TABLE t1 ADD COLUMN b DEFAULT (-+1)". Also an assert() failure that could occur if SQLITE_ENABLE_STAT4 were not defined.


type: ci
user: drh
comment:
  If the SQLITE_EXTRA_INIT function is defined, make sure it is called only
  once by the effective sqlite3_initialize() call.


type: ci
user: dan
comment:
  Use a binary search instead of a linear scan when comparing a sample key against data from the sqlite_stat4 table.


type: ci
user: dan
comment:
  Fix problems in estimating the number of rows visited by a range query using sqlite_stat4 data when the column subject to the range query is not the leftmost of the index.


type: ci
user: dan
comment:
  Fix a bug in calculating the average number of entries for keys not present in the sqlite_stat4 table.


type: ci
user: dan
comment:
  If there is data in both the sqlite_stat4 and sqlite_stat3 tables for a single index, ignore the sqlite_stat3 records.


type: ci
user: dan
comment:
  If ENABLE_STAT3 is defined but ENABLE_STAT4 is not, have ANALYZE create and populate the sqlite_stat3 table instead of sqlite_stat4.


type: ci
user: dan
comment:
  Change some assert() statements in vdbe.c to ensure that a memory cell used to store a VdbeCursor object is not also used for some other purpose.


type: t
user: drh
brief: Ticket [f617ea3125]: 6 changes
comment:
  Ticket [f617ea3125] <i>Incorrect ORDER BY with colliding input and output column names</i> status still Open with 6 other changes


type: ci
user: drh
comment:
  Bare identifiers in ORDER BY clauses bind more tightly to output column name,
  but identifiers in expressions bind more tightly to input column names.
  This is a compromise between SQL92 and SQL99 behavior and is what
  PostgreSQL and MS-SQL do.  Ticket [f617ea3125e9c].


type: ci
user: drh
comment:
  Make sure that GROUP BY terms select input column names in preference to
  output column names, in compliance with the SQL standard.
  Ticket [1c69be2dafc28].


type: t
user: drh
brief: Fixed ticket [f617ea3125].
comment:
  Fixed ticket [f617ea3125]: <i>Incorrect ORDER BY with colliding input and output column names</i> plus 3 other changes


type: t
user: drh
brief: Fixed ticket [1c69be2daf].
comment:
  Fixed ticket [1c69be2daf]: <i>Incorrect GROUP BY when input and output columns have the same name</i> plus 5 other changes


type: ci
user: dan
comment:
  Avoid buffer overreads and false OOM error reports that could be caused by corrupted sample records in the sqlite_stat4 table.


type: ci
user: dan
comment:
  Fixes for test code that was not working with utf16 databases. Run the analyze*.test scripts as part of the 'utf16' permutation test.


type: ci
user: drh
comment:
  Fix valueFromExpr() so that it returns SQLITE_NOMEM following an OOM when
  changing text encodings.  Also fix some asserts to accommodate OOM errors.


type: ci
user: drh
comment:
  In sqlite3Stat4ProbeSetValue() change a local variable name iVar to iBindVar
  to avoid confusion with iVal, and fix a place where the name was actually
  confused.


type: ci
user: drh
comment:
  The fullfsync, checkpoint_fullfsync, and cache_spill pragmas apply to all
  files of a database connection, including those opened by future ATTACH
  statements.


type: ci
user: drh
comment:
  Add the cache_spill pragma.  Change the fullfsync and checkpoint_fullfsync
  pragmas to apply to all attached databases.


type: ci
user: drh
comment:
  Adjustments to #ifdefs in analyze.c to all a clean compile with no
  extra code with both ENABLE_STAT3 and ENABLE_STAT4 and with neither.


type: ci
user: dan
comment:
  Initialize a variable in fts3_write.c on the grounds that the argument required to show that it does not require initialization with is complicated. Add an assert() to where.c to silence a clang scan-build warning.


type: ci
user: drh
comment:
  Performance improvement in sqlite3BtreeNext() and sqlite3BtreePrevious()
  for the common case of a valid cursor.


type: g
user: drh
comment:
  Tag changes on [/timeline?dp=af49707211ff7c7c&n=4 | af49707211ff7c7c]: Add propagating branch=toTypeFuncs. Add propagating symbolic tag "toTypeFuncs". Cancel symbolic tag "trunk".


type: ci
user: drh
comment:
  Performance optimizations in the VDBE and especially to the OP_Next and
  related opcodes and in the sqlite3BtreeNext() and sqlite3BtreePrevious()
  routines.  This is a cherrypick of [6f99b54aedeb], [d2efea1682a7], and
  [d78c5d89de4b].


type: ci
user: dan
comment:
  Fix an invalid assert() in where.c. Also a crash that can occur in the EXPLAIN QUERY PLAN code under obscure circumstances.


type: t
user: dan
brief: Ticket [d666d600a6]: 6 changes
comment:
  Ticket [d666d600a6] <i>COLLATE operator on lhs of BETWEEN expression is ignored.</i> status still Open with 6 other changes


type: t
user: drh
brief: Fixed ticket [d666d600a6].
comment:
  Fixed ticket [d666d600a6]: <i>COLLATE operator on lhs of BETWEEN expression is ignored.</i> plus 3 other changes


type: ci
user: dan
comment:
  If a virtual table xSync() returns an error message, copy it into a buffer allocated by sqlite3DbMalloc() before transfering it to Vdbe.zErrMsg.


type: ci
user: drh
comment:
  Simplification to the StrAccum object and the sqlite3StrAccumAppend()
  method that also results in slightly better performance.


type: ci
user: drh
comment:
  Simplify the btreeGetPage() routine so that it uses a single flag parameter
  in place of two boolean parameters.


type: ci
user: dan
comment:
  Modify script mkautoconfamal.sh to use the download.html naming convention for the tar.gz it creates.


type: ci
user: drh
comment:
  In the ANALYZE command implementation make statInit() a 2-value function
  since the 3rd parameter was always the same constant.


type: ci
user: drh
comment:
  Reduce the amount of code run and memory used for ANALYZE in the common case
  where neither STAT3 and STAT4 are enabled.


type: ci
user: drh
comment:
  Adjust ANALYZE for improved test coverage.  Use the SQLITE_ENABLE_STAT3_OR_STAT4
  macro (created in sqliteInt.h) to conditionally include code, instead of 
  a boolean specifying both macros separately.


type: ci
user: mistachkin
comment:
  Make names of private functions in the Win32 VFS consistent.  Fix comment typo in Win32 mutex implementation.


type: ci
user: drh
comment:
  Fix an off-by-one error that causes a quoted empty string at the end of
  a CRNL-terminated line of CSV input to be misread by the shell.


type: ci
user: drh
comment:
  In the query optimizer, when converting BETWEEN and LIKE/GLOB expressions
  into simpler forms for processing, be sure to transfer the LEFT JOIN markings.
  Fix for ticket [bc878246eafe0f52c].


type: ci
user: drh
comment:
  Add the win32-longpath VFS allowing windows filenames up to 32K characters in
  length.  Remove unused code when -DSQLITE_MAX_MMAP_SIZE=0.  Fix some
  compiler warnings on windows.


type: ci
user: mistachkin
comment:
  Enable finer control of optimizations when compiling with the MSVC makefile.  Also, several modularity enhancements to the MSVC makefile.


type: t
user: mistachkin
brief: Closed ticket [2fd50fa665].
comment:
  Closed ticket [2fd50fa665]: <i>cygwin-1.7 issues: winFullPathname and tempname</i> plus 5 other changes


type: t
user: dan
brief: New ticket [9f2eb3abac].
comment:
  New ticket [9f2eb3abac] <i>A lookup on a primary key or unique index with more than 4 fields can cause a crash</i>.


type: ci
user: dan
comment:
  Candidate fix for [9f2eb3abac]: Have the whereShortCut() planner ignore indexes with more than four columns.


type: t
user: drh
brief: Fixed ticket [9f2eb3abac].
comment:
  Fixed ticket [9f2eb3abac]: <i>A lookup on a primary key or unique index with more than 4 fields can cause a crash</i> plus 5 other changes


type: ci
user: drh
comment:
  Cherrypick of [c1152bdcbb] and fix for [9f2eb3abac]:
  Have the whereShortCut() planner ignore indexes with more than four columns.


type: ci
user: drh
comment:
  In the query optimizer, when converting BETWEEN and LIKE/GLOB expressions
  into simpler forms for processing, be sure to transfer the LEFT JOIN markings.
  Fix for ticket [bc878246eafe0f52c].  Cherrypick of [caab361ebe].


type: ci
user: drh
comment:
  Fix an off-by-one error that causes a quoted empty string at the end of
  a CRNL-terminated line of CSV input to be misread by the shell.
  Cherrypick of [b5617e4fdadc4c].


type: ci
user: drh
comment:
  Never leave an open file descriptor pointing into the middle of the
  database file if the file descriptor number is 2 or less.


type: ci
user: drh
comment:
  Make the unix VFS defensive against the error of having a database file open
  on file descriptors 1 or 2, as an error message might easily be written onto
  those file descriptors and thus overwrite and corrupt the database.


type: ci
user: drh
comment:
  Improvements to the robust_open() logic in the unix VFS so that if an attempt
  is made to open a repository on file descriptors 0, 1, or 2, and blocking
  that file descriptor by opening it on /dev/null fails, then the open will
  fail.


type: ci
user: drh
comment:
  Add the SQLITE_MINIMUM_FILE_DESCRIPTOR compile-time option, for control over
  exactly which low-numbered file descriptors SQLite will use.


type: ci
user: drh
comment:
  If the cost of two whereLoop objects is the same in every way except that
  one has fewer expected output rows than the other, then choose the one with
  fewer output rows.


type: ci
user: mistachkin
comment:
  Add support for Cygwin when handling temporary file names.  Improve error codes and diagnostic messages for temporary file name handling on Windows.  Rename winConvertUtf8Filename to winConvertFromUtf8Filename.  Improve placement and comments for forward function declarations.


type: ci
user: dan
comment:
  Fix a problem causing SQLite not to use stat4 or stat3 data to analyze constraints of the form "column = expr COLLATE collation" (those with an explicit COLLATE on the non-column side of the comparison operator).


type: ci
user: mistachkin
comment:
  Revise the amalgamation tool to allow 'duplicate' include files to be retained manually while still preserving the existing line numbers.


type: ci
user: drh
comment:
  Cleanup of the windows VFS, including added support for Cygwin, fixes
  for compiler warnings under unusual configurations, and improved diagnostic
  error messages.


type: ci
user: dan
comment:
  Fix a problem with using stat4 data to estimate the number of rows scanned by a range constraint on the second or subsequent column of any index where an affinity transformation must be applied to the constraint argument.


type: ci
user: drh
comment:
  Simplify branch coverage testing by interchanging the order of two tests
  in the whereLoopInsert() function.


type: ci
user: drh
comment:
  Add the experimental SQLITE_DEFAULT_INDEX_SHAPE=1 compile-time option that
  makes a much more pessimistic guess at the effectiveness of unanalyzed
  indices.


type: t
user: drh
brief: New ticket [be84e357c0].
comment:
  New ticket [be84e357c0] <i>Segfault during query involving LEFT JOIN column in the ORDER BY clause</i>.


type: ci
user: drh
comment:
  Make sure the omit-noop-left-join optimization is not applied if columns
  of the LEFT JOIN are used in the ORDER BY clause.  
  Ticket [be84e357c035]


type: t
user: drh
brief: Fixed ticket [be84e357c0].
comment:
  Fixed ticket [be84e357c0]: <i>Segfault during query involving LEFT JOIN column in the ORDER BY clause</i> plus 5 other changes


type: ci
user: drh
comment:
  Make sure the omit-noop-left-join optimization is not applied if columns
  of the LEFT JOIN are used in the ORDER BY clause.  
  Ticket [be84e357c035].  Increase version number to 3.8.0.2.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Merge in all the latest trunk changes, including the win32-longpath VFS and
  the fix for the segfault in the omit-left-join optimization.


type: ci
user: dan
comment:
  When preparing an UPDATE statement, avoid generating VDBE code for those foreign key related actions and constraint checks that may be seen to be unnecessary by considering the subset of table columns potentially modified by the UPDATE.


type: ci
user: drh
comment:
  Make sure the destination WhereLoop is left in a sane state when an
  OOM fault occurs inside of whereLoopXfer().


type: ci
user: drh
comment:
  Enhance the plan solver to take into account the number of output rows when
  computing the set of paths to retain for the next cycle.


type: ci
user: mistachkin
comment:
  When converting from a BLOB value in the tointeger() and toreal() SQL functions, make sure that endianness of the machine does not matter.


type: ci
user: drh
comment:
  Continuing refinements of the logic to take WHERE clause terms not used for
  indexing into account when computing the number of output rows from each
  table.


type: ci
user: drh
comment:
  Make sure that the transitive constraint optimization does not cause
  WHERE clause terms to be disabled prematurely.  We are unable to find a test
  case that fails because of this, but it seems prudent to make this
  preventative change nevertheless.


type: ci
user: drh
comment:
  Deterministically initialize the PRNG used as a tie-breaker in the ANALYZE
  command, so that the analysis is always the same given the same database.
  This simplifies testing.


type: ci
user: drh
comment:
  Improvements to likelihood processing so that commuting an unindexed term in
  the WHERE clause does not change the query plan.


type: ci
user: mistachkin
comment:
  For error log messages generated by the Win32 native allocator, make sure the correct format specifier is used for the value returned by GetLastError().


type: ci
user: drh
comment:
  Increase the number of bits available in Expr.flags.  Other tweaks aimed at
  making expression processing more robust.


type: ci
user: drh
comment:
  Merge in the Expr.flags expansion to 32-bits.  Use an extra bit to help
  optimize the sqlite3ExprSkipCollate() routine.


type: ci
user: drh
comment:
  Refactor the ExprSetIrreducible() macro into ExprSetVVAProperty(*,EP_NoReduce).
  This is a naming change only.  The logic is the same.


type: ci
user: drh
comment:
  Change the PRAGMA parser to use a binary search for the pragma name.
  Also:  Minor performance enhancement to sqlite3DbFree() and to the
  token dequoter.


type: ci
user: drh
comment:
  Enhance the pragma lookup table generator script to output a comment that
  gives the number of pragmas.


type: ci
user: drh
comment:
  Adjust the query planner to take into account WHERE clause terms that do not
  drive indices.  Add the unlikely() and likelihood() functions used to give
  hints to the query planner about the selectivity of WHERE clause terms.


type: ci
user: drh
comment:
  Remove one unreachable branch and add asserts() to dupedExprStructSize().
  New asserts verify that removed branch is unused and that constants that are
  ORed together in the output do not overlap.


type: ci
user: drh
comment:
  The date and time functions use the exact same notion of "now" for every
  invocation within the same call to sqlite3_step().


type: ci
user: dan
comment:
  Test that the unicode61 tokenchars= and separators= options work with the fts3tokenize virtual table.


type: t
user: dan
brief: New ticket [9fb5cd7c76].
comment:
  New ticket [9fb5cd7c76] <i>&quot;DELETE FROM tbl&quot; statements do not obtain a shared-cache write-lock on table &quot;tbl&quot;</i>.


type: t
user: dan
brief: Ticket [9fb5cd7c76]: 6 changes
comment:
  Ticket [9fb5cd7c76] <i>"DELETE FROM tbl" statements do not obtain a shared-cache write-lock on table "tbl"</i> status still Open with 6 other changes


type: ci
user: dan
comment:
  Obtain the required shared-cache write-lock when executing "DELETE FROM tbl" statements. Fix for [1e1321ee98].


type: ci
user: drh
comment:
  Updates to the sqlite3_analyzer utility:  Change the names of some labels,
  especially change "Fragmentation" to "Non-sequential pages".  Revise the
  computation of non-sequential pages so that it ignores itercalated non-leaf
  pages (overflow and index pages).


type: ci
user: drh
comment:
  In the nextchar.c extension, allow the second argument to the next_char()
  function to be a subquery.


type: t
user: drh
brief: Fixed ticket [9fb5cd7c76].
comment:
  Fixed ticket [9fb5cd7c76]: <i>"DELETE FROM tbl" statements do not obtain a shared-cache write-lock on table "tbl"</i> plus 3 other changes


type: ci
user: dan
comment:
  Fix a performance problem in the FTS4 auxiliary functions triggered by an OR clause in the full-text query.


type: ci
user: drh
comment:
  Change the ".dump" command in the command-line shell so that it COMMITs
  if there are database corruption errors but invokes ROLLBACK on any other
  kind of error.


type: ci
user: dan
comment:
  Allow multi-token phrases to load doclists from the database incrementally. This allows queries that feature such phrases to benefit from the "docid<?" optimization.


type: ci
user: drh
comment:
  In the lemon parser generator, change all hashes to unsigned to avoid
  potential problems with signed integer overflow.


type: ci
user: dan
comment:
  Return an error if an attempt is made to create a trigger with an SQL variable embedded within it. If such a variable reference is found within a trigger definition loaded from the sqlite_master table, silently replace it with a NULL.


type: ci
user: drh
comment:
  Rework the PRAGMA implementation to only call sqlite3ReadSchema() from a single
  place, based on a flag in the pragma table, rather than separately from each
  case which needs the schema.


type: ci
user: dan
comment:
  Allow FTS4 multi-token phrases to use a combination of in-memory and incrementally loaded doclists. This allows phrases to (partially) benefit from incremental doclists without disabling the deferred token optimization.


type: ci
user: dan
comment:
  Have FTS take advantage of "docid<?" constraints when they are present. Extend the FTS "incremental doclist" optimization so that it is used for tokens within multi-token phrases.


type: ci
user: drh
comment:
  Make sure the count(*) optimization works correctly even when partial
  indices are present.  Ticket [a5c8ed66cae].


type: t
user: drh
brief: Fixed ticket [a5c8ed66ca].
comment:
  Fixed ticket [a5c8ed66ca]: <i>Incorrect count(*) when partial indices exist</i> plus 5 other changes


type: ci
user: drh
comment:
  Improved estimates of the relative speed of index scans based on declared
  datatypes of columns in the table.  Add "r" column to PRAGMA index_info,
  showing the estimated relative scan rate.


type: ci
user: drh
comment:
  Fix test cases so that they work when the query planner uses index size
  estimates to determine whether or not to try an covering index scan.


type: ci
user: dan
comment:
  If an "INSERT INTO ... SELECT" can use the xfer optimization, pass the OPFLAG_BULKCSR hint to btree cursors used to update indices. This results in a tighter key packing.


type: ci
user: drh
comment:
  In the index_list pragma, make sure the "r" column is the same on output
  as it was on input in the sqlite_stat1 table.


type: ci
user: drh
comment:
  Begin an experimental refactoring to estimate the average number of bytes
  in table and index rows and to use that information in query planner.
  Begin by renaming WhereCost to LogEst and making that type and its
  conversion routines available outside of where.c.


type: ci
user: drh
comment:
  Improvements to the LogEst command-line tool used to convert between
  ordinary numbers and the LogEst representation.


type: ci
user: drh
comment:
  Completely remove the iScanRatio field.  The PRAGMA index_list(TABLE) command
  shows the estimated row size in the forth column.  It also generates a row
  for the table with an index name of NULL.  The query planner still does not
  take row size estimates into account - that is the next step.


type: ci
user: drh
comment:
  Fix an issue in the test8.c test module that arises because of the change
  to PRAGMA index_list().  Remove an unused local variable.


type: ci
user: drh
comment:
  Restore the hexrekey pragma which was accidently deleted during the
  pragma refactoring.  Make sure the hexkey and hexrekey pragmas do not
  overflow buffers with a over-length key.


type: ci
user: drh
comment:
  Multiply all cursor step cost estimates by the estimated size of the row in
  bytes, in order to get the query planner ot make use of estimated row sizes.
  This check-in uses magic numbers in a few places (for example, estimates of
  the size of output rows) and needs lots of refinement.  Consider this a
  proof-of-concept only.


type: ci
user: drh
comment:
  Rollback some of the previous changes in the branch such that the estimated
  row sizes are now only used as a tie-breaker for index scans.


type: ci
user: drh
comment:
  Move a conditional inside of an #ifdef in order to make all branches
  reachable regardless of compile-time options used.


type: ci
user: drh
comment:
  Make sure the correct printf format is used for type tRowcnt regardless
  of whether 32-bit or 64-bit row counts are specified at compile-time.


type: ci
user: drh
comment:
  Estimate row sizes for tables and indices and use those estimates during
  query planning.  Enhance the index_info pragma to show the estimated row
  sizes and to show the estimated row size for the main table as well.  Allow
  an alternative row size estimate to be specified in the sqlite_stat1 table.


type: ci
user: drh
comment:
  Fix the hash signature algorithm in vfslog.c.  Add a utility program to
  show the hash signatures for every page of a database file.


type: ci
user: drh
comment:
  Enhancements to the vfslog.c module to show all change-counter changes and
  to show the hostname and pid of the process that creates each log file.


type: ci
user: drh
comment:
  Fix various harmless compiler warnings.  Change the "warnings.sh" script to
  work with STAT4 instead of STAT3.


type: ci
user: drh
comment:
  Additional test cases and requirements marks for the unlikely(),
  likelihood() and instr() functions.


type: ci
user: drh
comment:
  Identify requirements text in the SQLITE_CONFIG_ documentation.  Fix a typo
  (a duplicated word) in part of that documentation.  Add some requirements
  marks for DETACH to the test scripts.  No code changes.


type: ci
user: drh
comment:
  Add tests that demonstrate that PRAGMA defer_foreign_keys will reset to off
  at the conclusion of the next transaction.


type: ci
user: drh
comment:
  Restore the index_list pragma back to its former operation.  Create a new
  PRAGMA stats used to access the table and index widths and heights.


type: ci
user: drh
comment:
  Update the foreign_key_check pragma so that when a parent table is undefined
  it is treated as an empty table.


type: ci
user: dan
comment:
  Fix a crash in FTS incremental phrase processing that can occur if the second or subsequent token is much more common in the dataset than the first.


type: ci
user: drh
comment:
  Move the tointeger() and toreal() functions out of core and make them into
  a run-time loadable extension.


type: ci
user: mistachkin
comment:
  Fix harmless compiler warning in the totype extension.  Include all standard whitespace characters in totypeIsspace.  Minor adjustments to style and comments.


type: ci
user: drh
comment:
  Fix an 8-byte alignment problem on the "crash test" harness (test code,
  not in the core) that causes problems on Sparc.


type: ci
bgcolor: #b1d3a8
user: drh
comment:
  Merge the latest trunk changes into the sessions branch.  This merge
  should fix the build for WinRT.


type: ci
user: drh
comment:
  Fix memory and resource leaks for WinCE and Cygwin, and a compiler warning
  on windows with SQLITE_THREADSAFE=0.


type: ci
user: dan
comment:
  Clear a valgrind error by zeroing the first 4 bytes of the temp-space allocation used by the b-tree module.


type: ci
user: drh
comment:
  In the vfslog extension for FILECONTROL records, show the pragma name for
  SQLITE_FCNTL_PRAGMAs and the requested size for SQLITE_FCNTL_SIZE_HINT.


type: ci
user: drh
comment:
  Further enhance the vfslog extension to record the number of freelist pages
  and the first freelist page in CHNGCTR-READ and CHNGCTR-WRITE records.


type: ci
user: drh
comment:
  Add the SQLITE_FCNTL_TRACE file control and generate it for OP_Trace
  when compiled with SQLITE_USE_FCNTL_TRACE.  Update vfslog.c to make
  use of the new file control.  Also update vfslog.c to log UNLOCK events
  before the fact, rather than afterwards.


type: ci
user: dan
comment:
  Fix a bug causing an "malformed database schema error" error if a temp table with the same name as an existing table that has at least one temp trigger attached to it is created.


type: ci
user: drh
comment:
  Experimental changes toward "index only" tables.  Add the ability to specify
  options on CREATE TABLE statements using the WITH clause modeled after
  PostgreSQL and SQL Server.  Only the "omit_rowid" option is currently
  recognized and that option is currently a no-op.


type: ci
user: drh
comment:
  Previous refactor is not going to be helpful because implied indices must be
  created in the same order that they appear in the CREATE TABLE statement
  for backwards compatibility.  This is a much smaller change to clean up a
  few loose ends.


type: ci
user: drh
comment:
  Extra backwards-compatibility tests verify that UNIQUE and PRIMARY KEY 
  indices are created in the correct order.  Other backwards-compatibility
  tests already cover this, but it does not hurt to double up.


type: ci
user: drh
comment:
  The Index object now has nKeyCol and nColumn.  nColumn is the total number
  of columns and nKeyCol is the number of key columns.  Currently these always
  differ by one.  Refactor aiColumn[] to be of type i16 instead of int.


type: ci
user: drh
comment:
  Change the sqlite3OpenTable() utility to open the PRIMARY KEY index when
  reading a WITHOUT ROWID table.


type: ci
user: drh
comment:
  Delete PRIMARY KEY index entries last.  Only construct the unique prefix of
  an index key when deleting entries from an index.


type: ci
user: drh
comment:
  Update the interface to the sqlite3GenerateRowDelete() utility so that it is
  able to handle WITHOUT ROWID tables.  The implementation still needs to be 
  completed.


type: ci
user: drh
comment:
  Replace the OP_IsUnique opcode with OP_NoConflict.  This code simplification
  might be useful to move onto trunk even if this branch is never merged.


type: ci
user: drh
comment:
  Work on the UPDATE and INSERT logic.  This is an incremental check-in so that
  can switch over to trunk to work on an unrelated issue there.


