Commit Graph

735 Commits

Author SHA1 Message Date
drh
648e264342 Add the "defer_foreign_keys" pragma and the SQLITE_DBSTATUS_DEFERRED_FKS
value for sqlite3_db_status().  This is a cherry-pick of a sequence of five
checkins in the sessions branch between [1d44e5d3c2] and [d39e65fe70].

FossilOrigin-Name: 527121ac3cdc96ac33ad975c227a6685a2f7e999
2013-07-11 15:03:32 +00:00
drh
8f8c65f79b Fix harmless compiler warnings in the progress callback logic.
FossilOrigin-Name: 908141d5bf7a9ad8f40c2332476847733eca7fdc
2013-07-10 18:14:29 +00:00
drh
8d56e2059c Issue the new SQLITE_WARNING_AUTOINDEX warning on the SQLite log whenever
an automatic index is created.

FossilOrigin-Name: 338826ef3f8a209b14f8d42370855cab9ac9ed45
2013-06-28 23:55:45 +00:00
drh
986b38792f Add the SQLITE_DEFAULT_AUTOMATIC_INDEX compile-time option, which if set to
zero turns automatic indices off by default.  Increase the estimated cost
of an automatic index.  Additional minor refactoring of the automatic
index code.

FossilOrigin-Name: 459b3179023c2c45994ea4acbf34ed5f87cf3c18
2013-06-28 21:12:20 +00:00
drh
4f7d3a5f06 Refactor names of fields in the sqlite3 object: "activeVdbeCnt" becomes
"nVdbeActive".  Related fields becomes "nVdbeRead", "nVdbeWrite", and
"nVdbeExec".

FossilOrigin-Name: 14f796963474350e7aee8d3757acd3315fe78e4f
2013-06-27 23:54:02 +00:00
dan
f73819af05 Add extended error code SQLITE_BUSY_SNAPSHOT - returned in WAL mode when a read-transaction cannot be upgraded to a write-transaction because it is reading from a snapshot other than the most recently committed.
FossilOrigin-Name: 361c22969aa75340ed696e00e3dc5d17d5493bee
2013-06-27 11:46:27 +00:00
drh
cda73feaa2 Finish removing the sqlite3.inTrans field. In the previous check-in, it was
merely commented out because I failed to select File->Save on my text editor.

FossilOrigin-Name: 2f97e38a6611cb17c24d74332d3ac3777dc0dd3e
2013-05-28 17:30:52 +00:00
drh
4580d759fb Remove the obsolete and unused sqlite3.inTrans field.
FossilOrigin-Name: c3381cd4957013d46075996c3b865177c888d2a8
2013-05-28 17:25:48 +00:00
drh
f7b5496e8e Many small harmless comment changes. Removal of obsolete comments and
fixing misspelled words.  No changes to code.

