Commit Graph

6801 Commits

Author SHA1 Message Date
drh
d7c7ecdb01 Simplifications to the PRAGMA integrity_check logic. Remove unreachable code. (CVS 6892)
FossilOrigin-Name: 17749fa5480069cc4909acd992ab26d10afb279d
2009-07-14 17:48:06 +00:00
drh
407414c25f Simplifications and tweaks to vdbeaux.c resulting from structural testing. (CVS 6891)
FossilOrigin-Name: fa49666fb913f0d82e84bdfa2af3a294be04e47c
2009-07-14 14:15:27 +00:00
drh
6be240e546 Make sure the IN operator works with zeroblobs. Ticket #3965.
Other simplifications associated with structural testing. (CVS 6890)

FossilOrigin-Name: 25dd342283046aaf66a679348ef1c7364c616402
2009-07-14 02:33:02 +00:00
drh
3c18eb6048 Remove the SQLITE_CommitBusy flag. This was an attempt to block recursion
on the sqlite3_commit_hook() interface.  But such recursion is explicitly
disallowed, so the flag is pointless. (CVS 6889)

FossilOrigin-Name: 1c2bfc43a4fd5b779a3b5b5b8ca5b41cb7250b5a
2009-07-13 15:52:38 +00:00
danielk1977
31d31b87e9 Change an unreachable condition in btree.c to a NEVER(). (CVS 6888)
FossilOrigin-Name: 9f800e11391a108d7aa57f5a96d9a58711129132
2009-07-13 13:18:07 +00:00
danielk1977
a299d61249 In sqlite3PagerWrite(), do not set the PGHDR_NEED_SYNC flag on a page if an IO error occured while attempting to journal it. (CVS 6887)
FossilOrigin-Name: b9be365d85fddedbfa93eebf3ee62a140cbaa426
2009-07-13 11:22:10 +00:00
danielk1977
8f880a8cfb Remove an assert ("assert( subpage>0 )") from btree.c that may not be true for a corrupt database. Also add comments and other assert() statements to btree.c function moveToRoot(). (CVS 6886)
FossilOrigin-Name: 3151dab9c78106217ec80ebadc666dfd11b42029
2009-07-13 09:41:45 +00:00
danielk1977
3fd7cf5aa1 Remove a case from BtreeMovetoUnpacked() that is unreachable as of (6881). (CVS 6885)
FossilOrigin-Name: 39ce2097da03176e256a2ff35bb857e578f3ca2d
2009-07-13 07:30:52 +00:00
drh
3bcdfd25bd Simplifications to btree.c to help facilitate coverage testing. (CVS 6884)
FossilOrigin-Name: dfb146ef003bae8ff216baf68cc43d7eb7855c68
2009-07-12 02:32:21 +00:00
drh
6a8b8d3cc8 When an OOM fault occurs while moving a page for autovacuum in an in-memory
database, be sure to undo the page move prior to returning the error, to
avoid corrupting the in-memory database file. (CVS 6883)

FossilOrigin-Name: d0964b93669123e228e7ce1890167447c56753b5
2009-07-12 02:31:36 +00:00
drh
fb1926837a Remove an unused parameter from the accessPayload() function in btree.c. (CVS 6882)
FossilOrigin-Name: 7deb6568d89335926b77336756837c6dc3985529
2009-07-11 18:26:28 +00:00
danielk1977
bd5969a268 Fix a case where deleting a row from a corrupt database could cause an assert to fail. (CVS 6881)
FossilOrigin-Name: 6994b41a94a60f6460cf9814767db321ab3851f7
2009-07-11 17:39:42 +00:00
drh
41d628c123 Bug fix in the computation of the number of pages to autovacuum when
nReserve is greater than zero. (CVS 6880)

FossilOrigin-Name: 618a83d65f973183d21245721dc656a35ff594a4
2009-07-11 17:04:08 +00:00
drh
a4ec1d443a Unwind some complex conditions in sqlite3BtreeDelete() into
separate "if" statements. (CVS 6879)

FossilOrigin-Name: d99bde9ca61eeccfe6363ff0882fd4bcdb9a34dc
2009-07-11 13:13:11 +00:00
danielk1977
d8a3f3dd0d Remove another unreachable branch from btree.c. (CVS 6878)
FossilOrigin-Name: b0853100a9f8e185e8d027502822337a79a2ba0c
2009-07-11 11:45:23 +00:00
danielk1977
93caf5ad93 Modify the integrity-check code so that each b-tree page inspected is reinitialized while doing so, even if an initialized copy exists in the cache. This prevents an assert from failing when running integrity_check on a corrupt database. (CVS 6877)
FossilOrigin-Name: 709576c670f802bf4b6e5c0e8db2bbde2cc16a90
2009-07-11 06:55:33 +00:00
danielk1977
171fff3c9a Remove unreachable condition from btree.c. (CVS 6876)
FossilOrigin-Name: 47b40fefa67f7c563ce2004509aaf8e203038be4
2009-07-11 05:06:51 +00:00
drh
5e483939bc Fix a pager reference count leak in btree that occurs on an OOM following
a database page size change. (CVS 6875)

