Commit Graph

78 Commits

Author SHA1 Message Date
drh bb77b753c5 Enhance sqlite3_shutdown() so that it automatically invokes
sqlite3_reset_auto_extension().  This is a harmless no-op if applications
are already calling sqlite3_reset_auto_extension() prior to sqlite3_shutdown().
And it prevents possible memory corruption if they do not.  So it works
either way.  Most of the changes are to the test cases. (CVS 6475)

FossilOrigin-Name: 0c41f7cff4f6ffb9321f6f6b6ef3e431b750d41a
2009-04-09 01:23:49 +00:00
danielk1977 238746a650 Fix a couple of fairly obscure cases where an assert() could fail following a malloc failure. (CVS 6360)
FossilOrigin-Name: cc0d925669ddeb55048e88aa5b4f658be60b0962
2009-03-19 18:51:06 +00:00
danielk1977 02f33725d2 Minor changes and coverge tests for "SELECT count(*)" optimization. (CVS 6324)
FossilOrigin-Name: a3695b98f63fb776c3b7f77f0553e8a38bcc6f78
2009-02-25 08:56:47 +00:00
danielk1977 de06e9f230 Fix a bug in malloc.test causing the exclusive permutation to fail. Changes to test code only. (CVS 6251)
FossilOrigin-Name: 72745bde90a9b4ffae1496f1668e4bb0678bd400
2009-02-04 08:17:57 +00:00
danielk1977 db3403973c Fix a change-counter bug similar to #3584. This one is much more obscure though, requiring a transient IO or malloc error to occur while running in exclusive mode. (CVS 6189)
FossilOrigin-Name: 9f07d2d9226b73c4dc311fd142e0aaba4ffcb078
2009-01-16 16:40:14 +00:00
danielk1977 7cbd589da0 Improve coverage of pager.c. (CVS 6158)
FossilOrigin-Name: 855c4093cf331496d9ef508011ad814e91e3882f
2009-01-10 16:15:09 +00:00
danielk1977 c87239fb32 Fix a bug in the previous commit - use SQL comments instead of Tcl comments in SQL blocks. (CVS 6155)
FossilOrigin-Name: 3d7a8de248ad5fba0e9c88f439cd2d988dcbab8c
2009-01-10 11:13:39 +00:00
danielk1977 9585528844 Add a malloc failure test case that covers a few previously untested lines in pager.c (CVS 6154)
FossilOrigin-Name: 000aedb0471b5f5a69e7b61f5e1d4b2644994f32
2009-01-10 11:10:18 +00:00
danielk1977 956f4319be Fix an assert() failure that can occur after an OOM error. (CVS 5939)
FossilOrigin-Name: 4c765758c18d7aeffe6e1cf658d2847f9460a956
2008-11-21 09:43:20 +00:00
danielk1977 e435975093 Modify an assert() statement to fix #3473. No other code changes. (CVS 5856)
FossilOrigin-Name: aca6b260c0dd1a1515b70f3567a0653b6bcdeea2
2008-11-03 09:39:45 +00:00
danielk1977 85574e31cb Allow INDEXED BY and NOT INDEXED clauses in SELECT statements. (CVS 5766)
FossilOrigin-Name: 98ca5580f5acd2e7b3ce512520ec0527f221505e
2008-10-06 05:32:18 +00:00
danielk1977 98c21903bd Always transform error code SQLITE_IOERR_NOMEM to SQLITE_NOMEM before returning. This was already happening in most places. (CVS 5738)
FossilOrigin-Name: 046ef07261d520c9399bd8cdfdfd5281956b7a27
2008-09-23 16:41:29 +00:00
danielk1977 77eb5bb6f7 Fix a memory leak that can follow a malloc failure in sqlite3_initialize. (CVS 5731)
FossilOrigin-Name: 118dc0ba082dd9abba5602dafc86bd56e756db86
2008-09-22 17:22:19 +00:00
danielk1977 518002e4ba Fix a problem in btree.c preventing an OOM error from being propagated up to the caller. (CVS 5677)
FossilOrigin-Name: 0b8ee83f2ebadab099ccd6490f6995949dafdd6f
2008-09-05 05:02:46 +00:00
danielk1977 59633aeec2 If any error occurs during sqlite3_open(), move the database handle into "sick" state. When in the sick state the user can use sqlite3_errcode() and sqlite3_errmsg(), but not much else. (CVS 5628)
FossilOrigin-Name: ce9c74eaab459ddde213c828e821940f5d6cb354
2008-08-27 19:01:57 +00:00
danielk1977 7eaabcdb2a Test a couple of specific malloc() failures that were not tested before. (CVS 5350)
FossilOrigin-Name: b96bcaa197519b5be89e1f6a1579f0e36fe2b644
2008-07-07 14:56:56 +00:00
danielk1977 d09414cdd6 Move the malloc() failure simulation out of malloc.c and into a separate sqlite3_mem_methods interface. Still some related changes to come. (CVS 5250)
FossilOrigin-Name: d22cd2a59f472f4eaf80aa9f55fbff2514ca428d
2008-06-19 18:17:49 +00:00
drh f3a87624a2 In exclusive locking mode, commit by zeroing the first 28 bytes of the
journal file, not by truncating the journal.  Overwriting is much faster
than truncating. (CVS 5023)

