Commit Graph

8707 Commits

Author SHA1 Message Date
drh
fc4491366b Restructuring and generalizing analyze5.test. The whole script is
currently disabled and will need to be reenabled prior to merging with trunk.

FossilOrigin-Name: 31fcc7067bd76da4bf19232811b90cf8b76eed74
2011-01-24 17:46:35 +00:00
drh
b966194a63 Change the cost estimator in the query planner to take into account the
logN rowid lookup cost when going from an index to a table.

FossilOrigin-Name: b442525b0ba642bb8d57b87b7b9e373b6046454a
2011-01-24 15:11:23 +00:00
drh
534230cf2e Add the ability to use indices for constraints of the form "x IS NOT NULL"
when sqlite_stat2 is available and most entries for column x are NULL.

FossilOrigin-Name: 5d5bddd290e71a7b03bcc23ff29881c23233cbff
2011-01-22 00:10:45 +00:00
drh
5ac0607169 Adjustments to the result row estimator for the IN operator so that it gives
the same estimates as the equivalent OR operator.  Test cases for the same.

FossilOrigin-Name: c82cb9c028b3ba5463ae50c30196dbf157a7a305
2011-01-21 18:18:13 +00:00
drh
0c50fa0f61 Make use of histogram data to make better estimates for the number of rows
that will be returned from "x IN (v1,v2,v3,...)" constraints.

FossilOrigin-Name: fd3977a27ae68e694df12a4713e55515c1e87c5d
2011-01-21 16:27:18 +00:00
drh
9b3eb0adc1 Add the ability to use indices when a range contraint is bounded on
the lower end by NULL.

FossilOrigin-Name: f73a167b434fadcbbd15e3891c4b7f4f87f6363c
2011-01-21 14:37:04 +00:00
drh
3851b74ae1 Update ANALYZE test cases to check out the use of histograms for equality
constraints.

FossilOrigin-Name: c7b59afaf0c0bf85dbaf0a122cc8d65fca93680f
2011-01-20 20:36:13 +00:00
drh
82759754ce Use histogram data to improve the row-count estimates on equality constraints.
FossilOrigin-Name: 6bfc5c69eb22938972bbf4e60179952dc215f770
2011-01-20 16:52:09 +00:00
drh
e847d3247f The first of a planned series of enhancements to the query planner that
enable it to make better use of sqlite_stat2 histograms when the table
has many repeated values.

FossilOrigin-Name: 2cd374cd23fa2fd38f49090d6eeb9b1e521d51d5
2011-01-20 02:56:37 +00:00
drh
3a5676ce26 Comment improvements in pcache1.c. No changes to code.
FossilOrigin-Name: 9660a0a22547656cc3765b673d0cee9e1dd829ef
2011-01-19 21:58:56 +00:00
drh
bee29f4ac1 Do not use mutexes in the pcache implementation unless
SQLITE_ENABLE_MEMORY_MANAGMENT is defined.  This is a performance enhancement.
A side effect is that pcaches will not steal pages from one another unless
ENABLE_MEMORY_MANAGEMENT is set, or unless SQLITE_THREADSAFE=0.

FossilOrigin-Name: e5ca59e63b18ac45a8c82ca39dc8cce1c4ce903c
2011-01-18 17:03:26 +00:00
drh
986d3b95bb Get all test cases working with the mutex-free-pcache implementation.
FossilOrigin-Name: 2dc98d29995bef51108e99aa8f7a56427cf9e1d7
2011-01-18 16:13:27 +00:00
drh
40f9837ff6 Do not use SQLITE_MUTEX_STATIC_MEM2 since it has been reused as STATIC_OPEN.
Instead, create a new static mutex STATIC_PMEM which is an alias for the
unused STATIC_LRU2.

FossilOrigin-Name: f1cf02efcb3a871fef49f8b5f41bcf07622a6d29
2011-01-18 15:17:57 +00:00
drh
9f8cf9da27 Here is a completely new implementation of the mutex-free-pcache. This
one uses a common code base and automatically selects whether or not to 
use mutexes depending on compile-time and start-time options.

FossilOrigin-Name: d094a1bfb7569a52b637fe9ba5d3fa6ce5ea6d94
2011-01-17 21:32:24 +00:00
drh
eee50ca5a7 Fix a typo in the documentation for sqlite3_stmt_readonly().
FossilOrigin-Name: 56417a3386fc84dd36bf1488e88149b1ac6a0d02
2011-01-17 18:30:10 +00:00
drh
602acb4871 Add the SQLITE_OMIT_AUTORESET compile-time option which if enabled causes
the sqlite3_step() routine to return SQLITE_MISUSE if it is called after
it has previously returned anything other than SQLITE_ROW, SQLITE_BUSY, or
SQLITE_LOCKED.