FossilOrigin-Name: c6dfc8bd3911b4c93969bfc13d9931965feed674
2009-07-10 16:51:30 +00:00
danielk1977
e932ba260e Fix a double-free that can occur when using the fts3 legacy syntax '-' operator. Add tests for the same operator. Ticket #3960. (CVS 6874)
FossilOrigin-Name: c19d419e8cf94a26d9bb6ad478e84841168a882e
2009-07-10 09:24:43 +00:00
drh
8c2bbb620b Simplifications to the PRAGMA integrity_check logic in btree.c. (CVS 6873)
FossilOrigin-Name: 440c573c7e2a22f9a67a9571883e205fbadb7c11
2009-07-10 02:52:20 +00:00
drh
7157e1d2e5 Fix two faulty assert() statements btree. (It was possible for the assertions
to be false given a corrupt database file as input.) (CVS 6872)

FossilOrigin-Name: 9403f04dfdabdd2ba9adb1a91ca9b400cf4ca6b3
2009-07-09 13:25:32 +00:00
danielk1977
5cb0963fdc Remove an unused branch from btree.c. (CVS 6871)
FossilOrigin-Name: 45efb78a8a1e01a0154153b10469bb34d6d129eb
2009-07-09 11:36:01 +00:00
danielk1977
9d10486ae7 In btree.c, have setSharedCacheLock() assume that the b-tree is sharable instead of checking to see if it is. The caller has already performed this check. (CVS 6870)
FossilOrigin-Name: 3190eefd5f5285a5250d6f4729f109852fdb02ab
2009-07-09 08:27:14 +00:00
danielk1977
3054866c7c Restore (btree_set_cache_size) to test3.c. This is used on unix for the tcl "crash tests". Make some functions no longer used outside of btree.c static. (CVS 6869)
FossilOrigin-Name: 1d96ce8c76e007ca29e7971a6c72b6387fe0fb93
2009-07-09 05:07:37 +00:00
shane
cbcadd41f9 removed the test function sqlite3BtreeFlags() (test code only); (CVS 6868)
FossilOrigin-Name: 579ba6c83f52d26860e5152f06355aa4f49e568d
2009-07-09 03:20:46 +00:00
shane
20a35fd826 removed unused functions from test3.c (test code only); (CVS 6867)
FossilOrigin-Name: 0eb69e8dda13e2d52a06f66a71480f59fd766271
2009-07-09 02:48:23 +00:00
drh
df35a08cb7 Simplifications and additional testcase() macros for btree.c. (CVS 6866)
FossilOrigin-Name: 1b8c3a8246a5d8b8f5607014f68483735a403249
2009-07-09 02:24:35 +00:00
danielk1977
4e6604ee80 Fix a typo in (6861): "ifndef SQLITE_TEST" -> "ifdef SQLITE_TEST". (CVS 6865)
FossilOrigin-Name: 890dbab28c3a1af4a1e01221318c9200574139e7
2009-07-08 18:50:55 +00:00
danielk1977
4f02960899 Revert part of (6860) that was accidentally checked in. (CVS 6864)
FossilOrigin-Name: 11e295ccd28fe669ee74c846db507040895a5e5b
2009-07-08 18:45:37 +00:00
drh
f3aed5944c Add another boundary-condition testcase() macro to btree.c. Correct the
comment on modifyPagePointer(). (CVS 6863)

FossilOrigin-Name: fed66e8695ee552d5ca05ac91485cfc5940e7496
2009-07-08 18:12:49 +00:00
drh
b908d76fb8 Improvements to comments in btree.c:freeSpace(). Added a testcase() macro
to verify a boundary case is tested in sqlite3BtreeInitPage(). (CVS 6862)

FossilOrigin-Name: 5ac991b3cea214095b8369e85f3e0ad8e5059ad6
2009-07-08 16:54:40 +00:00
drh
35a25da1b3 Comment out sqlite3BtreeFlags() when not in debug mode. Tweaks to
database corruption detection logic in freeSpace(). (CVS 6861)

FossilOrigin-Name: 196cbf82290a308e78b13044d0fae993f2d5cb90
2009-07-08 15:14:50 +00:00
danielk1977
c9000e60c6 Fix error handling in sqlite3BtreePutData(). (CVS 6860)
FossilOrigin-Name: 86eba4f16fd9e97344ab6dfb9cb9a85cf14751dd
2009-07-08 13:55:28 +00:00
danielk1977
ecaecf929e Remove an ALWAYS clause that could be false if an IO error within a statement executed by a virtual table caused an emergency rollback. (CVS 6859)
FossilOrigin-Name: 0cc705c2c4aa06c33361b11c06423ff76d9eed7c
2009-07-08 08:05:35 +00:00
drh
0a45c270be Simplifications to sqlite3BtreeInsert() and allocateSpace(). Added many
testcase() macros to verify boundary conditions in btree.c. (CVS 6858)