FossilOrigin-Name: a0d5cc9315dc6e9ef7dee4c3dfabf4e562d64376
2013-05-28 12:11:54 +00:00
dan
617dc8602d In sqlite3_close_v2(), do not attempt to roll back a transaction if there exist active statement objects. Any open transaction will be rolled back when the last of these statement objects is finalized.
FossilOrigin-Name: d11e76072a17fe833b87595d9d79f2c4b0b09cb3
2013-05-16 11:57:28 +00:00
dan
6743081784 When closing a connection, avoid tripping active cursors belonging to a different shared-cache client. Also, if sqlite3_close() is called while there are still active statements belonging to the connection, return SQLITE_BUSY and do not roll back any active transaction.
FossilOrigin-Name: 6071b7cce067c807e040283fc4b7449dc6eca498
2013-05-15 10:21:50 +00:00
dan
cd7b91a7f1 Candidate fixes for problems revealed by notify2.test. Notify2.test is still failing at this point.
FossilOrigin-Name: ea0428f9b6e63066e7444a2ba2f8c12a2e3ab7e4
2013-05-13 18:23:15 +00:00
mistachkin
10269dc676 Define the sqlite3ErrName() function only when necessary. More robust handling of unknown return codes.
FossilOrigin-Name: e47cd314371c2be6e00d96392b3892a7f3015f98
2013-04-30 07:54:42 +00:00
mistachkin
e84d8d3219 More refinements to Windows OSTRACE usage. Replace all usage of sqlite3TestErrorName() with sqlite3ErrName() and add missing return codes.
FossilOrigin-Name: 05ba5e23fcc5da416d47a8ad5e667ed6a0c7a34a
2013-04-29 03:09:10 +00:00
mistachkin
f2c1c99f15 Initial work on reforming usage of OSTRACE by the Windows VFS.
FossilOrigin-Name: b347b5d1a01301f44e6fd20ee03a9529ffd25788
2013-04-28 01:44:43 +00:00
drh
9b4c59fa1b Refactoring the mmap interface. The controlling pragma is now "mmap_size"
instead of "mmap_limit".  Also change SQLITE_CONFIG_MMAP_LIMIT and
SQLITE_FCNTL_MMAP_LIMIT to SQLITE_CONFIG_MMAP_SIZE and
SQLITE_FCNTL_MMAP_SIZE, respecctively.  
The default mmap_size is now always 0, meaning that
memory mapped I/O is off by default.  There is a new compile-time option
SQLITE_MAX_MMAP_SIZE that determines a hard upper bound on the mmap_size.
Setting SQLITE_MAX_MMAP_SIZE to zero disables the memory-mapped I/O logic
and causes it to be omitted from the build.  An extra argument is added
to SQLITE_CONFIG_MMAP_SIZE that can optionally lower the SQLITE_MAX_MMAP_SIZE
at start-time. The SQLITE_MAX_MMAP_SIZE is zero for platforms where we 
know that it does not work, meaning that it cannot be turned on by mistake
on those platforms.

FossilOrigin-Name: ea1404a10abd7f68e1f8e0708c8a3199d1f79665
2013-04-15 17:03:42 +00:00
drh
a1f42c7c32 Add the SQLITE_CONFIG_MMAP_LIMIT configuration option for overriding the
SQLITE_DEFAULT_MMAP_LIMIT compile-time setting.  Enhance "PRAGMA mmap_limit"
so that without a specific database name, it sets the limit on all database
files and changes the default for any future databases that might be added
using ATTACH.

FossilOrigin-Name: 78141d0a16dd1d56b575fccd149de7fa789cb06c
2013-04-01 22:38:06 +00:00
mistachkin
48864df97d Many spelling fixes in comments. No changes to code.
FossilOrigin-Name: 6f6e2d50941e444ebc83604daddcc034137a05b7
2013-03-21 21:20:32 +00:00
drh
5c5760aa81 Do not rollback the schema if a parsing error occurs while parsing the schema
and writable_schema is set.

FossilOrigin-Name: 680d3ab56b578bd4b0170559f9e35615ff43cf2c
2013-02-19 18:34:45 +00:00
dan
71ba10d3c9 Fix problems in test_sqllog.c. Clarify the experimental SQLITE_CONFIG_SQLLOG interface. Handle at least the more likely error conditions in test_sqllog.c.
FossilOrigin-Name: 429c5b2056d7b7c644ca53bc97b8e0b9cb89ab04
2012-11-27 10:56:39 +00:00
dan
ac45593931 Add an option to register global hooks used for logging all SQL executed by an application.
FossilOrigin-Name: cd501bbccf3e62b002317592cc331770b32c129a
2012-11-26 19:50:41 +00:00
drh
a575967793 Make it possible to disable the subquery-by-coroutine optimization using
sqlite3_test_control().  Remove an always-false conditional.

FossilOrigin-Name: 564631f3e45f8f8a8db69f1e0df0d1dadbad8a2c
2012-10-30 14:39:12 +00:00
mistachkin
c197eedbb4 Fix several compiler warnings seen with MSVC.
FossilOrigin-Name: 8b5f617c2a5f0bf7bdbd9144aee58d69564db1e2
2012-10-01 20:12:30 +00:00
drh
f784c1ede9 Query planner enhancements to be more agressive about optimizing out ORDER BY
clauses - in particular the query planner now has the ability to omit ORDER BY
clauses that span multiple tables in a join.

