danielk1977 [Tue, 24 Mar 2009 04:46:08 +0000 (04:46 +0000)]
Add a comment to prepare.c explaining why the lookaside buffer is disabled before sqlite3_exec() is called to parse a schema statement. No code changes. (CVS 6376)
drh [Mon, 23 Mar 2009 17:49:14 +0000 (17:49 +0000)]
Add asserts to make sure that database connection locks are held when
accessing the lookaside memory allocation buffers. No defects were found. (CVS 6374)
danielk1977 [Mon, 23 Mar 2009 17:11:26 +0000 (17:11 +0000)]
Fix an obscure race condition that can occur when multiple threads, shared cache and DDL statements are combined. Enhance notify2.test to test this scenario. (CVS 6373)
danielk1977 [Mon, 23 Mar 2009 04:33:32 +0000 (04:33 +0000)]
Use the ROUND8() macro to round an integer up to the nearest multiple of 8 and ROUNDDOWN8() macro to round down to the nearest multiple of 8. This is a cosmetic change. (CVS 6372)
drh [Sat, 21 Mar 2009 14:56:52 +0000 (14:56 +0000)]
Rig the unix backend to use fdatasync() by default, without having to set the
HAVE_FDATASYNC macro. Systems that do not support fdatasync() can be compiled
using -Dfdatasync=fsync. (CVS 6368)
drh [Sat, 21 Mar 2009 14:41:04 +0000 (14:41 +0000)]
On unix, always use fdatasync() instead of fsync() when available, even if
the file size changes, since (we are told) fdatasync() will automatically
flush the inode when the file size changes. (CVS 6367)
drh [Fri, 20 Mar 2009 13:15:30 +0000 (13:15 +0000)]
Rename the unused MEM2 static mutex to OPEN and reuse it to serialize access
to the sqlite3BtreeOpen() routine to prevent a race condition on detection
of sharable caches. Ticket #3735. (CVS 6363)
danielk1977 [Fri, 20 Mar 2009 09:09:37 +0000 (09:09 +0000)]
Fix a problem in loadext.test causing an error on OSX. This is not a real problem, just a case of the test script expecting a slightly different error message than the one returned. (CVS 6361)
danielk1977 [Thu, 19 Mar 2009 07:58:31 +0000 (07:58 +0000)]
Change sqlite3_step() to return SQLITE_LOCKED if a statement cannot be re-compiled due to locks on the shared-cache schema. Also add a blocking wrapper of sqlite3_prepare_v2() to the test code. (CVS 6359)
drh [Tue, 17 Mar 2009 22:33:00 +0000 (22:33 +0000)]
Move the rowid cache out of VdbeCursor and into BtCursor. When multiple
BtCursors are open on the same table, set their rowid cache all at the
same time. Ticket #3731. (CVS 6354)
danielk1977 [Sat, 14 Mar 2009 08:37:23 +0000 (08:37 +0000)]
Fix for #3719. When synthesizing a CREATE TABLE statement as as result of a "CREATE TABLE AS", quote the column type names unless they are simple identifiers or simple identifiers followed by one or two dimensions (e.g. "VARCHAR(10)"). (CVS 6345)
danielk1977 [Thu, 5 Mar 2009 14:59:39 +0000 (14:59 +0000)]
Begin purging dirty pages from the cache once 90% of the cache is dirty (insteadof waiting until it is 100% dirty). This improves performance in some circumstances by effectively reserving 10% of the configured page-cache for frequently reused read-only pages. (CVS 6341)
drh [Mon, 2 Mar 2009 14:24:21 +0000 (14:24 +0000)]
Fix the SQLITE_ENABLE_UPDATE_DELETE_LIMIT option for the new Expr compression
logic of check-in (6305). Bug discovered during regression testing. (CVS 6333)
drh [Mon, 2 Mar 2009 01:22:40 +0000 (01:22 +0000)]
Fix a bug in the GROUP BY alias name resolution. The bug was by
check-in (6305). Discovered by regression test on 64-bit linux.
Test cases added so that the problems is detected on 32-bit systems. (CVS 6332)
danielk1977 [Sat, 28 Feb 2009 10:47:41 +0000 (10:47 +0000)]
Instead of linking temporary triggers on non-temporary tables into the Table.pTrigger list, search the temp schema for them on demand. Fix for #3688. (CVS 6329)
drh [Tue, 24 Feb 2009 16:18:05 +0000 (16:18 +0000)]
Enhanced comments on table locking logic as it relates to preparing new
statements. Added assert() and testcase() but no other changes to code. (CVS 6319)
danielk1977 [Mon, 23 Feb 2009 17:33:49 +0000 (17:33 +0000)]
Scan an index instead of a table for "SELECT count(*) FROM <tbl>" queries. Because an index is usually smaller than a table on disk, this saves some IO. (CVS 6315)
drh [Sat, 21 Feb 2009 22:38:59 +0000 (22:38 +0000)]
The sqlite3.def file is automatically generated and is not suppose to be
part of the source code repository. So it is hereby removed.
Ticket #3671. (CVS 6312)
drh [Fri, 20 Feb 2009 03:55:05 +0000 (03:55 +0000)]
Add a count parameter to the OP_Variable opcode and use it to simplify
prepared statements that copy consecutive unnamed parameters into
consecutive registers (a common case). (CVS 6309)
drh [Fri, 20 Feb 2009 01:28:59 +0000 (01:28 +0000)]
Reuse space left-over opcode space at the end of the VDBE opcode array to
store memory cells, VDBE cursors, and other content needed by the VDBE.
This reduces the memory required by a prepared statement. (CVS 6307)
danielk1977 [Thu, 19 Feb 2009 14:39:25 +0000 (14:39 +0000)]
Changes to reduce the heap space consumed by triggers, views and tables in the in-memory representation of the schema. Also to reduce the space used by prepared statements slightly. (CVS 6305)
drh [Wed, 18 Feb 2009 18:37:58 +0000 (18:37 +0000)]
Move the text of C-API requirements out of the sqlite.h.in source file and
into separate files in the "docsrc" CM system. Comment changes only - no
changes to code. (CVS 6303)
drh [Tue, 17 Feb 2009 18:37:28 +0000 (18:37 +0000)]
Add tests to double-check that nothing within SQLite ever tries to allocate
amounts of memory that are close to the maximum signed integer, leading to
an integer overflow within malloc(). This is not currently a problem.
The extra tests just insure it never becomes a problem. (CVS 6298)
drh [Thu, 12 Feb 2009 17:06:41 +0000 (17:06 +0000)]
Update thread tests to clear the sqlite_open_file_count counter at the
end. This counter is not threadsafe and can end up with an invalid value
at the end of the thread tests. (CVS 6289)
danielk1977 [Thu, 12 Feb 2009 09:11:56 +0000 (09:11 +0000)]
Fix a case where during a rollback triggered by an IO or malloc error an unjournalled region of the database could be written to (with it's original data). This was causing an assert in test_journal.c to fail. Add a test case in ioerr2.test to trigger this case. (CVS 6286)
danielk1977 [Wed, 11 Feb 2009 07:38:11 +0000 (07:38 +0000)]
Modify the test_journal.c code to (1) account for the backup code writing to parts of the pending-byte page when changing a databases page-size, and (2) to avoid reading from the pending-byte page and triggering the assert in os_unix.c. Changes to test code only. (CVS 6280)
danielk1977 [Wed, 11 Feb 2009 05:18:06 +0000 (05:18 +0000)]
In test_mutex.c, zero the global structure staticly instead of in Sqlitetest_mutex_Init(). This is because Sqlitetest_mutex_Init() is now called by each thread during thread tests ((6193)). Test code changes only. (CVS 6279)