Commit Graph

8389 Commits

Author SHA1 Message Date
dan
7e68423894 Fix a bug in pager.c causing it to omit the xSync() call required following a hot-journal rollback.
FossilOrigin-Name: 42ba43ac690dc800fb8b969ae257a79942918342
2010-08-10 15:46:06 +00:00
dan
c864912ad1 Add variable pager.dbHintSize, used to limit the number of calls made to the xFileControl(FCNTL_SIZE_HINT) method.
FossilOrigin-Name: eb3ac895bd92c880ac6acca58de8cf9643c2b5e4
2010-08-10 09:58:57 +00:00
dan
84612fec1c Changes to debugging code in mutex_unix.c and mutex_w32.c to make an assert() statement threadsafe.
FossilOrigin-Name: e82e32bd431ccacd276df8241592eb5519d87122
2010-08-10 07:12:26 +00:00
dan
de5fd22f3d Modify some comments in pager.c.
FossilOrigin-Name: 5662da6d4f648e5d07d7cbea6bbd92fa684c02c9
2010-08-09 19:17:29 +00:00
dan
5a26383ab7 Merge latest trunk changes with experimental branch.
FossilOrigin-Name: aecbd890327dc676d6c2366b07f3d2e636a4983e
2010-08-09 16:52:12 +00:00
dan
5198bead7a Fix a memory leak in test_journal.c causing tests to fail.
FossilOrigin-Name: f229487cccc7514b2663e8e6e04798702c9cfb10
2010-08-09 16:12:51 +00:00
drh
9b8d02727a Fix typos in comments. No functional changes to the code.
FossilOrigin-Name: 9cebaf2dca6dc35e489537fe7c55474e1029a98e
2010-08-09 15:44:21 +00:00
dan
ec561a351a Change to tcl test infrastructure so that --malloctrace=1 works when sizeof(int)!=sizeof(void*).
FossilOrigin-Name: c3e771b3cf685f4237a2516ee7111849bf0ffb3f
2010-08-09 14:47:50 +00:00
drh
f053d5b6c7 Fix two comment typos that were reported on the mailing list.
FossilOrigin-Name: 88bf9016277c133dfbf4f4b2be0c35c9fe9fabd6
2010-08-09 14:26:32 +00:00
dan
007820d65d Fix a problem causing the return code of an xSync call to be ignored in wal.c.
FossilOrigin-Name: f1b2b5f9c3a5561ea6108283ae08404106c3f8bc
2010-08-09 07:51:40 +00:00
dan
7a76197f40 In WAL mode, ignore any error returned by an xFileControl(FCNTL_SIZE_HINT) call. This matches the behaviour in rollback mode.
FossilOrigin-Name: 158a309737bd4cdc033cd504a6d0cc43c15b6e17
2010-08-09 07:07:37 +00:00
dan
73d66fdb22 Fix minor problems and update comments in pager.c.
FossilOrigin-Name: 92e456374b052aceff356d10317b5b94fcdeaa5c
2010-08-07 16:17:48 +00:00
dan
e5953ccdb2 Fix a problem wherein changing the journal-mode immediately after leaving exclusive-locking mode could lead to the database being unlocked without clearing the changeCountDone flag.
FossilOrigin-Name: 531abc808526d607768bf6f503268d4cc66ab169
2010-08-07 09:31:14 +00:00
dan
16f7720ede Add test case 'cgt_pager_1', intended for use with callgrind to detect performance regression in the pager module, to threadtest3.c.
FossilOrigin-Name: b5d46f1ea08db2b88d2205bc283b9262ad970b55
2010-08-07 05:15:22 +00:00
drh
c78db070a3 Remove all vestiges of ctype.h from FTS3.
FossilOrigin-Name: b8b465ed2c56b23b50334680a2a940885b1ac530
2010-08-06 19:00:12 +00:00
dan
85d14ed238 Further enhancements to comments in pager.c.
FossilOrigin-Name: 876162c7e036af1cb447409b685afc72c0061a32
2010-08-06 17:18:00 +00:00
dan
4f7b8d6260 Fix some problems with running test scripts with the inmemory_journal permutation.
FossilOrigin-Name: 7bd8ba084e75bcd5c744e1d4a1812df3a4d91887
2010-08-06 14:37:13 +00:00
dan
5db5640185 Merge trunk changes into experimental branch.
FossilOrigin-Name: aef6698c732f3f9e46986f53e63ca2bdf5f7d208
2010-08-06 13:53:09 +00:00
dan
cb79e5137c Do not run some tests in notify3.test with the inmemory_journal permutation. They do not pass as the tests assume that the database schema is not loaded until the first invocation of [db eval]. This is not true with the inmemory_journal permutation.
FossilOrigin-Name: 698fba826e40ce6414cf6c261441d68b174c1637
2010-08-06 13:50:07 +00:00
dan
de1ae34eed Further updates to comments in pager.c.
FossilOrigin-Name: 5f4c17a33fd442d66c1bf75af9b21954f6906897
2010-08-06 12:00:27 +00:00
dan
dc1106148a Modify test_journal.c to work with pre-allocated databases.
FossilOrigin-Name: 4894a5d21044b169f412fef095e689cb8a8575dc
2010-08-06 09:43:03 +00:00
dan
11f47a9b4e Fix a bug to do with deleting the journal file when exiting exclusive-locking mode.
FossilOrigin-Name: 6217b607f0cd60383c6cb4ab0fe9da008f611244
2010-08-06 06:54:47 +00:00
drh
3bb9b93f1f Change two automatic array variables into static constant arrays.
Update and reformat some comments for cleaner presentation.

FossilOrigin-Name: a7a15547cccb4aeb719aba19641f31390c316d8c
2010-08-06 02:10:00 +00:00
dan
54919f8238 Add comments describing UNKNOWN_LOCK to pager.c. Improve some other comments i the same file.
FossilOrigin-Name: 54eff6de9d8d87f33192c192ca91907c4c090988
2010-08-05 18:53:26 +00:00
dan
4557b92cdb Merge trunk changes with experimental branch.
FossilOrigin-Name: acd26b8b746980c344db017a0e96dbd92c89acdf
2010-08-05 16:22:49 +00:00
dan
5761dbe4a3 Catch an error code that was not being propagated back to the caller.
FossilOrigin-Name: 800f496929fb0d45d16c573c5dca0197ac922e2b
2010-08-05 16:08:26 +00:00
dan
4e004aa6b9 Fixes for error handling with temp databases. And for errors that occur within OS locking primitives.
FossilOrigin-Name: f99a902f9b3d0bf6f607c4ba641b4096fbbef5d5
2010-08-05 15:30:22 +00:00
drh
f6171e9bae Make the size of a Bitvec object 512 bytes on all platforms, instead of
having the size depend on the size of a pointer.  This makes testing easier.