FossilOrigin-Name: 1e874629d7cf568368b912b295bd3001147d0b52
2012-09-28 00:44:28 +00:00
drh
7e5418e4a4 Add more bits to the bit vector that is used to disable optimizations for
built-in test.  Add specific bit patterns to disable ORDER BY using an
index in general and for joins.  Use macros to test for bits in the 
disabled-optimization bit vector, in order to make the code clearer.

FossilOrigin-Name: d2fcba1e143beca8c45724d2108870657c269e17
2012-09-27 15:05:54 +00:00
drh
cec320fb0e Merge the "PRAGMA busy_timeout" change into trunk.
FossilOrigin-Name: 1a679a1ef3b4f2d898c8cd83432d2b4c12bd93fa
2012-09-27 12:11:25 +00:00
drh
de9a7b8a94 Add the ability to disable the covering-index-scan optimization at compile-time,
start-time, or at run-time.  Add test cases to check this configurability.

FossilOrigin-Name: ccb8ecc30c8e6c7760131250297c2e452bbac43b
2012-09-17 20:44:46 +00:00
drh
a371ace426 Change boolean fields in the Column object from unsigned characters into
bits in a single bit mask variable.

FossilOrigin-Name: 4163f5f194741bc2bdf141973912661c6aac70f1
2012-09-13 14:22:47 +00:00
mistachkin
5dac843233 Added sqlite3_errstr API to translate a result code to the corresponding error message.
FossilOrigin-Name: bf8a9ca5b58404112a8af666f5840b462b7bbfe1
2012-09-11 02:00:25 +00:00
drh
c0c7b5ee74 Have PRAGMA busy_timeout return 0 if the busy handler has been changed
or cancelled.

FossilOrigin-Name: 7be5bc36798d30f50658b70fc0bd31af897f3a87
2012-09-07 18:49:57 +00:00
drh
f360396c47 Add an experimental busy_timeout pragma to facilitate access to the
sqlite3_busy_timeout() interfaces for programmers that are working from
behind a language wrapper that does not expose that interface.

FossilOrigin-Name: 22ebc668516bc3dd5782d6d3d42dc7fd2eed7d79
2012-09-07 16:46:59 +00:00
drh
ed68801b20 Add the sqlite3_close_v2() interface (from the deferred-close branch) that
allows close operations to happen out-of-order in bindings to
garbage-collected langauges.

FossilOrigin-Name: fb8893abeefabe9de44e34dcf4327764481189f5
2012-06-21 15:51:42 +00:00
mistachkin
4104337270 Fix compiler warning.
FossilOrigin-Name: 37d9bc061d5ecfe37ccbd6f559986d7ae0449179
2012-06-15 20:42:43 +00:00
dan
0b8dcfa2bd Fix a problem preventing a shared in-memory database from being attached to a read-only connection.
FossilOrigin-Name: 7caca1939ce70d5b14ae8ca8ff6afb62f8aff361
2012-06-07 17:16:04 +00:00
drh
cc71645bf7 Merge the changes need to compile on WinRT into trunk.
FossilOrigin-Name: 61360ca6ca3448477d5c662d3642beef6dd2079e
2012-06-06 23:23:23 +00:00
drh
bae591a960 Merge the latest trunk changes into shared-schema branch. Also fix a C99-ism
in that branch.

FossilOrigin-Name: 42338e9e6979bb497823527f8f39e96f63623c59
2012-06-05 19:20:03 +00:00
drh
167cd6ab78 Revert sqlite3_close() to legacy behavior. Create a new sqlite3_close_v2()
interface that exhibits the deferred-close behavior.  This minimizes the
chance of breakage in legacy apps.

