Commit Graph

6374 Commits

Author SHA1 Message Date
dan
ecac670a8b Do not report corruption if the the db size header field is greater than the file size on disk unless the two change-counter header fields are identical. Fix for ticket [89b8c9ac54].
FossilOrigin-Name: 00c4596f0b270120848ab8d06dcdec7813a9a315
2011-02-09 18:19:20 +00:00
drh
7924f3e8e7 Use macros to define the relative costs of search and seek operations when
computing costs in the query planner.  Current constants seems wrong and
need to be fixed, but doing so will alter test results.  Need more
experimentation to determine accurate relative costs.

FossilOrigin-Name: 5f2ec44b22062ee9d31e20806fcec0101675aced
2011-02-09 03:04:27 +00:00
drh
383d79ee0b Simplifications to the sqlite3_wal_checkpoint_v2() logic.
FossilOrigin-Name: 652b8835c58fc9d474c9837fc966d8857bec4a91
2011-02-09 03:03:16 +00:00
drh
30aa3b93b6 Cleanup to the OP_Checkpoint opcode.
FossilOrigin-Name: f611a5a879b7dec1ed1d8bf32413c8a6b81c3172
2011-02-07 23:56:01 +00:00
dan
9c5e3680df Change blocking-checkpoint tests so that they run once using "PRAGMA wal_checkpoint" and once using calls to sqlite3_wal_checkpoint_v2(). Also fix edge cases surrounding the output variables set by wal_checkpoint_v2().
FossilOrigin-Name: 5a4b6652cf3780ffed6fe0fe669e8090b0b71e81
2011-02-07 15:12:12 +00:00
drh
47fe5533a6 Merge the stat2 query planner enhancements into the trunk.
FossilOrigin-Name: 499edcbc8ab70fcf35431d4e672c68dbcb6c5aad
2011-02-04 06:36:44 +00:00
drh
9ab724f196 If a deferred foreign key constraint fails on a statement that is not part
of a larger transation, make sure that the statement fully ends so that
subsequent invocations of the same statement will not pass the constraint
because they think the transaction is not closed.  This is a merge of
the deferred-fk-quirk branch together with a test case.

FossilOrigin-Name: 2f94d4623f9aae1b5bc7041bd85f4e3a7462c60e
2011-02-04 05:47:51 +00:00
drh
0097eb3942 Fix the ATTACH command so that the filename argument can be any expression
and so that if authorizer callback gets a NULL pointer for the filename
if the filename argument is anything other than a string literal.
Ticket [9013e13dba5b58c7]

FossilOrigin-Name: e64e1453a9c204d93de1af92dc0b3ca26762b024
2011-02-04 00:51:16 +00:00
dan
d42892ebaf Fix minor problems with the output of "PRAGMA wal_checkpoint". In both code and tests.
FossilOrigin-Name: aef61036b31963e4c3ff4e8acf8c1734dc9394af
2011-02-02 19:17:39 +00:00
drh
87fa53ee8d Merge in the blocking-checkpoint enhancement, including the new
sqlite3_wal_checkpoint_v2() interface and the
PRAGMA wal_checkpoint(full) statement.

FossilOrigin-Name: bac7342c368a7c4f5f2878e08d9581dcbf57dd58
2011-02-02 16:34:08 +00:00
dan
290c939fbf Remove extra instances of the text "checked out." from sqlite.h.in. Also add new file fts3_aux.c to mksqlite3c.tcl.
FossilOrigin-Name: 9897da22c5b51611597350efbe8d5dcaf39d748b
2011-02-01 18:59:34 +00:00
dan
6d311fb0ac Fix a problem causing builds with SQLITE_OMIT_WAL defined to fail.
FossilOrigin-Name: b9b48dd8ddceec009b5a22a3699e1524542c004a
2011-02-01 18:00:43 +00:00
drh
bd1334dfd9 Change pager_truncate() to a different method for extending files while
also ensuring that writes are page-size and page-aligned.

FossilOrigin-Name: 874bc8844f6494cdbf700bd884dee67d40f11fc0
2011-01-28 15:46:14 +00:00
dan
fb3828c25f When extending a database file, do so by writing one or more page-size chunks of data to the file, instead of just a single byte to the end.
FossilOrigin-Name: 58577135a81d3f19667b1de6167d2e3f1b74cd53
2011-01-28 15:07:55 +00:00
drh
083310dfcc Change the weighting of binary searches on tables to 1/10th the cost of a
search on an index.  Change the assumed reduction in search space from a
indexed range constraint from 1/3rd to 1/4th.  Do not let the estimated 
number of rows drop below 1.

FossilOrigin-Name: 4847c6cb71423248b186ab7842b97c83e2f5fefd
2011-01-28 01:57:41 +00:00
drh
0b52b7d0cd Update all built-in VFSes to return SQLITE_OK for the
SQLITE_FCNTL_SYNC_OMITTED file-control operation.  Also change the 
xFileControl methods to return SQLITE_NOTFOUND for unrecognized
operation codes.