FossilOrigin-Name: ca479f3de2927ccc05dc76d10e40c00b8e0c88d1
2010-08-05 11:56:01 +00:00
drh
b9b49bf36b Do not read the database file size on a SAVEPOINT rollback any more since
after checkin [65b8636ac6e5] the in-header-size field is always valid.

FossilOrigin-Name: fbe70e1106bcc5086ceb9d8f39cc39baf3643092
2010-08-05 03:21:39 +00:00
drh
aa0ba4345d Fix the query planner so that when it has a choice of full-scan tables to
move to the outer loop, it chooses the one that is likely to give the fewest
output rows.

FossilOrigin-Name: 309bbedf9648c750d7b8aedbc15d4fd68f846824
2010-08-05 02:52:32 +00:00
drh
5e377d90ed If the outer loop of a join must be a full table scan, make sure that an
incomplete ANALYZE does not trick the planner into use a table that might
be indexable in an inner loop.  Ticket [13f033c865f878]

FossilOrigin-Name: e7a714b52c45af096af74049826d32c647abfe3f
2010-08-04 21:17:16 +00:00
dan
431b0b4291 Fix some problems with error recovery introduced while reworking pager state.
FossilOrigin-Name: 77eaab6f77c53cc4f429b65dfcf287ad6084c2da
2010-08-04 19:14:22 +00:00
dan
59257dc615 When opening a write-transaction on a database file that has been appended to or truncated by a pre-3.7.0 client, update the database-size field in the database header. Fix for [51ae9cad31].
FossilOrigin-Name: 65b8636ac6e5d3e4502d4f576ddf9350d5df3022
2010-08-04 11:34:31 +00:00
dan
d5e0101be0 Merge trunk changes into experimental branch.
FossilOrigin-Name: 15368a9f8523d5fb611cd576080daed2cf2f1500
2010-08-03 18:29:04 +00:00
dan
a42c66bdfb Set the Pager.eState variable to PAGER_ERROR whenever the pager enters the error state.
FossilOrigin-Name: 4d384761d27425b71555f4f3262778277a955835
2010-08-03 18:18:41 +00:00
drh
a3e414cd48 Fix disabled implementation-mark comments in func.c.
FossilOrigin-Name: 57c0960038b8ce97f9d6665f15e7f6ec310c681f
2010-08-03 18:06:25 +00:00
dan
b22aa4a63d Add comments to clarify the purpose of the pager "error state".
FossilOrigin-Name: fde4c59782e98366792e1552fd122e7d80a277ff
2010-08-03 15:57:09 +00:00
drh
6dc8490232 Fix the REPLACE conflict resolution so that it falls back to ABORT when
a CHECK constraint fails.  Ticket [c38baa3d969eab794].

FossilOrigin-Name: 4e157b774764b8bafc9fabb88decf54f178b5ff5
2010-08-03 13:08:54 +00:00
dan
937ac9da38 Add state diagram to comments in experimental version of pager.c.
FossilOrigin-Name: 16dcf5a6d3ebff9a734705693b5ac740f4ff2cc1
2010-08-03 12:48:45 +00:00
dan
763afe62e1 Incremental checkin on pager state refactoring.
FossilOrigin-Name: 0a636798bdb6961a47327091715b254f79add823
2010-08-03 06:42:39 +00:00
dan
d08640871c Experimental refactoring of the Pager object state.
FossilOrigin-Name: 03a240514aa07a22db787d221641253f23933e88
2010-08-02 14:32:52 +00:00
drh
9e5f10743d Modify wal2.test to disable tests requiring TCL 8.5 if the test harness is
compiled using TCL 8.4.

FossilOrigin-Name: 016486c7d544dcf9b7422cb0fb9804aa1c418f68
2010-08-02 10:59:13 +00:00
dan
a550f2decd In shared-cache mode, do not allow one connection to checkpoint a database while a second connection is reading or writing the same shared-cache.
FossilOrigin-Name: e75b52d156905ce16bedb94f65c01a4640bdfa75
2010-08-02 10:47:05 +00:00
drh
1c320a4366 Fix a typo in an error message of the TCL interface.
FossilOrigin-Name: 8eadd7b87bfe8786e0352ca14b29d1451998c02c
2010-08-01 22:41:32 +00:00
drh
be0b237e6a If a database becomes corrupted such that an index is out of sync with its
table, make sure the corruption is detected and reported back.  Do not assume
that indices always contain rowids for valid table rows.

FossilOrigin-Name: 83395a3d24f18170fc068d9e644291678694c3f0
2010-07-30 18:40:55 +00:00
drh
a3388cc5b0 Fix typos in comments. No code or logic changes.
FossilOrigin-Name: 15c294ca051ed8b5078e7ac9a969b0f9358d9184
2010-07-30 16:54:25 +00:00
drh
1e8ed64ed0 Remove a test from sqlite3PagerCommitPhaseOne which is now always true
after the multi-file transaction fix.

FossilOrigin-Name: 6758f6a8ec97941e09847b309812b3194eb57f19
2010-07-30 16:44:29 +00:00
dan
51133eaefa Remove variable Pager.needSync, which was almost completely unused.
FossilOrigin-Name: 347f22a5b777af92873590a5b9af5a6498bef918
2010-07-30 15:43:13 +00:00
dan
6037b92a4e Merge trunk changes into experimental again.
FossilOrigin-Name: 87e0f4e184284bf775c2fc7c4e9a334f4f237c59
2010-07-30 14:39:13 +00:00
dan
1e01cf1b84 Changes to the comments describing the Pager.setMaster variable in pager.c. Add an assert() statement to verify that two master journal pointers are not written to a single journal file.
FossilOrigin-Name: ad78ccacb00e2f8a5ca93e2c9006266d9477fe48
2010-07-30 11:31:12 +00:00
drh
abfb62f9bd Cherry-pick the multi-file transaction fix for ticket [f3e5abed55] out of
the experimental branch.

