Commit Graph

6636 Commits

Author SHA1 Message Date
drh c4ac22e905 Disable the LIKE optimization if the affinity of the LHS column is
not TEXT.  Ticket #3901. (CVS 6727)

FossilOrigin-Name: a255c645c46ae03b65f862858fe57e462076e1fc
2009-06-07 23:45:10 +00:00
drh 49008596ed Update the error message on one of the corruption tests to account for the fact
that we are finding the corruption sooner. (CVS 6726)

FossilOrigin-Name: ba9848e7b89df1fb6bf6db2b9d66cd3ffce375df
2009-06-06 19:21:13 +00:00
danielk1977 08746af43b Fix an error in the malloc.test test script causing a small buffer overread. (CVS 6725)
FossilOrigin-Name: 4d129bee696f3a537f7ea5501a387012fc08c27e
2009-06-06 16:08:22 +00:00
drh 125feffc89 Make sure the result of sqlite3VdbeGetOp() is not used as an array following
an OOM error, since after (6691) it might be a single-entry dummy opcode. (CVS 6724)

FossilOrigin-Name: 127b13981960a9690de09e8f9d0b38a4bd76015f
2009-06-06 15:17:27 +00:00
danielk1977 41f5b04ceb When building in debug mode with gcc, force the nullMem variable in function columnMem() to be aligned to an 8-byte boundary. Otherwise an assert() statement may fail. (CVS 6723)
FossilOrigin-Name: 3fd6c72da599347af70897b30b86a4ba641d4cd9
2009-06-06 14:13:26 +00:00
drh acfc72bea4 Detect when database corruption causes an attemp to set the pointer map
value for a pointer map page and report the corruption. (CVS 6722)

FossilOrigin-Name: 3ae4880bee3a0312c61cdd36f4fa50286cc2ef48
2009-06-05 18:44:15 +00:00
drh dda70fe38e Remove leftover "breakpoint" commands from test scripts. Also remove blank
lines at the end of scripts. (CVS 6721)

FossilOrigin-Name: 1fef16ec2b89981770cf44f606a420fbe031a7a4
2009-06-05 17:09:11 +00:00
drh bfb19dc698 Do not cast an unsigned int into an int for comparison. (CVS 6720)
FossilOrigin-Name: 302ab855e62dfae8507800302dae479e0494b81a
2009-06-05 16:46:53 +00:00
drh 35cd643cc7 Take care that a corrupt variable-length integer does not cause 32-bit
integer overflow when parsing a record format, nor cause excessively large
memory allocations. (CVS 6719)

FossilOrigin-Name: 38b20327a80996c7044b88be32161ac4ac0ec3a9
2009-06-05 14:17:21 +00:00
drh 1662b5a6f9 Earlier detection of freelist corruption in the page allocation routines. (CVS 6718)
FossilOrigin-Name: e557c8e5846f9c4eaaeb3bd07614ac101bb0b3d0
2009-06-04 19:06:09 +00:00
drh d46b6c23d3 Fix an assertion fault in balance_quick() that occurs when an interior
btree node has zero cells due to database corruption.  Also update the
corrupt7.test result vectors for a couple of cases where the error report
on database corruption changed due to earlier detection. (CVS 6717)

FossilOrigin-Name: 1335e4440f5a3d24ce9ce187e0e23fc9b166ca98
2009-06-04 17:02:51 +00:00
drh c85240dbf6 If the root page of a btree is empty and is also not a leaf page and the
page is not page 1, then report database corruption. (CVS 6716)

FossilOrigin-Name: 52b02ca5f3e5fdf2f3e02e9d8e016028d0842818
2009-06-04 16:14:33 +00:00
danielk1977 6f235cc5de Reduce the stack usage of balance_quick(). (CVS 6715)
FossilOrigin-Name: e7ad68e93b19b59cb16205c4b48fd9d6492dbb02
2009-06-04 14:46:08 +00:00
shane e71169ba30 Minor updates to comments in test scripts. (CVS 6714)
FossilOrigin-Name: 453ff88f73a01a54ff464563effdb63014b1972c
2009-06-04 02:47:03 +00:00
shane bbc795fdaf Minor tweak to test script to ensure every byte in file touched at least once. (CVS 6713)
FossilOrigin-Name: bc6c2d894b711361808a19b673803186d3a28369
2009-06-04 02:46:19 +00:00
drh c5e47ac238 Fix two instances where a malformed header in a database file (in other words
a corrupt database file) can lead to an assertion fault. (CVS 6712)

FossilOrigin-Name: 4e92c7f20afa51849128aa1d784ab885b517a73d
2009-06-04 00:11:56 +00:00
drh 69e931e7bb Change the pcache1.c implementation so that the "header" occurs at the end
of page buffer, not at the beginning.  This insures that the 20 bytes
immediately following the page buffer are mapped if a read of the page
buffer overruns due to a malformed cell. (CVS 6711)

