Commit Graph

7836 Commits

Author SHA1 Message Date
dan
4cd78b4d89 Fixes for problems with small caches and SAVEPOINT rollback in WAL mode.
FossilOrigin-Name: 6a944f028d4a070bef29e1fbc6fbef481ebcd34c
2010-04-26 16:57:10 +00:00
drh
7ecc14761e Further enhancements to the showdb utility: A page number followed by "b"
causes a btree decoding to occur on the page.

FossilOrigin-Name: 2ff824e58ce8b8f605c809ac960dcbfc51c30e30
2010-04-26 16:47:12 +00:00
drh
562cedb185 Enhancements to the showdb.c utility program. Automatically detect the
page size and adjust the display accordingly.  Add the "dbheader" display
option.

FossilOrigin-Name: 23eb408b5d08b89b41aaf245a7be8e235f30af8a
2010-04-26 15:44:07 +00:00
dan
71cb518fca Add the "wal" permutation to run existing test files savepoint.test and savepoint2.test in WAL mode.
FossilOrigin-Name: 205e5d8ac08f7d7853427b4cd235fca125155d2d
2010-04-26 12:39:03 +00:00
dan
cd11fb28c3 Add mutexes to fix a race condition in wal.c. This isn't a very good fix.
FossilOrigin-Name: 3d159939cc2beb18c4ca0c8e9a99a75d4107e6e4
2010-04-26 10:40:52 +00:00
drh
c438efd68a Change the names of the log.c and log.h source files to wal.c and wal.h.
FossilOrigin-Name: 56fe5d7624f840417152bcc63efbe21a5f557920
2010-04-26 00:19:45 +00:00
drh
f2424c521b Begin moving WAL-specific I/O into the VFS. This checkin contains VFS
infrastructure but it is untested and is not yet hooked up to the WAL.
The version number is bumped to 3.7.0 because of the VFS extension.

FossilOrigin-Name: f5e615c28c7035a7e6d896790b51cf9bc7371d5f
2010-04-26 00:04:55 +00:00
drh
a4741840f6 Remove an unreachable branch from the function initialization logic.
FossilOrigin-Name: 064d3ddd6199b7b049b1706974e4295f78fb5ab9
2010-04-25 20:58:37 +00:00
dan
56d95913eb Add comment explaining checksum mechanism.
FossilOrigin-Name: 3e9ef5153ebf0543ad0f75a7561f73d22171da53
2010-04-24 19:07:29 +00:00
dan
74d6cd887f Fix bugs in WAL mode rollback.
FossilOrigin-Name: 31215969f59be536fe87431bb9fbfa7d13027e35
2010-04-24 18:44:05 +00:00
dan
9de7943783 Merge with [0291ed974d].
Merge with [0291ed974d].
Merge with [0291ed974d].

FossilOrigin-Name: a352f6285e33a806fbe4475e720e763fdc5bb47d
2010-04-24 14:33:08 +00:00
drh
545f587fc8 When commands such as ALTER TABLE and VACUUM use SQL internally, make sure
they use only the built-in functions and not application-defined overrides
for those functions.

FossilOrigin-Name: 0291ed974d5bf1e344e2c38422530cc961b897da
2010-04-24 14:02:59 +00:00
dan
4f08d4b848 Merge with [e79dac3c2f].
FossilOrigin-Name: 1e793d3a6d46ec5d744e077b10362e7cfa118eef
2010-04-24 04:53:15 +00:00
dan
ff207012e6 Reserve some space at the start of the log-summary file to apply locks to.
FossilOrigin-Name: a031aa1fa01f062b087154833738f011f7bc4eb5
2010-04-24 04:49:15 +00:00
dan
3306c4a945 Fixes and tests for backup of a WAL database.
FossilOrigin-Name: 480d12db4c0ebcc37598f7620d39193875eab15b
2010-04-23 19:15:00 +00:00
shaneh
9a6e897328 Merge of notify.c changes from experimental.
Reset stored blocking connection when registered unlock_notify callback is cleared.

FossilOrigin-Name: e79dac3c2f723ed7cc62fcef468f53952711f242
2010-04-23 14:29:04 +00:00
dan
d5c99c3939 Add very simple test cases for backup and VACUUM of WAL databases. More to come.
FossilOrigin-Name: 1077d8130b8ed5716ad73f78382270909d347963
2010-04-23 11:44:40 +00:00
dan
ce4f05f374 Create a version of the log checksummer that works on big-endian platforms. Remove the 512KB size limit on the log-summary.
FossilOrigin-Name: 5d6d4423d1def39bd2424703120aa985085c3f8e
2010-04-22 19:14:13 +00:00
dan
ede6eb8d1d Further tests and changes related to switching between WAL and rollback modes.
FossilOrigin-Name: 1236318477787a612f02cc98caf2931bd2e99d94
2010-04-22 06:27:04 +00:00
dan
b978002743 Tests for (and changes to) the code to switch between WAL and rollback modes.
FossilOrigin-Name: 9f4f933f2c6596064fcfc7fb5add87e8c5b57448
2010-04-21 18:37:57 +00:00
dan
a470aeb4ac If, after obtaining a SHARED lock, there exists a *-wal file in the file-system, use WAL mode. This is necessary to recover from a crash that damages the first page of the database file.
FossilOrigin-Name: 33cabf271b8f4dda508a610bf59964273fe2cb84
2010-04-21 11:43:38 +00:00
dan
28e5386f79 Minor changes to test cases to account for the fact that databases with read/write versions of 2 are now understood.
FossilOrigin-Name: 278ed41e1d4bbff9544cb2cf4cf52dbbcf0c17df
2010-04-21 06:19:12 +00:00
dan
e04dc88be5 Use the read and write version fields of the database header to mark a database as operating in wal-mode.
FossilOrigin-Name: 96bef18c1411c3e0348295886f105e1646c46320
2010-04-20 18:53:15 +00:00
dan
8d22a17411 Add the sqlite3_log_hook() interface for scheduling checkpoints.
FossilOrigin-Name: 9bda601455705475075e33bfa85687bce34b15ff
2010-04-19 18:03:51 +00:00
dan
54934f4689 Add some comments regarding file-locks to log.c.
FossilOrigin-Name: 9d51c3b754f0b94fea5ef3d669ad583b93b2b024
2010-04-17 18:50:27 +00:00
dan
c511878955 Do not sync any files in wal mode if "PRAGMA synchronous=off" is set. If files are synced, pass either SQLITE_SYNC_FULL or SQLITE_SYNC_NORMAL to the xSync() callback as configured by "PRAGMA fullfsync".
FossilOrigin-Name: 0ae91b0008b242a47385fc1f295c6b645483ee22
2010-04-17 17:34:41 +00:00
drh
335c0faabd It is possible for sqlite3.pUnlockConnection to be non-NULL when
sqlite3.pBlockingConnection is NULL, as the notify1.test script
demonstrates.

FossilOrigin-Name: 95ff76ef67d6189f54375973fa485d6eb464b029
2010-04-17 16:10:19 +00:00
dan
dea0a85091 Merge with trunk commit [3e646e3f4c].
FossilOrigin-Name: 43463970f5885fb116588695146f2a56cb22804a
2010-04-17 15:45:35 +00:00
dan
6703239d2f In synchronous=normal mode, do not sync the log after every transaction. In synchronous=full mode, sync the log and add any extra frames required to avoid blast-radius related problems after each transaction.
FossilOrigin-Name: 9bc9b6847303d0324543a9ded8dd0473490122d8
2010-04-17 15:42:43 +00:00
drh
3674bfd1b6 Change sqlite3_step() so that it automatically calls sqlite3_reset() instead
of returning SQLITE_MISUSE when invoked on a prepared statement that
previously returned any value other than SQLITE_ROW.

FossilOrigin-Name: 3e646e3f4cd0ca288e444561e951cecfdaee2ab5
2010-04-17 12:53:19 +00:00
dan
3de777fd8c Enhancements to wal-mode locking scheme.
FossilOrigin-Name: 8549c286497f3d2cd118be1334fce00d6f8a26c4
2010-04-17 12:31:37 +00:00
shaneh
4b93f6bd1e Changes for branch coverage of notify.c. Fixed quirk of
unlock_notify() where it would still think it was blocked
after a callback was cleared (even after the transaction
on the blocking connection was closed).