FossilOrigin-Name: 40f7f0a583e6bba66cd006253a0ef4623ea74f17
2010-07-30 11:20:35 +00:00
dan
2554ea7b0b Add the test cases for bug [f3e5abed55].
FossilOrigin-Name: cbbaf8e67a23dc332ce935bc7234246eacba60bf
2010-07-30 10:09:12 +00:00
dan
eb9444a4b3 Make sure a connection has an exclusive lock on all database files involved in a multi-file transaction before writing the master-journal pointer into any journal files. Fix for [f3e5abed55].
FossilOrigin-Name: 50c0f2202d21bbf6b593d75fd20f13c0fac23eff
2010-07-30 10:02:24 +00:00
dan
4d9c1b7fc4 Merge further trunk changes into experimental branch.
FossilOrigin-Name: fb847d70407b0f0e548919b7554f62bc1dab8a6c
2010-07-30 07:26:51 +00:00
dan
3843a4c19a Add tests to check that the ICU regexp() function can only be called with exactly two arguments.
FossilOrigin-Name: 451d965742cc219db709939b4ba1da2f2343dbce
2010-07-30 05:06:05 +00:00
drh
60176fa925 Updates to the README.txt file for ICU.
FossilOrigin-Name: d37443d33388b402e610a00c362a1e2e79548801
2010-07-30 00:31:08 +00:00
drh
0cf68a9b17 Unconditionally include the pTmpSpace size in the estimate of the pager
memory used.

FossilOrigin-Name: 4b97f8640e9167cd355a24836fe74e4224cf12b9
2010-07-29 10:13:25 +00:00
drh
df0db0feb5 Change the profile timer units back to nanoseconds and update the
sqlite3_profile() documentation.
Ticket [c43940c49b74c70a69]

FossilOrigin-Name: 7783b98a938b77d6b8e4e85b32b05452c47fbe4b
2010-07-29 10:07:21 +00:00
drh
6cbda64d07 Correct handling of compound foreign key constraints that include the
integer primary key as one of the columns.  
Ticket [ce7c133ea6cc9ccdc1]

FossilOrigin-Name: 53902f7d4a46aa70ecc5bf180a01ff888d52686a
2010-07-29 01:50:38 +00:00
drh
078e4084e9 Get SQLITE_OMIT_VIRTUALTABLE working again after being broken by recent
changes.

FossilOrigin-Name: 33b1e862ffa7109480cf4a77ceae8aebe98d3eee
2010-07-28 19:17:51 +00:00
drh
60a311785f Fix the dbstatus.test script so that it works correctly on 64-bit machines.
FossilOrigin-Name: a3401d9ee540828f3efd26d89f6b771e0ecb2777
2010-07-28 18:51:26 +00:00
dan
76d5918243 Merge trunk changes into experimental branch.
FossilOrigin-Name: aa81900153a2762cb2ad41e6710c1f1e7dc8b41e
2010-07-28 18:35:50 +00:00
drh
233f816b84 Improve the accuracy of the Pager heap usage estimate.
FossilOrigin-Name: ae89777e7f8bae2cdd3407395ea84c1b39577c4b
2010-07-28 17:36:11 +00:00
drh
abc97a7834 Adjust the shell test script "shell4.test" to account for changes in the
".stat on" display format from the previous checkin.

FossilOrigin-Name: 2f2fa7dd809ae2a67048643da8c01a4664848ba7
2010-07-28 17:16:41 +00:00
drh
29dfbe3b70 Record the pcache allocation size statistics even for pcache overflow
allocations.  Adjust the wording on one of the stat output lines in
the shell.

FossilOrigin-Name: f9adf66ad575abbb63736caef27bd3c619e516a6
2010-07-28 17:01:24 +00:00
shaneh
642d8b87fe Modify CLI to optionally display "stats".
FossilOrigin-Name: 419ce0ed89d10252492b2926817259899ee74e71
2010-07-28 16:05:34 +00:00
drh
39539804c6 Lookaside memory is not used to store schemas. Change the
SQLITE_DBSATUS_SCHEMA_USED documentation to reflect this fact.

FossilOrigin-Name: 07abfd5268564c18afd1074c2069d65c64f4b8eb
2010-07-28 15:52:09 +00:00
drh
154a319213 Add documentation for the SQLITE_STATUS_MALLOC_COUNT parameter to
sqlite3_status().

FossilOrigin-Name: dbfbdb60c00b5aeae29c85acec0ae910b82dbdba
2010-07-28 15:49:02 +00:00
dan
bfcaec729c Fix errors in wal3.test caused by recent modifications.
FossilOrigin-Name: 0714aeccd82d82686c074c1bb74ea794b7bfa3a3
2010-07-28 15:10:37 +00:00
dan
502019c8bb Support FCNTL_CHUNK_SIZE on windows too.
FossilOrigin-Name: a038688c991435967b935946c2283707820bb5da
2010-07-28 14:26:17 +00:00
drh
cf4d38aaf0 Do not allow automatic indices for the RHS of IN expressions which are not
correlated subqueries.  Ticket [8011086c85c6c404014c9]

FossilOrigin-Name: 267492d3a7eff7b7b24ed6bd6d6ff55148fe37f3
2010-07-28 02:53:36 +00:00
dan
eb8def8449 Merge trunk changes into experimental branch.
FossilOrigin-Name: 621824092d443425c420ba9010bbe1202fe99ea2
2010-07-27 18:36:37 +00:00
dan
6e09d69c92 Add experimental unix-only file-control to grow and truncate the database file by a configurable chunk size.
FossilOrigin-Name: 7cf0e851d4c5e826ea22ed08291b7c91d7b1abc7
2010-07-27 18:34:15 +00:00
drh
d7ceb372aa Update the makefiles to prefer TCL version 8.5 instead of 8.4.
FossilOrigin-Name: 8118de2af33557f75b4f2f1b1194a21d46ccf7fe
2010-07-27 16:42:22 +00:00
drh
81ba7d16b7 Fix a bug in the SQLITE_STATUS_MALLOC_COUNT counter. Add an ALWAYS() around
a condition in the SQLITE_DBSTATUS_SCHEMA_USED logic that is always true.