FossilOrigin-Name: 6f2c72a0f6579db3f40c079436ca40e3e52bd6d9
2011-01-26 19:46:22 +00:00
drh
15ad92f2ae More mutexes around another sqlite3StatusAdd() call.
FossilOrigin-Name: e3b500fb5d93d98e6e1ddf6d494a841274d1b68d
2011-01-26 13:28:06 +00:00
drh
9bf3da8eab Add a mutex around an sqlite3StatusAdd() call to prevent the pagecount
overflow measurements from getting off in multithreaded applications.

FossilOrigin-Name: 3d8b298dc24fe13a3f390da41f79b8613a6f25a7
2011-01-26 13:24:40 +00:00
dan
6d4fb833b7 Update mutex1.test so that it works with the memsubsys1 permutation (pagecache memory). Change a few instances of SQLITE_MUTEX_STATIC_LRU2 in comments and test code to STATIC_PMEM.
FossilOrigin-Name: 456bd5c63b41bae8e389df81e318b830aa314000
2011-01-26 07:25:32 +00:00
drh
25ca568251 Rename the PCache1.mxPinned field to n90pct (since it is 90% of nMax) in order
to distinguish it from PGroup.mxPinned.  Fix the computation of n90pct so that
it does not overflow adversely on excessively large cache sizes.

FossilOrigin-Name: c85202baac49b22a4be36b9733d44f01d83edb28
2011-01-26 00:07:03 +00:00
drh
1e4040a4b4 Fix new compiler warnings in pcache1.c that were introduced by the recent
performance enhancement patches of [e14649301138b684].

FossilOrigin-Name: c17703ec1e604934f8bd5b1f66f34b19d17a6d1f
2011-01-25 18:30:51 +00:00
dan
4d26d585d6 Add a missing call to sqlite3PagerSync() removed by [ce552d975] to the backup code.
FossilOrigin-Name: 1965b85318c1fac62fae9691059021b298c17dde
2011-01-25 18:19:24 +00:00
drh
534a58a76d Make sure the return code from doing an xSync is correctly initialized
so that a valid return code is produced regardless of the path taken through
the logic.

FossilOrigin-Name: f12b5d76854c2f294ac60afe38a6dac37eb5b174
2011-01-25 16:48:56 +00:00
drh
951596cdef Change the name of SQLITE_FCNTL_SYNC to SQLITE_FCNTL_SYNC_OMITTED and only
send it when PRAGMA synchronous=OFF.  Add better documentation to explain
what that file-control opcode is used for.

FossilOrigin-Name: 64914980855dbbf19512642836ca962a507b3ddb
2011-01-25 16:20:16 +00:00
dan
0ecdeb2414 Fix a couple of typos in comments. No changes to actual code.
FossilOrigin-Name: 9167fdb3560b1567a0bdc9a1906a87ec98e161f1
2011-01-25 13:43:35 +00:00
dan
d1cf7e2972 Fix a broken assert() in pager.c.
FossilOrigin-Name: 13108ce13c281f31aa60b403567710ae3d925797
2011-01-25 11:33:01 +00:00
drh
41692e9d7c Shave a few cycles so that performance is better than 3.7.4 in speed tests.
FossilOrigin-Name: e14649301138b6840e24a4bbd2cf5205c0f72409
2011-01-25 04:34:51 +00:00
drh
3778ac15dd Modify the test_quote.c demonstration shim so that it works when
SQLITE_THREADSAFE=0 is defined.

FossilOrigin-Name: b70bcccaf5597c8a59cccb64fb997523f7b8fe4f
2011-01-24 20:18:05 +00:00
drh
2afc704ad8 Fix a typo in the documentation for sqlite3_snprintf(). No changes to code.
FossilOrigin-Name: 8d1065411aadf189880606c48ab63dd2a56b9793
2011-01-24 19:45:07 +00:00
drh
906b662060 Fix a harmless compiler warning (a shadowed local variable) in analyze.c.
FossilOrigin-Name: a1ad7fb38bb38909ca2fddee31c7a8001f10686f
2011-01-24 19:14:06 +00:00
dan
19611b1a88 Ensure that if a deferred FK constraint is violated by a statement that creates its own implicit transaction, the statement is not an "active-write" after sqlite3_step() returns.
FossilOrigin-Name: 8063197ef141c0c62ba710efdd2b3421fbee4e5d
2011-01-24 16:00:58 +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
dan
27381bd519 Modify the trace callback mechanism so that SQL commands executed from within virtual table or user function callbacks are passed to the trace callback without parameter expansion and enclosed in SQL comments.
FossilOrigin-Name: a764915b87564fa91ee68e9b1f41394ce0f1fc7e
2011-01-22 13:32:29 +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
dan
a9ef7097c7 Change sqlite3StrAccumAppend() to use realloc instead of malloc.
FossilOrigin-Name: 380f61df0754ceec6b3f6a758d04e951cce8c3d9
2011-01-21 18:25:29 +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
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
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
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