Remove two unused fields from the Parse structure. The TCL interface now
removes leading whitespace from SQL statements before parsing them. (CVS 6846)
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)
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)
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)
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)
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)
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)
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)
danielk1977 [Mon, 29 Jun 2009 06:00:37 +0000 (06:00 +0000)]
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)
drh [Fri, 26 Jun 2009 15:14:55 +0000 (15:14 +0000)]
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)
drh [Fri, 26 Jun 2009 14:04:51 +0000 (14:04 +0000)]
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)
danielk1977 [Fri, 26 Jun 2009 07:12:06 +0000 (07:12 +0000)]
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)
drh [Thu, 25 Jun 2009 11:50:21 +0000 (11:50 +0000)]
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)
drh [Wed, 24 Jun 2009 13:13:45 +0000 (13:13 +0000)]
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)
drh [Tue, 23 Jun 2009 20:28:53 +0000 (20:28 +0000)]
Enhance autoincrement so that it works with triggers that also do
autoincrement inserts, even multiple inserts into the same table.
Ticket #3928 (CVS 6807)
drh [Mon, 22 Jun 2009 12:05:10 +0000 (12:05 +0000)]
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)
danielk1977 [Sat, 20 Jun 2009 18:52:49 +0000 (18:52 +0000)]
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)
danielk1977 [Sat, 20 Jun 2009 11:54:39 +0000 (11:54 +0000)]
If after obtaining an exclusive lock to rollback a hot-journal file it is found that the journal file has been deleted, do not return an SQLITE_BUSY error. Just downgrade the lock and continue with the current operation. This eliminates a spurious SQLITE_BUSY error caused by a race condition. (CVS 6792)
danielk1977 [Fri, 19 Jun 2009 17:50:01 +0000 (17:50 +0000)]
If a call is made to sqlite3PagerAcquire when there are no outstanding references to any pages and the pager is in the error-state, try to exit the error-state at this point. Previously this was only attempted if the pager was configured to use exclusive mode. (CVS 6788)
drh [Fri, 19 Jun 2009 14:06:03 +0000 (14:06 +0000)]
Reorganize and cleanup the prepared statement object. Remove code that has
been commented out for ages and is no longer relevant to anything. (CVS 6786)
drh [Wed, 17 Jun 2009 22:50:41 +0000 (22:50 +0000)]
Avoid an assertion fault if an out-of-memory error occurs while trying
to run the string-concatentation operator on a zero-blob. (This is an
absurd thing to do, but even so, we still should not fault.) (CVS 6778)
drh [Wed, 17 Jun 2009 21:42:33 +0000 (21:42 +0000)]
Fix a problem in vdbe.c that could cause a double-free of memory if the
SQLITE_LIMIT_LENGTH is changed after a statement is prepared but before
it is run. Also remove debugging statements from tkt3841.test. (CVS 6777)
drh [Tue, 16 Jun 2009 17:49:36 +0000 (17:49 +0000)]
Changes sqlite3_prepare_v2() (and related routines) so that if it fails due
to a missing table and the schema is out of date, it retries once before
returning SQLITE_SCHEMA. Other changes to prepare.c to facilitate coverage
testing. (CVS 6769)
drh [Fri, 12 Jun 2009 17:46:19 +0000 (17:46 +0000)]
Change lemon so that it does not generate yytestcase() macros on destructor
cases since destructors are commonly unreachable in a reasonable grammar.
For the reduce-rule switch, gather all no-ops into the "default:" case. (CVS 6757)
drh [Fri, 12 Jun 2009 13:53:51 +0000 (13:53 +0000)]
The lemon parser generator now inserts yytestcase() macros on reduce action
and on each destructor, to verify that all have been executed. yytestcase()
is a no-op by default but can be set to something more useful inside
of %include. (CVS 6755)