FossilOrigin-Name: 6df081adbfa581c477bd2c96bb3f7f44be131a8f
2010-07-26 19:09:31 +00:00
drh
eafc43b156 Add the SQLITE_STATUS_MALLOC_COUNT option for sqlite3_status().
FossilOrigin-Name: 8f8e442b3af553753e25c304efa289b626e3a227
2010-07-26 18:43:40 +00:00
drh
d2de9f4e68 Increase the version number to 3.7.1 due to the API enhancement of the previous
check-in.

FossilOrigin-Name: 1d7571e4be6d96aec13cd8b3b7b10b8dc44d19a5
2010-07-26 16:40:03 +00:00
drh
89ae1023cc Add support for SQLITE_DBSTATUS_SCHEMA_USED and SQLITE_DBSTATUS_STMT_USED to
the trunk.

FossilOrigin-Name: 008368b2bd1513e2df21c2070548c6fc94abebb1
2010-07-26 16:24:35 +00:00
dan
111becfbc0 When calculating schema memory, use the actual allocated size of hash elements, not sizeof(HashElem). Also fix a bug in dbstatus.test
FossilOrigin-Name: e327ef37faec52ce99591266160be2ce2d577cc3
2010-07-26 15:57:01 +00:00
dan
ccd4ad3e6c Add virtual table test cases to dbstatus.test.
FossilOrigin-Name: 72b84d066a4eac90a77142c3ea66ef3d21a1104e
2010-07-26 14:47:14 +00:00
drh
f37c68e036 Further fixes to the P4_MEM size measurement logic.
FossilOrigin-Name: 934cda2987c331b57a195ed45e9a91794896672a
2010-07-26 14:20:06 +00:00
drh
c176c27cbc Fix an issue with P4_MEM and the schema size measurement logic. Also fix
a compiler warning.

FossilOrigin-Name: 8166f33885b86029bb8a0fbaf70606a0d2d5ec2e
2010-07-26 13:57:59 +00:00
drh
7043db9f6f Make sure sqlite3_free() is not called for P4_MPRINTF during a size
measurement.

FossilOrigin-Name: 56f11f8823cd06a69eebce6a9613e22b1810b59b
2010-07-26 12:38:12 +00:00
dan
eb8603a7c4 Remove an assert() that uses a variable removed earlier.
FossilOrigin-Name: c04907e69820bd19f647c5f555327e0058db4e6d
2010-07-26 12:36:29 +00:00
dan
d19c933e8e Change the way SubProgram objects are deleted so that the code is the same for deletion and measurement.
FossilOrigin-Name: 00e55102a8309eb6df08ad4a8937ba02688bac62
2010-07-26 12:05:17 +00:00
drh
643f35e4a6 Update comments to better documentation the new memory measurement functions.
FossilOrigin-Name: 620bad035755449c4e6a762f01ef2b1d9e521c7c
2010-07-26 11:59:40 +00:00
drh
174b9a166d Make sure all memory from sqlite3DbMalloc() is freed by sqlite3DbFree()
and all memory from sqlite3_malloc() is freed by sqlite3_free().

FossilOrigin-Name: 629e38a8c9e31111e351fe4625a5835576d23584
2010-07-26 11:07:20 +00:00
drh
b975598ea0 Make sure all memory from sqlite3DbMalloc() is freed by sqlite3DbFree() and
all memory from sqlite3_malloc() is freed by sqlite3_free().

FossilOrigin-Name: ac1f37a647e9ed1c00a901d26d9956a86c40117a
2010-07-24 16:34:37 +00:00
dan
d46def77db Experimental code to measure memory consumed by database schemas and prepared statements.
FossilOrigin-Name: 9aa30342f4de4eff630520ea8e07ad253d3f0877
2010-07-24 11:28:28 +00:00
drh
5419ee5f2f Fix a typo in the OS/2 vfs code.
FossilOrigin-Name: a6bb2108bfb562a7067ef6150e43382736c0c4f5
2010-07-23 22:26:20 +00:00
dan
d8747eff5a Merge two leaves.
FossilOrigin-Name: 54e5886d841af69c8fa965bbcd637441d4a398ba
2010-07-23 17:37:13 +00:00
drh
7c2ed2ac25 Strenghten an assert() in malloc.c that helps to ensure that allocated memory
is freed by the appropriate routine.

FossilOrigin-Name: 80db61acca034a8edff0fd23a65a0bbc9206a7b3
2010-07-23 17:32:23 +00:00
drh
b2468954c2 Remove additional traces (mostly in comments) of the Table.dbMem field.
FossilOrigin-Name: 5c58f44aeb224e106497368d9290d75a08807761
2010-07-23 17:06:32 +00:00
dan
2949e4e8a0 Add a test case to shared.test. No changes to production code.
FossilOrigin-Name: bfb0dd3c2f7e1ffbdf236be4adc3e0d804ed5854
2010-07-23 15:55:31 +00:00
dan
1feeaed291 Remove the Table.dbMem variable, as it is no longer being used for its original purpose.
FossilOrigin-Name: 6eddc6e601cf8f585c6c2cf79f36fcbfe98a307e
2010-07-23 15:41:47 +00:00
dan
1dcb9df43f Remove the unused Schema.db variable.
FossilOrigin-Name: 430be657be68687c998f2f5f8dcd112bf26106be
2010-07-23 08:31:35 +00:00
drh
e9cdceafab Add evidence marks to the where.c source file. Comment only - no code changes.
FossilOrigin-Name: f3f9e8e5bb90cc36e0d63a7289a8acf534c5fa2a
2010-07-22 22:40:03 +00:00
dan
2339f06714 Make the sqlite3_db_status() routine threadsafe.
FossilOrigin-Name: 241f7bd190329fa02ca428651072a4a206132eab
2010-07-22 17:55:40 +00:00
drh
8342e49f62 Enhance the LIKE/GLOB query optimization so that it works as long as there
is an index with the appropriate collating sequence and even if the default
collating sequence of the column is different.
Ticket [4711020446da7d93d99].

FossilOrigin-Name: 9f932655f9eb9fdab16d7deed98b7cad414e0ca6
2010-07-22 17:49:52 +00:00
dan
4be02b901c Add test/threadtest3.c, containing multi-thread tests implemented in C.
FossilOrigin-Name: aad88cf54e9e55b757d2ece9e39d436e71dcaa9f
2010-07-22 15:44:06 +00:00
drh
93ee23cc03 Try to optimize LIKE and GLOB operators when RHS contains no wildcard.
Ticket [e090183531fc274747]