FossilOrigin-Name: 8efb7f4ffbfc3ad901a3bb1b4ff9390b8c13760b
2008-04-17 14:16:42 +00:00
danielk1977 ce98bba24b Change the allocator in mem2.c (used when SQLITE_MEMDEBUG is defined) so that allocations are not rounded up to the nearest 4 byte boundary. Fix a couple of errors in malloc.test related to sqlite3OsAccess() returning -1. (CVS 4956)
FossilOrigin-Name: fd97f8762cb1e4653c932402940f74d7c0ebf71f
2008-04-03 10:13:01 +00:00
drh eee4c8ca11 Add the memory fault simulator to mem5.c. Enable soft heap limit on mem5.c.
Limit the size of hash tables and the vdbefifo when using mem5.c. (CVS 4795)

FossilOrigin-Name: 63da5d97542e4f54c33329833477c8d96ce05dd0
2008-02-18 22:24:57 +00:00
danielk1977 cdf3020ca3 Fix a segfault that may follow a malloc failure during compilation of an INSTEAD OF trigger. (CVS 4749)
FossilOrigin-Name: c6635a71dbb2a06d56a0cfce7f0383325e12dc01
2008-01-24 14:27:44 +00:00
danielk1977 ac559264e3 Fix another segfault that can occur following a malloc failure in the SQL compiler. (CVS 4748)
FossilOrigin-Name: 9d98a3f0dded4ee7ed53872f48ee8592ff077f92
2008-01-23 17:13:40 +00:00
danielk1977 15cdbebe08 Fix a couple of segfaults that could occur after a malloc() failure in the SQL compiler. (CVS 4747)
FossilOrigin-Name: 6bd8db3839d57a738cae2196679819186968b40e
2008-01-23 15:44:51 +00:00
drh de4fcfdd7a Additional test coverage improvements. Test coverage now stands at 98.73%. (CVS 4731)
FossilOrigin-Name: 010f7b780cb9c8f21af9ce810494fbd2be98a13f
2008-01-19 23:50:26 +00:00
drh 93aed5a177 Get all tests running without memory leaks. (CVS 4714)
FossilOrigin-Name: 5807921f5a6e2e08f2c9e79aa91d8c587d64de74
2008-01-16 17:46:38 +00:00
drh ade8648301 Add the {quote: StrAccum} object
for accumulating strings.  Revamp xprintf to use
the new object.  Rewrite the group_concat() function to use the new object.
Productize and test the group_concat() function. (CVS 4578)

FossilOrigin-Name: 221aee72be040769e8026b91648f03c6366a8821
2007-11-28 22:36:40 +00:00
danielk1977 932083c60f Fix a crash that can occur after a malloc failure. Ticket #2775. (CVS 4547)
FossilOrigin-Name: c91bc8d33306881cb2501070dccced92c82cf165
2007-11-16 14:55:46 +00:00
danielk1977 5a8f9374ab Fixes to the test suite (no code changes) so that quick.test runs with OMIT_ATTACH builds. #2706. (CVS 4480)
FossilOrigin-Name: 07c00fffe50e8380748f7ae02328531a75d64610
2007-10-09 08:29:32 +00:00
danielk1977 2a180ff9c5 Add a test case to malloc.test. (CVS 4456)
FossilOrigin-Name: 7d3f0b149bd2b9c7c12aabb93d022c0ea26f0d74
2007-10-03 15:02:40 +00:00
danielk1977 ae72d98252 Add automatic recovery from the pager "error-state". Also add a new error code - SQLITE_IOERR_NOMEM. (CVS 4454)
FossilOrigin-Name: 12eca32a6a3d68d5b20eed03afdffe7599e66014
2007-10-03 08:46:44 +00:00
danielk1977 4152e677b8 Fixes for compilation/testing when the various OMIT macros are defined. (CVS 4423)
FossilOrigin-Name: c8405b15c074c94dab5e33272cf1471f458d11df
2007-09-12 17:01:45 +00:00
drh dc05efb4ff Fix the malloc-10 test in malloc.test so that it will run on windows when
invoked from exclusive3.test. (CVS 4389)

