Commit Graph

7151 Commits

Author SHA1 Message Date
dan c02008333c Merge with main branch.
FossilOrigin-Name: 6e09e28751a7071969ef9f3445f4092d2c28f358
2009-08-31 05:39:58 +00:00
dan 523a087b9e Fix another test problem and some instances where an OOM may cause a segfault.
FossilOrigin-Name: 31199db0f77cf4b32d5589a29abd9535b155164b
2009-08-31 05:23:32 +00:00
dan 76d462ee78 Fixes for new triggers scheme.
FossilOrigin-Name: 9eb91efda5241609ff18ff15ef5eaa0e86788eab
2009-08-30 11:42:51 +00:00
dan 165921a742 Changes to support recursive triggers.
FossilOrigin-Name: 9b9c19211593d5ff7b39254a29c284560a8bcedb
2009-08-28 18:53:45 +00:00
drh 5d00d0a8dc Add a new source code logo gif.
FossilOrigin-Name: 6abcba1021b237452f542f1fbb69eb75d9f50f53
2009-08-28 00:49:03 +00:00
drh 2238dcccc7 Patch to the named semaphore locking mechanism used by VxWorks.
FossilOrigin-Name: 609c5341bea16e4e8bcd15388b209c753ca9e0bb
2009-08-27 17:56:20 +00:00
drh 67fba28055 Updates to the pluggable page cache documentation.
FossilOrigin-Name: 3085ad7612e2c50a2d7906e82b2d057954d9c3f9
2009-08-26 00:26:51 +00:00
drh a8f576126e Remove an unreachable branch from where.c in order to restore 100%
branch test coverage.  Add assert() and testcase() macros to verify
that the branch is unreachable.

FossilOrigin-Name: 58db7e7166ccefef77b237b77e17f47d31ff41e0
2009-08-25 16:28:14 +00:00
drh 011cfca18e Initialize variables differently in the range processing logic of where.c
in order to make sure variables are always initialized even following
an OOM error.

FossilOrigin-Name: 3fb3686a4502140720dc3710a28a4f4128ab6554
2009-08-25 15:56:51 +00:00
drh 333ceb9389 Attempt to clarify the meaning of a "parameter" in the sqlite3_bind() API
documentation.

FossilOrigin-Name: 9389e6a7dad7ba70923282d6fe45fbccd22f681e
2009-08-25 14:59:37 +00:00
drh 560168934c Make sure that the output of EXPLAIN is right when the P4 argument of
an opcode is of type P4_MEM with the MEM having type MEM_Blob.

FossilOrigin-Name: 6a623e6cf0370456232497a84366d18fa180debb
2009-08-25 14:24:04 +00:00
drh ec9b31f033 Avoid calling sqite3VdbeRecordCompare() with uninitialized memory following
an OOM.  Doing so is harmless, but it worries valgrind.

FossilOrigin-Name: d33b9eb2567561ccfdc588c95604cce9b697d768
2009-08-25 13:53:49 +00:00
drh ff104c17b7 Fix an uninitialized variable in sqlite3VdbeIdxRowid().
FossilOrigin-Name: 6e787e18fa87f5463bf62cd91a0c0855099693f0
2009-08-25 13:10:27 +00:00
drh fd3ca1c680 Merge together the os_unix.c fix of [aa6acfa8ca] and the trigger fix of
[dee1b8eb40].