FossilOrigin-Name: 613a87d62fd1f8526d53136efae5adae91824bcf
2010-07-22 12:33:57 +00:00
drh
6ba8e9667c Tweaks to the virtual table documentation contained in comments of sqlite3.h.
No changes to actual code.

FossilOrigin-Name: f5866d4723460e80814b8599e0b84ff4a924da6f
2010-07-22 11:40:34 +00:00
drh
300c18a1b5 Fix a comment typo. This check-in is 3.7.0 release candidate 2.
FossilOrigin-Name: b36b105eab6fd3195f4bfba6cb5cda0f063b7460
2010-07-21 16:16:28 +00:00
shaneh
d5a724000b Added fix for race conditions from os_unix.c; added saving of errno in two places.
FossilOrigin-Name: 13ed106c8c279422a6159e28c6887d13a88b7b8b
2010-07-20 20:23:38 +00:00
dan
0668f5916e Fix a race condition in os_unix.c that may occur when one thread is opening a connection to a shared-memory block and another is either closing or locking the same shared-memory.
FossilOrigin-Name: 3b7330c19a5327322068e9460018fe0152b8ac87
2010-07-20 18:59:00 +00:00
drh
74bec6b93f Update the CLI test scripts for version 3.7.0.
FossilOrigin-Name: 92fe70dadde2eb551518d69ac2eaa6a0151d7dfe
2010-07-19 15:01:43 +00:00
dan
d3f6b81a76 Use exit(255) instead of abort() in the tcl [sqlite_abort] test command. This stops testfixture from creating dozens of core files each time tests are run.
FossilOrigin-Name: aec9e13148671e612d4ba674e74c12116573434f
2010-07-19 12:44:14 +00:00
dan
2d07f26078 Changes to stat.test so that it works with file-format 4.
FossilOrigin-Name: f87bb283615847764d24943695990564f02b939e
2010-07-19 12:05:33 +00:00
dan
a69f7d5aa5 Re-introduce the prefix-search optimization of [feef1b15d6], which was lost in a reorganization of FTS3 code.
FossilOrigin-Name: d692434b4935e8e7858230af1c126b0be8203077
2010-07-19 11:16:36 +00:00
dan
bd0c001405 Enable previously failing tests in e_expr.test that pass following [3e5975aa3b].
FossilOrigin-Name: 3d59c54a39c4c3149bf01063a91c3db35ec84b31
2010-07-19 05:27:17 +00:00
drh
1dca1458cc Fix a parser bug that was causing the relative precedence of LIKE and <
operators to be incorrect.

FossilOrigin-Name: 3e5975aa3bb9df9e1f954bcce99384e0f13cb453
2010-07-19 02:30:33 +00:00
drh
dd7e9dba97 Improvements to the formatting of parse.out file from Lemon. Add the -r option
to Lemon to disable the state sorting, making debugging easier.

FossilOrigin-Name: a2eaf8294f6d3fb39548987d632e934bb5d71cc9
2010-07-19 01:52:07 +00:00
drh
f5c4e0f12a Add the -p option to lemon to cause conflicts resolved by precedence rules
to appear in the parse.out file.

FossilOrigin-Name: fb6a59b0a905ddea071948f9a527483a1b1b219f
2010-07-18 11:35:53 +00:00
dan
784141ea5c Add new test file e_expr.test.
FossilOrigin-Name: cbcf8abbb2cb3e603cc3da45075f6b076e5cad56
2010-07-17 18:44:49 +00:00
dan
3757556873 Do not run journal3.test with the inmemory_journal permutation.
FossilOrigin-Name: e1d228e992fe8da1fc5aef95d9bc8be62c6b46c7
2010-07-17 09:27:31 +00:00
dan
250ea1ad3e Fix a problem with wal4.test caused by changes in the previous checkin.
FossilOrigin-Name: 1218d3703ad23d01ce0d7cbcabdc9e0d864f8717
2010-07-16 11:10:25 +00:00
dan
304feffc3f Fix a test script bug uncovered by [a121cd80c5] that was causing shared_err.test to fail.
FossilOrigin-Name: d7b63a4c9fdd2acdb5829224b6189e7f2f6bedb9
2010-07-16 10:39:54 +00:00
drh
8ab58665bc Previous check-in [534aab837e] accidently reverted some
changes from [a121cd80c5].  This check-in restores those changes.

FossilOrigin-Name: abff795f38e33d778c8dd494a601bc029237da9e
2010-07-15 18:38:39 +00:00
drh
a4ced195db Optionally support shared-memory in /dev/shm or other tmpfs directory
using an unsupported compile-time option.

FossilOrigin-Name: 534aab837e5a34fd58963ab2b505bfbb9da2e8ee
2010-07-15 18:32:40 +00:00
dan
1e5de5a13d Changes to wal.c so that SQLite can read even if the WAL file is opened read-only, provided the wal-index (shm file) is opened read/write.
FossilOrigin-Name: 932d19da73c9673cdd4cc01289b17761c23d23cb
2010-07-15 18:20:53 +00:00
dan
7d4514a4e1 Handle the case where xShmMap returns SQLITE_BUSY.
FossilOrigin-Name: 75f5354876c4300a8e53fe551dc837dd383d1e38
2010-07-15 17:54:14 +00:00
dan
c74e4ef4c7 When creating a journal file on unix, attempt to create it with the same permissions as the associated database file.
FossilOrigin-Name: a121cd80c5ac94e5977bc3164d2500e0ea132fed
2010-07-15 14:59:37 +00:00
dan
473c1bf241 Change a comment inside a block of code in parse.y from C++ to C style.
FossilOrigin-Name: dea7d33b2d7d25280a31a2b9c1573f4292b81187
2010-07-15 11:14:21 +00:00
drh
f65bc9119c Fix a typo in a comment in os_unix.c.
FossilOrigin-Name: e1e7312580a8b19825b0c52fa8af6c9382f99f22
2010-07-14 20:51:34 +00:00
drh
a7d2db175b The expression list on the RHS of an IN operator can no longer be empty
because an empty expression list is now optimized out by changes in
check-in [c288ac644d0bf].  Therefore add ALWAYS() macros around tests
for the expression list being non-empty.

FossilOrigin-Name: fd130ae56c0e23f2d5b4a82f1a09e89ed7ae1e85
2010-07-14 20:23:52 +00:00
drh
ef5d9ec166 Additional test cases and evidence marks for the empty RHS bug on the IN
operator - ticket [80e031a00f45dca877]