FossilOrigin-Name: 1166f9c7d1b3cb39a2ab96ed08a0552ba5fe1851
2007-09-04 01:25:48 +00:00
danielk1977 fa18bece7a Handle transient malloc() failures in sqlite3CreateFunc(). (CVS 4371)
FossilOrigin-Name: c0ce63196458c81e0859fc8a38f2dd2145a580bc
2007-09-03 11:04:22 +00:00
danielk1977 a1644fd863 Modifications to the malloc failure tests to test transient and persistent failures. (CVS 4321)
FossilOrigin-Name: e38ef81b85feb5bff2ad8448f3438ff0ab36571e
2007-08-29 12:31:25 +00:00
drh f3a65f7e44 The malloc.test script now passes all tests with no errors. (CVS 4271)
FossilOrigin-Name: db818430e9ea4ef4a4af575784009d5acae785a3
2007-08-22 20:18:21 +00:00
danielk1977 9fb3ecbc5b Add a test for malloc() failure when compiling a trigger step of the form "INSERT INTO ... SELECT ...". Currently causes a segfault. (CVS 4232)
FossilOrigin-Name: 161643a694458e76849cd663f277892ae7c6b729
2007-08-16 04:39:01 +00:00
danielk1977 c9cf901d8c Add some extra tests for malloc failure during expression parsing and execution using fuzzily generated SQL. (CVS 4043)
FossilOrigin-Name: 7522d2fb3204d107b8b4816d7f39c88741f20230
2007-05-30 10:36:47 +00:00
danielk1977 7e29e9561c Fix a bug whereby sqlite3_prepare_v2() could return both an out-of-memory error and a valid statement handle. (CVS 3858)
FossilOrigin-Name: 8795d11c3c5bb39d34bc5194621ce97097a320e7
2007-04-19 11:09:01 +00:00
danielk1977 b5584c0c69 Extra test cases to improve coverage of main.c. (CVS 3755)
FossilOrigin-Name: 19fc3d78962d225d42372b9298be5921ec1fc8a1
2007-03-30 07:10:50 +00:00
danielk1977 69b637b56b Add a couple of test cases to improve coverage testing. (CVS 3747)
FossilOrigin-Name: 0b22ce3637f87c453084c5bd994b6b19a0b014c0
2007-03-29 17:07:52 +00:00
danielk1977 c5859718af Run some malloc() tests with exclusive-access mode. (CVS 3717)
FossilOrigin-Name: 127454903764daff17390941a002f527ee2ffc87
2007-03-26 12:26:27 +00:00
danielk1977 59a33f98d6 Modifications to crash-test infrastructure. (CVS 3695)
FossilOrigin-Name: c4be8d9949fc7b5e1bed757423c5195f38069048
2007-03-17 10:26:59 +00:00
drh 28f4591466 Fix a problems that arise if malloc() fails while compiling SELECT
statements within a TRIGGER. (CVS 3478)

FossilOrigin-Name: ee4894b49995e4904db1991281563cfbb7b1c16d
2006-10-18 23:26:38 +00:00
drh d9910fe529 Tests cases automatically remove many of their temporary files. (CVS 3463)
FossilOrigin-Name: eef0ec0d7ae0743d29454567f539e46ad2d5008e
2006-10-04 11:55:49 +00:00
drh 76f8079623 Fix a NULL pointer deference following malloc failure. Bug discovered
by klocwork. (CVS 3328)

FossilOrigin-Name: eb91612f4646b15c2b8398c5225669419b03b531
2006-07-11 12:40:25 +00:00
drh 344a627661 Fix a file descriptor leak following malloc failure on DROP TABLE IF EXISTS. (CVS 3296)
FossilOrigin-Name: 6a63f76c8de977b628c4cab258be5a11d7d7def9
2006-06-26 12:50:09 +00:00
drh a06ab2ca23 Follow-up to check-in (3164). Make sure SQLITE_NOMEM is returned after
a memory allocation failure.  It is not sufficent to return an "out of memory"
error message.  The return code needs to be SQLITE_NOMEM. (CVS 3172)

FossilOrigin-Name: 9d95750e8556aef20a637a815652d547ed2f887c
2006-04-10 13:37:47 +00:00
drh 6103fe972e Make sure SQLITE_NOMEM is reported out on a malloc failure in an ATTACH
even if the malloc failure reports within a nested calls to sqlite3_prepare(). (CVS 3164)

FossilOrigin-Name: 3538a4e30fb5131b461bb0cf72cada63e9724e14
2006-04-05 11:57:37 +00:00
danielk1977 161fb79619 General test coverage improvements. (CVS 3022)
FossilOrigin-Name: 153940af5af4f775fa3b1784931d3fd1e41764c5
2006-01-24 10:58:21 +00:00
danielk1977 950f054cec Handle malloc() failures that occur in open16() and errmsg16(). (CVS 2967)
FossilOrigin-Name: 86eab9e53db8d7fecc789fe3d8cd8d7be3196fed
2006-01-18 05:51:57 +00:00