FossilOrigin-Name: c54e8dad01b0ecaf8d66b10e64e862dcad8a6746
2010-04-16 22:05:31 +00:00
dan
97a313554d Change the log file format to include a small (12 byte) header at the start of the file.
FossilOrigin-Name: 9865d14d6041874bc1239ce7a061d5c75f2d33c9
2010-04-16 13:59:31 +00:00
dan
4a4b01dc1c Fix bug in log recovery (last frame in log was being ignored). Also remove an incorrect assert statement.
FossilOrigin-Name: 67d2a89ec2d593a077eb19a6ea2b06cb1c2e9ba8
2010-04-16 11:30:18 +00:00
drh
f391327824 Disable query flattening when the outer query is a compound SELECT and
the inner query has a LIMIT clause.  Ticket [02a8e81d44].

FossilOrigin-Name: f96782b389b5b97b488dc5814f7082e0393f64cd
2010-04-15 23:24:29 +00:00
dan
4cc6fb6165 Allow writers to write dirty pages to the log mid-transaction in order to free memory.
FossilOrigin-Name: ecd828f96909895535d7dc744e5a8530e234e04d
2010-04-15 16:45:34 +00:00
dan
bb2e9c97fc Merge two leaves on the WAL branch.
FossilOrigin-Name: c9ed66cc3994b3b0d67a6c950b552a1a869f2ed2
2010-04-15 13:33:18 +00:00
drh
ed808acd1b The query planner fix of check-in [33b1f584ef] should have been on the trunk.
FossilOrigin-Name: f538d759beda67e042b66181b65bd432488f7650
2010-04-15 13:29:37 +00:00
drh
521a72b1fa Fix a problem in the result set size estimation logic of the query planner -
a problem introduced by the two previous changes.

FossilOrigin-Name: 33b1f584ef712625c4df8e2aefe895fa89f6a795
2010-04-15 12:36:06 +00:00
dan
39c79f587c Change the way checksums are calculated.
FossilOrigin-Name: 84955c2e9ce526c5a3ed479aa09f093a7e37c7d0
2010-04-15 10:58:51 +00:00
drh
ce2f88d95b Bring over the recent query planner enhancements from the trunk.
FossilOrigin-Name: 82969f27e5ea843cb379666d8a02e4a3fddc03b2
2010-04-15 02:37:10 +00:00
drh
ed754ce2cc Further refinements to table order selection on join query planning.
FossilOrigin-Name: defaf0d99a807027f8883bf821b6482025f9f54e
2010-04-15 01:04:54 +00:00
drh
1e0f4a83d6 The query planner uses non-indexable WHERE clause terms to reduce the
estimated number of output rows, then uses the estimated number of output
rows as a tie-breaker when choosing table order.

FossilOrigin-Name: b87cb0c2bd9c52a938795a974e101879b81210e3
2010-04-14 19:01:44 +00:00
dan
49320f8568 Add tests and fix bugs in WAL locking mechanism.
FossilOrigin-Name: c18077f2465fc34830f11c9832e76be5746eaeea
2010-04-14 18:50:08 +00:00
dan
e264d983d1 Add tests to check inter-process WAL locking.
FossilOrigin-Name: 9435f3135849e0d38fde1669201db508561a6308
2010-04-14 18:06:50 +00:00
dan
02bb596649 Improve the logLockRegion() function in log.c.
FossilOrigin-Name: 5e9dd3bd8e829376408925fb4cfcd5bb1eb1105f
2010-04-14 15:49:40 +00:00
dan
b9bf16bfde Fixes for locking issues in WAL mode.
FossilOrigin-Name: a9617eff39177250e2f118f25fdd4b3acb8b0478
2010-04-14 11:23:30 +00:00
dan
64d039e512 Add experimental locking scheme.
FossilOrigin-Name: 3f958e87c33d667d299b03ffdef58db5dc6363f4
2010-04-13 19:27:31 +00:00
drh
622194c0d2 Fix an uninitialized variable in readDbPage of pager.c.
FossilOrigin-Name: f4e1150fed2c520c7c52612cb1019429d78dc32a
2010-04-13 15:30:53 +00:00
dan
f05c86dd73 Remove old code to interpret an argument (no longer used) to "PRAGMA checkpoint".
FossilOrigin-Name: 27dc5977c19e717afd65d3805557e38dec7bedcb
2010-04-13 11:56:03 +00:00
dan
80a1526a9a Fix other problems in the WAL test scripts.
FossilOrigin-Name: dcb31181db246dd3f81ce63b144dd0cf95f06ee3
2010-04-13 11:45:31 +00:00
dan
d3f8f94652 Fix test script issues preventing walthread.test from running.
FossilOrigin-Name: d90b1dde0702ceb0eae2a3da36733a7e5b1a6b3a
2010-04-13 11:35:01 +00:00
dan
9281bf2a9f Fix a pager bug introduced by the wal code.
FossilOrigin-Name: 4a0b29dc5e573a5d696ede17db5d7acf8d23aa98
2010-04-13 11:18:40 +00:00
dan
835ae8bcdd Sync wal branch with [012cf101bf].
FossilOrigin-Name: 9d690f24f634696f76fa38372461cfa69263e91e
2010-04-13 06:20:45 +00:00
dan
c9206ed56e Test that the rollback-hook is invoked if a commit-hook implementation returns non-zero (causing a rollback). Remove documentation comment that says otherwise from sqlite.h.in.
FossilOrigin-Name: 012cf101bf8be9e39c138786ea5a5039b8131e55
2010-04-13 06:18:02 +00:00
drh
08ede1d08b Add e_fts3.test to the set of tests excluded from the inmemory_journal
exclusion list, since it does simulated OOM errors which trigger I/O errors
and SQLite is unable to recover from I/O errors without a persistent journal.

FossilOrigin-Name: e7e7127f0b0db582274338a9fefc30a0c0be07c3
2010-04-12 20:54:13 +00:00
drh
09c0f6d02d Recent changes cause the xSync method of the memory journal implementation
to be used, so remove the assert(0).

FossilOrigin-Name: 1f2cb9402838373f6370660dfc885013df079895
2010-04-12 19:44:22 +00:00
drh
02927cc1f3 Clear a global variable in e_fts3.test before it is used.
FossilOrigin-Name: ae89dfd26b65fb1a3633a4338f5cb5e54a7d2035
2010-04-12 19:43:43 +00:00
drh
63ca1dba52 Remove duplicate secure_delete pragma implemention.
FossilOrigin-Name: c15fda145b621fc86402914aa5b015e53590555a
2010-04-12 19:31:59 +00:00
dan
6700d02cce Add "log.h", which should have been part of the previous commit.
FossilOrigin-Name: 8de9f010044fc992b5b45a7bb0da1284b404ecdb
2010-04-12 19:05:58 +00:00
dan
7c24610e64 Import experimental write-ahead-logging code.
FossilOrigin-Name: 409d61baeb0a19d1700c973f16c8acef7b8506cd
2010-04-12 19:00:29 +00:00
dan
eada58aa49 Fix a problem where a process in exclusive mode could delete a hot-journal file without rolling it back from within sqlite3_close() or DETACH. This problem was introduced by the previous commit, it is not present in any releases.
FossilOrigin-Name: 51a613950824698687c0db83b7884db33d45f7f5
2010-04-12 17:08:44 +00:00
drh
47f18f7294 Reset the simulated device in the test harness to its default
configuration whenever it is restarted.

FossilOrigin-Name: 562d20e662da474ea326165730ecfdfcf9b414ee
2010-04-12 14:51:10 +00:00
drh
91781bd72f Fix issues and clarify the operation of pager_playback_one_page().
A block comment in pager.c identifies 13 invariants on the pager subsystem.
Ticket [9d68c883132c8].