FossilOrigin-Name: c4b8621125ce77308b06692d92f70586b10055a9
2012-06-02 17:09:46 +00:00
drh
4245c405ea The sqlite3_close() interface returns SQLITE_OK even if there are outstanding
sqlite3_stmt and sqlite3_backup objects.  The connection becomes a zombie.
Resource deallocation is deferred until the last sqlite3_stmt or 
sqlite3_backup object closes.  This is intended to help SQLite play nicer
with garbage collectors.

FossilOrigin-Name: e276a02b7f54e804caa553dca99023416a415e1c
2012-06-02 14:32:21 +00:00
drh
9c67b2aae0 Add the mode=memory option to URI filenames, which when present forces the
database to be an in-memory database.  This enables named in-memory databases.

FossilOrigin-Name: 651520fa84ee0c488bef660bab9865500309d5e9
2012-05-28 13:58:00 +00:00
drh
4ab9d254e0 Only allow :memory: databases to share cache if there are created using a
URI filename.  This minimizes the risk of breakages in legacy applications
that have shared-cache enabled but also use :memory: databases which they
expect to keep separate.

FossilOrigin-Name: e3ad61e0308a8442c2bdb7cdb3465576cd39ed4a
2012-05-26 20:08:49 +00:00
drh
5efb314525 Avoid using sqlite3ResetAllSchemasOfConnection() purely for its side-effects.
FossilOrigin-Name: 5587c73badc07d3e01a7c5c5964e178b5112dd24
2012-05-16 01:24:34 +00:00
drh
81028a455d The former sqlite3ResetInternalSchema() routine was really two different
routines, selected by parameter, each with a confused mission.  So split
this routine up into three separate smaller routines, calling each
separately as needed.  Hopefully this will make further refactoring and
schema reset collateral damage containment easier.

FossilOrigin-Name: aa0c3493d3647d7efe527067e9fcccefda8e3008
2012-05-15 18:28:27 +00:00
dan
bba02a95d9 When a connection disconnects from a shared-cache database, only delete the in-memory schema if there are no other connections.
FossilOrigin-Name: 46f4eb5430d7bc9a339cdf7124ff4bd518eaa39b
2012-05-15 17:15:34 +00:00
mistachkin
9917a71da0 Merge updates from trunk.
FossilOrigin-Name: 4ab1ffd45d4c25368b9b393a3336068b747d8b22
2012-03-19 23:32:26 +00:00
mistachkin
86f89871b0 Add SQLITE_OMIT_SHUTDOWN_DIRECTORIES compile-time option to disable clearing the sqlite3_data_directory and sqlite3_temp_directory variables during sqlite3_shutdown. Also, only clear the variables if the heap was actually shutdown.
FossilOrigin-Name: 1ae9f9e4f730eccbc0fc3408de1ac3c4be931e01
2012-03-18 01:32:44 +00:00
mistachkin
e4c46aaccd Reset the sqlite3_data_directory and sqlite3_temp_directory variables when the sqlite3_shutdown function is called since they may refer to memory allocated by the heap subsystem that was just shutdown.
FossilOrigin-Name: cd70bc4b788b947d47a7a7158c27028160df06bd
2012-03-16 10:28:40 +00:00
drh
421377e67a Add the sqlite3_db_readonly() interface. This is still tentative, pending
a closer look at other ideas to accomplish the same thing.

FossilOrigin-Name: 254f99ea9ff1534948bdb179e69ab0c940c87ec1
2012-03-15 21:28:54 +00:00
mistachkin
a112d140ae Add experimental support for resolving relative database file paths using a fixed user-defined directory.
FossilOrigin-Name: 7354ae8fd3eccee2cf9f6501da5b1a014c31556f
2012-03-14 00:44:01 +00:00
drh
cd565fd118 Fix a typo in the header comment of sqlite3_commit_hook().
FossilOrigin-Name: 3784d1475b49f24e4a51450edc94aee66fd48fe4
2012-03-01 21:30:44 +00:00
drh
21021a5cbf Add the new SQLITE_ABORT_ROLLBACK extended error code to be returned for
statements that are cancelled due to a rollback.

FossilOrigin-Name: 549f4fd00d8325c10099b100e5202b77ee1d83ad
2012-02-13 17:01:51 +00:00