FossilOrigin-Name: aab82a229a984bdd37bda2d140cf4279ab54a741
2009-07-08 01:49:11 +00:00
drh
1714662877 Improvements to corrupt database detection in defragmentPage(). (CVS 6857)
FossilOrigin-Name: 87bbc8d6b68c089c8211c35c11c2f6ac4e46271c
2009-07-07 17:38:38 +00:00
danielk1977
172114a02e Do not load the root-page of a b-tree table/index when opening a cursor. Instead, allow it to be loaded when the cursor is first used (in function moveToRoot()). Also move the root-page flags sanity checks that were a part of the OP_OpenRead/OpenWrite opcodes into the moveToRoot() function. (CVS 6856)
FossilOrigin-Name: 06dcfe72a6ff3f63639eeb00ec5b5022d10fc55b
2009-07-07 15:47:12 +00:00
danielk1977
75a4012765 If an error occurs in PagerBegin(), call pager_end_transaction() to reset the internal state of the pager object. (CVS 6855)
FossilOrigin-Name: ea7ed16628da29cf4a127a25cbac8ae553e2ac1f
2009-07-07 13:56:24 +00:00
drh
4925a55d14 Fix a reference count problem following database corruption detection in
the ptrmapPut() routine of btree.c. (CVS 6854)

FossilOrigin-Name: ec1e27e33b89e809a03e4140b351f6c8674c0233
2009-07-07 11:39:58 +00:00
drh
fa3be90471 Simplifications to btree.c and vdbeaux.c in support of structural coverage
testing. (CVS 6853)

FossilOrigin-Name: fc2a40a9db23285da16f40f5131613907fb80f02
2009-07-07 02:44:07 +00:00
drh
d5bc725f0b Fix the pager so that it remembers the name of the journal for an in-memory
database as an empty string.  This is important when committing a multi-database
transaction that includes one or more attached memory databases. (CVS 6852)

FossilOrigin-Name: 31a5e8192e164f01c5d7c2744b67cfb517251fad
2009-07-06 21:54:40 +00:00
drh
f25cd7186e Fix the backup logic so that it detects a failure to sqlite3BtreeUpdateMeta()
and reports that failure back up to the top level. (CVS 6851)

FossilOrigin-Name: 471b92f2514aedecb5773825a7ae472190375727
2009-07-06 19:03:12 +00:00
danielk1977
3509a65827 Make the sqlite3BtreeMoveto function static, since it is only used from within btree.c. Remove unused function lockBtreeWithRetry from btree.c. (CVS 6850)
FossilOrigin-Name: 30d5ec62ab6a85ee60ee4128e20959842f8c7ad1
2009-07-06 18:56:13 +00:00
drh
5f82e3cc3a Simplifications and comment cleanup in vdbeaux.c. (CVS 6849)
FossilOrigin-Name: 1636e7831a21d401a48aa74d884444a287f14f72
2009-07-06 00:44:08 +00:00
danielk1977
3e8add919a Remove unreachable code from function btreeCursor() in btree.c. (CVS 6848)
FossilOrigin-Name: c76a366ed4dc63604ff695b3ee9c183e430a367e
2009-07-04 17:16:00 +00:00
danielk1977
1bc9ee9835 Remove a redundant branch from btree.c. (CVS 6847)
FossilOrigin-Name: 133357d2f070ba303deddff59beead1ec8d10521
2009-07-04 15:41:02 +00:00
drh
e7f3f3eec1 Remove two unused fields from the Parse structure. The TCL interface now
removes leading whitespace from SQL statements before parsing them. (CVS 6846)

FossilOrigin-Name: 983cb6924b8a7d3057718b9228c0cb2fbe7f0dc4
2009-07-03 22:54:36 +00:00
drh
1adecdf814 Remove unused code (that was commented out) from prepare.c. Remove an
incorrect NEVER() macro.  Fix the comment on schemaIsValid() to correctly
describe its return behavior. (CVS 6845)

FossilOrigin-Name: 90deb65835febc908f21bca89ef497d1048afe0a
2009-07-03 19:19:50 +00:00
drh
6bef648d97 Cause sqlite3_exec() to return SQLITE_NOMEM if it cannot allocate memory to
hold the error message for some other error. (CVS 6844)

FossilOrigin-Name: e9849292ab741f4c86203b2629dbe116f9b527c8
2009-07-03 19:18:43 +00:00
drh
ee152b00a3 Remove an unused variable from the test code in test3.c. (CVS 6843)
FossilOrigin-Name: 9e35bec9ef924ec44e87294a549238e0104bb27b
2009-07-03 17:23:48 +00:00