FossilOrigin-Name: 0906597698b697ab2993a460f257e326cb58e475
2010-04-10 17:52:57 +00:00
drh
f762593eaa Add a test case for the OOM-fault corruption issue.
Ticket [9d68c883132c8].

FossilOrigin-Name: 0a64a937b583c32c02c83fc669addf79662efea8
2010-04-09 23:05:24 +00:00
drh
05f69dd388 Candidate fix for a pager bug associated with sqlite3PagerMovepage().
FossilOrigin-Name: 8c046eb6d16682d5e755624deb4f76f57350b9c9
2010-04-09 15:34:06 +00:00
drh
6498f0bb2e Avoid unnecessary calls to sqlite3_step() with null prepared statements
while parsing the schema.

FossilOrigin-Name: ae04d2d15d3d96f607adb394a631d96cd4cf2c1d
2010-04-09 09:14:05 +00:00
drh
9e48165b07 Fix a typo in a comment. No changes to code.
FossilOrigin-Name: 332cb55113a621456c6522830585434146c388e7
2010-04-08 17:35:34 +00:00
drh
f12cde5637 Fix code coverage problems in where.c.
FossilOrigin-Name: b04a52824971e8880e4bf0d9862db4eef8b607ab
2010-04-08 17:28:00 +00:00
drh
c71b5f34c9 Additional automatic index tests.
FossilOrigin-Name: 99d8e325e9eb8905631b06676206e6412f386d08
2010-04-08 16:30:38 +00:00
drh
7caba669a6 New test cases for automatic indices. New testcase() macros associated
with column-used bitmasks.

FossilOrigin-Name: e1aa48ace7e43c3805278120b8228ee597e2cee7
2010-04-08 15:01:44 +00:00
drh
8bd5412b90 Fix the computation of the number of rows in a table during automatic
index generation.

FossilOrigin-Name: edeab06a5010c82491a6cc9393cf2a35a7622ac5
2010-04-08 15:00:59 +00:00
drh
67ae0cb231 Fix an integer overflow bug in the automatic index logic. The bug was
detected by the testcase() macros added in the previous check-in.  Also
add some more testcase() macros, since this issue points up their importance.

FossilOrigin-Name: af97b4881a8f010055cde672634141d7ed6898fc
2010-04-08 14:38:51 +00:00
drh
52ff8ea605 Add testcase() macros to the automatic index logic to insure that boundary
cases are tested.

FossilOrigin-Name: 7286547847721b8f5f64bc2e7dc236652b1ae985
2010-04-08 14:15:56 +00:00
drh
9d6caca80d Make sure F_OK, R_OK, and W_OK are defined in test_demovfs.c. Define them manually
if they are not.  This is necessary to get the module to compile on some systems.

FossilOrigin-Name: 7c8afc3272fa91e2b5685b009eb674dbc1b5920d
2010-04-08 11:35:18 +00:00
drh
5c56f70199 Merge automatic index changes into the trunk.
FossilOrigin-Name: bf7b8d863665870a38f0b2335cc71de856a515b4
2010-04-08 01:16:19 +00:00
drh
0013e72edf When constructing automatic indices do not include the same column more than
once.

FossilOrigin-Name: d067d9f7a9138e026c1018361127e34385928657
2010-04-08 00:40:15 +00:00
drh
5a8aedab2d Pull over the latest changes from the trunk.
FossilOrigin-Name: e388fe8be878c80ef0bfd1699a7268cdb22cb3c6
2010-04-07 20:32:18 +00:00
drh
d14133e3f4 When rolling back a savepoint to the beginning of the transaction, make sure
to initialize the database size in the btree layer correctly even if the
database size field of the header is zeroed.

FossilOrigin-Name: a3540c6acf2bb6bdd44c101b63f17ca85e6b68ed
2010-04-07 20:29:56 +00:00
drh
3c379b0101 Add an interface to the SQLITE_STMTSTATUS_AUTOINDEX status information
to the TCL bindings.  Add some simple automatic index test cases.

FossilOrigin-Name: 1f40441204d9a912b1d6b67ff6ff9e17146c7abd
2010-04-07 19:31:59 +00:00
drh
c633908199 Wrap all automatic index changes inside SQLITE_OMIT_AUTOMATIC_INDEX. Add
the automatic_index PRAGMA to turn it on and off.

FossilOrigin-Name: a811a47fbe4f757a7ab575ae5a0f65177a3f07c0
2010-04-07 16:54:58 +00:00
drh
4139c99eba Make sure that all automatic indices are covering indices. Otherwise, the
table and index might be used together in a query but the table could get
out of sync with the automatic index through out-of-band changes.

FossilOrigin-Name: 2364313142668b3d0ad144447b4862709be929cd
2010-04-07 14:59:45 +00:00
drh
2a6a7eeba5 Enhance comments on the SrcList object definition to better explain the
operation of the SrcList.a[].colUsed field.  No changes to code.

FossilOrigin-Name: c0f67ea131c3e237e46311b1a3dcb3febf2ea036
2010-04-07 14:33:07 +00:00
drh
ab5cd70ae5 Fix the trace output of the OP_Function opcode to show the correct
register numbers.

FossilOrigin-Name: 064c283eee82c5053e84058a0e1908e468da6ce3
2010-04-07 14:32:11 +00:00
dan
0a7a9155a4 Add file test_demovfs.c, containing a simple VFS implementation that demonstrates how writes to the journal file may be safely buffered by the VFS layer to improve performance on some embedded systems.
FossilOrigin-Name: af3b72d94a1b6513f02402af3ada5fb5dd390151
2010-04-07 07:57:38 +00:00
drh
a21a64dd0c Veryquick.test is now working. The SQLITE_STMTSTATUS_AUTOINDEX counter
added.

FossilOrigin-Name: abbf16e5e7895971710fb3a8fd9c782fc1218a77
2010-04-06 22:33:55 +00:00
drh
75bb9f5a5b Runs quicktest without hitting an assert now. Some tests get unexpected
results still and there is a memory leak.

FossilOrigin-Name: a8224448cc305258a59a9023e6604783dda73e45
2010-04-06 18:51:42 +00:00
drh
424aab88ca Progress toward getting automatic indices to work. Still failing in corner
cases.

FossilOrigin-Name: ac6d0fba78eb9dcd69372e128d4a039aaff4b417
2010-04-06 18:28:20 +00:00
drh
8b307fbfa0 Automatically generate transient indices for tables in joins that would
otherwise have to use a full table scan.

FossilOrigin-Name: 1b2a04125f964e14f3fb90171c5ab86a0641d1c9
2010-04-06 15:57:05 +00:00
drh
25d3adbb6a Minor comment changes to the OP_OpenEphemeral header. No changes to code.
FossilOrigin-Name: 8e1d7ef47f643503aa823d9986a931a83c63648b
2010-04-05 15:11:08 +00:00
drh
8d83c0fdd5 Silently abandon a rollback if the journal has been truncated.
FossilOrigin-Name: 7626f6c9ea04d1a5690dd11bb13e8c3c04e3b0f5
2010-04-03 13:08:09 +00:00
drh
34e2b837d5 Check for a failure in the call to sqlite3PagerPagecount() from within
sqlite3PagerWrite().  (Error discovered by valgrind.)

FossilOrigin-Name: d64d181c79aee3501be6f7eb8c11ab2cc9a8d63c
2010-04-02 13:25:22 +00:00
drh
a378c566d2 Take care to avoid a buffer over-read when adding a KEYINFO structure
to the P4 parameter of an opcode.

FossilOrigin-Name: 937b931a7cdad6874638158ed6a9ab6356b0bd0c
2010-04-02 12:55:38 +00:00
drh
c2a4bab462 If the size of the database according to the header is larger than the
actual database file size, report that the database is corrupt.