FossilOrigin-Name: 6851c517ac7f80538aa5f3a1994fa1921c0ec3f4
2010-07-14 19:31:07 +00:00
drh
094430eb71 Make the result of an IN or NOT IN expression with an empty set on the
right-hand side always either false or true, respectively, even if the
left-hand side is NULL.  Ticket [80e031a00f45dc]

FossilOrigin-Name: c288ac644d0bfda2b9bc204dc86df8e74d4f6843
2010-07-14 18:24:06 +00:00
dan
e84322e503 Fix an assert() failure in wal2.test caused by messing with the contents of shared memory.
FossilOrigin-Name: 9f452514d96ab8d424eadc55c283c53fe831476d
2010-07-14 18:10:02 +00:00
dan
50833e32c1 Test the libaries response to read-only or unreadable database, WAL and wal-index files. If a WAL file cannot be opened in read/write mode, return SQLITE_CANTOPEN to the caller.
FossilOrigin-Name: 45bb84c6283d803fc29077fdc2d06fa50ec06a59
2010-07-14 16:37:17 +00:00
dan
ddb0ac4b9f On unix, try to create the *-wal and *-shm files with the same permissions as the associated database file.
FossilOrigin-Name: e5d180eed245437b61bfb257ee01e2571c93afe7
2010-07-14 14:48:58 +00:00
dan
9d08d640ac Add tests to pagerfault.test.
FossilOrigin-Name: b092f2a74bdc77c1f90ad3b4448cb68a891ecf63
2010-07-14 08:20:35 +00:00
dan
c385793495 Test that a corrupted WAL hash-table does not put the library into an infinite loop.
FossilOrigin-Name: c73886ed7497c0daf798c3b02ca6f5a1c2addde3
2010-07-14 07:06:47 +00:00
dan
b31a6afad0 Fix a typo in the IS_BIG_INT macro used by coverage test instrumentation.
FossilOrigin-Name: 5314ca3928dab1c76fa4ec5dbe110e3212c95e9f
2010-07-14 06:20:26 +00:00
drh
5d4feffe7d Fix the unix driver to return an I/O error if unlink fails for any reason
other than the file not existing in the first place.

FossilOrigin-Name: 90d73c66bfa880cdeb688b3016c8b1c58bfcf35f
2010-07-14 01:45:22 +00:00
drh
54e0536275 Remove the xShmOpen method from the VFS. Shared-memory is opened automatically
by a call to xShmMap.  Rename the xShmClose method to xShmUnmap.

FossilOrigin-Name: 2b68e50268412599576c86ae70b830d0388cb35c
2010-07-14 00:22:36 +00:00
drh
e11fedc589 Change the name of the xShmClose VFS method to xShmUnmap, everywhere.
FossilOrigin-Name: c2d27cf51d33e6f38bab37008d39074051f75274
2010-07-14 00:14:30 +00:00
drh
6e1f482824 Tweaks to the new shared-memory interface design - mostly comment changes.
FossilOrigin-Name: 6336de7aa96a6e1e68cc123e5d5f485d790d95a2
2010-07-13 23:41:40 +00:00
dan
0c1736026a Fix a typo in a comment in sqlite.h.in.
FossilOrigin-Name: 4a6c4b6605ddce59e586ab17024de5269191a823
2010-07-13 18:45:10 +00:00
dan
da9fe0c327 Changes so that the xShmOpen VFS method is no longer required. Its job can be done by the first call to xShmMap. Rename xShmClose to xShmUnmap.
FossilOrigin-Name: f4780bde62c6c19146d2723c101540b8db898d38
2010-07-13 18:44:03 +00:00
drh
2103245e75 Improved documentation for the SQLITE_ACCESS_* constants that are used
with the xAccess() method of the VFS.

FossilOrigin-Name: 3d4bb65f10ed0297f38e732ce57e5440cba8deef
2010-07-13 14:48:27 +00:00
dan
af6ea4e9f9 Add proposed interface change to sqlite.h.in. This commit breaks the build.
FossilOrigin-Name: 52577bb5e723d8de4fc609286666b581f8d9c746
2010-07-13 14:33:48 +00:00
dan
2acd4c6375 Fixes to the pcache10 and pcache90 permutations.
FossilOrigin-Name: 597d40fa529073123a50ae6afc762c59404f8f5f
2010-07-13 14:22:39 +00:00
dan
0cf408ff11 Fix problems with running the async.test script.
FossilOrigin-Name: 05ac2548652f3c9aa358289700b0b4c7fc22486d
2010-07-13 07:38:51 +00:00
shaneh
1f3e27b29e Updates to comments and code organization to reflect changes in os_unix.c;
Updated winShmLock() with logic changes from unixShmLock(); 
Modified IO error returns in winShmMap() to match those in unixShmMap();

FossilOrigin-Name: b73fe2754b68af4c76a1788aa18b93359720d1f1
2010-07-12 20:46:33 +00:00
dan
6d3eb82bc7 Fix test_stat.c so that it does not cause compilation errors if SQLITE_OMIT_VIRTUALTABLE is defined.
FossilOrigin-Name: bf4fc0888705108aab997e1cb491fc7f9c64c443
2010-07-12 18:12:41 +00:00
drh
3a0f13ff83 Fix makefiles so that they build sqlite3_analyzer again. Tweaks to comments
in test_stat.c.  Fix tclsqlite.c to build the sqlite3_analyzer again.

FossilOrigin-Name: e6cd15451d8c47bfc86d07565655920134b494fe
2010-07-12 16:47:48 +00:00
dan
d846c5e047 In the async-IO module, do not increment the open file-counter until after an "open file" event has been added to the event queue. Otherwise, an OOM may cause the system to increment the counter even though no file was successfully opened.
FossilOrigin-Name: 15a190dc5769beb53b89254543e744a964cd86ed
2010-07-12 12:22:29 +00:00
dan
599e9d21bb Changes so that the space-analyzer script works with 3.7.0.
FossilOrigin-Name: 86159cb3f00a380dc55be3affb01c433618f0683
2010-07-12 08:39:37 +00:00
shaneh
c3b84830bd Exclude a few more FTS modules from the "in memory" permutation test suite.
FossilOrigin-Name: 4e9d69cd5ac3cc4d12ccea3028cba73e3c3f2965
2010-07-09 19:32:28 +00:00
shaneh
decd09cbe5 Exclude fts3cov.test from the "in memory" permutation test suite to avoid a false positive.
FossilOrigin-Name: 6af6794cac5516f8cbc425cb8c73468ca371a1ad
2010-07-09 18:43:40 +00:00
shaneh
55897967cc Fix warning under MSVC.
FossilOrigin-Name: 0c32c4bbdd74297767dcf4ec4295f9cc72875af0
2010-07-09 12:57:53 +00:00
drh
519426aaf8 Reformat WAL code for clearer presentation. Update comments for correctness.
Add checks to ensure that corruption in shared-memory does not result in
an infinite loop.