FossilOrigin-Name: c54de1f54080de7e134d7b562498abb5337a0a46
2009-06-03 21:04:35 +00:00
danielk1977 93c829c110 Add corruptD.test, a container for testing the "cell overflow" problem. Also shuffle a small amount of code in BtreeInitPage() to check that the page header pointer to the start of the cell offset array is set to a sane value. (CVS 6710)
FossilOrigin-Name: 7fa5d3cb0fa05f7d901bcc139c2c037ce5944caa
2009-06-03 17:26:17 +00:00
danielk1977 0d19f7ac57 Define a set of constants to use as the "index" argument to sqlite3BtreeGetMeta and UpdateMeta. This makes some parts of the code easier to follow. (CVS 6709)
FossilOrigin-Name: 6dbf4eca00f845baa7200aba421d0bc158ba96aa
2009-06-03 11:25:07 +00:00
drh 50d654da3b Additional changes to reduce stack usage. The SQLITE_SMALL_STACK compile-time
option is now available. (CVS 6708)

FossilOrigin-Name: baea79fd0cfeb860973846c3f2776776c87f0ae3
2009-06-03 01:24:54 +00:00
drh e98c9049a0 Further reductions in the amount of stack space required. (CVS 6707)
FossilOrigin-Name: 04bad9eb6dd8bf7cafc9f3918b676e95d5b1c984
2009-06-02 21:31:38 +00:00
drh c54a617e1f Tweaks to vdbe.c to further reduce stack space requirements. (CVS 6706)
FossilOrigin-Name: 6f2aab3f7be12710b703eda22b1d5c0e8f85f814
2009-06-02 16:06:03 +00:00
drh e4a96be62b Add a test case for ticket #3893 and ticket #3894. (CVS 6705)
FossilOrigin-Name: 2472f6db95cd537a908bdbbbbc41bad2bd987b2f
2009-06-02 15:47:37 +00:00
drh 856c10375d Add the vdbe-compress.tcl script which automatically refactors the
sqlite3VdbeExec() routine to use less stack space.  Use this script
when constructing the amalgamation. (CVS 6704)

FossilOrigin-Name: 7f43391831b03e53d967acee6ae02089740aaedb
2009-06-02 15:21:42 +00:00
drh 6ee700c32c Avoid allocating large objects on the stack in the incremental BLOB I/O
interface. (CVS 6703)

FossilOrigin-Name: ea7dfde700fb57ed0ecb5000a55abbf45aa1e09d
2009-06-01 19:53:30 +00:00
drh e7b3470705 Malloc for space to hold the Parse object in sqlite3_prepare() and friends.
Or, if compiled with SQLITE_USE_ALLOCA, obtain space for the object from
alloca(). (CVS 6702)

FossilOrigin-Name: c7c0c58e472cd8277b2ad58bb60834190bace4fa
2009-06-01 18:18:20 +00:00
shane ddfefca736 Added assert to verify winMutex system is inited before "static" mutexes are used. (CVS 6701)
FossilOrigin-Name: b126013b5a1d6526810139d19acbec7fd0ab8168
2009-06-01 17:10:22 +00:00
shane 61b82d6aa5 Ensure that "static" mutexes are deleted on shutdown so that they are not leaked across restarts. (CVS 6700)
FossilOrigin-Name: 4e75897ee177bd24145f9dbfccd41a03c108440f
2009-06-01 17:06:07 +00:00
shane cf6973963a Fix compiler warnings with MSVC build. (CVS 6699)
FossilOrigin-Name: 0791588520603d106aa0b8ce24d68b740b7b80c8
2009-06-01 16:53:09 +00:00
shane 739a277031 Fix a couple of Windows only issues with test scripts. (CVS 6698)
FossilOrigin-Name: 0f6bc5e1ba6937b36df08ed3b5903839389021bb
2009-06-01 16:42:17 +00:00
drh d6b8c43474 Code simplifications to facilitate coverage testing following the recent
changes to the Expr object. (CVS 6697)

FossilOrigin-Name: ee9a144d448a76f29c3ca03851c1aeef539068e2
2009-05-31 21:21:40 +00:00
drh de7446bd85 Fix the ".genfkey" command of the CLI so that it does not leak memory
if sqlite3_realloc() fails.  Ticket #3891. (CVS 6696)

FossilOrigin-Name: a028d69c70ae961f418052a91aa1518e80a8ddf5
2009-05-31 17:16:09 +00:00
drh 20bc393c6a Fix typo reported by ticket #3888. Other minor edits to facilitate
coverage testing. (CVS 6695)

FossilOrigin-Name: 164adf261d2536f16c83e44f6482dfb3d04a45d5
2009-05-30 23:35:43 +00:00
drh 33cd490992 Simplifications to the expr.c source module resulting from structural
testing. (CVS 6694)

FossilOrigin-Name: f760bb7a0372d11ac7e3287b8a56fc4261e6371c
2009-05-30 20:49:20 +00:00
drh f7bca5740d Fix for ticket #3887. Other unrelated bits of code cleanup in the expr.c
source module. (CVS 6693)

