1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

2168 Commits

Author SHA1 Message Date
drh
22e9c155ae Merge in the latest changes from the trunk.
FossilOrigin-Name: 435b57dc2be7b071270a6cddece297758b8153aa
2011-04-06 22:33:50 +00:00
drh
dc5b047ec3 Fix a performance regression: Keep two btree masks in each prepared
statement; one for btrees used and another for btrees that require locks.
Only try to lock the btrees identified by the second mask.

FossilOrigin-Name: 614de91a504d2231009a9de1305e31fce1b1c5a6
2011-04-06 22:05:53 +00:00
drh
d7162fa64e Merge the latest trunk changes into the sessions branch.
FossilOrigin-Name: 45f20261720dcd73eb887f7e3df100723000418b
2011-04-05 22:13:49 +00:00
drh
fcd71b6010 Suppress many harmless compiler warnings, mostly signed/unsigned comparisons
within asserts or unused parameters in extensions.

FossilOrigin-Name: 3eeb0ff78d04891b5fd1a3d99a9fb8cfbed77a81
2011-04-05 22:08:24 +00:00
drh
8d4991e7ba Remove dead code from the OP_JournalMode opcode in the VDBE.
This code seems to have been useless since [f88c6367d2] on [20010-08-07].

FossilOrigin-Name: a89f24e2c9591d09cbe329895ceec87885059184
2011-04-05 18:34:10 +00:00
drh
e54e051800 Remove the mutex counter and the logic that attempts to verify that btree
mutexes are held continuously.  We are not making that assumption at this
time.

FossilOrigin-Name: 242ce7cff416a87d57d4eb624cb79fa4e2215559
2011-04-05 17:31:56 +00:00
drh
c94f31236e Pull the latest trunk changes (and hence the schema-parse-refactor changes)
into the sessions branch.

FossilOrigin-Name: 03ca83422f0259ae5525aeecc14171811252a67d
2011-04-05 13:27:30 +00:00
drh
cdf011dcc4 Additional schema mutex checks for sqlite3RootPageMoved().
Reduce the scope of sqlite3ResetInternalSchema() in a few places.

FossilOrigin-Name: 39c00907833413c0d97d3e06fdda967b825d23ea
2011-04-04 21:25:28 +00:00
drh
2120608e0f Add a description of access rules for the Schema object and lots of asserts
to verify that the access rules are followed.

FossilOrigin-Name: ae8374af057b6e6546e9265148cfffe32fcb0849
2011-04-04 18:22:02 +00:00
drh
b92fce1eae Merge the latest changes of trunk into the session branch.
FossilOrigin-Name: 95d53c44320b9639f2623aa9cc88d0d3e1a3be8f
2011-04-04 13:19:36 +00:00
drh
e038f852c8 Merge in the latest changes from trunk.
FossilOrigin-Name: 47b79c40cf07048f682c44bfef533d4764b20c4d
2011-04-04 13:07:02 +00:00
drh
7b94e7f838 Move the expired-statement test for OP_Function until after all memory has
been freed.  The test is still commented out, however.

FossilOrigin-Name: 425e3edb146c497817855dd741878709a25c8b98
2011-04-04 12:29:20 +00:00
drh
bdaec52c62 Remove the BtreeMutexArray object - use the Vdbe.btreeMask field to accomplish
the same result.  Add a generation counter to btree mutexes in order to assert
that mutexes are never temporarily dropped over a range of instructions in order
to do deadlock avoidance in some subroutine.  Lock all btrees in any Vdbe
program that uses OP_ParseSchema.

FossilOrigin-Name: d81708f7d1eee399bfe76f6b8dac950a85dc2582
2011-04-04 00:14:43 +00:00
drh
dddd779b2b Make sure that the constant 1 is cast to yDbType before shifting to create
an attached database mask.  This check-in is a follow-up and fix to the
[7aaf8772274422] change that increases the maximum number of attached databases
from 30 to 62.

FossilOrigin-Name: e2a09ea73c76a0bec1e09d1fc11092517e3ebdf9
2011-04-03 18:19:25 +00:00
drh
c7792fa052 Begin a series of changes designed to reduce the scope and frequency of
invalidating schemas.  Design goals are that the internal schema should
never be deleted out from under a prepared statement that is running and
that all prepared statements should be expired if the schema is invalidated.
At the same time, minimize the number of schema invalidations.  This change
merely revises the sqlite3ResetInternalSchema() function to use -1 as the
wildcard for "all" rather than 0, so that we can reset the main schema
independently of all the others.