FossilOrigin-Name: 40eaada7ec45e70bdf64d060051f24c5c5e3faf3
2010-07-09 03:19:07 +00:00
drh
a485cccd0a Add a test case to cover code that was left untested by the journal_mode
simplification.

FossilOrigin-Name: bcdddba4f011cf008d29918bcac59131007a8138
2010-07-08 19:19:51 +00:00
shaneh
afdc5fa5cc Fix test case numbering in backup_malloc.test and issue when running under Windows.
FossilOrigin-Name: aef26438523bccf1ea2c19205cd05799e4c69a1f
2010-07-08 18:32:18 +00:00
drh
c6b2a0ff99 Change the journal_mode pragma to remove the "default journal mode" concept.
The journal_mode pragma only effects currently attached databases and does 
not change the behavior of future attachments.

FossilOrigin-Name: e396184cd3bdb96e29ac33af5d1f631cac553341
2010-07-08 17:40:37 +00:00
shaneh
4677ddff7e Merged experimental crashsql() into trunk.
FossilOrigin-Name: 01b575ff1aa512f34be78f9d67b6caaf825e5820
2010-07-08 16:50:08 +00:00
shaneh
f2c0882baa Changes to get crashsql() working on Windows.
FossilOrigin-Name: 8a5811ea80e8415f9ba6b1d9390ed723840402c3
2010-07-08 16:30:44 +00:00
shaneh
ebffe41eaf Fix warning in test fixture code.
FossilOrigin-Name: 0bfcf3bcd77acab48344dde87cecb01e877f1a19
2010-07-08 16:22:51 +00:00
shaneh
504b2514c2 Fix test case number issue in walcrash.test.
FossilOrigin-Name: 6a46e64168705a31d86d29a60025f138a42c5b79
2010-07-08 16:22:05 +00:00
dan
f0ab1f15de Fix to lock5.test so that it runs with the inmemory_journal permutation on osx.
FossilOrigin-Name: 948bb54568b5eb26644db78e8cd62381bdc22bac
2010-07-08 14:59:01 +00:00
shaneh
caace9261a Fixed a few tests in pagerfault.test so they work correctly on Windows.
FossilOrigin-Name: ffbdd954a05c003a213069e39ad0655e77983666
2010-07-08 13:33:47 +00:00
dan
cb35460330 Changes to test scripts so that the "inmemory_journal" permutation works with [ef126e775a].
FossilOrigin-Name: f553c8ed04b4b2df8ff4929e0754e3ffd1d01ba4
2010-07-08 09:44:42 +00:00
dan
8700b1e52d Add tests to walmode.test.
FossilOrigin-Name: 5aa2bdb502d70ccbc249a6b38b8a07b91c4ccd26
2010-07-08 06:22:25 +00:00
shaneh
e2ad93173d Changes to os_win.c to have it simulate IO errors like os_unix.c.
FossilOrigin-Name: 0d53da9451fe016adc57c7c077fdbbbdb1c8d6ee
2010-07-08 03:13:33 +00:00
drh
2327f5a454 Make the initial salt values in the WAL header random values, not zero.
FossilOrigin-Name: baa5eddd0539342945c14a2793c2579efb7e3b26
2010-07-07 21:06:48 +00:00
drh
12c7e1aba3 Add the write-ahead log viewer/debugger tool to the tools/ folder.
FossilOrigin-Name: 0e4bd44682a252fb8af0df20f011b2b2364644b5
2010-07-07 20:38:26 +00:00
shaneh
aa9ecebc2d Fix issue in mallocI test script where db handle not released.
FossilOrigin-Name: dd59cea6c860ad11f1794f3689a60ca6dbfffea5
2010-07-07 20:00:04 +00:00
dan
9f4127d50a Add further test cases to savepoint.test.
FossilOrigin-Name: f825205dbf3ebbfba0add86aa41f477281a13b0e
2010-07-07 18:38:35 +00:00
dan
ab7e8d85a9 When rolling back a savepoint, reset the changeCountDone flag.
FossilOrigin-Name: fb62f4e3a7ceaa60ff6af2196ccf35b48759307e
2010-07-07 17:53:51 +00:00
shaneh
2ceced15ce When using MSVC to build test code, suppress the popup dialog when abort is called from the sqlite_abort() test function.
FossilOrigin-Name: 55d3d39f1c653627fc4c048e12fdd8c4444b6de7
2010-07-07 16:51:36 +00:00
shaneh
b638a3d3eb Fix some MSVC compiler warnings in the ASYNC extension.
FossilOrigin-Name: b951c8675df3e719c30a1dd94200b7c04252a3ea
2010-07-07 16:49:46 +00:00
dan
8fb66141ed Merge together another accidental fork.
FossilOrigin-Name: c41f04edb20c0c8fc8c49a53d42cc0b8a0ff7fe3
2010-07-07 16:23:36 +00:00
shaneh
100efa3f73 Fix test numbering issue in nan.test.
FossilOrigin-Name: 5bb1330fef559d47dc854089dedba45bf05db192
2010-07-07 16:20:38 +00:00
dan
7fb574ecf7 Do not make the SQLITE_FCNTL_SIZE_HINT call if an error has already occurred during transaction commit.
FossilOrigin-Name: e92de834a39be07da5f0848d7ec5f1f6dff902a5
2010-07-07 16:18:45 +00:00
shaneh
538fa0b716 Close the file handle before returning. TCL test script issue only.
FossilOrigin-Name: f4076d8567243174c023b7aa7ae9ca7f8f73e33b
2010-07-07 15:41:55 +00:00
shaneh
cce1b689f4 Fixed a new error introduced by last check-in of os_win.c. Updated xAccess() to support SimulateIOError().
FossilOrigin-Name: 8eefc287265443ec043bdab629597e79c9d22006
2010-07-07 14:45:40 +00:00
drh
e9187b4371 Remove two more testcase() macros that require 4GiB WAL files to hit.
FossilOrigin-Name: 16e18f2706e67210eae62edfb748758fd27f23d7
2010-07-07 14:39:59 +00:00
drh
09b5dbc519 Remove a testcase() macro that would require a 4GiB WAL to reach.
FossilOrigin-Name: 15f9c2713bdfd3d6c8d8d4298f101d128e39b99a
2010-07-07 14:35:58 +00:00
drh
f77e2ac27d Fix a compiler warning in PRAGMA journal_mode.
FossilOrigin-Name: d94269e60dbcb50b8a35f142c64ed013cc0045ac
2010-07-07 14:33:09 +00:00
drh
146151cd23 Avoid the need for a NEVER() from pager_write_pagelist() by passing in
pPager as an extra parameter.