FossilOrigin-Name: 00e7250f11e190cd915870438d172f574d110e6d
2009-05-30 14:16:31 +00:00
danielk1977 43996e858b In vacuum.c use "PagerIsMemdb(X)" instead of "PagerFile(X)->pMethods==0". (CVS 6692)
FossilOrigin-Name: 874295ce71380da3f4c9296df0e0ce5ece136220
2009-05-30 10:46:10 +00:00
drh 20411ea700 Enhance the sqlite3VdbeGetOp() routine so that it always returns a pointer
to VdbeOp, even following an OOM fault.  This simplifies error handling in
callers.  Cleanup to the column cache logic and the expr.c source module. (CVS 6691)

FossilOrigin-Name: ede06dacdf7acab23cd9666a0a0d092a637bcb78
2009-05-29 19:00:12 +00:00
drh fd773cf970 Refinements in expression handling logic that have resulted from recent
structural testing. (CVS 6690)

FossilOrigin-Name: bd89f2c29b00e6b473f30c2e929d2f626721ad92
2009-05-29 14:39:07 +00:00
drh 9fe769f129 Still more refinements to the hasHotJournal() fix of ticket #3883. (CVS 6689)
FossilOrigin-Name: 726b425e43e5d864e7e83853bdf134debc1ffb59
2009-05-29 11:57:38 +00:00
drh cc0acb261e The hasHotJournal() fix of check-in (6687) causes some minor problems in
various alternative operating modes, such as locking_mode=EXCLUSIVE.  This
additional patch attempts to fix those concerns.  Ticket #3883. (CVS 6688)

FossilOrigin-Name: a2ba61d927a06c390a9a818a013328092b802222
2009-05-29 10:55:29 +00:00
drh f0039ad815 Modify the hasHotJournal() routine to return a false-positive if it is
unable to open the journal file to check its header due to a race
condition.  Processing downstream of hasHotJournal() already knows how to
deal with false-positives.  Ticket #3883. (CVS 6687)

FossilOrigin-Name: d6b5d8e1ab8e5d3348ace560230702718a2a8af9
2009-05-29 00:30:30 +00:00
drh b74b101766 Remove references to deleted function sqlite3ExprRegister(). Changes to
the expr.c source module to promote better testing. (CVS 6686)

FossilOrigin-Name: 6ae4ad6ebee4db88c411df97bb1de574708dd53c
2009-05-28 21:04:37 +00:00
drh 2c220455b9 Fix a NULL pointer dereference following an OOM error in the column name
resolver. (CVS 6685)

FossilOrigin-Name: 3b46142532934d17aa136c2e56e58e7828df0f54
2009-05-28 14:34:49 +00:00
drh 0b0745ae37 Make sure the column name resolver does not try to duplicate Expr.u.zToken
when the Expr.u.iValue union member is the element being used. (CVS 6684)

FossilOrigin-Name: 376ecf0d87e4a2329f5861401f83ed9ceb35d528
2009-05-28 12:49:53 +00:00
danielk1977 4b0aa4cf3e Workaround the need for internal API sqlite3BtreeCursorDb(). It was only being used for an assert() statement, which can be done differently. (CVS 6683)
FossilOrigin-Name: 5904af6e6df3effdaaa30e7cf96ee316fc09b28d
2009-05-28 11:05:57 +00:00
drh 33e619fc1c Additional refinements to Expr handling. Restore compression of trigger
expressions.  Change Expr.zToken to Expr.u.zToken and added Expr.u.iValue.
Remove an unnecessary ExprDup from CHECK constraint processing.  And so forth. (CVS 6682)

FossilOrigin-Name: 4ac2bdfbb4230b6ceaae87e738fa61036bbe03cb
2009-05-28 01:00:55 +00:00
drh b7916a78ff Simplifications to the Expr object: Remove Expr.span completely and convert
Expr.token into a char* Expr.zToken.  Also simplify the Token object by
removing the Token.dyn and Token.quoted fields. (CVS 6681)

FossilOrigin-Name: 7cb1c3ba0759539cb035978fdaff6316775986f3
2009-05-27 10:31:29 +00:00
drh 38a2c01b09 Fix the rtree test module so that it works even if the ext/ subfolder is
omitted from the tree. (CVS 6679)

FossilOrigin-Name: 086206e1f51e22ce7b9f45865b370088db126cd2
2009-05-25 14:17:35 +00:00
drh 5cd792399a When pinning a temp register after it is reused by the column cache, make
sure all instances of that register in the cache are pinned so that the
register is never reused for a different purpose.  Ticket #3879. (CVS 6676)

FossilOrigin-Name: 5f358e63712e8de93bd6fecc5131badeef0292be
2009-05-25 11:46:29 +00:00
danielk1977 d17fe2a352 Add a test case for ticket #3879. (CVS 6675)
FossilOrigin-Name: 5b9b66f47b0b8178427806149958387d32b70dc2
2009-05-25 11:46:10 +00:00