FossilOrigin-Name: 8eb1f2443f2712920452b7ed3fb835c7f3221191
2010-04-02 12:46:45 +00:00
drh
cce75d3343 Pager changes for code coverage testing.
FossilOrigin-Name: b04a45ea9714e7a35372b5d6a58868b307d10502
2010-04-02 03:38:59 +00:00
drh
4d077f9255 Disable the corruptE.test script when ENABLE_OVERSIZE_CELL_CHECK is on.
FossilOrigin-Name: 1dc4f9fe9b83467ba014e759b93f6caa2925e4d2
2010-04-01 18:33:14 +00:00
drh
43377f5ad5 Zero the filesize-in-header word for bigfile.tcl. Remove bigfile.tcl from
the journaltest permutation.

FossilOrigin-Name: 63610c71ca629de5e81950bc3c2ee6014e67853b
2010-04-01 16:15:56 +00:00
drh
45b355dc4f Do not journal the content of freelist leaf pages. This restores an
optimization that was accidently undone by check-in [12f7346c13] on
[2009-01-20].

FossilOrigin-Name: b1e7a1a677e1c2a6c2ab83a67070605465a3e495
2010-04-01 13:41:10 +00:00
drh
9afb1abe42 Remove a NEVER in sqlite3PagerPagecount() that can in fact be true.
FossilOrigin-Name: 8f00533782a0eae5613caaf86608384cb702fc51
2010-04-01 02:47:01 +00:00
drh
1f5b467f13 Restore the size information in the BtShared structure when a transaction
rolls back.

FossilOrigin-Name: 802aeb30c9baf4059fa84f4693f290f80d3a4085
2010-04-01 02:22:19 +00:00
drh
a792dc5c4a Make sure an OOM error on sqlite3PagerPagecount() is detected and reported
out to the interface.

FossilOrigin-Name: 8aecf302a5aac66e43a8cc6c4e0d917f74e9e0de
2010-03-31 23:20:04 +00:00
drh
8d8626fe2b Report corruption if a database contains a reference that is out of range
according to the filesize-in-header database size.

FossilOrigin-Name: a91db0b1cd0b0fbadc5c8fe2eb8863629b411d87
2010-03-31 20:29:06 +00:00
drh
afc266a76a Clarification of the implementation of SQLITE_STMTSTATUS_FULLSCAN_STEP.
No logical code changes - just commenting and layout changes to improve
readability.

FossilOrigin-Name: 06b9ca32255572a699dc51f46f848d0bf01255e1
2010-03-31 17:47:44 +00:00
dan
67a6a40cf9 Clear the column cache before populating aggregate accumulator registers. Fix fo
r [883034dcb5].

FossilOrigin-Name: ffc23409c7fb45dc5a8722fad26e26d207bb3213
2010-03-31 15:02:56 +00:00
drh
d3d986d329 Documentation enhancements for the sqlite3_log() interface. No functional
changes to code.

FossilOrigin-Name: ba13a11108d7852c61f959cc8a5fc39c25202cae
2010-03-31 13:57:56 +00:00
drh
4b4580b701 Include shell.c and sqlite3.def in the amalgamation ZIP archive.
Ticket [e063139eb3f8]

FossilOrigin-Name: 0077ed5cf4e56eb81cfa850fc98e6b033708fc03
2010-03-31 11:52:57 +00:00
drh
97b59a56d2 Increase test coverage following the introduction of the new
filesize-in-header logic.

FossilOrigin-Name: dbc2c3c0144d2c76aec04f80892302c532947dc8
2010-03-31 02:31:33 +00:00
drh
b1299158c7 Continuing refinements to the filesize-in-header enhancement.
FossilOrigin-Name: 79e22b95038c50b9b7f35e09262805ff6338b59b
2010-03-30 22:58:33 +00:00
drh
bf59283ba2 Add a NEVER macro around a test in btree.c that can not longer be true.
FossilOrigin-Name: c117f99236a009778bb7878da464918554391f0a
2010-03-30 15:51:12 +00:00
dan
7ba4597135 Do not crash when compiling an "INSERT INTO tbl DEFAULT VALUES" when tbl has either BEFORE or INSTEAD OF triggers attached to it. Ticket [f3162063fd].
FossilOrigin-Name: ca359a3e8048bd11605c41c4b48134c0343e543b
2010-03-30 12:40:32 +00:00
drh
d454214ddd Change an #if into an #ifdef.
FossilOrigin-Name: 371bab5d6534860ce908e52129c64a49946be33a
2010-03-30 11:57:01 +00:00
drh
4b11b0897a Pull the experimental file-size-in-header changes into the trunk.
FossilOrigin-Name: 0092b36c7bbd04bf3826de7805e8a14739390f31
2010-03-29 21:22:00 +00:00
drh
25a80ad0b1 The btree layer now tracks when a database is empty at the start of a
transaction and rolls back to that state.

FossilOrigin-Name: 01ef6c1944507c188a83a434ff00e98ad767f744
2010-03-29 21:13:12 +00:00
drh
5e0ccc216d Fix issues with the io.test script. There is still a problem with a
ROLLBACK TO not working on an initially empty database files.  And much
more testing is needed.

FossilOrigin-Name: 09786e2a51817d572a01ae7f3621f03fd27fc363
2010-03-29 19:36:52 +00:00
drh
dd3cd977cc Experimental changes that cause SQLite to use bytes 28..31 of the database
header to determine the database size, rather than using the actual database
size.  This allows database space to be preallocated.

FossilOrigin-Name: b844ac6fcb72595a71e5c5283ec461309a87ba79
2010-03-27 17:12:36 +00:00
dan
c26c00495f Increase the estimated cost of using a virtual table as the outer loop of a join when there exists an ORDER BY clause that is not satisfied by the virtual table. Fix for [775b39dd3c].
FossilOrigin-Name: 9e075e70f0e2a1ad302d17150cd58f91669a97a6
2010-03-27 09:44:42 +00:00
shaneh
1141ae2463 Fix OOM error on ANALYZE with STAT2 enabled with zero-length data. Ticket [cbd054fa6b].
FossilOrigin-Name: c33b38b59f733494ca0bce3f59a669fe7ed76b9f
2010-03-26 01:54:33 +00:00
dan
6d3cb2fbae Fix for [9861b74ab9]. Correctly handle strings with zero tokens in the fts3 offsets() function.
FossilOrigin-Name: d37034f7fc46b83be681247fde97823736c994cc
2010-03-24 15:57:33 +00:00
drh
280799b4ff Attempt to suppress a warning from Borland Code Guard.
FossilOrigin-Name: be278979917336e7186d7830876180154b5280ba
2010-03-24 11:55:08 +00:00
drh
7bca0a3660 More commenting and documentation enhancements in FTS3.
FossilOrigin-Name: 892e286709c4a72aae364b85dd43bea525bb1b4d
2010-03-23 18:24:06 +00:00
drh
d6291c9155 Fix up obsolete comments in FTS3 to conform to the latest nomenclature.
Add new comments to better explain FTS3 operation.