FossilOrigin-Name: b3179379437dbcb1d8e7f1f8f631a3e7df1a5c9a
2010-07-07 14:19:13 +00:00
drh
51538e9d90 Merge together the accident fork.
FossilOrigin-Name: cdcf08cb18b1e290a4093454bebbd3e7094d6804
2010-07-07 14:00:17 +00:00
shaneh
7ea7259176 Fix minor issue in xAccess() method for Windows.
FossilOrigin-Name: 4bfd46f1db41009a1b925d61c6f074b933caa4ec
2010-07-07 13:58:11 +00:00
dan
f6c614715c Make sure the schema is loaded before preparing a "PRAGMA journal_mode" command. This helps it return meaningful results when it is the first command executed by a new database connection.
FossilOrigin-Name: ef126e775a02d69a9cab53028513e8799e1b6044
2010-07-07 13:54:28 +00:00
drh
3e8e7ecbc4 Add testcase macros to ensure that large-file cases are tested in WAL.
FossilOrigin-Name: 8156b57ac33161ae6dd8a9413127ecce3c9eae83
2010-07-07 13:43:19 +00:00
dan
60f9da7561 Run some fts3 tests as part of the "wal" permutation.
FossilOrigin-Name: 8657455a11d20dbf78247559670943a72541a09d
2010-07-07 11:42:59 +00:00
dan
78f1e53840 Change the async-IO extension to return SQLITE_IOERR_SHORT_READ when appropriate. This prevents a valgrind warning in the test suite.
FossilOrigin-Name: d9e3287900ae4aa7722ad0132bb8d6cd2755d3a6
2010-07-07 11:05:21 +00:00
dan
bd0e9070e5 Fix a problem with writing to databases larger than 2^32 bytes with WAL mode.
FossilOrigin-Name: b956ddca75d64ba662fa0b03b643822d836b6501
2010-07-07 09:48:44 +00:00
drh
4d9a7bf990 Remote the SQLITE_OMIT_GLOBALRECOVER macro - it is subsumed by
SQLITE_OMIT_DEPRECATED.  Add support to sqlite3_compileoption_used()
for SQLITE_OMIT_WAL.

FossilOrigin-Name: 21a2db908b9eeb7477fc9d8b2b54482db93cd76f
2010-07-07 01:52:31 +00:00
shaneh
186070588c Minor changes to Makefile.in to bring it more inline with main.mk.
FossilOrigin-Name: 5621862b0e2fc945ded51f5926a6b4c9f07d0ab7
2010-07-06 20:37:09 +00:00
shaneh
33d85c9cd7 Changes to pager1.test to support Windows.
FossilOrigin-Name: fce689ebe6165276598539779958407856e2f84f
2010-07-06 20:34:37 +00:00
shaneh
133ce560c6 Modified the xWrite() method on Windows to differentiate between IO and disk full error returns.
FossilOrigin-Name: ca4b7ffbd44937a02ae62d606f9e1eb767075c22
2010-07-06 20:33:47 +00:00
dan
ea5542d126 Do not do the *-closeallfiles test for notify2.test. It uses multiple threads.
FossilOrigin-Name: fb09152db879211986a7161a96a61da1425f79ef
2010-07-06 11:26:15 +00:00
dan
e1a2a990b8 Before calling Tcl_ExitThread() in a multi-threaded test, call Tcl_DoOneEvent() as many times as necessary to handle any queued events.
FossilOrigin-Name: b3399b40785d13754979203f15d71c95fec50282
2010-07-06 10:55:44 +00:00
drh
9e55d47d33 Reorder variable declarations in the previous check-in to avoid putting code
before declarations when not testing.

FossilOrigin-Name: d1fe8ab4a176180053d35300ad0540a27c6cd76d
2010-07-06 09:29:01 +00:00
dan
9859c427a2 Ensure the correct error code is returned if an attempt to parse a database schema made by an ATTACH statement fails.
FossilOrigin-Name: c272196115ab3926e56b6f4183ec127e3f98ef9c
2010-07-06 07:36:18 +00:00
drh
722a7e9ab3 Modify the VFS xAccess() method on winNT so that it returns false for
an exists test of a zero-length file.  This makes the windows VFS work
the same as the unix VFS.

FossilOrigin-Name: ec35f25403744f7441ac5ae1486b84d8ebc13e98
2010-07-05 21:00:43 +00:00
dan
db10f08282 Simplify the previous commit by removing the pagerCheckForOrDeleteWAL() wrapper.
FossilOrigin-Name: a1324d125e2dd7004eaf8680f5f832ef17285087
2010-07-05 19:13:26 +00:00
dan
3e875ef3b5 Allocate a buffer containing the full path-name to the associated WAL file when a pager is created. This saves having to construct a new buffer each time a new read-transaction is opened and SQLite checks for the existance of a WAL file.
FossilOrigin-Name: 3053a4ad15343a56efa430503797b77bb6d1e770
2010-07-05 19:03:35 +00:00
drh
8220da7b8b When rolling back page 1 from a journal, restore the "nReserve" setting
in case it has been corrupted by a prior crash.

FossilOrigin-Name: c0d124da88e84e68679c2f3f4b2b35c03aecc916
2010-07-05 17:43:32 +00:00
dan
92d516a221 Do not report an error if the open-file-count is not as it should be after running a multi-threaded test. The counter instrumentation is not thread-safe.
FossilOrigin-Name: ea80b21c881fabaec1da788588c35c6c9782dcbd
2010-07-05 14:54:48 +00:00