FossilOrigin-Name: 6a8ad6e31e0d2b8a5ace38faf0efd805155ee5f3
2011-04-02 16:28:52 +00:00
dan
6c15487b7e Fix a race condition in OP_ParseSchema.
FossilOrigin-Name: 71a799b02a3b3cf2e12758dea29fd2465bbec3e1
2011-04-02 09:44:43 +00:00
drh
9b1c62d416 Add the SQLITE_ENABLE_PREUPDATE_HOOK compile-time option.
FossilOrigin-Name: 6634521461e6acff7cc778590e62d57831f9230d
2011-03-30 21:04:43 +00:00
drh
5847b5f9c3 Merge in all the latest changes from trunk.
FossilOrigin-Name: b11d941e92897663da46160185e6e305d4e28fe6
2011-03-30 02:03:12 +00:00
drh
22645842a4 The changes to fix [f7b4edece25c9948] mean that the schema is always loaded
whenever a prepared statement is running.  This means that a couple of
branches can be eliminated and one operand of OP_ParseSchema can be removed.

FossilOrigin-Name: b6e268fce12829f058f1dfa223731ec8479493f8
2011-03-24 01:34:03 +00:00
dan
319eeb7b33 Fix a problem with INTEGER PRIMARY KEY columns and the pre-update hook.
FossilOrigin-Name: 24d4d5dd007197a141555bcca6f2ac9ab47cde80
2011-03-19 08:38:50 +00:00
drh
516ae18005 Merge the fix to ticket [f7b4edece25c99485] into the sessions branch.
FossilOrigin-Name: 1b736ac2934f2361dee5062e9033cbf26b41fc3a
2011-03-19 02:37:38 +00:00
drh
c2a75551ef Add a generation counter to the Schema object and enhance OP_VerifySchema
to also check the Schema generation.  Fix for
ticket [f7b4edece25c99].

FossilOrigin-Name: 36c04dd1695f0899b53ce58738181b146fc005ed
2011-03-18 21:55:46 +00:00
drh
0639c34ecd Merge all the latest trunk enhancements into the sessions branch.
FossilOrigin-Name: 94fd5bb6da5ef4d850c2ed4ad38afabc5569dae6
2011-03-18 12:35:36 +00:00
dan
37db03bf73 Add the sqlite3_preupdate_new() API, for retrieving the new.* values from within a pre-update callback.
FossilOrigin-Name: 526545c49f64d9063d1b888cfc14ece62fa3c13c
2011-03-16 19:59:18 +00:00
dan
6566ebe1b6 Remove the sqlite3_transaction_hook() API.
FossilOrigin-Name: b0015a1cfe63c924ee5f250aa08460522882009b
2011-03-16 09:49:14 +00:00
drh
c126e63e4f Remove dead code identified by the clang static analyzer.
FossilOrigin-Name: 01a79d5a7af48fb7e50291c0c7c6283d3fb359d0
2011-03-06 21:28:32 +00:00
drh
158b9cb965 Fix all known instances of signed-integer overflow. Within SQL expressions,
integer overflow now forces coercion to floating point.  The shift operators
work with any integer right-hand operand with negative values reversing
the direction of the shift.

FossilOrigin-Name: abf21394124a0af46f072793718964cee2ce55d0
2011-03-05 20:59:46 +00:00
drh
cfd654bf2a Fix an instance of signed arithmetic overflow and an one bit-shift overflow.
Mark six other signed arithmetic overflow locations that need fixing.

FossilOrigin-Name: 04abab71ecd52f6070b9f84781a3df3d6dba7722
2011-03-05 13:54:15 +00:00
dan
21e8d0126d Add the experimental sqlite3_transaction_hook() API.
FossilOrigin-Name: 093d8cd8e2f3a6af5d40cf810e396f4919eb5cef
2011-03-03 20:05:59 +00:00
dan
46c47d4677 Add the experimental sqlite3_preupdate_hook() API.
FossilOrigin-Name: 6145d7b89f83500318713779c60f79a7ab2098ba
2011-03-01 18:42:07 +00:00
drh
5b6c545ba1 When a stale schema-cookie is seen, expire only the one statement that
encountered the bad cookie, not every statement on the database 
connection.  Ticket [b72787b1a7cea1f]

FossilOrigin-Name: 1bca0a7e198391202fd2bc1650c0a62028a9aaa5
2011-02-22 03:34:56 +00:00
drh
30aa3b93b6 Cleanup to the OP_Checkpoint opcode.
FossilOrigin-Name: f611a5a879b7dec1ed1d8bf32413c8a6b81c3172
2011-02-07 23:56:01 +00:00
drh
87fa53ee8d Merge in the blocking-checkpoint enhancement, including the new
sqlite3_wal_checkpoint_v2() interface and the
PRAGMA wal_checkpoint(full) statement.

FossilOrigin-Name: bac7342c368a7c4f5f2878e08d9581dcbf57dd58
2011-02-02 16:34:08 +00:00
drh
ea76f55562 Remove an over-zealous call to memAboutToChange() from OP_MustBeInt.
OP_MustBeInt will never invalidate the Mem.z pointer so the memAboutToChange()
call is not necessary.