FossilOrigin-Name: 3e4a0082170155b5b779afd075a3ee650530ca68
2010-03-23 15:46:41 +00:00
drh
486ff4897e Close the auxiliary database db2 at the end of the crash8.test script.
FossilOrigin-Name: 0fbdc431e832200efd87efd68456d5906397a219
2010-03-23 15:29:49 +00:00
dan
e07b606522 Add an extra test case for crash recovery.
FossilOrigin-Name: f2326dad4e47b2657be302e194970967960eb1c0
2010-03-22 17:38:11 +00:00
dan
bb23e7f91b After a rollback that writes or truncates the database file, sync the database file before invalidating the journal contents.
FossilOrigin-Name: b21b911f233842357af9ccc14525bbd48a38edb1
2010-03-22 17:13:53 +00:00
drh
acd63a5a62 Disable the "init.test" test script when compiled with SQLITE_THREADSAFE=0.
FossilOrigin-Name: ad68fa65bbd6b82e69fe8c36e4c459ea2ced0f8c
2010-03-22 15:47:38 +00:00
dan
98f0c3619f Change the formatting of the preprocessor macros surrounding the compileoption interface in sqlite.h.in. This is so the documentation produced by parsing this part of sqlite.h.in is formatted similarly to the docs for the deprecated interfaces (with the #ifndef visible on the webpage).
FossilOrigin-Name: 161958d11f2ef6ce4d7ba69afea03e0a6764cc1b
2010-03-22 04:32:13 +00:00
drh
f3609eeba7 Put an ALWAYS() around a condition in pcache.c that must always be true in
the current implementation.

FossilOrigin-Name: 88810cd091b33f2c56f842e32cafbac5d34d7412
2010-03-19 19:23:51 +00:00
dan
3f0d9d3846 Have the xUpdate() method of the rtree module virtual table implementation set the *pRowid output variable when inserting a row. Fix for [dd3ba6063a].
FossilOrigin-Name: f31d22489d44701c89cb13c663dfa1a6cc04f900
2010-03-19 19:02:27 +00:00
drh
f92a4e35c5 Store the SQLite version number of the last writer in bits 96..99 of the header.
FossilOrigin-Name: 146d4f5d3459235d8b2d27a5d77beb7645f75185
2010-03-19 16:55:47 +00:00
drh
e9c2d34c5b Make sure the in-journal boolean vector is cleared and released when ending
a transaction.  This fixes an obscure problem with the previous check-in.

FossilOrigin-Name: 69d749d93d6565b848ce5c07f2738d144c6564bf
2010-03-19 16:52:53 +00:00
drh
ba726f4939 Do create, open, or initialize the rollback journal until something actually
needs to be written into the journal.  That way, expensive filesystem
operations are avoided if the transaction ends up being a no-op.

FossilOrigin-Name: b78e58ae1570ab4d66a69db445a752c6456038a0
2010-03-19 15:48:13 +00:00
dan
3b6f4c06ac Rewrite a couple of queries used internally by FTS3 to take advantage of the "SELECT max(x) FROM ..." optimization.
FossilOrigin-Name: b7e42ae77443b33e0ab83265064830594094dc7c
2010-03-19 06:59:19 +00:00
drh
71663ad0c1 Mark internal routines as "static" in FTS3.
Ticket [b1552d0fa7].

FossilOrigin-Name: 39b34ac4a7bd06144b3630c0ad71bad0615418b6
2010-03-18 16:34:44 +00:00
drh
3a3dd3ac8d Improved error message when the right-hand operand of MATCH in FTS3 is
not a valid search expression.  Ticket [170872f1c3].

FossilOrigin-Name: bea9258643edfeb98ebf59d93fa18a14e4221fea
2010-03-15 20:53:01 +00:00
drh
9396a41e6e Fix FTS3 so that it does not run illegal SQL and cause a spurious log
message.  Ticket [42d45a693e6].

FossilOrigin-Name: f186b6a61909be1d65b76a6fbaa42f57bbd0d1e5
2010-03-15 19:27:55 +00:00
drh
ed37690afd Store the database size in pages in bytes 28..31 of the header. Currently
this is for forensic use only, but it might be used in the future.

FossilOrigin-Name: 59f75bba028e1107ed41d447c27aef31a6656b68
2010-03-13 02:15:49 +00:00
drh
107b56e86d Add assert()s to mem2.c (activated by SQLITE_MEMDEBUG) which verify that
memory alloctions that might have come from lookaside are always freed
using a lookaside-aware free routine.

FossilOrigin-Name: c2af2164cf7b279ebb3e08201561348be6e765df
2010-03-12 16:32:53 +00:00
drh
735b9cbb96 Move the ctime.c source module near the beginning of the list of files
inserted into the amalgamation so that #defines that are overridden in
other modules will not effect the values returned by
sqlite3_compiletime_used().

FossilOrigin-Name: bb591802fff5a99ae504509e812bb34e762eaef0
2010-03-10 23:13:53 +00:00
drh
63da089314 Add the SQLITE_DBSTATUS_CACHE_SIZE verb for sqlite3_db_status(). The
highwater mark does not yet work on this verb.

FossilOrigin-Name: 418c6d8113bc337556b0d47acfd6a7d865d1121f
2010-03-10 21:42:07 +00:00
drh
9f8da32662 Remove the "experimental" markings on most interfaces that have been around
for multiple releases.

FossilOrigin-Name: d670e8bd51c794e2d7ea365ca553c2b74cf5a3a3
2010-03-10 20:06:37 +00:00
drh
c92271c549 Fix typo in a comment in the sqliteInt.h. No changes to code.
FossilOrigin-Name: 1716821ddb992fd6d1330604d4f59586bf056b00
2010-03-10 14:06:35 +00:00
drh
1d2b77944d Version 3.6.22
FossilOrigin-Name: 4ae453ea7be69018d8c16eb8dabe05617397dc4d
2010-03-09 19:31:43 +00:00
shaneh
942179f37a Fix a test script issue affecting the TCL backup tests under Windows.
FossilOrigin-Name: 20c400e73a9b6586b97de61da0d9f3d9a01dbebc
2010-03-09 15:10:30 +00:00
shaneh
6d8096e675 Version 3.6.23 release candidate 4
FossilOrigin-Name: 3445eda0295940e00c33cc87aedaf586fa1b1b63
2010-03-09 14:41:57 +00:00
shaneh
1da207e676 Minor changes to silence compiler warnings on various MSVC builds.
FossilOrigin-Name: 115c978b6bbc110119a1b2f178cc30b33aaa27ef
2010-03-09 14:41:12 +00:00
drh
ed6adb447f Version 3.6.23 release candidate 3
FossilOrigin-Name: 747baea5c32f9a5de4b46a1fd1b24bd509c9a85e
2010-03-09 13:12:40 +00:00
drh
0b2f8ba965 Check-in [87a6a9970b] did not completely disable FTS4. This check-in aims
to finish the job.

FossilOrigin-Name: 0259b6299e435b3c3a7ca33df8c38c8a5dc84a61
2010-03-09 13:02:09 +00:00
drh
c7594fc635 Version 3.6.23 release candidate 2
FossilOrigin-Name: 73f4d292dc66ac41456f2ebddada82c7f5633431
2010-03-09 12:35:50 +00:00
drh
40d238e09f Disable FTS4 (which is incomplete and not ready for publication) to prevent
accidental use.

FossilOrigin-Name: 87a6a9970b8cea25fc5f8ff03d87762dd1166899
2010-03-09 12:35:21 +00:00
drh
e396bfe6fd Version 3.6.23 release candidate 1
FossilOrigin-Name: 30e9f966e7bc517f69796828026c8b23337c356b
2010-03-09 05:01:49 +00:00
drh
3517324ddc Add NEVER and assert macros and explanatory comments for unreachable
conditions.

FossilOrigin-Name: ffb6596e6c80e284c1542b03f2c7bbfce0bd87d9
2010-03-08 21:40:13 +00:00
dan
3b4aae569a Correct an assert() in mem2.c (test code only).
FossilOrigin-Name: 1a88e31b03e090732243a70bec082b32ecf77c43
2010-03-08 15:17:53 +00:00
dan
01d3856428 Do not run the stmt.test script as part of the inmemory_journal permutation.
FossilOrigin-Name: 049cadf92bca5645a6f398eb83940344643fcacf
2010-03-08 10:32:38 +00:00
drh
29391c5b49 Make sure the dbFileVers field in the Pager object is properly initialized
even if there is an I/O error while reading its content off of disk.

FossilOrigin-Name: 81ff698f62c8133818a3db1997ae7427705da23f
2010-03-05 20:17:45 +00:00
dan
5fea90762a Change a condition in sqlite3VdbeMemShallowCopy() to avoid accessing an unitialized variable (doing so was not dangerous, but caused a valgrind error).
FossilOrigin-Name: 4793c381c6ff4e4d25433298be30028721a9cb67
2010-03-05 18:46:12 +00:00
dan
89374d2309 Fix a one byte buffer overread in fts3.
FossilOrigin-Name: 6e3e014af91601ed1f3a9cbe23f7c4260a4d177f
2010-03-05 17:27:01 +00:00
dan
b7dca7d733 Modify the vdbe so that the comparison operator opcodes do not modify the data type of operands. Fix for [aa92c76cd4].
FossilOrigin-Name: 8858042fa1449516a2c7dbb991dca3eb6c5794cb
2010-03-05 16:32:12 +00:00
drh
f8b4d8c682 Adjustments to #ifdefs so that the #include of <sys/mount.h> is not included
twice, because that confuses the amalgamation builder.

FossilOrigin-Name: 27413fc8dd52b754b4be9344a66bb9e0d752d48e
2010-03-05 13:53:22 +00:00
drh
84a2bf67d8 Adjust some #ifdefs so that the build works on Mac both with and without
SQLITE_ENABLE_LOCKING_STYLE.

FossilOrigin-Name: 0cc981f1ccc2c99b87eb968590ad18b2d3ebf37b
2010-03-05 13:41:06 +00:00
dan
60d4a30453 Fix for [9abd6aa831]. Do not overread a buffer used for an %q or %w conversion with a precision specifier.
FossilOrigin-Name: 5e472896e02eed05c6c0886a48acd0bdc7a38731
2010-03-04 17:58:45 +00:00
drh
69ef70362a Fix an uninitialized variable in printf when compiling with
SQLITE_OMIT_FLOATING_POINT.

FossilOrigin-Name: 14ad62b9a54dba5c5a2d4a994bcd4be6ab6e711f
2010-03-04 17:11:31 +00:00
drh
c05a9a8a57 Suppress harmless compiler warnings.
FossilOrigin-Name: fc2c63ac78ba7d48fe3232f88093e980ea34eaa9
2010-03-04 16:12:34 +00:00
drh
a64fa9123e Increase the maximum length of an sqlite3_log() result string. Provide more
details on the statement abort log message.

FossilOrigin-Name: 5322d1df5ba981001d248b7fb2ee02281e4f9723
2010-03-04 00:53:32 +00:00
drh
ccd0489baa Pull the latest Lemon updates from the lemon-update-2010 branch into
the trunk.

FossilOrigin-Name: 84d760bfc1d219fda99901061bb5db2cafe9eb1d
2010-03-03 22:43:37 +00:00
drh
7c0c460fff Modify the sqlite3_log() interface and implementation so that it never
uses dynamic memory allocation - to avoid deadlocking when called while
holding the memory allocator mutex.

FossilOrigin-Name: 28d1bc98d60319b10af427072037a0121bc76259
2010-03-03 22:25:18 +00:00
icculus
7b429aa6a8 Fixed compiler warning on Visual Studio.
FossilOrigin-Name: 83495128c820e963c70d11c3196f81d8cf01f867
2010-03-03 17:09:01 +00:00
icculus
d286fa6691 Whoops, that shouldn't have been in the merge. Removed buggy code.
FossilOrigin-Name: 643728003218c9841425dffb6fe506763859fd37
2010-03-03 17:06:32 +00:00
icculus
d49c1aa7a9 Use Strsafe() instead of strdup(). Fixes Visual Studio complaining.
FossilOrigin-Name: 89d8f98ea6d4d8bf871e08a8d8d1f0d2fd11aec1
2010-03-03 17:00:15 +00:00
icculus
05ac70ee0a Merged trunk to lemon-update-2010 branch.
FossilOrigin-Name: 88b466bae47d006c48eff42ab271f05ff56d5ed1
2010-03-03 16:54:58 +00:00
dan
3bbe761c9b Fix some extra instances of the constants addressed by [83e47ca006].
FossilOrigin-Name: 0354ab279f0ea9915a14d1ed972b4aa6b5a27fd1
2010-03-03 16:02:05 +00:00
drh
0b2864cb34 Factor out constant expressions in sqlite3GetVarint() to work around
nuisance warning messages from the RVT compiler.

FossilOrigin-Name: 83e47ca0069de259e98798d84d88301a5b4b6d2e
2010-03-03 15:18:38 +00:00
dan
0f831771c3 Modify the command line tool to disable all mutexes. The command line tool is single-threaded.
FossilOrigin-Name: 00e5679047a0a96dc4396aae5e061909faf3b81d
2010-03-03 07:23:12 +00:00
drh
2ec050c5b1 When TEMP files are in memory, also put the massive TEMP file used by
the VACUUM command in memory.

FossilOrigin-Name: 9daf4e7d07769f25b3a579d80e7fada4e52344b1
2010-03-02 23:34:54 +00:00
drh
8bb76d39a0 Rename the sqlite_compile_option_*() SQL functions to sqlite_compileoption_*()
for consistency with the C/C++ interface.

FossilOrigin-Name: dd4962aa34c4dd118d2cb15465384636eacc64d5
2010-02-26 16:37:47 +00:00
drh
71caabf0cc Remove the compile_option pragma (retaining compile_options - with an "s").
Updates to documentation.

FossilOrigin-Name: 733778df996a2dda7c31ff7b544cb6f9a6ed4c97
2010-02-26 15:39:24 +00:00
dan
2ed11e7b18 Avoid a buffer overwrite that can occur with a corrupt database if secure-delete is enabled.
FossilOrigin-Name: 7bdb1e05faceddbb0b8e3efee7d070ad8c4611a3
2010-02-26 15:09:19 +00:00
drh
383d30f483 Avoid incorrect compiler warnings by doing a couple of needless
variable initializations.

FossilOrigin-Name: 8f29490da62df07ea922b03cab52b6edd2669edb
2010-02-26 13:07:37 +00:00
drh
0d06d98980 Increase the version number to 3.6.23 in preparation for the next release.
FossilOrigin-Name: b5835d3e3d7f3fbf04431f9afe27dfef7b7f23c9
2010-02-26 12:58:50 +00:00
shaneh
84f4b2f237 Minor changes to silence some compiler warnings with MSVC.
FossilOrigin-Name: 4927c62d6214d93e582bf1266215ed3519630c15
2010-02-26 01:46:54 +00:00
drh
e294da02ba Fix to the database connection validity checker. Other test coverage
enhancements.

FossilOrigin-Name: 0f6291bbbd31673e2a65f38c7fc364c33719d25e
2010-02-25 23:44:15 +00:00
drh
bee8065e37 Test coverage enhancements. Additional documentation detail on the new
sqlite3_log() interface.

FossilOrigin-Name: d986e9289388fd72257b26cb2f9c972177255cd4
2010-02-25 21:27:58 +00:00
dan
887d4b2b43 Add experimental fix for corruption detection problem. This may well be revised yet.
FossilOrigin-Name: 1cc4be7ebc463921827e61da724f0de946c061f6
2010-02-25 12:09:16 +00:00
shaneh
88ba618ee7 Fixed numbering of a few tests; minor tweaks on others.
Added a couple new tests to stress previous simplifications.

FossilOrigin-Name: 9b18dfd19e825b09c1d246c826e179b9892308df
2010-02-25 18:07:59 +00:00
drh
264a2d4de1 Minor simplifications to the compile-time option reporting functions and
pragmas to facilitate coverage testing.

FossilOrigin-Name: 633d874783a94f923ff8240f9153764033d37a89
2010-02-25 15:28:41 +00:00
drh
4611d925a9 Expire pragma statements when reset, even if they were not run to completion.
FossilOrigin-Name: 78351d289bba83e536b64666c566b7bfc57351da
2010-02-25 14:47:01 +00:00
drh
5e767c5793 Make sure the ON clause of a LEFT JOIN does not cause an index to be
used to speed access to a table to the left of the join.
Ticket [ebdbadade5]

FossilOrigin-Name: f0ae251abb9e8a8793f46a30b79b2ce541cf14d5
2010-02-25 04:15:47 +00:00
drh
af46dc12f7 Add testcase() macros beside each sqlite3_log() call to make sure it is
tested with both logging enable and disabled.

FossilOrigin-Name: 1168763d2cd96acfa0488198e8bc82f0c4fa35a3
2010-02-24 21:44:07 +00:00
shaneh
915c8bdbbd Changes to compile time option diags to report values for some defines.
Added test cases to TCL test suite (ctime.test).

FossilOrigin-Name: dd480f62afa56ff85c2dd57ee7a16eee427e823f
2010-02-24 19:36:10 +00:00
drh
cda455b7ff Add a sqlite3_log() call on anonymous constraint failures.
Fix the output of test cases having to do with improved reprepare reporting.
Fix the VACUUM command to report more helpful error messages when things go
wrong.

FossilOrigin-Name: 69a493182fd77bec91598516ee42c11a6db1d039
2010-02-24 19:23:56 +00:00
drh
7823006011 Fix an incorrect ALWAYS() macro in vdbeapi.c. Fix the output of a few
test cases that changed due to better error propagation out of reprepare.

FossilOrigin-Name: a8c984c1d6cb6e2fc95a07eb32befeea122e8ed3
2010-02-24 18:40:39 +00:00
drh
31caa42afd Remove an unused variable from rtree.
FossilOrigin-Name: 8e60d3995a1ea940de9751dd3bbd7ef41b0bb00a
2010-02-24 18:25:58 +00:00
drh
a6129fa79a Enhancements to the way errors are reported up when an automatic
statement reprepare fails.

FossilOrigin-Name: 1a6d4bb130382564093b6370818ae4a7633f4074
2010-02-24 17:15:19 +00:00
drh
5a29d9cbc5 Fix an assertion fault that occurs when two different virtual tables are
used in a single UPDATE statement.
Ticket [d2f02d37f52b].

FossilOrigin-Name: ff61e0fd802c46c2d84c4b0c0bc8a0f34959bb25
2010-02-24 15:10:14 +00:00
drh
78e0fcf914 Fix the stmt.test test script so that it works with SQLITE_TEMP_STORE=3.
FossilOrigin-Name: 8bf710ce6dfab0e6fd4de7d6d3157008cc70d192
2010-02-23 21:08:40 +00:00
drh
380083ce18 Merge the compile-time option introspection interfaces into the trunk.
FossilOrigin-Name: 9f429434c0404f03a3e5c6741b769afe98a5c6c9
2010-02-23 20:32:15 +00:00
drh
413c3d36a2 Continuing improvements to error reporting and the sqlite3_log() routine.
FossilOrigin-Name: edea3bb740ddd096a46e00678b59d465bb1e2903
2010-02-23 20:11:56 +00:00
shaneh
dc97a8cdc1 Refactored compile time option diagnostic support to use strings identifiers instead of bitmask.
FossilOrigin-Name: 76a0294ab4208a0858a13bab0858e1bc1448b651
2010-02-23 20:08:35 +00:00
dan
39547b418b Fix a segfault that can occur if a malloc fails in ATTACH in shared-cache mode.
FossilOrigin-Name: e37137376a2b23062e2625b5285299b33630b326
2010-02-23 11:05:26 +00:00
drh
9978c97ec5 Remove the obsolete sqlite3SafetyOn() mechanism. Add additional logging
output for CORRUPT, and CANTOPEN errors.

FossilOrigin-Name: 7c4cca6d1a23a6d1591b62f58c3716a944969947
2010-02-23 17:36:32 +00:00
dan
440ac39bc0 Fix a segfault that can occur if a malloc fails in ATTACH in shared-cache mode.
FossilOrigin-Name: 875f8fa32708b8dbf314fd7056fac2fefdacfa36
2010-02-23 10:56:15 +00:00
shaneh
ca07b9df47 Removed checking of some compile options from the sqlite3_compileopts() API.
FossilOrigin-Name: 833da702ff9bd99d62640756d80e094256efff5c
2010-02-23 05:17:51 +00:00
shaneh
bdea6d1368 Test new api to report which options (defines) were used to compile SQLite.
FossilOrigin-Name: 84c9756993caf82710a0905ed1987d144bc764fd
2010-02-23 04:19:54 +00:00
drh
127f9d75e2 Add the ".log" command to the shell. This shows that some errors are logged
multiple times and other errors are never logged at all.

FossilOrigin-Name: 6d910245ad0097521cf1619449cc3d202137b8b8
2010-02-23 01:47:00 +00:00
drh
5bd1d051e8 Remove the ".genfkey" command from the shell. We've had foreign-key support
in the core since 3.6.19.  Anyone who still needs the simulated foreign-key
triggers can always generate them with an older version of the shell.

FossilOrigin-Name: c4401fc93b66c5339422d7e765a4a32b1ef96bdb
2010-02-23 01:01:58 +00:00
drh
4ec84f35e2 Fix an assertion-fault/segfault problem that comes up when trying to
VACUUM an auto-vacuumed database with a large schema. 
Ticket [da1151f97df244].

FossilOrigin-Name: 86d50ce57feb78440956192e37a03686ffa1e196
2010-02-22 23:17:42 +00:00
drh
a0f3509606 Merge in the massive clean-up and ANSI-fication of Lemon carried out
by Ryan Gordon.  There are no functional changes to SQLite itself - Lemon
still generates exactly the same parsing automaton from exactly the same
grammar.

FossilOrigin-Name: 1e8b842039cc06b57a321226633c55b94eb8dcd7
2010-02-22 19:37:44 +00:00
drh
a756466349 Log all error messages if logging is enabled.
FossilOrigin-Name: a8076aede33c07e9a2aaa05be8a888f37b45e41c
2010-02-22 19:32:31 +00:00
shaneh
195475d839 Changes to pragma integrity_check to check rowid order. Tests of same in corruptE.test.
FossilOrigin-Name: cae47c5b09cb122689bcb020a66ce14982cc4aa8
2010-02-19 04:28:08 +00:00
drh
3f28070109 Add a new, experimental logging interface designed to aid in debugging of
deeply embedded projects that use SQLite.

FossilOrigin-Name: 103321e37ae46eacfad4e127d13477ad5dd02bab
2010-02-18 18:45:09 +00:00
dan
da730f6eb4 Allow statements like "REPLACE INTO tbl(rowid) VALUES(...)" to run without a statement journal as long as there are no triggers, foreign keys or indexes.
FossilOrigin-Name: 0e4225804010cb0e3f254e2dbffc4fe0e7d982ce
2010-02-18 08:19:19 +00:00
icculus
866bf1e6a2 Repore error if the grammar has multiple %type lines for the same nonterminal.
FossilOrigin-Name: 721f33e7221c5fc907e9e293ac3242843f4fcfb7
2010-02-17 20:31:32 +00:00
icculus
d0d97b09c6 Fixed % formatting in some printf-style strings.
FossilOrigin-Name: f96add898f096cfc1e435c625ce74093d790b3c7
2010-02-17 20:22:10 +00:00
icculus
10163b7d82 Corrected error message (cut-and-paste bug).
FossilOrigin-Name: b3839f2aad00844c578d496c40481a39c018e4f6
2010-02-17 20:19:50 +00:00
shaneh
ad9f9f6693 Consistent use of #ifdef for SQLITE_HAS_CODEC to avoid confusion.
FossilOrigin-Name: 34a3413a5318050254b246ad859c91c134516a32
2010-02-17 17:48:46 +00:00
icculus
a3191195af Removed unused variables.
FossilOrigin-Name: ca570a02f5c5215098050de4eb551b2dcd11b1fd
2010-02-17 05:40:34 +00:00
shaneh
147e176aff Avoid using the internal printf routine for round(x,y) in the common case where y==0.
FossilOrigin-Name: d76ad8b3c494ffb4e670da0e92a1f8dbf7f48daf
2010-02-17 04:19:27 +00:00
shaneh
35c1a793ce More rounding tests.
FossilOrigin-Name: 3863638b8cd8d41cf4abf8b0d618892de845e91f
2010-02-17 03:57:58 +00:00
shaneh
030ea31797 Remove duplicated assignment in realloc.
FossilOrigin-Name: c419955df0ad0507ecb3869786d48458366d4e8f
2010-02-16 22:06:30 +00:00
shaneh
4a0b43caad Added additional rounding tests.
FossilOrigin-Name: b8ee76bc1fd355110149bd9135dd31a5724c2ac6
2010-02-16 22:00:35 +00:00
icculus
8e15802812 Removed %expect directive, on drh's advice.
FossilOrigin-Name: b43ac3309e77dc8ea2952bf62da6eaad5aef6653
2010-02-16 16:09:03 +00:00
icculus
15a2cec1ed Patched to compile. Accidentally removed va_list declaration.
FossilOrigin-Name: 673d470c0c14106da05461d355a0c09e5f62851d
2010-02-16 16:07:28 +00:00
dan
2b0ef4725f Change a C++ style comment in os_unix.c to use normal C style commenting.
FossilOrigin-Name: 7a1933097f2a95bd495c1621fca99e8952a1b25a
2010-02-16 12:18:47 +00:00
dan
5dcb3937b6 Fix for [e9a9fde1f4]. When opening an existing rtree, determine the node size by inspecting the root node of the r-tree structure (instead of assuming it is a function of the page-size).
FossilOrigin-Name: ebc9433fddf78ef7b4237686951d8d79c1c98f03
2010-02-16 10:59:40 +00:00
drh
9a6ffc845b Fix the ALTER TABLE RENAME command so that it converts FOREIGN KEY constraints
in ATTACH-ed and in TEMP tables as well as in the main database.
Ticket [13336e9c3c8c3f].

FossilOrigin-Name: ab197d0aaf18016ac2dd3674f49bea5f1556451c
2010-02-15 18:03:20 +00:00
drh
622d288790 When creating a trigger on a main database table when there is a TEMP table
with the same name, make sure the trigger is bound to the main table.
Ticket [985771e11612].

FossilOrigin-Name: ec914af32675e472694270d46f3ba2214eb2fe90
2010-02-15 16:54:55 +00:00
drh
a8c62df904 Fix a compiler warning in shell.c. Updates to comments in trigger.c.
FossilOrigin-Name: c727601eecd85a26dbd4fc36823d77bec34da3c3
2010-02-15 15:47:18 +00:00
drh
2d8d7cebe1 Fix a typo in the documentation for the OP_OpenPseudo opcode.
FossilOrigin-Name: 9acfb0694059c80b2efc08a60232d4be91575c32
2010-02-15 15:17:05 +00:00
icculus
1c11f74a8a Removed the 80-char line formatting for ErrorMsg(), on dhr's suggestion.
FossilOrigin-Name: 132ea4e5d7f69fc307904f5086a72d8532e5aac6
2010-02-15 00:01:04 +00:00
icculus
9e44cf1a03 Make Lemon able to compile as C++ code.
FossilOrigin-Name: 75a1060b29eb4122487152b068e7d1073eb0ccab
2010-02-14 17:14:22 +00:00
icculus
d191282111 Added option to not clip error output.
This is useful for IDEs and other tools that benefit from full path
information, so they can jump directly to the error line in the source code.

FossilOrigin-Name: 90602030d18152a934644db119a291aa38fe3fd4
2010-02-14 05:42:46 +00:00
icculus
f5ad824071 Delete output files if this is a failed run.
Otherwise, the fail will stop a Makefile from progressing, but if you
immediately run the build again, Make will think the output files are up to
date, since they are newer (albeit incomplete/incorrect).

FossilOrigin-Name: e38c08d9cdeb0476ac1a77cd3f29f547a8205835
2010-02-14 05:34:42 +00:00
icculus
42585cf73a Added %expect directive, to consider a certain number of conflicts "correct."
This has the side effect of changing the process exit code to never overflow.

FossilOrigin-Name: d8bab8cf0bc3fbd4c489c31a65d724dda2944d83
2010-02-14 05:19:56 +00:00
icculus
3e143bdfaf Added -T option, to specify a template filename on the command line.
The default is still "lempar.c", though.

FossilOrigin-Name: e6cbe1e5ee80db282a41951b805b7bd8b13adf28
2010-02-14 00:48:49 +00:00
shaneh
1f4222f84c Merged tracing and initialization changes from mutex_unix.c.
FossilOrigin-Name: 942aa1f6a91655356cc32a8185cb447331d405dc
2010-02-13 02:31:09 +00:00
drh
af034ed685 Enhancements to the secure_delete pragma to make it easier to use.
FossilOrigin-Name: 2bb38bb96ff6b9fb91dd1cf214041cf113ac5508
2010-02-12 19:46:26 +00:00
drh
5b47efa662 All the secure-delete setting to be changed at run-time using a pragma.
The SQLITE_SECURE_DELETE compile-time option determines the default setting.

FossilOrigin-Name: f72f8a870a0fc98a9f2b564ffafe7946bbce506e
2010-02-12 18:18:39 +00:00
dan
56f2996b48 Fix a segfault in fts3 that may occur if the snippet, offsets or matchinfo functions are used in a query that does not contain a MATCH clause.
FossilOrigin-Name: 14ab536a96f81595ab8c3dcd4b72075f1a827c8b
2010-02-10 05:33:17 +00:00
drh
309e6555a5 Make sure file descriptors are closed before unlinking in VxWorks.
FossilOrigin-Name: f64b81f13de4875343c752e7183bf61032dc9594
2010-02-05 18:00:26 +00:00
shaneh
6885de360d Avoid truncating non-in-memory sub-journals when releasing a savepoint for a small performance improvement.
FossilOrigin-Name: 27dc5b1c52eaa5f99cf44ee31204f62598fbf011
2010-02-05 16:28:00 +00:00
drh
6658cd9a74 Remove the use of 64-bit math in the offset computations of
the OP_Column opcode for a small performance improvement.

FossilOrigin-Name: 61a2c8d4d64c28119e9f06eb42f9c0437ba7a7bd
2010-02-05 14:12:53 +00:00
drh
a963896796 Fix a performance glitch that appears for large transactions.
FossilOrigin-Name: 26cb1df73504d5d883cf0967e57b46aa062d0b00
2010-02-04 17:38:31 +00:00
drh
b4a1fed2ea Add a new full-text search variant that tracks the total number of documents
and document sizes, to make ranking search results easier.  Currently
called FTS4.

FossilOrigin-Name: 1b6e6094c88214e02c9e3638932997ac20bfe413
2010-02-03 19:55:13 +00:00
drh
0ae0bfd486 Fix a C++-ism that snuck into sqlite3_finalize().
FossilOrigin-Name: fb96f2a2c63a061a90733448c4af14384893d409
2010-01-31 15:14:37 +00:00
drh
7c9c98684c If an OOM occurs while setting the page size for the TEMP database, be sure
that error gets reported back out to the interface layer.

FossilOrigin-Name: 6487e70a1e18bb01ee692e250b41c8652e34a87c
2010-01-31 14:18:21 +00:00
shaneh
959dda6d94 Tweaks for consistency to the SEE and CEROD API declarations in sqlite3.h.
FossilOrigin-Name: 299f74567b1b97a1fdc0a620ef382cfd24941809
2010-01-28 19:56:27 +00:00
drh
10a76c90e4 Make the TEMP file tables use the page size set for the main database.
Ticket [b80eeab588c4].  
Also copy over the changes from apple-osx check-in [7c3bede3f2].

FossilOrigin-Name: 5dcfb0c9e420d27e54a299b3991b98776651a507
2010-01-26 01:25:26 +00:00
dan
d3789b98a7 Fix two similar problems in fts3 that meant that an OOM error could cause a memory leak.
FossilOrigin-Name: 701ef64b3dbf45e52043e79e528002bd4b7a21e2
2010-01-22 15:48:18 +00:00
drh
5cb7434c72 Fix a segfault that can occur when the LHS of a LIKE operator has an
undefined collating sequence.  Ticket [1258875e07553].

FossilOrigin-Name: a82e6b4585b9ddba581204976cd5ea8704339185
2010-01-21 23:11:24 +00:00
drh
4b5db5ac9c Redesign the string to numeric value caster so that it is more likely to
work on unusual floating point hardware.

FossilOrigin-Name: 8bb1104c6f02c88eb09ed345890be71dee099485
2010-01-21 01:53:07 +00:00
dan
14d4cc4356 Fix a problem with handling OOM errors in fts3.
FossilOrigin-Name: f9c54e95ecf1c36c4750bb151e91d81c1d1bd596
2010-01-20 14:25:37 +00:00