FossilOrigin-Name: 053ce76deb356d31358454507ba94947142e20ca
2011-01-17 17:42:37 +00:00
drh
c5aae5c90b Add back an ALWAYS() to regain full test coverage.
FossilOrigin-Name: b93f6f3e679c7710f42580a8dd9ce43136376c1d
2011-01-17 02:24:12 +00:00
drh
c6aed5424b On a backup from a smaller to a larger page size, do not begin committing
the transaction until the source pages after the pending byte have been
copied.

FossilOrigin-Name: 612e2599d3e1a17c268402fce018a53dee6dffe1
2011-01-16 22:37:09 +00:00
drh
d40d7ec78b Make sure the change-counter and SQLite-version fields of the header are
set correctly even when doing a VACUUM with locking_mode=EXCLUSIVE.
Ticket [5d863f876ee9561b].

FossilOrigin-Name: 04fa1e16905183b948ee6456675799a873d5f97d
2011-01-16 00:56:19 +00:00
drh
0bf1f496b8 Make sure the change counter and SQLite version numbers in the header are
set correctly, even when running in WAL mode and when VACUUMing in WAL mode.
Ticket [5d863f876ee9561b9].

FossilOrigin-Name: 0be92a75769dbafbc08c3b229089aaac03a9a907
2011-01-15 21:42:23 +00:00
drh
54a7347aa1 Fix the change-counter increment for WAL pages so that it works even when
invoked from xStress.  Ticket [5d863f876ee9561b95e2].

FossilOrigin-Name: 228e7c34c64114670fe015747d47fdaa3b7e1270
2011-01-15 18:11:12 +00:00
drh
104a7bba8c Increment the change counter and update the SQLite version number whenever
page 1 is added to the WAL.  Ticket [5d863f876ee9561b9]

FossilOrigin-Name: c1e0d09cd3f5feae123468a35f147021d839641c
2011-01-15 17:12:59 +00:00
dan
39210bdaa6 Add a test case demonstrating the problem described by ticket [5d863f876e].
FossilOrigin-Name: af54963f0fa0afafbc2d0847f30543c041b182ec
2011-01-15 16:52:10 +00:00
drh
a5657d710b Rerun autoconf to bring the configure script up-to-date.
FossilOrigin-Name: 142174640d60e834cae27ccaa78b02ecef8bcfe5
2011-01-14 16:43:29 +00:00
drh
94e7bd55bd Fix comments, including some documentation comments, in the page cache
logic.  No code changes.

FossilOrigin-Name: c80e9c1a0dc0e501b209874e147e1cb1348cb4a4
2011-01-14 15:17:55 +00:00
dan
47e909bb15 Fix a bug in test code (test_vfs.c).
FossilOrigin-Name: 772a3845f8ef5cd3131992c45f6ce607977820f3
2011-01-14 11:51:28 +00:00
drh
5b3696e8a6 Fix a typo on the sqlite3_open_v2() documentation.
FossilOrigin-Name: b0add45abc9929c5b8d1124879bc3e8acf2ab7c7
2011-01-13 16:10:58 +00:00
dan
a8ab60c648 Fix a couple of crashes in fts3 that can occur if the database contents are inconsistent.
FossilOrigin-Name: 811e12cddfb3246c6cf3d5085bd9b72b12e05550
2011-01-13 11:20:04 +00:00
dan
86596e552e Fix a segfault that can occur in matchinfo if an fts4 table contains mostly zero-length documents. Specifically, if the table contains more rows than it does bytes of text.
FossilOrigin-Name: fe9047668eaaf76e7aa1ef1f32dec7c7c4226e45
2011-01-13 10:58:26 +00:00
drh
efd95a7aca Do not raise an SQLITE_CORRUPT error in Recoverymode
if the database size in the header is larger than the physical file
size.  This facilitates recovery of a database in which the database size
field has been corrupted.

FossilOrigin-Name: 114640d920e16c85de90b19d53c485135875de5b
2011-01-12 17:56:26 +00:00
dan
da56b15e95 Merge accidentally created fork.
FossilOrigin-Name: b7d080b8e850bd262f53f29ba4687a62cf76d4ef
2011-01-11 17:40:30 +00:00
dan
354bfe0363 Add the SQLITE_FCNTL_SYNC file-control.
FossilOrigin-Name: b3f2f465c310a2cfef8731a0dae3453593b68de9
2011-01-11 17:39:37 +00:00
drh
ca94d8bf82 Change the page size of the destination database in a backup, if it is
changeable, prior to starting the backup.