FossilOrigin-Name: 841cf7a7dbf0947cb7bde864609a8d3294f78689
2010-12-03 18:57:17 +00:00
drh
6ea28d6d84 Fix various compiler warnings.
FossilOrigin-Name: c412f61229b6ab1ac90b932afd56f7c5e3ba1cfe
2010-11-26 16:49:59 +00:00
drh
c84e033c92 The previous check-in with changes to the max_page_count pragma was not
quite correct.  This check-in fixes the problem.

FossilOrigin-Name: 30c26c3b13b29ce57683e91ac11641d4eb4d678f
2010-11-23 20:25:08 +00:00
drh
60ac3f426c Fix the max_page_count pragma so that it will not set to a value smaller
than the current database size, as the documentation requires.  Also,
remove all occurances of atoi() from the core.

FossilOrigin-Name: 2031974b606ef713b5f34522b2221470d98687c5
2010-11-23 18:59:27 +00:00
dan
7e0454fc72 Merge with latest trunk changes.
FossilOrigin-Name: e376480f0855c598c91529abacbd73e31d9f4713
2010-11-18 16:32:53 +00:00
drh
e5a8a1df0d Prevent a possible segfault when the sqlite3_value_numeric_type() interface is
misused to try to determine the numeric type of the NULL value returned
from sqlite3_column_value() with an invalid column number.

FossilOrigin-Name: 501b743bcb60cda0acf63bcf8a4abbf00797b347
2010-11-18 12:31:24 +00:00
dan
cdc1f049bf Modify the interface to the blocking wal-checkpoint functionality.
FossilOrigin-Name: 72787c010c8944e8fcf9c98aa4482f129142d8e9
2010-11-18 12:11:05 +00:00
dan
a58f26f93f Add experimental command "PRAGMA wal_blocking_checkpoint", which uses the busy-handler to block until all readers have finished in order to ensure the next writer will be able to wrap around to the start of the log file.
FossilOrigin-Name: 7e3fc2c833a5baa08820c499867b6902bdc2ed5a
2010-11-16 18:56:51 +00:00
drh
6b87056570 Remove unnecessary calls to memAboutToChange() in vdbe.c. An affinity
change no longer invalidates shallow copies.

FossilOrigin-Name: afb0fd0b0421c42630c5e6e5e8811aca634bc9d0
2010-09-30 18:12:01 +00:00
shaneh
5f1d6b616e Changes to remove sqlite3FitsIn64Bits().
FossilOrigin-Name: 43fef1cab6315f837782ea601d5a2aeb9843ab3c
2010-09-30 16:51:25 +00:00
drh
9351862b6d Fix the handling of default values for ALTER TABLE ADD COLUMN columns so
that is able to deal with negative numbers, including large negative numbers.
Ticket [8454a207b9fd2243c4]

FossilOrigin-Name: ce6cc16e3a151a0c67855abde1411422dfcc8828
2010-09-30 14:48:06 +00:00
drh
9339da1f22 Rework the text to numeric conversion routines so that they work with either
UTF8 or UTF16 and do not require a NULL terminator.  This allowed text to
numeric conversion without reallocating the string.

FossilOrigin-Name: 14eed3a0e0a45c6f2904a3a134aa27c159916f7b
2010-09-30 00:50:49 +00:00
drh
d81a142bfa Replace some unreachable branch instructions with assert() statements.
FossilOrigin-Name: 88b84bf18a4b27626f8a0a2d313706ddd4f13749
2010-09-28 07:11:24 +00:00
drh
746fd9cc58 Tweaks to help facilitate structural test coverage.
FossilOrigin-Name: ff49a5f00b3aa83bdacc95a32d60527c740a6c09
2010-09-28 06:00:47 +00:00
drh
ebc16717fa Continuing work toward detecting and fixing shallow-copy misuse.
FossilOrigin-Name: d0342f4bb9d25dd1dba3957778faa993fb9cc81c
2010-09-28 00:25:58 +00:00
drh
2b4ded993b Add assert() statements that fail when a shallow copy is accessed after the
original has been modified.  These assert() statements should detect the kinds
of subtle SCopy bugs such as caused the fault
in ticket [b351d95f9cd5ef17e9d9dbae18f].

FossilOrigin-Name: 8b8e1732e8410efd5f8e308c43abe521584e87a0
2010-09-27 21:09:31 +00:00
drh
ee9ff672da Documentation enhancements for sqlite3_db_status(). Evidence marks on
the SQL function call intrface.

FossilOrigin-Name: f06c7b1973d64a6a1a1db2b44df2a4eb0ece0077
2010-09-03 18:50:48 +00:00