FossilOrigin-Name: 1e2c6e134e04dd22795ad4839874ec0edd9b0970
2009-08-25 12:11:00 +00:00
dan 15edd587fd Fix a bad interaction between "proxy-locking" and [http://www.sqlite.org/src/vdiff/aa6acfa8caa2ef59b4c16dfe42c4b5644da96905|aa6acfa8ca].
FossilOrigin-Name: 2a5c9e1dbf7f5f4b2081c964450a9305a4516f5b
2009-08-25 05:57:47 +00:00
drh cee4c93771 Update the version number to 3.6.18, even though the actual release of
that version is still a few weeks away.

FossilOrigin-Name: c0ea4e9a7dcd66c079f917af47157f6ab7d79401
2009-08-24 19:37:20 +00:00
dan 6aa657f76b Fix some errors in [http://www.sqlite.org/src/vdiff/aa6acfa8caa2ef59b4c16dfe42c4b5644da96905|aa6acfa8ca].
FossilOrigin-Name: 82d1934a428a34c292a612fb67bbcea262990e0f
2009-08-24 18:57:58 +00:00
drh e408edac16 Run the column cache in a new context when generating code for trigger
programs.  Fix for ticket [efc02f9779].

FossilOrigin-Name: dee1b8eb402f47c6d5ee60aac28f8e3dcf98167f
2009-08-24 01:35:25 +00:00
drh 30a89a3845 Remove an obsolete documentation file left over from SQLite version 1.0.
FossilOrigin-Name: f7eb1efc37d0658d66b3b86d5afd5419d22bfe92
2009-08-22 19:17:02 +00:00
dan e946c3966a Fix a problem in os_unix.c where a malloc failure could lead to a leaked file descriptor.
FossilOrigin-Name: aa6acfa8caa2ef59b4c16dfe42c4b5644da96905
2009-08-22 11:39:46 +00:00
dan 08da86a68e When a database file is opened, try to find an unused file descriptor to reuse. This change affects unix (and other systems that use os_unix.c) only. Fix for cvstrac ticket [http://www.sqlite.org/cvstrac/tktview?tn=4018|#4018].
FossilOrigin-Name: 9b4d9ab62d687289837b13b07885e72cc3abe8a9
2009-08-21 17:18:03 +00:00
drh d00151613a Change the expression code generator to account for the fact that the new
sqlite3AtoF() never returns NaN.  Also, clarification of a comment in
where.c.

FossilOrigin-Name: 75f596a04a74eb3a538c7be5b41756c970a21a1b
2009-08-21 13:22:25 +00:00
dan 9359c7b7ab Add assert() statements to os_unix.c to check that the mutex is held when it should be.
FossilOrigin-Name: 11a669b6537d6bac67764fd91a319234345ac504
2009-08-21 08:29:10 +00:00
shane 6085f5e0a0 Updated sqlite3AtoF() that performs slightly better with GCC, and significantly better with MSVC.
FossilOrigin-Name: f084f5a8ba850de627ca8e9de6c81ab1ad9b7a1b
2009-08-21 02:13:14 +00:00
shane 8e283794b6 Updates for test_init.c for configure and other consistency changes.
FossilOrigin-Name: 3ba316e9a32de406a4390fb3f52fccb48da4da30
2009-08-21 02:07:09 +00:00
drh 9e1fadee5b Remove a redundant OOM test from the sqlite_stat2 analysis loader.
FossilOrigin-Name: d30ceeb8b303e2ebfab2855beb973da606a97fa9
2009-08-20 23:05:31 +00:00
drh daf4a9f3b8 Simplifications to the range-scan logic in support of structural testing.
FossilOrigin-Name: bbbee81075d923be7ca11e6e635c069a05d1605a
2009-08-20 20:05:55 +00:00
drh 98cdf62690 Continuing refinements of the range-scan optimizations in where.c.
The range scores are changed from an integer 1..9 to 0..100.

FossilOrigin-Name: f0c24b5fb86940f1a88adfb39cc4b9cbfcc66f8a
2009-08-20 18:14:42 +00:00
dan 68c4dbbdfc Change the code that collects samples for sqlite_stat2 so that the first sample taken is the (nRow/(2*SQLITE_INDEX_SAMPLES))th entry in the index, where nRow is the total number of index entries.
FossilOrigin-Name: cbfe6e9df39684607cbc9637e3fb3c5ee6af2515
2009-08-20 09:11:06 +00:00
drh cdaca55eb1 Incremental code and comment cleanup in where.c. There is more to be done.
FossilOrigin-Name: 4a5d9550bdc08633535a7869d7748f56ac3e9a36
2009-08-20 13:45:07 +00:00
drh f8d4e8bd3f Set the "type" correctly of built-in BINARY collating sequences for UTF16.
FossilOrigin-Name: 167644f33c949b532655c2297aedf13f93876396
2009-08-20 02:49:30 +00:00
drh 9aeda79cf6 All the sqlite3GetCollSeq() function to specify an arbitrary text encoding.
FossilOrigin-Name: 4ee44322ca3c92ed8d6f5d4a3f89d219bf379595
2009-08-20 02:34:15 +00:00
drh 3995c26d16 Make sure that sqlite3ValueFromExpr() sets the "type" field of the
sqlite3_value object correctly when the value is a floating point
number.

FossilOrigin-Name: 2467eb68ace46f6185fd14758446a5c887caffe3
2009-08-19 22:14:17 +00:00
dan fcd4a150e2 Change the way an Expr that has been converted to TK_REGISTER stores its original opcode. The previous method, overloading Expr.iColumn, did not work in all cases.
FossilOrigin-Name: 71ea9d0e148fbd3d633651c61c81044e37cf88b9
2009-08-19 17:17:00 +00:00
dan 0f9a34ea4f Fix an assert() failure that may follow an OOM error.
FossilOrigin-Name: 14a715c5639b2bc69b129485ca32e96366dab4c4
2009-08-19 16:34:31 +00:00
dan 4190326626 Merge 29cafcfdcc and a6f39181a7.
FossilOrigin-Name: 740a93e89c5f12672d72de7b3c55807deac613d4
2009-08-19 16:21:25 +00:00
drh 6aa5f152a3 Documentation improvements in sqlite.h.in. No changes to code.
FossilOrigin-Name: a6f39181a7b3083ae46cffd7aee7db895b4df8a4
2009-08-19 15:57:07 +00:00
dan dec221e352 Add some tests that use the sqlite_stat2 table in shared-cache mode.
FossilOrigin-Name: 29cafcfdccf4c0a27746b9a82fa4191605a4505a
2009-08-19 15:34:59 +00:00
dan 9267f85790 Merge with 709e16145e.
FossilOrigin-Name: 6c8a0e2b37d9f4399ef90a44cbc492526201d0d5
2009-08-19 14:42:25 +00:00
dan 85c165caca Clean up sqlite_stat2 related code. Add test cases.
FossilOrigin-Name: aa728e06ce456fa42e68687bff6c7424460c31ef
2009-08-19 14:34:54 +00:00
dan a898aac951 Fix a problem where a buffer allocated from a lookaside pool was being released using the system free().
FossilOrigin-Name: 67207a15bd7302ffeb2f342532b57b4852838d83
2009-08-19 09:09:38 +00:00
dan 69188d9a66 Add the SQLITE_ENABLE_STAT2 macro. If this is not defined at build-time, the stat2 table is not created, populated, or used.
FossilOrigin-Name: 362665e89c21fd603d9f8ad6c0ead590e885af7c
2009-08-19 08:18:32 +00:00
shane 6c53320320 Adjust sync count for SQLITE_DISABLE_DIRSYNC compiler option.
FossilOrigin-Name: 709e16145e37940cb243eede75071fb15095d960
2009-08-19 04:24:48 +00:00
dan e275dc3fb8 Change the sqlite_stat2 schema to be more flexible.
FossilOrigin-Name: ded9dec6459baf21e01f63250db5ace57f390e7a
2009-08-18 16:24:58 +00:00
drh feb306f556 Unknown functions in the DEFAULT clause of a table cause an error when
the DEFAULT value is needed.  Ticket [2d401a94287b5].

FossilOrigin-Name: 093917d7fda442012dfd1a1b2f20f85d2eefa093
2009-08-18 16:05:46 +00:00
drh 1b25753b30 Move the allocation of the memsys5 mutex into the initializer.
FossilOrigin-Name: 4e377a09c194e90581ef00fd3a213e936b4e648a
2009-08-18 15:33:44 +00:00
drh 7c6791c8b1 Fix obscure issues with the memsys5 memory allocator. Arrange that the
xRealloc() interface to memory allocators is only called with a value
that has been through xRoundup().

FossilOrigin-Name: 577bd6f15556b7f6d86ee5167353fdd535577bf6
2009-08-18 14:48:53 +00:00
drh 15385ad437 When shutting down the memsys5 memory allocator, be sure to clear the mutex
pointer in case the next startup does not use a mutex because it is configured
differently.

FossilOrigin-Name: d4e7e2d82321c12fe471ed49098828bc0ef78543
2009-08-18 12:16:03 +00:00
drh 4c5514d76e Fix a bug in mem5.c which would cause an infinite loop on an attempt
to allocate more than 1073741824 bytes of contiguous memory.  Also, some
cleanup of mem5.c.  More work to do on this.

FossilOrigin-Name: 783b751a38f9f911c5ebdf738c255b7111978f76
2009-08-18 01:54:19 +00:00
dan 02fa469619 First version of sqlite_stat2 (schema forces exactly 10 samples).
FossilOrigin-Name: dd96bda2a85c1d94fb4a0bf5f27e2977f7f7e42e
2009-08-17 17:06:58 +00:00
drh adad77a6c6 Always call sqlite3_malloc() in sqlite3OsInit(), even when not compiled
with SQLITE_TEST.

FossilOrigin-Name: b98a8706a61ad27c881b6820eee10d06bfb27417
2009-08-17 16:01:11 +00:00
dan 3d6e060b48 Move error simulation code from the sqlite3_os_init() functions into a wrapper.
FossilOrigin-Name: 67ad21abf88abb7a3e2eacddcaf1ab5d54149807
2009-08-17 15:52:25 +00:00
shane 7c7c311da5 More documentation and comment updates for sqlite3_initialize/shutdown interface changes to handle failures.
FossilOrigin-Name: 32509bc7339cd6a46cea4c243e3418546860cb2d
2009-08-17 15:31:23 +00:00
dan e1ab219309 Add tests to check that sqlite recovers from an error in sqlite3_initialize() correctly.
FossilOrigin-Name: 904a371c6c9d3f20332b37767b06161fa0a78113
2009-08-17 15:16:19 +00:00
drh 9ac06509f1 Enhanced documentation and minor code tweaks in preparation for hardening
the sqlite3_initialize/shutdown interfaces against initialization failures.

FossilOrigin-Name: 98c49e6135ae6268a80de88f8b0284f88ef32e1d
2009-08-17 13:42:29 +00:00
dan d768f944d9 Add a test to verify that 3.6.17 releases read-locks obtained to read the database schema even if the connection is not currently in auto-commit mode.
FossilOrigin-Name: 78dfe8321db9debfcd4a7f3daf4223d0cbf23ab9
2009-08-17 09:29:09 +00:00
drh d9c50f7fed Update the amalgamation builder so that it avoids putting redundant
SQLITE_API macros on declarations.

FossilOrigin-Name: 0d5b058717858c9cda8ca120a3d814453a94a0e6
2009-08-14 18:18:03 +00:00
drh e74871ac06 Work around an over-zealous optimization in GCC 4.3.3. See
CVSTrac ticket #4027.

FossilOrigin-Name: 9cbe3654055a78c09ea1ecd5dc599bcd888b57e3
2009-08-14 17:53:39 +00:00
dan 4361e79f14 Fix a case where SQLite may write past the end of a buffer as a result of a corrupted database file.
FossilOrigin-Name: 43321a556031942389ca11b033c1eae46ac6141b
2009-08-14 17:01:22 +00:00
drh 04616bb703 Fix to the "publish.sh" script that was broken by the previous check-in.
FossilOrigin-Name: 34c21210eb03bd1230cde5d08039a8a656f35674
2009-08-14 16:15:17 +00:00
drh 47baebc2a6 Incorporate fossil-scm version information into the build. Add the
SQLITE_SOURCE_ID macro to the header.  Add the sqlite3_sourceid() interface.
Add the sqlite_source_id() SQL function.

FossilOrigin-Name: 302dabe98f50b472bccd65c58504bc8a330049c4
2009-08-14 16:01:24 +00:00
drh 9e42f8ac1a Fix typos in comments used to generate documentation.
CVSTrac tickets #4028 and #4029.

FossilOrigin-Name: 1fc73b9146ee8844c73fc6a545cd0c98ac4d472b
2009-08-13 20:15:29 +00:00
drh c4fa5315a5 Tweak to the new whereB.test file to make it more consistent.
FossilOrigin-Name: 06098505fca5c67b627a9e1102451f93e490e192
2009-08-13 19:54:26 +00:00
dan 69f8bb9c72 If a binary operator in a WHERE clause that should be performed with no affinity conversions applied to its operands (see http://www.sqlite.org/datatype3.html) is optimized by index lookup, do not apply any conversions to the key value before looking it up in the index. Fix for 93fb9f89d6.
FossilOrigin-Name: e72186f2d68d28c2e0c32894f9adb28c155b5f63
2009-08-13 19:21:16 +00:00
drh 320b3a7a3a Enhancements to the whereB.test to check more affinity corner cases.
FossilOrigin-Name: 1048459824746307c9e4296cbc21716bf8b5449d
2009-08-13 18:14:32 +00:00
drh 9fa7207b1b Add a test case for the affinity problem reported by ticket [93fb9f89d6].
FossilOrigin-Name: 149ec24e61437fac2b0dd6239276d3aa543c56cb
2009-08-13 17:14:59 +00:00
drh 3da9a940b7 Merge the accidental fork.
FossilOrigin-Name: 86a06dd0494c2fe83d4fde517557600956cedd9e
2009-08-13 15:42:52 +00:00
drh 97e35a9378 Fix a typo on a comment in sqlite3VdbeIntegerAffinity().
FossilOrigin-Name: b5a709d3609d40a6e5ef77f9889077d7395d3d26
2009-08-13 15:13:52 +00:00
dan 5236ac1d04 Changes to the query planner that improve the order in which tables/indexes are scanned in join queries.
FossilOrigin-Name: 19f799b32f9d1be25d4185ce18b13f4dd502e199
2009-08-13 07:09:33 +00:00
shane d87873d19b Fixed some compiler warnings in WINCE only sections when using the MSVC compiler.
FossilOrigin-Name: 1f0a93e17d6291268da909699ce1a5a7619ae637
2009-08-12 15:34:02 +00:00
drh 2210dcc60d Make sure the large-file support macros occur first in sqliteInt.h.
Fix for CVSTrac ticket #4022.

FossilOrigin-Name: b0848925babde5241aefe0a117ebb10299c94a15
2009-08-12 11:45:40 +00:00
danielk1977 2d04deb21d Instead of adding SQLITE_API macros sqlite3.h while creating sqlite3.c, add them as part of generating the sqlite3.h target, while copying from sqlite.h.in to sqlite3.h. This fixes a build problem that was causing multiple SQLITE_API macros to be added to a single line of sqlite3.h, and the problem cited by #4016. (CVS 6971)
FossilOrigin-Name: 7f4810747b0864981f27edbd504bfab2efea1e3c
2009-08-11 05:50:36 +00:00
drh 1a5c00f8ce Reduce the maximum supported sector size to 64KiB. (CVS 6970)
FossilOrigin-Name: 8e1e0ba292150f8968e5295e8ba9cd7360b6a64b
2009-08-10 17:48:57 +00:00
drh 50a595200d Version 3.6.17 (CVS 6969)
FossilOrigin-Name: 36650102285ef9663853cacd5daf8dd6d7cf418f
2009-08-10 15:16:26 +00:00
danielk1977 8f00a826ca Update a couple of tests in corrupt7.test to account for a change in the error message text emitted by SQLite. (CVS 6968)
FossilOrigin-Name: 3172a296926c6b50af5b6edfe38013056e155fa0
2009-08-10 10:18:07 +00:00
danielk1977 c551288256 Exclude a static function in test1.c from the build when OMIT_DEPRECATED is defined. This avoids a compiler warning that occurs with some compilers. (CVS 6967)
FossilOrigin-Name: ace499506e3c7a315f66928d8a98de255491b2b9
2009-08-10 04:37:49 +00:00
danielk1977 f77a367db4 Change mallocI.test to close a database connection that was being left open. (CVS 6966)
FossilOrigin-Name: 4f0096d7ef43f4b9f32c4d78b3dfe34271f2120a
2009-08-10 04:26:39 +00:00
shane 5eff7cf0c9 Removed some warnings from the MSVC compile. (CVS 6965)
FossilOrigin-Name: ee034cfc71425745dda8d5fee58ae95f937c86cd
2009-08-10 03:57:58 +00:00
shane 1987c8d4c3 Fixed "Interlocked" logic error that prevented the "static" mutexes from being released when sqlite3_shutdown() is called. Ticket #4011. (CVS 6964)
FossilOrigin-Name: 04cafb7ee3b67a68c0604d7f1143feaec44be610
2009-08-10 03:23:21 +00:00
drh eeb844a7f1 Suppress various compiler warnings. (CVS 6963)
FossilOrigin-Name: 257e9b575029f63277ed602d1402f87cfa15d22e
2009-08-08 18:01:07 +00:00
danielk1977 410b6bb578 Enhancement to (6844). If sqlite3_exec() is to return SQLITE_NOMEM because it fails to allocate space for an error message, set the database error-code to SQLITE_NOMEM too. (CVS 6962)
FossilOrigin-Name: 8293fa19c02abe0e2a7594b9bceac28929de8fdf
2009-08-07 16:55:59 +00:00
danielk1977 9af00021a1 Mark the rtreeUpdate function as static. (CVS 6961)
FossilOrigin-Name: b6bdfdc69df4fc6cad669fd8b2cbaa9ecb95cb78
2009-08-06 18:36:47 +00:00
drh 3d5f74b275 Alternative fix for ticket #3810. This is a replacement for check-in (6956). (CVS 6960)
FossilOrigin-Name: ba1afc040171810d0c996708d7b9cb11abcd99d8
2009-08-06 17:43:31 +00:00
drh e33b0ed3b7 Change a hyperlink label on shared cache mode documentation. No changes
to code. (CVS 6959)

FossilOrigin-Name: 3d08ca0e54dd4c292b3db3a8364ab237713c5c43
2009-08-06 17:40:45 +00:00
shane 338ea3c140 Simplified conditional for read-only lock in winceLockFile() function. Ticket #3991. (CVS 6958)
FossilOrigin-Name: a1c184cd2ac5a7559d787e6c34b1d0ce034d10cf
2009-08-05 04:08:29 +00:00
drh b4bc2b7a07 Make sure all database connections are closed at the end of the test case
for ticket #3810. (CVS 6957)

FossilOrigin-Name: 9bca5a0e8f22da6be41b0eda298fd2e19f64e8b6
2009-08-01 18:22:30 +00:00
drh 35ccb3d3bc Return a better error message when problems are encountered parsing a
TEMP trigger or TEMP view that references objects in other databases that
have been modified or dropped.  Ticket #3810. (CVS 6956)

FossilOrigin-Name: 102785b9fbc5ab5dd740110243f080e3f3661e87
2009-08-01 16:27:00 +00:00
drh a0e0d8ea98 Add a testcase for ticket #3810. (CVS 6955)
FossilOrigin-Name: 29972f7445cede64d99c2433742572120c92b393
2009-08-01 15:54:25 +00:00
drh 38210ac500 Fix a segfault following OOM that was introduced by check-in (6949) which
was a fix for ticket #3997. (CVS 6954)

FossilOrigin-Name: 359d78e144c2399791d341eda1760eb486f9740a
2009-08-01 15:09:58 +00:00
drh a147a9ea37 Increment the version number in preparation for the next release. (CVS 6953)
FossilOrigin-Name: 12d9b87316cf072d8071fb43ca1232d36720bbca
2009-08-01 15:04:19 +00:00
danielk1977 f51d1bd665 Fix a bug in where.c that could cause SQLite to write to freed memory while compiling a query with many terms in the WHERE clause. (CVS 6952)
FossilOrigin-Name: 8161af840e8fd2b06457e75023f934e1b8fe5fd6
2009-07-31 06:14:51 +00:00
danielk1977 1a4eaf0be2 Add a test to mallocI.test to show that a shared lock is correctly released if an OOM condition occurs while parsing a database schema. (CVS 6951)
FossilOrigin-Name: 5a82620efa1298530760e69e4e34d446a30233b8
2009-07-29 06:04:56 +00:00
danielk1977 ee0484c1b5 Add the experimental API sqlite3_strnicmp(). Modify fts3 so that in terms like 'column_name:token' the column_name is interpreted in a case-insenstive fashion. Ticket #3996. (CVS 6950)
FossilOrigin-Name: 4571aa9e9142db465ae8250b0adf27e0a094331a
2009-07-28 16:44:26 +00:00
danielk1977 0a458e5e2f When flattening a SELECT query, do not discard collation sequences explicitly attached to expressions in the parent query. Fix for #3997. (CVS 6949)
FossilOrigin-Name: b2784cf5d8b520fb714efdb2d2746b2c88b56edf
2009-07-28 13:30:30 +00:00
shane 3190f4b5f1 Fixed reversed labels in WHERETRACE() statement. Debugging code only. (CVS 6948)
FossilOrigin-Name: 614a8d83158eb59e3fbe78d62461635bfcc13525
2009-07-28 08:43:09 +00:00
danielk1977 ded6d0f1a9 If there is a hot-journal in the file-system, a connection with journal_mode=memory set may have to open it to effect rollback. Account for this in pager_end_transaction(). This prevents an assert from failing in the in-memory journal permutation test. (CVS 6947)
FossilOrigin-Name: 224bc69a04f4fe6d1004125847761b7842c2bfe0
2009-07-27 14:15:44 +00:00
danielk1977 b5a1920816 Do not simulate OOM conditions in the sqlite3OsXXX() calls if the underlying file is an in-memory journal file. (CVS 6946)
FossilOrigin-Name: d486811715350f315374cc41f3d808a75d140afb
2009-07-27 11:41:20 +00:00
danielk1977 c7538b5f63 When extracting values from a record to use in an UPDATEd version of that record, apply OP_RealAffinity if required. Fix for #3992. (CVS 6945)
FossilOrigin-Name: 3616766a6f5c8179cc55444c29ecf29cc69f88ce
2009-07-27 10:05:04 +00:00
drh a53c704fec The noReadlock property on a pager object implies the readOnly property.
Use this fact to simplify the logic in sqlite3PagerSharedLock(). (CVS 6944)

FossilOrigin-Name: 886e665f6cf780464b280c286b03c9fb5c1a6b2a
2009-07-25 22:13:34 +00:00
drh f31506b7b7 Remove obsolete assert and testcase macros related to ticket #2565 (CVS 6943)
FossilOrigin-Name: f0024b3189245d608a0cb57fa7e472c6daa1406f
2009-07-25 19:31:31 +00:00
drh bdd7191cc6 Adjust memory size computations to avoid a conditional that is always
false on 64-bit systems. (CVS 6942)

FossilOrigin-Name: 04211e6af9cdd3e7f19b458c72b722f8f8584245
2009-07-25 17:42:21 +00:00
danielk1977 c7ca875ec9 Change an unreachable condition in PagerSharedLock to a NEVER(...). Add an assert to pager_error() to show that it is never called to put an in-memory pager to the error-state. (CVS 6941)
FossilOrigin-Name: 1d931f77519baf3586708c77cbd161c0e75bcbaf
2009-07-25 17:39:13 +00:00
drh 7ee27b07c3 Change a condition to a '%' operator in bitvec.c. (CVS 6940)
FossilOrigin-Name: 10250fe5c039dbef2e1614e6320f7bd354c10211
2009-07-25 17:33:25 +00:00
drh b75d570ef8 More simplifications to pager.c. (CVS 6939)
FossilOrigin-Name: 533d6cc67a3b6467db5b83c5ca535d229d36ad27
2009-07-25 17:08:35 +00:00
drh 5e1fa03dca Simplifications and comment improvements to pager.c in support of coverage
testing. (CVS 6938)

FossilOrigin-Name: 5b70b5c19cd587a8afbf2909ac7a4c04aea20f44
2009-07-25 15:24:13 +00:00
drh 0b0abe45ca Add a NEVER() on an always-false conditional in pager.c.
Make sure the text of the master journal file is zero-terminated before
trying to process it - to prevent a buffer overrun in strlen(). (CVS 6937)

FossilOrigin-Name: cc9430e334fe98e1c35d408f81a2d8953377cda6
2009-07-25 14:18:57 +00:00
danielk1977 8c924fe002 Remove the "proc zeroblob" implementation from incrvacuum2.test. It is no longer required as of (6906) and, as #3988 points out, unreliable. (CVS 6936)
FossilOrigin-Name: 03153831635342a744ee42f14cb041499cdece2a
2009-07-25 13:42:50 +00:00
danielk1977 750e87df2e Add files that should have gone in with the previous checkin. (CVS 6935)
FossilOrigin-Name: 64c7afc704e95e13fb3315be402525d277a0d8d8
2009-07-25 11:46:48 +00:00
danielk1977 9f0b6be85c Add a complex assert() that checks a pager invariant. (CVS 6934)
FossilOrigin-Name: 2e08ad7bf629485a79ccebcf4c413e9dcc0d3ccf
2009-07-25 11:40:07 +00:00
drh 8a938f9808 Add assert() statements to more tightly constrain the state of pager.c.
Remove the three pager*.test scripts since they violate the constraints
asserted above by modifying the state of the system in ways that it cannot
be modified in a live system. (CVS 6933)

FossilOrigin-Name: 3b6d370ed68eaf9636b26c7240a8b3a43d2edd70
2009-07-25 04:12:02 +00:00
drh d4e5cd05a4 Remove two more overzealous assert() statements. (CVS 6932)
FossilOrigin-Name: 788aa9dde9e76f67f22c07a904faf03e97e032c6
2009-07-25 00:13:58 +00:00
drh 16ff1700a9 Remove an overzealous assert() from pager.c. (CVS 6931)
FossilOrigin-Name: 4a924b475aa0f7f2f69caed0adc2e60d29c47f21
2009-07-25 00:10:45 +00:00
drh d05c223c2e Fix an issue with the previous check-in, (6929). (CVS 6930)
FossilOrigin-Name: e5165c80abfdba0ad74e1042e4c94fe00d4b3308
2009-07-24 21:23:15 +00:00
drh 4775ecd06a Further simplifications to pager.c in support of structural coverage testing. (CVS 6929)
FossilOrigin-Name: 866216c0b6ba23b66483046fb402ddbe4f9a7b14
2009-07-24 19:01:19 +00:00
danielk1977 595a523a10 Allow virtual tables to be used in shared-cache mode. (CVS 6928)
FossilOrigin-Name: 5d9e767a05e381235e064061043e30cc03a11a07
2009-07-24 17:58:53 +00:00
drh ad7516c45f Simplifications to pager.c in support of structural coverage testing. (CVS 6927)
FossilOrigin-Name: 7222ad2667b95d6021d9ae47f548b76b224f46aa
2009-07-24 16:32:00 +00:00
drh b480dc2393 Simplifications and comment improvements in pager.c. (CVS 6926)
FossilOrigin-Name: 2d2f42ca0a24ed8b33f9ad560c76a6c1301c757b
2009-07-24 12:35:57 +00:00
drh e39f2f9326 Simplifications and comment enhancements on btree.c. (CVS 6925)
FossilOrigin-Name: 5ba880dde8a219543ced6f792c7f9ecdcd8c1cbb
2009-07-23 01:43:59 +00:00
danielk1977 440637eb46 Modify mksqlite3c.tcl so that it inserts SQLITE_API macros into sqlite3.h. Ticket #3983. (CVS 6924)
FossilOrigin-Name: 803ec79f3b05fdd680f9ab762685bbd50a087b9b
2009-07-22 18:24:53 +00:00
drh 5d1a872ab6 Simplifications to btree.c in support of coverage testing. (CVS 6923)
FossilOrigin-Name: 375fd6f9c54fa5aa8cfae30845c7bfc0ec49e8fa
2009-07-22 18:07:40 +00:00
danielk1977 e878a2f41b Avoid leaving a suspect page in the page-cache if an error occurs during sqlite3PagerAcquire(). (CVS 6922)
FossilOrigin-Name: 2594f01c73301f9432be9d007a079a19a3d383f9
2009-07-22 16:41:15 +00:00
danielk1977 146ba99061 Fix a double-free that can occur after database corruption is detected. (CVS 6921)
FossilOrigin-Name: 5260e8b1048af2e00d49706466d9aded90c24ed2
2009-07-22 14:08:13 +00:00
drh fe6212d549 Add a NEVER() macro around a pager.c conditional that must always be false
in the current implementation. (CVS 6920)

FossilOrigin-Name: 1e510d7fc5cc47fe2714dbb1ed3ea7e90acbff7b
2009-07-22 13:19:20 +00:00
danielk1977 257d9dc748 Changes to test code (only) to allow veryquick.test to run with OMIT_UTF16 builsd. Ticket #3985. (CVS 6919)
FossilOrigin-Name: 7f3fc7f20f6dc205eedbe445e35f5071f1c01185
2009-07-22 07:27:56 +00:00
drh 6e2ef43197 Remove an ALWAYS() from a condition that can in fact be false under very
obscure circumstances. (CVS 6918)

FossilOrigin-Name: 38083228956ac05df45f44447ab39c64852239d2
2009-07-22 02:02:39 +00:00
drh ea8ffdfec7 Further simplifications to btree.c, especially the sqlite3BtreeKey() and
sqlite3BtreeData() functions.  New assert() statements added to verify
that these routines are called correctly. (CVS 6917)

FossilOrigin-Name: 96cfd079528501f6f1e658ce8a5a4e3bdea729be
2009-07-22 00:35:23 +00:00
danielk1977 89bc4bc645 Change getAndInitPage() (btree.c) to use only PagerAcquire(), not PagerLookup() and PagerAcquire(). (CVS 6916)
FossilOrigin-Name: 0b41dfc066b60ccabbf1a9ab4db41ebcb73a2799
2009-07-21 19:25:24 +00:00
drh fe3313f9b1 Additional simplifications to btree.c in support of coverage testing. (CVS 6915)
FossilOrigin-Name: 716fccea58c4c217e68e04e0776e44ae39c11950
2009-07-21 19:02:20 +00:00
drh fd5f02f0c6 Remove an assert() in btree.c which is no longer true due to changes in
the error reporting behavior of ptrmapPut(). (CVS 6914)

FossilOrigin-Name: 110998f18a7ad1ddaffab048cabef675d882cbb8
2009-07-21 15:33:14 +00:00
drh c314dc7996 Changes to btree.c in support of coverage testing. (CVS 6913)
FossilOrigin-Name: 4cf23e9e860bd6245344884ec84f487fdf36f86f
2009-07-21 11:52:34 +00:00
drh cd09c53d7f Reverse the order of two conditionals in a test in order to achieve coverage
of them both.  Also: clarifications to comments in btree.c. (CVS 6912)

FossilOrigin-Name: a159e9d24708dfe6c5a98d220e39f3b1b2a3d281
2009-07-20 19:30:00 +00:00
drh 98add2ed74 Modify various routines inside btree.c to take a pointer to the return-code
as a parameter and to no-op if the return-code storage location already
contains a non-zero code. (CVS 6911)

FossilOrigin-Name: 7dcf2a78727ce448d9d26bd6e2e23b553456ec54
2009-07-20 17:11:49 +00:00
drh 5dea3158fc Use an ALWAYS() on a conditional in btmutex.c that is always true. (CVS 6910)
FossilOrigin-Name: 609022caff12c010575e704be550da6f52226d33
2009-07-20 12:33:32 +00:00
drh 8de5a17e47 Corrections to the comment that is inserted at the top of the amalgamation.
Ticket #3981. (CVS 6909)

FossilOrigin-Name: 7572991bc2232f57d04c972d516a3e8f85f34f14
2009-07-20 12:25:44 +00:00
drh dfc926410e Always provide a name for the TEMP database even if SQLite is compiled using
SQLITE_OMIT_TEMPDB. (CVS 6908)

FossilOrigin-Name: 0ba17c04834c0a44c8690169c0096c1d9cf325e4
2009-07-20 11:32:03 +00:00
drh 6aac11dc66 Code tweaks in support of full-coverage testing. (CVS 6907)
FossilOrigin-Name: 22c6dbfdce965e32f3df9aec28e46e714620c362
2009-07-18 20:01:37 +00:00
danielk1977 f16c62464d Add some code to sqlite3VdbeMemSetZeroBlob() so that it works (less efficiently) even when OMIT_INCRBLOB is defined. Ticket #3977. (CVS 6906)
FossilOrigin-Name: f5f7259d811ce8c2bf0bc64128256c4cd95f676a
2009-07-18 14:36:23 +00:00
danielk1977 5368f29ac4 When the asynchronous IO backend opens a file with the EXCLUSIVE flag set, make sure only a single file-descriptor is opened (not one for reading and one for writing). This change fixes #3978. (CVS 6905)
FossilOrigin-Name: 630e669b97a81f9125d4bdc18517738b74eecdec
2009-07-18 11:52:04 +00:00
danielk1977 627a3d6ab4 Changes to test scripts so that (make test) works when OMIT_INCRBLOB is defined. (CVS 6904)
FossilOrigin-Name: 1dd834a3d61496dfa138c36676a5fa6afaa4c817
2009-07-18 08:30:44 +00:00
danielk1977 e494817534 Fix a subtle problem that can occur when a transaction is automatically rolled back, and afterwards a VM that had opened a statement transaction within the abandoned transaction is finalized. Fixes an assert() that was failing in rtree3.test. (CVS 6903)
FossilOrigin-Name: 910df46e0f570cbffa9ff9b50d75632c091838b6
2009-07-17 17:25:43 +00:00
danielk1977 33c54a989e Return a meaningful error message if a keyword is used as an rtree table column name. Ticket #3970. (CVS 6902)
FossilOrigin-Name: 046efe46b50fbe928f39a0cda1b1006d486ce9f5
2009-07-17 16:54:48 +00:00
shane 9a8cee7f73 Skip all tests in tableapi.test if SQLITE_OMIT_GET_TABLE defined. Ticket #3975. (CVS 6901)
FossilOrigin-Name: 0219a543367638013ccd06295eeb9efc822e2dd1
2009-07-17 14:37:24 +00:00
drh f18a61dd59 Code simplifications in support of structural testing. (CVS 6900)
FossilOrigin-Name: fb1b955dda5105025ef199880afa871e44331d65
2009-07-17 11:44:07 +00:00
drh e64ca7ba11 Code simplifications and comment improvements in support of structural
coverage testing. (CVS 6899)

FossilOrigin-Name: 945251798144110787b197f9eb552a2dd4a25cb4
2009-07-16 18:21:17 +00:00
drh b5526ea67f Remove an unused variable from sqlite3ExprListDup(). Ticket #3973. (CVS 6898)
FossilOrigin-Name: 17c05aefd6c9e938a4cc5d3de348d8c8fdc9394d
2009-07-16 12:41:05 +00:00
drh e184965d7e Fix a potential database corruption following DROP TABLE when the pending
byte page corresponds to a ptrmap page.  This situation cannot happen in
a real deployment - but it still needs to be fixed. (CVS 6897)

FossilOrigin-Name: 6242db39f7f4ead5017bf684139d1f8312799f81
2009-07-15 18:15:22 +00:00
drh 4c301aaca8 Simplifications to btree.c in support of structural testing. Renamed the
"skip" field of the BtCursor object to "skipNext" to make it easier to
search for places where it is used. (CVS 6896)

FossilOrigin-Name: d3897235d77e48ad09f7edb0a7641458afa0a282
2009-07-15 17:25:45 +00:00
drh 2fa34d35c4 Remove an assert() from vdbeaux.c that might not be true if the database
file is corrupt. (CVS 6895)

FossilOrigin-Name: a42dc51e3bd258d5a357e557251fb2642708ceac
2009-07-15 16:30:50 +00:00
drh c046e3edeb Added the SQLITE_TESTCTRL_RESERVE option to sqlite3_test_control().
Simplifications to btree.c to facilitate structural coverage testing. (CVS 6894)

FossilOrigin-Name: cfbeda1b3126503e9631471ce4713e25b007859f
2009-07-15 11:26:44 +00:00
drh c27ae614dd Add comments and assert() statements to show that the return value from
sqlite3BtreeKeySize() and sqlite3BtreeData() usually do not matter.
Ticket #3968.  Also remove a NEVER() macro that can sometimes be true -
discovered while testing the previous change. (CVS 6893)

FossilOrigin-Name: 0c710c1be537127511d95b5b261c7bf26e1bc952
2009-07-14 18:35:44 +00:00
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
drh 53bc21b911 Add a version of the Lemon parser template "lempar.c" to the src/ subfolder.
This new parser template contains a couple of NEVER() macros that disable
tests that are needed for general grammars but not for the specific grammar
used by SQLite.  SQLite builds with the modified lempar.c. (CVS 6842)

FossilOrigin-Name: d426cc64f6014e2c2b9bcde0f5440396aec2fa18
2009-07-03 17:09:28 +00:00
danielk1977 e0d9e6f623 Simplify the way the read-uncommitted flag is handled to facilitate test coverage. (CVS 6841)
FossilOrigin-Name: e2112d6160a82ccd4b6a1c798d2064d0f1b086eb
2009-07-03 16:25:06 +00:00
drh b1819a0b95 Make explicit the restrictions on UPDATE, DELETE, and INSERT statement syntax
within triggers.  Ticket #3947. (CVS 6840)

FossilOrigin-Name: c8bf40df7be728b11bb633516d1988c6064a9d70
2009-07-03 15:37:27 +00:00
drh 06150f95e8 Test the result of pthread_create() and do not call pthread_join() if the
thread creation failed.  Ticket #3933. (CVS 6839)

FossilOrigin-Name: 304c5110ad958b2cc1ddff30e68c8791109128b5
2009-07-03 12:57:58 +00:00
danielk1977 34acdc9573 Fix to sqlite3AuthRead to accommodate "new" or "old" references that are used in a context where a column reference may also be used (i.e. "SELECT new.<col> FROM <tble>"). Ticket #3944. (CVS 6838)
FossilOrigin-Name: 45fd5419a7cde29eb6ab5d98141bd642af0d78fb
2009-07-02 18:40:34 +00:00
danielk1977 94b30733f7 When a b-tree transaction is committed when there are open cursors, downgrade shared-cache write-locks to read-locks instead of relinquishing all locks. Fix for #3942. (CVS 6837)
FossilOrigin-Name: 611e704fdf90a3d3932ca1cbab4be7e282bf1ddf
2009-07-02 17:21:57 +00:00
danielk1977 602b466e99 Cause opening a transaction on a sharable b-tree module automatically obtain a read-lock on page 1. This means there is no way for sqlite3BtreeGetMeta() to fail. (CVS 6836)
FossilOrigin-Name: e3c055f167f895ae45858de9d9d8a264df2f36b6
2009-07-02 07:47:33 +00:00
danielk1977 325ccfa90e Fix for compilation with OMIT_AUTOVACUUM defined. Ticket #3940. (CVS 6835)
FossilOrigin-Name: 8f0591ae98c2125a4922933496f4412aee8ab86e
2009-07-02 05:23:25 +00:00
danielk1977 8b32282795 Change to test code and scripts allowing memsys3 to be tested using a build that has both memsys3 and memsys5 enabled. (CVS 6834)
FossilOrigin-Name: a00aeec21cca7ccf19d4cdef618149aa2773c005
2009-07-01 18:09:01 +00:00
danielk1977 e25a50b6c3 Fix a 1-byte buffer overwrite that can occur when a virtual table overloads an SQL function. (CVS 6833)
FossilOrigin-Name: bfe336a8993e06e70d3c32a929202fb015dcbb89
2009-07-01 18:04:20 +00:00
danielk1977 bd1a0a4f61 Report an error if a USING or ON clause is specified following a from-list element that is not to the right of a join operator. Fix for #3846. (CVS 6832)
FossilOrigin-Name: 29b48972b65a17dab343b063a620cf8d456a923c
2009-07-01 16:12:07 +00:00
danielk1977 9b87d7b904 Do not ignore alias "a" in a query of the form "SELECT ... FROM (...) AS a" Fix for #3935. Also expand upon (6751) to fix some similar obscure memory leaks. (CVS 6831)
FossilOrigin-Name: 42f9d1e56483a59353bff57d75f09ed67e1d9c3c
2009-07-01 14:56:39 +00:00
danielk1977 96d48e963a Cause incremental-blob read/write operations lock shared-cache tables in the same way as normal SQL read/writes. Add complex assert statements to make sure tehe correct shared-cache locks are held when accessing the database. Eliminate some redundant checks from btree.c. (CVS 6830)
FossilOrigin-Name: f17ef37897da9bcaf20b5acdce6840522c0a0b16
2009-06-29 06:00:37 +00:00
drh 1b1166b7c7 Version 3.6.16 (CVS 6829)
FossilOrigin-Name: ff691a6b2a302fe7978459cb8df9d56184892ee0
2009-06-27 14:10:30 +00:00
drh bdfb6b5ab2 Fix an instance where sqlite3JumpHere() might be called with a negative
address following an OOM fault. (CVS 6828)

FossilOrigin-Name: 49f22e55d69d0b5a34400b36332a2eb861362eb2
2009-06-27 11:17:35 +00:00
drh b6063cf823 Fix a bug in sqlite3_realloc() - if called with a size of more than
2147483392 it returns 0 but it also releases the prior allocation. (CVS 6827)

FossilOrigin-Name: 653df0afcc58de82c8c1b5f6a7b2f4829ff69792
2009-06-27 00:48:33 +00:00
drh e08ed7e71b Remove incorrect NEVER() macros from malloc.c. The allocations can be
exceeded using sqlite3_malloc() and sqlite3_realloc(). (CVS 6826)

FossilOrigin-Name: 0d345e5923ff92a87195f6c04a29a56bf67ee43c
2009-06-26 18:35:16 +00:00
shane 36840fdddb Removed a few compiler warnings under MSVC. (CVS 6825)
FossilOrigin-Name: f01a9fc375d77c67602a9f6be6a674beb516233f
2009-06-26 16:32:13 +00:00
drh 9ed7a9953e Remove the priorNewRowid field from the sqlite3 structure. Use the
last_insert_rowid as the initial value when searching for a new random
rowid in the OP_NewRowid opcode. (CVS 6824)

FossilOrigin-Name: 96729b2d499f029bfaec6648a592e8ec697d9521
2009-06-26 15:14:55 +00:00
shane 389ae2c52d Skip a couple tests requiring working 64bit int support on platforms without that support. Test code change only. (CVS 6823)
FossilOrigin-Name: d8c8145c9d28d014eb9218b3f1312b957ccc72b7
2009-06-26 14:17:47 +00:00
drh c42ed16e5c When sqlite3VdbeAddOp() fails due to an OOM fault, return an address of 1
rather than zero so that there appears to always be a prior instruction.
This prevents a negative jump-to address computation in where.c following
an OOM fault. (CVS 6822)

FossilOrigin-Name: fe02339cb2f61c1e8a356e2d0ce9c3aef6e6cd8d
2009-06-26 14:04:51 +00:00
danielk1977 31559aee71 Fix a test script problem in exclusive.test. (CVS 6821)
FossilOrigin-Name: a52ef5a4216f26c617bd1471cd19f3da2a6d2c4c
2009-06-26 12:30:39 +00:00
drh 7b746030bc Fix the new pager.c changes so that they compile with IOTRACE defined.
Fix an out-of-order variable definition in vdbeaux.c. (CVS 6820)

FossilOrigin-Name: ac1450285025e33fad81e2fb14a06eb85e8ed87a
2009-06-26 12:15:22 +00:00
danielk1977 8ca8255325 Another change to test_journal.c to account for (6817). Again, only test code has changed. (CVS 6819)
FossilOrigin-Name: 58884b6c50f927c5606d857b2865d788a5147060
2009-06-26 10:39:36 +00:00
danielk1977 8f398adbb7 Update test_journal.c to account for (6817). Changes to test code only. (CVS 6818)
FossilOrigin-Name: 542ee8cced2a37095808d8baf5002dc66f4a64d6
2009-06-26 09:01:28 +00:00
danielk1977 6f4c73eedb Avoid writing the 8-byte journal-header magic until the journal-header is synced. In persistent journal-mode, this prevents any old content that follows an unsynced journal-header from being interpreted as part of the rollback journal. (CVS 6817)
FossilOrigin-Name: a5ecffcf025da2fcb241e83c7bebc1095a3b51d6
2009-06-26 07:12:06 +00:00
danielk1977 46aa38f2c0 Fix a problem with a return code being ignored in insertCell(). (CVS 6816)
FossilOrigin-Name: bb5f1c01435dcc1ea056f0d149f750fa7812f652
2009-06-25 16:11:05 +00:00
drh 9635cc7c0d Get the notify2.test running again by removing an ALWAYS() that was mistakenly
inserted and by taking care not to report corruption following an
SQLITE_LOCKED failure during schema parsing. (CVS 6815)

FossilOrigin-Name: 6e9140a729bd26dd102e603abf6ea16d67e8546e
2009-06-25 11:50:21 +00:00
danielk1977 c1761e887b Replace an "if" condition that is always true in btree.c with an assert(). (CVS 6814)
FossilOrigin-Name: daadbd9a8f0e35dd16c715cf2e9f99f52afa30dd
2009-06-25 09:40:03 +00:00
drh 4c8555fd47 Improved handling of oversize string and blob errors. Other simplifications
in support of full coverage testing. (CVS 6813)

FossilOrigin-Name: 8b34076668f0f712de0fbbe9bc2e68d42797e1b2
2009-06-25 01:47:11 +00:00
drh 46bbabd959 Remove an ALWAYS() macro from vdbe.c that sometimes fails on thread tests. (CVS 6812)
FossilOrigin-Name: 52eac078c7080519911599e19819cbec475de6d6
2009-06-24 13:16:03 +00:00
drh c3927537d8 Disable the new malloc-37 test when locking_mode==exclusive. The test
basically works, but sometimes reports "database is locked" instead of
"out of memory" and that messes up the error reporting. (CVS 6811)

FossilOrigin-Name: 3b8f9dec24d06865455a75587bbfc199c19c6215
2009-06-24 13:13:45 +00:00
drh bfff79f125 Remove a declaration of the sqlite3Assert() function that was deleted by the
previous check-in. (CVS 6810)

FossilOrigin-Name: ee20b6a23fa4a4ec4d3a2d0dcfcabff466f08246
2009-06-24 11:08:13 +00:00
drh 2de80f4c50 Remove the sqlite3Assert() function. The ALWAYS() and NEVER() macros call
assert() directly when compiled with SQLITE_DEBUG. (CVS 6809)

FossilOrigin-Name: d8fc373fef22311e1c6b5bce6d3e601217a69940
2009-06-24 10:26:32 +00:00
danielk1977 13bd99fa43 Simplify things by rolling the functionality of balance_shallower() into balance_nonroot(). (CVS 6808)
FossilOrigin-Name: 11750c6aee6aa05b2627ad9dfb2fbcdfe8944168
2009-06-24 05:40:34 +00:00
drh 0b9f50d8aa Enhance autoincrement so that it works with triggers that also do
autoincrement inserts, even multiple inserts into the same table.
Ticket #3928 (CVS 6807)

FossilOrigin-Name: 1330993de8eae7baeec24100216158063c9bdc19
2009-06-23 20:28:53 +00:00
danielk1977 1c3d2bf9cf Remove a condition from balance_nonroot() that is always true. (CVS 6806)
FossilOrigin-Name: c5dc80e6bdd18a5ada728c8d5c9403ac233f1c9a
2009-06-23 16:40:17 +00:00
danielk1977 cd581a7eff Call balance_shallower() from balance_nonroot() instead of from balance(). This simplifies coverage testing a bit. (CVS 6805)
FossilOrigin-Name: da9893e23caf89090c8b6563cb5f88d7dbf7c260
2009-06-23 15:43:39 +00:00
drh 5c91b64e0d Update the configure script for version 3.6.16 (CVS 6804)
FossilOrigin-Name: b614e554f7ebaef9cb1718b617e020e532568bbb
2009-06-23 14:39:52 +00:00
drh d40afea8bc Update the version number in preparation for the next release. (CVS 6803)
FossilOrigin-Name: 207c4a02ba4dd950948367c91b4a73209d62da41
2009-06-23 14:18:15 +00:00
drh 35f6b936ce Simplifications to vdbe.c to promote better test coverage. (CVS 6802)
FossilOrigin-Name: 3ffc93d762b64fd84f47c4b6d68ab56b69ea98a9
2009-06-23 14:15:04 +00:00
danielk1977 1c84ac596d Add a test to verify that #3929 is fixed. (CVS 6801)
FossilOrigin-Name: 16c1ae9bde895d39c4eaababbd1dbf9e3b9cb653
2009-06-23 11:53:09 +00:00
danielk1977 54109bb206 Fix a failing assert in btree.c. The same bug was causing a spurious SQLITE_CORRUPT return when compiled without SQLITE_DEBUG. (CVS 6800)
FossilOrigin-Name: 47ec8749470af7cab9f3ef15effce1a7ba79a654
2009-06-23 11:22:29 +00:00
drh 9a65f2cd7d Simplifications to vdbe.c and it service routines in support of coverage
testing. (CVS 6799)

FossilOrigin-Name: 308f2e61520ac7440700d93ca5bab4a844f2dc17
2009-06-22 19:05:40 +00:00
danielk1977 b980d2219f Remove a condition that is always true from btree.c. (CVS 6798)
FossilOrigin-Name: 3ec8b37a89fdb2436d312439715414fae2cd20a8
2009-06-22 18:03:51 +00:00
drh 27731d7c73 Make sure sqlite3BtreeCreateTable() returns an error code if the largest
rootpage field is invalid in auto_vacuum mode.  Update file-format comments
to describe all of the "meta" values. (CVS 6797)

FossilOrigin-Name: bda38f5e86db45234c2dbb0f8d1a81f6ff6d04e4
2009-06-22 12:05:10 +00:00
drh 653b82a516 More simplifications to vdbe.c. Remove a NEVER() from vdbe.c that is possible
after all. (CVS 6796)

FossilOrigin-Name: c8f009bd24cb4e4b5ce9fbfd8ab09921f19d41af
2009-06-22 11:10:47 +00:00
danielk1977 3582c8f7ae If an OOM error occurs just after obtaining a shared lock on the database file, release the lock before returning. (CVS 6795)
FossilOrigin-Name: 971a9650f66f079630489c34e40003eee97d1683
2009-06-22 05:43:24 +00:00
drh aa73609f92 Simplifications to vdbe.c in support of coverage testing. (CVS 6794)
FossilOrigin-Name: 16680f05bd169dfb1b4bf0eb082e69701f9b07ab
2009-06-22 00:55:30 +00:00
danielk1977 3a1bf71f95 When recovering from the error-state in pagerSharedLock(), do not search for a hot-journal in the file-system if the pager is configured to use an anonymous temp file as the journal. (CVS 6793)
FossilOrigin-Name: 4b46805cbc9fe71f1febe9ea5f0f5634b65128e3
2009-06-20 18:52:49 +00:00