FossilOrigin-Name: a5e4e0caad788318bc973e2550488a3b83128b8b
2011-01-11 17:38:03 +00:00
dan
9f4beedb6f If a rollback is attempted in journal_mode=off mode, force SQLite to discard the contents of the pager cache before processing any subsequent queries.
FossilOrigin-Name: ece7efce2733b4fdd71db385abebbde464ac8f30
2011-01-11 16:09:55 +00:00
drh
bbd91944dd Fix the sqlite3.h generator script so that it generates the correct
SQLITE_SOURCE_ID string with the latest versions of Fossil that 
include fractional seconds on the date/time stamp.

FossilOrigin-Name: 3513bf6ee090d9be97f60e12a4b39f4361ee17b7
2011-01-11 12:46:05 +00:00
drh
444d26065e Update pager requirements to accound for the ZIPVFS extension.
FossilOrigin-Name: d94e59b514c16c5f7ea506e0af1c6e2ffecc13be
2011-01-10 21:01:10 +00:00
drh
2e5de2f2b3 Reorder the fields in private structures in an effort to reduce alignment
gaps and thus make the structures smaller, and to put frequently accessed
fields first.  Also update some obsolete comments.  Valgrind shows a very
slight performance improvement.

FossilOrigin-Name: 378a1d13af4a6f4cb2bfa65944b3b0d444b9f21c
2011-01-07 02:50:40 +00:00
drh
b7787eef7a Enhance the showdb tool to show overflow page pointers at the end of
overflow cells.

FossilOrigin-Name: cda5eab18f48d3836dfd3e1f8c76e5f83b43485f
2011-01-06 15:51:18 +00:00
drh
5240aebdd8 Enhance the showdb tool to show a btree page layout. Add limit checks so that
overflow content does not overflow the buffer.

FossilOrigin-Name: 57ffa07e26a26d2f4527c8e6d7a9c1f48f380bf7
2011-01-06 01:26:38 +00:00
drh
b2c062df71 Fix a bug in the showdb utility: the serial types for BLOB and TEXT where
reversed.

FossilOrigin-Name: 65a13faf1e3cd18f3459cd410f65d334cfa7c376
2011-01-05 21:46:52 +00:00
drh
100335be77 Enhancements to the "showdb" debugging tool. Add the ability to display
the content of a cell.

FossilOrigin-Name: e9023a4e1edd552a81dcb2dcd5a996edfa167709
2011-01-05 21:20:52 +00:00
drh
8a3d62224c Increment the version number to 3.7.5.
FossilOrigin-Name: 9ec3896e2fda5b04e609300463dc5b6e79d6cff1
2011-01-05 13:43:23 +00:00
drh
db26d4c9e1 Add the sqlite3_vsnprintf() interface.
FossilOrigin-Name: fc67adea414320e0c0b24054f76070cfaeebb401
2011-01-05 12:20:09 +00:00
drh
65a0ce16aa Fix a null-pointer dereference that can occur on an OOM error while running
ANALYZE with SQLITE_ENABLE_STAT2.

FossilOrigin-Name: 73128d4ef5d7703bf7af0553c307b55dc1b783f6
2011-01-04 20:06:33 +00:00
drh
4856698fa5 Fix the ANALYZE command so that it takes collating sequences into account
when gathering index statistics.

FossilOrigin-Name: a5867cfc4c9b9155fa345247dec29e38fffa8002
2011-01-04 19:01:26 +00:00
drh
8e93b10a4e The ANALYZE command now counts at all rows of an index, even those containing
NULL values.  A valid sqlite_stat1 entry is created even if the index contains
nothing but NULLs.

FossilOrigin-Name: 824c8dd3015bbd5c8a1dd661cfe09fe5bf7a80d3
2011-01-04 17:57:53 +00:00
dan
b29010cd4f Have testfixture invoke C routine Zipvfs_Init() when creating a new interpreter if SQLITE_ENABLE_ZIPVFS is defined.
FossilOrigin-Name: 430635dacfa818e8266a88214aaf60c77862de1c
2010-12-29 18:24:38 +00:00
dan
72903821e3 Fix some off-by-one errors in the comments for API functions create_function() and value_blob(). No changes to code or tests.
FossilOrigin-Name: 7ded90baeb75db5af83345cd2c31211cbee1e91b
2010-12-29 10:49:46 +00:00
dan
b9a93d70b8 Reduce the number of calls to sqlite3_realloc() made by fts3 when querying for position information of a term prefix.
FossilOrigin-Name: 7088d9450f403f12f67eed558e368573101245d6
2010-12-24 15:49:27 +00:00
drh
b469f46083 Do not include <sys/mmap.h> if SQLITE_OMIT_WAL is defined.
FossilOrigin-Name: b82e85ece94c8e25c1dc3251f5444a295fbf8c89
2010-12-22 21:48:50 +00:00