Commit Graph

11171 Commits

Author SHA1 Message Date
drh
f1645f0843 Inserting a few WhereLoop objects without leaking memory. Costs are
not correct.  Inequality and IN constraints are not implemented.

FossilOrigin-Name: e8881a8b2f25f38bc8ff77619f96f38fe530d13b
2013-05-07 19:44:38 +00:00
drh
c01b7306ae Make sure the ORDER BY collating sequences are compatible with the
comparison collations before using the merge algorithm for compound
SELECT statements.  Candidate fix for ticket [6709574d2a8d8].

FossilOrigin-Name: fc3630cdef6e2cdbfb4e7b373d1a094753e55016
2013-05-07 17:49:08 +00:00
dan
e8dee7d1ed Modify the fts3tokenize table implementation so that it does not use the SQL function fts3_tokenizer. The user may have installed an authorizer callback that prohibits this.
FossilOrigin-Name: 0ba67b64de258883e4c43db09e131bb67083855e
2013-05-07 12:16:48 +00:00
drh
1ba00291a3 In the command-line shell, output the elements of the schema in the order
that they appear in the sqlite_master table.  This is necessary in some
cases to make the schema parsable.

FossilOrigin-Name: e5b3cd747bb0b484e38b8611a81925e2cc144435
2013-05-06 21:01:06 +00:00
drh
151b7d5bad In the command-line shell, make sure the output of dot-commands goes to
the same redirected output stream as the result of queries.
Ticket [2f96536e7ff7dba]

FossilOrigin-Name: b72d365920dbe45e61d8b1cff708a8858c2b3e33
2013-05-06 20:28:54 +00:00
drh
acf9c2b555 Add an assert() to fts3_expr.c in order to silence a clang warning.
FossilOrigin-Name: d8dc2c5fb554eb5898ddc8d703c6a360af7fe023
2013-05-06 14:57:48 +00:00
drh
2722898c6c Make sure the authorizer callback gets a valid pointer to "ROWID" for the
column-name parameter when doing an UPDATE that changes the rowid.
Fix for ticket [0eb70d77cb05bb2272].

FossilOrigin-Name: 26a59bb88d4082758eb281b365b57f9a0c059d89
2013-05-06 13:22:50 +00:00
drh
1c8148fffb In where.c, make findTerm() a wrapper around methods to a new WhereScan object
which is capable of finding all suitable matching terms, not just the first.
This check-in includes some prototype functions for building WhereLoop objects.

FossilOrigin-Name: dd92b8fa929badaf2f79e8a00c83667a9d589096
2013-05-04 20:25:23 +00:00
drh
178e7ee76f Add magic numbers for Bentley Systems application files.
FossilOrigin-Name: 9314b08099e7ac99a507a4799f2c6cdd6d597abb
2013-05-03 20:08:16 +00:00
drh
ec7ecb8c9a Merge all recent trunk changes into the sessions branch.
FossilOrigin-Name: 3879ab1b532828fcc12a50a95b6730faebcb69e9
2013-05-03 18:29:22 +00:00
drh
bce5beee18 Allocate meta(8) in the header as the "application ID" and add the
"PRAGMA application_id" command to query and set it.

FossilOrigin-Name: b2efe4f225adc5f4c2e3080bf459cc52fff82e18
2013-05-03 15:23:24 +00:00
dan
32c12fe2bb Minor fixes for compilation with SQLITE_OMIT_WAL defined.
FossilOrigin-Name: b81e87e72b976e7157a53a50abc5422e2a6c4c39
2013-05-02 17:37:31 +00:00
drh
f1b5f5b855 Begin inserting some experimental code for the next generation query planner.
FossilOrigin-Name: ccaf4c3f7e1ec45e058d594d9b5c26818a37722a
2013-05-02 00:15:01 +00:00
drh
8a28a31028 Fix comments in the magic number file.
FossilOrigin-Name: 5a500848d2fa96fc7397e2acb64d5ae6551b5b1e
2013-05-01 20:40:46 +00:00
drh
b8a67ec827 Preserve the application-ID across VACUUM. Updates to the magic number
file.

FossilOrigin-Name: 4a190bea18e156b6fa4dc9f21c3ad32409049603
2013-05-01 20:36:23 +00:00
drh
4ee09b4bcc Allocate 4 bytes of unused header space for an "Application ID". Add
the "PRAGMA application_id" command to set and query this identifier.
Add the "magic.txt" file to show how the posix file command might use
this application id.

FossilOrigin-Name: 28c9e7fdee2471a3026ee05ff591194d5f398131
2013-05-01 19:49:27 +00:00
drh
a309552e2c Do not use a transitive constraint to an IN operator where the RHS is a
constant if there exists a direct == operator to another table in an outer
loop.

FossilOrigin-Name: faedaeace9c7ed9a8aaf96700caee09db0c0c061
2013-05-01 17:58:35 +00:00
drh
5c10f3b38e Avoid redundant constraint checking due to transitive constraints.
FossilOrigin-Name: 329478cbed06f93652de50abdb31a6b41af02b9e
2013-05-01 17:22:38 +00:00
drh
9a1eccb621 Update the documentation to explain that when the 3rd parameter to
sqlite3_bind_text() and friends is NULL the result is to bind a NULL
SQL value.  Ticket [19b44e35753ba]

FossilOrigin-Name: bd92de0e8d922b96513c5d431493800dda7e7562
2013-04-30 14:25:32 +00:00
drh
3c449c6b6b Make sure extra parentheses around subqueries in the FROM clause are harmless.
Ticket [28c6e830f239ea5].

FossilOrigin-Name: 1c79569226db3d5a73e65a35877635ea8b478866
2013-04-30 14:06:57 +00:00
mistachkin
dd08ca0ff9 Add the #ifdefs for sqlite3ErrName() to sqliteInt.h as well.
FossilOrigin-Name: 400fc4c37ff34e84f5a129a083a567bda840278e
2013-04-30 07:58: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
dan
3a01b600d3 Improve the error message issued when an FTS query exceeds the maximum allowable tree depth.
FossilOrigin-Name: f480b1fe6012f36c59cd0525efdc6df74143ccd0
2013-04-29 18:07:37 +00:00
dan
181f4f789d Fix an off-by-one in the code for limiting the depth of FTS expression trees.
FossilOrigin-Name: 72ac73189c3577740a77d2ea2fc7118391c0703f
2013-04-29 17:12:06 +00:00
mistachkin
a3514f1027 Merge mmap test fix from trunk.
FossilOrigin-Name: 95811877fdcbede4f61269ff1c7a6d9554f669cd
2013-04-29 09:20:06 +00:00
dan
f054396b38 Fix mmap1.test so that it passes on windows as well as unix.
FossilOrigin-Name: 52417eac3ecaec2dbbde170334358f5ddbd32501
2013-04-29 09:17:42 +00:00
mistachkin
56749cd1ba Adjust a WAL test result due to changes in the corresponding return code name.
FossilOrigin-Name: 9272009f7932b3f18006f73776e36b8ef8770d3e
2013-04-29 08:58:00 +00:00
mistachkin
84edc19a67 Merge updates from trunk.
FossilOrigin-Name: 3a245a832d4843802c3c57f8cda3e4e1d0d52622
2013-04-29 08:56:49 +00:00
mistachkin
4eb9b72151 Update 'fuzzerfault' test for its new module loading command. Fix several test names in 'io.test' and make sure the database gets closed between tests.
FossilOrigin-Name: e81e9ca11db09424dd310bbc91686a5daa618cb1
2013-04-29 07:01:23 +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
015db9c859 Remove spellfix virtual table documentation from the source tree.
Reference the separate documentation on the website instead.

FossilOrigin-Name: adcf78909ff9064b6e3c4dd15ccd3245c8cf270b
2013-04-27 18:06:40 +00:00
drh
c5797545de Untested fix for building on VxWorks.
FossilOrigin-Name: f14d55cf358b0392d3b8cd61dc85f43a610a8edf
2013-04-27 12:13:29 +00:00
drh
a13090fee9 Fix a formatting typo in a comment. No changes to code.
FossilOrigin-Name: 7a97226ffe174349e7113340f5354c4e44bd9738
2013-04-26 19:33:34 +00:00
dan
8e4714b303 Avoid unnecessarily reseting the pager cache after committing a transaction that takes advantage of the SQLITE_IOCAP_ATOMIC related optimization.
FossilOrigin-Name: c47144e98c0a0f9e09780c945de10c57b6a495ea
2013-04-26 18:36:58 +00:00
dan
77b428aa33 Avoid using posix_fallocate() in WAL mode, as it is not supported by all file-systems.
FossilOrigin-Name: 1bbb4be1a25947f75b2b0c6f368199016b6f7de3
2013-04-26 17:00:52 +00:00
dan
47a2b4a0b0 Avoid using posix_fallocate() in WAL mode, as it is not supported by all file-systems.
FossilOrigin-Name: 9c7523dabf4aee609287732ce787c9b9a9087e7f
2013-04-26 16:09:29 +00:00
drh
9ea88b2b48 Update documentation with new hyperlinks. No changes to code.
FossilOrigin-Name: 640eb54ad6aac9bc7109cba167389a9bcec3f21e
2013-04-26 15:55:57 +00:00
dan
5e2f28c1aa Rebalance FTS expressions after parsing to limit recursion during evaluation. Avoid recursion when deleting FTS expression trees. Enforce a limit (currently 12) on the depth of an expression tree.
FossilOrigin-Name: 49d23ef61f9ce2ffe13237b51a0e01b0b46ba96b
2013-04-26 14:13:15 +00:00
dan
2ea54000a1 Merge another trunk change.
FossilOrigin-Name: 2648966f17bc1b783ef6d3b2368c613f6e02945e
2013-04-26 14:04:28 +00:00
drh
6f77140f78 Fix harmless compiler warnings in the FTS expression parser.
FossilOrigin-Name: 3c78af8c535e16518f18733325f4cd1df7ec8282
2013-04-26 13:14:19 +00:00
drh
2bba8c249a Reduce the default SQLITE_MAX_MMAP_SIZE slightly so that it fits in a
signed 32-bit integer.

FossilOrigin-Name: 460752b8575320163d2659bb7ff24aff41e2bb66
2013-04-26 12:08:29 +00:00
dan
0d02dd8292 Merge latest trunk changes.
FossilOrigin-Name: 4d08e74d34e82f3be588049c9576a5c1008435e7
2013-04-26 06:58:06 +00:00
dan
aa29c86e49 Rebalance FTS expressions after parsing to limit recursion during evaluation. Avoid recursion when deleting FTS expression trees. Enforce a limit on the depth of an expression tree.
FossilOrigin-Name: f968d43f80cc2f236e7d09ba1e8278343e2b6976
2013-04-25 20:34:02 +00:00
drh
ea41dc44c5 Added the nextchar.c extension. Minor changes to the spellfix.c extension
so that it can be appended to an amalgamation and compiled without duplicating
symbols.

FossilOrigin-Name: 56b9a417f5451631f11c5206d625f11472ee65f9
2013-04-25 19:31:33 +00:00
drh
e67f418d10 Fix the tool/build-shell.sh script to remove references to files that are
now loadable extensions.

FossilOrigin-Name: aabeea98f53edde68f484f1794ae70789dac3889
2013-04-25 17:27:08 +00:00
drh
d9555a7927 Add wiki documentation files for the spellfix1 virtual table.
FossilOrigin-Name: 381564e91bbf619f99a48b0b7a94ac586cb9ee79
2013-04-25 17:07:26 +00:00
drh
c140a6b40d Merge the std-ext branch into trunk. This merge adds several new extensions
to the ext/misc folder, including transitive_closure, ieee754, and amatch,
and it convers some older src/test_*.c file into extensions in the ext/misc
folder.

FossilOrigin-Name: bbe607c7d17c50b667990360e2ccfab8dd22f161
2013-04-25 16:52:19 +00:00
drh
8416fc7fc7 Added the transitive_closure, ieee754, and amatch extensions.
FossilOrigin-Name: 84018099c8715b982cd24ce9221f93c7379e8c08
2013-04-25 16:42:55 +00:00
drh
b7045ab2ed Move the test_spellfix.c module to ext/misc/spellfix.c.
FossilOrigin-Name: de556add10150140981a2e34b3712e96a7c262e3
2013-04-25 14:59:01 +00:00
drh
1fb64af1dc Fix the MSVC makefile so that it works with the ext/misc/*.c extensions.
FossilOrigin-Name: 680822e892f3efdb702eea3b321bc5785239dd56
2013-04-25 14:36:28 +00:00
drh
e50db1c5d2 Convert the fuzzer virtual table into a loadable extension and move it
to the ext/misc/fuzzer.c file.

FossilOrigin-Name: c8c69307f60c1d07ac666ae3797b7e3f286fd491
2013-04-25 14:31:46 +00:00
drh
24b6422dcb Make test_wholenumber.c into a loadable extension and move it to
ext/misc/wholenumber.c.

FossilOrigin-Name: efcc9dd012b5f193324dfc2ee9c2410c16fc1b3b
2013-04-25 11:58:36 +00:00
drh
aa87f9a68b Make sure the affinity and datatype of sub-subqueries are initialized
prior to subqueries as the latter relies on the former.

FossilOrigin-Name: 39b4e6ff9316cc78ea88349091e195b8104d1e9e
2013-04-25 00:57:10 +00:00
drh
ed17167e1d Fix a simple comment typo. No changes to code.
FossilOrigin-Name: f136bd95824dc95b9e6acdc4d55db263ba13fbaa
2013-04-24 13:50:09 +00:00
drh
248f2be91a Make "test_regexp.c" into a loadable extension and move it over to
ext/misc/regexp.c.  Add the "load_static_extension" command for testing
purposes.

FossilOrigin-Name: 860fc393bff27045e0593c3c51bf5577accd0b79
2013-04-23 20:10:13 +00:00
drh
16fb176814 Merge the latest trunk changes into the sessions branch.
FossilOrigin-Name: 6994826c0784280f2e9728dfa4185848846d03df
2013-04-22 23:59:06 +00:00
drh
da8caa0b2d Fix harmless compiler warnings.
FossilOrigin-Name: 1a1cf5aa86734c832d845e07780262a178188d56
2013-04-22 23:38:50 +00:00
drh
d99aaf10df Do not allow a virtual table to cancel the ORDER BY clause unless all
outer loops are guaranteed to return no more than one row result.
Candidate fix for ticket [ba82a4a41eac1].

FossilOrigin-Name: 49cfa14fceeef2d55b449eb927c283ce6f650c07
2013-04-22 19:56:12 +00:00
drh
4d648c777b Update MSCV makefile for the fts3tokenize virtual table. Clear some
harmless compiler warnings in the fts3tokenize code.

FossilOrigin-Name: 2b3fed09eb89f1e9d6a5f7487ef526b46eb51490
2013-04-22 17:07:56 +00:00
dan
d7a959c694 Add virtual table module 'fts3tokenize' to fts3. fts3tokenize provides SQL access to FTS tokenizer implementations.
FossilOrigin-Name: c5a4b21a15bd8a184380817ff41657acbccb866d
2013-04-22 15:30:37 +00:00
drh
b9830a1454 Enhanced documentation for the SQLITE_CONFIG_SQLLOG mechanism and the
test_sqllog.c demonstration file.  No changes to code.

FossilOrigin-Name: 206caf21f6f6963aa38a9aa0f6ea11c7230bb726
2013-04-22 13:51:09 +00:00
drh
0c41d22920 Use transitivity to move constraints into the outer loops of a join whenever
possible, thereby reducing the amount of work that needs to occur in
inner loops.

FossilOrigin-Name: 5f4907e1c6230e3dd904bd99e1c48c576c669f63
2013-04-22 02:39:10 +00:00
drh
cca17c303b Add the "warning" command to the TCL test infrastructure. Fix problems
with the loadext.test module.

FossilOrigin-Name: 514adbbd8cf3e296f55e8f803bddaac8ad8b2c96
2013-04-19 12:32:52 +00:00
drh
f8b1c69e93 Enhance the extension loading mechanism so that the same source code
can be used for run-time loadable extensions and statically linked
extensions, and to mask architectural differences in shared libraries.

FossilOrigin-Name: a85b6ecefa14fcfe6ebfceabf910f00c3721be7d
2013-04-19 02:47:05 +00:00
drh
08ef8d7311 Make the SQLITE_EXTENSION_INIT1 and SQLITE_EXTENSION_INIT2 macros into
no-ops if the extension is statically linked.

FossilOrigin-Name: 86eb3eed4c70730dba0e319f243f8cb4fa8de06c
2013-04-19 01:23:06 +00:00
drh
c288e442e3 Experiments in making loadable extensions easier to program. The
shared library filename tries various operating-system specific extensions
if the bare library name does not work.  And the entry point is derived
from the filename is the legacy entry point name "sqlite3_extension_init"
is not found.

FossilOrigin-Name: 6cfa1d73d79b9f0be8157f0a37c264dd95b031c8
2013-04-18 22:56:42 +00:00
drh
93c8c457e8 Fix an incorrect comment (a copy/paste error) in the mptester. No code
changes.

FossilOrigin-Name: e94783f36ade43ef9d5b94db278622bcbce4179b
2013-04-18 20:33:41 +00:00
drh
bc08281954 Add the --breakpoint and --show-sql-errors commands to mptester.
FossilOrigin-Name: d0898fd76a54512894418e53ba28703e250c9ed3
2013-04-18 15:11:03 +00:00
drh
a956af67e1 Fix a compiler warning in sqlite3_compileoption_used().
FossilOrigin-Name: e9f9d84b223b69d36688cd7a4c7c696bfda8a1ad
2013-04-18 03:10:43 +00:00
drh
83b5bfc7d3 Do not suppress the ORDER BY clause on a virtual table query if an IN
constraint is used.  Fix for ticket [f69b96e3076e].  Testing done on
TH3 using cov1/where37.test.

FossilOrigin-Name: 61b2a7be3b9c04bf45bffa93a7d3a480fc5c947a
2013-04-18 02:55:54 +00:00
drh
44fddcad02 Fix the --match command in mptester so that it checks the entire result,
not just a prefix of the result.

FossilOrigin-Name: 3e3ecad2b5d6c97032f2a9fb920c1b8a16ab8ef5
2013-04-17 19:42:17 +00:00
drh
87f9caa85c In the mptester, add --glob and --notglob and --testcase. Make --exit work
on the main thread.  Enable the load_extension() SQL function.

FossilOrigin-Name: c273c171f511475045ef0aa68ecf8e22b8351996
2013-04-17 18:56:16 +00:00
drh
7a411f441b In the command-line shell, allow a dot-command to occur after a
multi-line c-style comment.

FossilOrigin-Name: e2c94ab930f0e5a6dbe8cdd34ebb8cfeeedca56c
2013-04-17 17:33:17 +00:00
drh
4670f6d5f6 Improvements to some of the comments that are used to render documentation
concerning loadable extensions.  No changes to code.

FossilOrigin-Name: 76f4e31245fd1676a4520a2f7488bca6eb981e4a
2013-04-17 14:04:52 +00:00
drh
99b390827b Update the command-line shell to give an exit code of 0 when the ".quit"
command is run from the command-line.

FossilOrigin-Name: 467e218120d63d0f34c447f7324bac1364ac0eac
2013-04-17 12:19:48 +00:00
drh
d16d0bc58b Omit sqlite3_compileoption_used() entries that are not explicitly stated
on the compiler command-line, except keep SQLITE_THREADSAFE around so that
there is always at least one compilation option.

FossilOrigin-Name: 109d6767d2626741db1d15ed55e699ac3184a536
2013-04-16 18:24:34 +00:00
drh
50287f5c0c Remove the unused SQLITE_CURDIR macro.
FossilOrigin-Name: 16f7ba4afaa69f6150b4defd4ddf5800f5d23084
2013-04-16 14:58:52 +00:00
drh
0f2340132f Disable memory-mapped I/O when the codec is enabled.
FossilOrigin-Name: 340cca3079cd7aac2f51071435666e9e00ed8bd5
2013-04-16 14:52:47 +00:00
mistachkin
5824e05315 Expand scope of the SQLITE_MAX_MMAP_SIZE define for the Win32 VFS.
FossilOrigin-Name: f4b8faab45e217f227bd7ce65d4741754731b8cd
2013-04-15 20:08:27 +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
a1710cc2ea Fix a formatting typo in a comment. No changes to code.
FossilOrigin-Name: 3412424990c93d2978e819e6099811f1cdde316d
2013-04-15 13:10:30 +00:00
drh
f9b70c4b1f Only consider AS names from the result set as candidates for resolving
identifiers in the WHERE clause if there are no other matches.
In the ORDER BY clause, AS names take priority over any column names.
Fix for ticket [2500cdb9be].

FossilOrigin-Name: d0d5af79a005de30194863c57c5018ee75e03581
2013-04-14 23:51:27 +00:00
drh
a3a5bd9b62 Only consider AS names from the result set as candidates for resolving
identifiers in the WHERE clause if there are no other matches.  In the
ORDER BY clause, AS names take priority over any column names.
Candidate fix for ticket [2500cdb9be].

FossilOrigin-Name: ad53924dcadffb95c6497c46c228c67e8f5370e4
2013-04-13 19:59:58 +00:00
dan
4b2ac35e5b Add a test case for detaching a database referenced by an fts4aux table created in the temp schema.
FossilOrigin-Name: 6d6f0592abe237256dbdf30ab0ba0bb0c365dd95
2013-04-12 16:53:19 +00:00
dan
a8f60381a9 Change the fts4aux virtual table module so that fts4aux tables created in the temp database may report on fts3/fts4 tables in any attached database.
FossilOrigin-Name: 546a187f1361dad340ed8f6c28dd89e6c19f9c33
2013-04-12 16:47:27 +00:00
drh
8bc8bfcb05 Fix the xCheckReservedLock() method on the windows VFS so that it cannot return a false positive when two or more processes use it at the same time on the same file. Ticket [7ff3120e4fa54abb55]. Update to version 3.7.16.2.
FossilOrigin-Name: 67b3c0efa7d5e0cb7cc0fc7606ab3f26ea5419fd
2013-04-12 13:53:50 +00:00
drh
226fb534dd Version 3.7.16.2
FossilOrigin-Name: cbea02d93865ce0e06789db95fd9168ebac970c7
2013-04-12 11:52:43 +00:00
drh
739ee7ffac In mptester: improve the way that child processes are dispatched. Pass
the --vfs option through to children.  Log the command used to start
child processes when the tracing level is high enough.

FossilOrigin-Name: 55718ae3462b2b6e0774d49e1c4c74143bc9e3a5
2013-04-12 01:04:36 +00:00
mistachkin
fdd72c9a2f For the multi-process tester on Win32, make use of the GetCurrentProcessId API.
FossilOrigin-Name: f1b524b9d9ea3db96d54ac55c39f15e6879085bd
2013-04-11 21:13:10 +00:00
drh
7f6e147a51 Increase the version number to 3.7.16.2 and cherrypick the
fix for ticket [7ff3120e4fa54abb55].  This check-in is a release
candidate.

FossilOrigin-Name: 86f26f9152988e47d7e1cfcca9eedf5e6265a225
2013-04-11 19:04:20 +00:00
drh
e82c6c39f4 Fix the xCheckReservedLock() method on the windows VFS so that it cannot
return a false positive when two or more processes use it at the same time
on the same file.  Ticket [7ff3120e4fa54abb55]

FossilOrigin-Name: dd3510bb20ade173c81c9874c05466011c8a249d
2013-04-11 18:28:55 +00:00
drh
ef8e986bde Fix pragma code generation so that it always outputs an OP_Trace opcode so
that pragmas are shown in sqlite3_trace() output.

FossilOrigin-Name: 663f04bd48bc6f302230a22bd22b82bde2353943
2013-04-11 13:26:18 +00:00
drh
e3be8c8627 Show the process-id on log messages from mptester.
FossilOrigin-Name: 6748a83dc5c02db37ecd963e678c5c69db142cac
2013-04-11 11:53:45 +00:00
drh
fbc7e8845d Have the UNIX VFS issue warnings via sqlite3_log() if a database file is
renamed or unlinked or linked to more than one name while the file is open.

FossilOrigin-Name: e238dcf9189c029fbdcf89339e21d9cdd8fbf2c5
2013-04-11 01:16:15 +00:00
mistachkin
73c4041b43 Correct minor typo in two regular expressions.
FossilOrigin-Name: f1eed92b7b0ef4ee22a11d8bb4f9a572b56ce019
2013-04-11 00:45:28 +00:00
mistachkin
08d418904a Enhance multi-process tester integration with the Win32 API.
FossilOrigin-Name: 0fdc743583c67a3a017b9ad812c62a5104b9aee7
2013-04-11 00:09:44 +00:00
drh
d040e76442 Add new primary error codes SQLITE_NOTICE and SQLITE_WARNING for use with
sqlite3_log().  Add new extended error codes SQLITE_NOTICE_RECOVER_WAL and
SQLITE_NOTICE_RECOVER_ROLLBACK to use with sqlite3_log() messages that occur
on each recovery.

FossilOrigin-Name: be7d2c5482c41baf000d7fb5dccc31b974e91064
2013-04-10 23:48:37 +00:00
drh
56282a5bc7 Add the sqlite3_strglob() interface.
FossilOrigin-Name: 41d6ff32a6dd1311dc3aabe5156335a64a886919
2013-04-10 16:13:38 +00:00
drh
eeeee7f55d Designate the beginning and the end of the sqlite3session.h file in the
constructed sqlite3.h file.

FossilOrigin-Name: 53f5be74327162a2bd25a91eaf7c91b126294727
2013-04-10 15:01:36 +00:00
drh
4c5298f352 Use symbolic names for tasks in mptester.
FossilOrigin-Name: f0d95afc73f8dbce8943dceb4a14b7de650c8823
2013-04-10 12:01:21 +00:00
mistachkin
21c9b6bdc9 Fix typo in name of mptest executable files in clean targets.
FossilOrigin-Name: 4c7d9e1ed8722e0c75b5fdbeffb9030ccef0bd64
2013-04-10 03:06:43 +00:00
mistachkin
65eb64765c Correct test numbering on several rtree tests.
FossilOrigin-Name: 0adf8a3a4f2ca370568b35c9e8ce0e18f18701a2
2013-04-10 02:56:24 +00:00
drh
7de96f7fc1 Limit integrity_check output to 10 lines in mptester scripts.
FossilOrigin-Name: 67ee0dc0f4de5dc2ae92fb98932f1fdda3e76bdf
2013-04-09 20:04:09 +00:00
drh
ab755ac81a Change the rollback journal so that it invokes sqlite3_log() make a record
of a recovery, just as the WAL journal does.

FossilOrigin-Name: 7cd3f6cd3a39ed1c4bbf9e3508824150632c5bd9
2013-04-09 18:36:36 +00:00
drh
6e0b6d52da Add extra #ifndef statements in os_unix.c and os_win.c to make sure the
memory mapped I/O really is disabled when SQLITE_DISABLE_MMAP is set.

FossilOrigin-Name: c1e2523c9051782569291fff998140f7e0b70b6d
2013-04-09 16:19:20 +00:00
drh
188d488409 Disable the use of memory-mapped I/O if the SQLITE_DISABLE_MMAP macro is
defined.  Automatically define this macro for OpenBSD and QNX.  Other
systems are likely to be added to the disabled list over time.

FossilOrigin-Name: 8a4314a398c6c6efb25e6993c826b7e60d9bb1f9
2013-04-08 20:47:49 +00:00
drh
f90e50f60b In mptester, handle startScript no-change commits using a retry rather
than grabbing an exclusive transaction.

FossilOrigin-Name: ae8bb24bfb014bdcb8aaa8159ddae0cd376afe99
2013-04-08 19:13:48 +00:00
drh
6adab7a1a8 Still more tests using mptester. Added test cases that leave rollback
journals that must be recovered by other threads.

FossilOrigin-Name: 437b674f00610e2b925dc00ca27b5022e3858994
2013-04-08 18:58:00 +00:00
drh
023dd903cc Adding tests to the mptester scripts.
FossilOrigin-Name: e121adceb1e267e032dcbadb74eaa692a12a65bb
2013-04-08 17:57:26 +00:00
drh
e5ebd22d99 Change mptester to avoid reporting SQLITE_BUSY errors if the busy handler
is turned off and the tracing level is set low.

FossilOrigin-Name: d77407ae6a9e09dea124dd59b14fdbbc36ed3d4e
2013-04-08 15:36:51 +00:00
dan
bcb8a868ce Handle the case in os_unix.c where SQLITE_FCNTL_MMAP_LIMIT requests that the mmap limit be set to a value smaller than the current mapping.
FossilOrigin-Name: 360473493ec1a7094a2b1c5436f3b70914a6dfdd
2013-04-08 15:30:41 +00:00
drh
554052c600 Merge the multi-process tester into trunk.
FossilOrigin-Name: ea53c45d79772986d2ad289f4f56f333541747e7
2013-04-08 14:41:34 +00:00
drh
bc94dbb661 Add the "mptester" target to the makefiles. Make mptester run with
synchronous off by default.

FossilOrigin-Name: 1397830bfead3699a7e6b1858ae67ae15259b89e
2013-04-08 14:28:33 +00:00
drh
841810cef6 Fix harmless compiler warnings in mptest.c.
FossilOrigin-Name: 59bdbb10ed67bf79e0991e2ad58a28321dedb959
2013-04-08 13:59:11 +00:00
drh
1bf44c7acb Add the vfsname() and eval() SQL functions to mptest.c.
Enhancements to the test/config01.test script.

FossilOrigin-Name: 91397a147ce4f67a7ea1182f06a7dda3a96ec465
2013-04-08 13:48:29 +00:00
drh
7dfe8e2bde Add --if, --else, --endif processing to mptest.c.
FossilOrigin-Name: 51265acae3088a51ac0ce6ab8731e6e15a48d4ae
2013-04-08 13:13:43 +00:00
dan
fbfe388d31 Fix an incorrect type cast in an assignment in vdbe.c.
FossilOrigin-Name: 320b5295da57023399c7b9eed82eae40cf619803
2013-04-08 10:38:57 +00:00
drh
e348fc7fe8 Fix the --source command so that its argument is relative to the script.
Verify that the SQLite header and library match.  Print SQLite version
and compile-time configuration information on startup.

FossilOrigin-Name: 15cb0db7583c3a24cbea0c72576047a93fba0801
2013-04-06 18:35:07 +00:00
drh
8f35eb024e Merge trunk changes into the mptest branch. The mptest needs the
SQLITE_MAX_SCHEMA_RETRY fix in particular.

FossilOrigin-Name: fb7a7773965697855c12193408cb75300decc23c
2013-04-06 18:10:27 +00:00
drh
60625313b0 Increase the default SQLITE_MAX_SCHEMA_RETRY to 50. Make sure that macro
covers every case where a prepared statement might need to be reprepared due
to a schema change.  The sqlite3_exec() interface now uses 
sqlite3_prepare_v2().

FossilOrigin-Name: c1d7304c80c4a6244c8a9f6fad1eebd0f339c724
2013-04-06 18:06:51 +00:00
drh
1790bb36c5 Add SQLITE_CONFIG_LOG error logging to the mptest program.
FossilOrigin-Name: 716c25bd125c8934499c1fb59a60d7e844c0691c
2013-04-06 14:30:29 +00:00
drh
896be7d93a Get the build of mptest working on mac.
FossilOrigin-Name: a0bae686c9d7f08afac00f66067f5147be6231e0
2013-04-06 14:16:41 +00:00
drh
f012ae0759 Get the mptest program running on windows.
FossilOrigin-Name: 3966b33284355325afda627ed6f4e26f967438f8
2013-04-06 14:04:22 +00:00
drh
3f5bc38037 Many improvements to the mptest program. Added a simple test script.
FossilOrigin-Name: 07b0401a9b61b1664fc6dcddac3b5969fc0f481a
2013-04-06 13:09:11 +00:00
dan
abd6d84a11 Add tests to "permutations.test coverage-pager" to cover uncovered branches.
FossilOrigin-Name: 07a0e4e9820a85bf1690214fef3577866c763f92
2013-04-06 11:03:09 +00:00
drh
27338e6ed7 Add a prototype TH3-script-style test harness that starts multiple processes
operating on the same database file at the same time.

FossilOrigin-Name: c318fafe686120d7fb8e487eb3bb4942d497665c
2013-04-06 00:19:37 +00:00
dan
d7a558a9fb Improve the code coverage of "permutations.test coverage-pager".
FossilOrigin-Name: b095e2cdb61ca8487255687f58fb1024d40f3986
2013-04-05 20:40:43 +00:00
dan
ced9813b12 Add further multi-client tests to mmap1.test.
FossilOrigin-Name: a107f75d93b8acd3403d8473a75137378041a833
2013-04-04 19:32:53 +00:00
drh
75f2d540ac Disable memory-mapped I/O for the win32lock.test module
FossilOrigin-Name: 2b3d9805a28e51f646113e22c2dff2272342306e
2013-04-04 17:28:11 +00:00
drh
67f7c780f3 Updates to the file-control documentation. No changes to code.
FossilOrigin-Name: 51fab480d0487107709e6c9e00bc0512b82ef1aa
2013-04-04 01:54:10 +00:00
drh
6109e50f87 Increase the version number to 3.7.17.
FossilOrigin-Name: 5c8c5a2a12f3f5e29c91c4d16e8b4afd4307354e
2013-04-04 00:51:14 +00:00
drh
a478b3fa80 Try to use mmap() to speed access to the database file on windows, linux,
and mac.

FossilOrigin-Name: fff2be60779571c8fb89158db976ec3755e9a223
2013-04-04 00:40:17 +00:00
drh
b0a8ea046a Release resources prior to bailing out of the btreeCreateTable() routine
following an OOM error.

FossilOrigin-Name: b2a72be9bab77f050bef75477a278a6294d3e854
2013-04-03 21:23:28 +00:00
drh
370c9f498d Remove an unreachable branch in the direct blob I/O logic of btree.c.
FossilOrigin-Name: f97d7274f48e3bb98ed17eae11abb55064134874
2013-04-03 20:04:04 +00:00
drh
716d6d2da7 Fix a bug in the detection of iOS when setting the default mmap_limit.
FossilOrigin-Name: ac1432b3a8e968be4cbc138b4a35f34187c0c36f
2013-04-03 13:38:46 +00:00
drh
34f7490311 Change the mmap_limit pragma to report the new limit, or to report the
existing limit if called with no arguments.  Report the default mmap_limit
as part of PRAGMA compile_options.  Set the default mmmap_limit to 0 for
all systems other than linux, mac, windows, and solaris.

FossilOrigin-Name: 2d9f1327fe79e40435ce1e2594d7cd9a5aea0ef2
2013-04-03 13:09:18 +00:00
dan
6c96946475 Remove the restriction on using xFetch to load the root pages of tables and indexes. It appears to have been based on a misconception.
FossilOrigin-Name: 5b082efead488a2fccc18171e640e0aa5252d1d0
2013-04-03 11:52:16 +00:00
dan
f7679ad19e When moving a page to make way for the root page of a new table or index in an auto-vacuum database, save the positions of any cursors that may be holding xFetch references to the page being moved.
FossilOrigin-Name: 9d9b1da54a555e8fb6037d63d1952458c12956d2
2013-04-03 11:38:36 +00:00
dan
227a1c482c In btree.c, save the positions of other cursors open on the same table when writing via an incremental blob handle. Otherwise, they may be left holding an out-of-date xFetch page reference.
FossilOrigin-Name: 3f09fba18f7e61e21381ffea13c31b968efd7d77
2013-04-03 11:17:39 +00:00
drh
2b8246e3e2 Initialize the mmap_limit of temporary files to the configured mmap_limit.
FossilOrigin-Name: 24bab7596bb7385981a5d331df5eeb05353547f7
2013-04-03 10:50:02 +00:00
drh
7e36962e6c Make use of xFetch, if it is available when doing a VACUUM or a backup.
FossilOrigin-Name: 83bc37af07857960c11275891f853a358dcbbf05
2013-04-03 03:53:15 +00:00
drh
7d9f3943ba Add the -mmap option to the command-line shell, for setting the default
mmap_limit.

FossilOrigin-Name: fc30d06c94c8212abb0477fb4cec4520d05bea34
2013-04-03 01:26:54 +00:00
drh
85830a70c2 Fix the unix driver to check defined(_BSD_SOURCE) rather than just the plain
_BSD_SOURCE macro.  This fixes the build for OpenBSD.

FossilOrigin-Name: 1dd42ef4144ee08fb4ee1676d934a56a0e34bac2
2013-04-03 00:42:01 +00:00
dan
48ccef8059 Fix a resource leak in os_unix.c.
FossilOrigin-Name: b29cda03fe4e8d8f5b5acbbea2d69f284a2bdf23
2013-04-02 20:55:01 +00:00
drh
c3d53189fc Adjustments to mmap1.test so that it works better on windows. It still gets
some answers wrong, but it no longer crashes.

FossilOrigin-Name: ee8d3ceeec40d84adb8798f084b6f1215ab56d92
2013-04-02 20:29:33 +00:00
dan
81d1765ad8 Fix a bug in mmap2.test that was leaving an invalid sqlite3_log() callback installed, causing a crash.
FossilOrigin-Name: c0cdaa07355f51bd217881b5b91ec2a609fa56f4
2013-04-02 20:19:22 +00:00
mistachkin
a9d79ae95d Add assert to the Windows VFS pertaining to the size of the SIZE_T type.
FossilOrigin-Name: 4eeea58354e21797ca1f4dc4ea785d0330381f0b
2013-04-02 20:13:04 +00:00
dan
db082408c6 Add test cases to mmap1.test and pagerfault.test.
FossilOrigin-Name: 3050136be962427cc4dcced6077ef29b2a941405
2013-04-02 18:33:55 +00:00
dan
d409792838 Change an assert in pager.c to acknowledge that it is possible for sqlite3PagerRollback() to return SQLITE_CORRUPT.
FossilOrigin-Name: d641d3d20d80fdb86d91de31fcf2eb5ca3c5c715
2013-04-02 18:31:29 +00:00
drh
a2c16c084a Fix the build for Mac.
FossilOrigin-Name: d36ce0bbad58445c983597ee93438fe07b659cdc
2013-04-02 18:25:04 +00:00
dan
f6653871b2 Add new test file btreefault.test.
FossilOrigin-Name: 7fe908afeba16f64edc16824c67b396138581a8f
2013-04-02 15:37:30 +00:00
drh
07fa864d15 Fix a faulty assert() in the os_win.c VFS.
FossilOrigin-Name: fd6ee54969322203c02ce9bd8744e095faf6a69c
2013-04-02 14:37:40 +00:00
drh
936c6d7e9e If the SQLITE_TRACE_SIZE_LIMIT compile-time parameter is set to a positive
integer then limit the expansion of strings and blobs in trace output to
approximately that many bytes.

FossilOrigin-Name: e5b710849dd66673ba0e0d935b103cb29abfcc4b
2013-04-02 13:56:53 +00:00
dan
4ff7bc45c6 Add test cases for errors in mmap() or mremap() is os_unix.c.
FossilOrigin-Name: 3098a3c1e7305033904a496ef534cb312a876fab
2013-04-02 12:04:09 +00:00
drh
a3a2b3bdc0 Proposed template preprocessor magic for activating mmap only on platforms
where we know it works.

FossilOrigin-Name: d96272f031102514b02bd839aac9e37618872200
2013-04-02 10:29:13 +00:00
drh
6d81449fc6 Reorder two conditions to make coverage testing easier.
FossilOrigin-Name: 793ba4e996426522eeaa86589a9e974fa1fc1522
2013-04-02 01:45:10 +00:00
drh
092d993cb7 Remove an unreachable condition from pager.c.
FossilOrigin-Name: 3628e86bf131cb205f08a4b299d84007cd6b25c3
2013-04-02 00:41:18 +00:00
drh
98d2038fc2 Always send the SQLITE_FCNTL_MMAP_LIMIT pragma to the VFS, even if the limit
is zero and even if the VFS does not support xFetch().

FossilOrigin-Name: 01ffdabbad30f1c157f2b33b1e85ee4d6c4632dd
2013-04-02 00:15:23 +00:00
drh
3861f546e3 Remove a debugging printf() accidently left in the previous check-in.
FossilOrigin-Name: 8198cdd8ac5dcc1c677fffa869ac965186b96abf
2013-04-01 22:42:48 +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
drh
a539c8a464 Add a comment to xUnfetch on windows to say that the call to winUnmapfile()
might be unnecessary.

FossilOrigin-Name: e3c63c31a21b27806592d066a013a111b280c61f
2013-04-01 18:25:48 +00:00
drh
db56bcbe42 In windows, round down the size of the memory mapped region to the next
smaller multiple of the page size.

FossilOrigin-Name: 0e44ed1badde6d766f18d1373d968e5b286b15bd
2013-04-01 18:15:50 +00:00
dan
57d6b25ec9 Merge accidental fork.
FossilOrigin-Name: 5f4437c0e35c8aa740515aac3e81e0146716d2bb
2013-04-01 17:58:10 +00:00
dan
e6ecd6630d Attempt to emulate mremap() on non-Linux systems by allocating a second mapping immediately following the first in virtual memory.
FossilOrigin-Name: 4d67433db8fb4754ae6b192945e479f3d7bad579
2013-04-01 17:56:59 +00:00
drh
f9d18e472b Bug fix in the winMapfile() subroutine: Be sure to record the map object
handle in the sqlite3_file object.

FossilOrigin-Name: ee4d188e207efa24a26776fa4f025c6ac39cce73
2013-04-01 17:56:28 +00:00
drh
5175b324b8 Add xFetch and xUnfetch methods to the os_win.c VFS.
FossilOrigin-Name: a1653a257d6af6e8b10c819e68b12f6c2f485811
2013-04-01 17:22:51 +00:00
dan
f55a4cf80c Ensure that a checkpoint does not use an out-of-date mapping.
FossilOrigin-Name: a1040f0397d57855500926494c978623286ddc77
2013-04-01 16:56:41 +00:00
dan
0943f0bdc8 Fix a typo in a log message in wal.c.
FossilOrigin-Name: 83fc48d16572443373e5de62adbd4cd53c2f7786
2013-04-01 14:35:01 +00:00
dan
71be5c5c87 Fix a problem in btree.c that could cause a crash following an OOM.
FossilOrigin-Name: b724aa5889f2e09cf0cbef133a672e6486755104
2013-04-01 14:29:33 +00:00
mistachkin
fde3b1c715 For the clean target, tidy up a couple more generated (or copied) source files.
FossilOrigin-Name: 5687e5ee7bafa00d2b353c3eda1e5dfb219cb185
2013-03-29 19:52:04 +00:00
drh
50126644a5 Version 3.7.16.1
FossilOrigin-Name: 527231bc67285f01fb18d4451b28f61da3c4e39d
2013-03-29 13:44:34 +00:00
drh
12886632c6 Adjustment to an extreme corner case in the sqlite3Atoi64() routine.
FossilOrigin-Name: 39534b4baa53b9360696a9d5ee8cc2108af34592
2013-03-28 11:40:14 +00:00
drh
8dd661aad1 Merge the changes for the 3.7.16.1 release candidate into the sessions branch.
FossilOrigin-Name: ee35a89712b8ea9f4e70d61a29150348896b519f
2013-03-28 01:19:26 +00:00
drh
4b11bad358 Fix harmless compiler warnings coming from MSVC64 in test code. No
changes to the core.

FossilOrigin-Name: 274d2a22660c7b34b8bbd85f3c29cbafbcb1b4e7
2013-03-27 20:41:15 +00:00
drh
ab5190a46c Increment the version number to 3.7.16.1.
FossilOrigin-Name: 7e32eb7b66290ba7323520f7ea92ffa584ee7193
2013-03-27 19:46:33 +00:00
drh
d9883570f5 In order to optimize out the ORDER BY clause,
outer loops must generate values for ORDER BY terms that are unique or else
the inner loops must generate no more than a single row.
Fix for ticket [a179fe7465].

FossilOrigin-Name: 2936f7466e162dfb003bda26d35358d1b3063112
2013-03-27 17:20:10 +00:00
drh
e6a8bbbb62 Restore additional ORDER BY optimizations that where broken by the
recent ORDER BY fix.

FossilOrigin-Name: c77ee6e20d3a8c91a8bf4c9063c36a95c70e17cf
2013-03-27 16:42:21 +00:00
drh
2b6c874b13 Improved optimization of ORDER BY.
FossilOrigin-Name: 97e5c70f2f19a1bca70dd2221b757b9e5418fce0
2013-03-27 16:05:30 +00:00
drh
8a1b87cb97 A fix an test-case for the ORDER BY problem identified by ticket [a179fe7465].
This change causes sorting to occur in some cases where it is not strictly
necessary.  Further work is needed to avoid those extra sorts.

FossilOrigin-Name: 488089e615e375c01b31544f06e801af950ae3db
2013-03-27 15:04:28 +00:00
drh
138eeeb1b0 Candidate fix for ticket [6bfb98dfc0c]: Make sure invalid cursors drop all
references to database pages prior to doing any insert or update.

FossilOrigin-Name: 322a5f086d9ee46017f750df81527799a54ae258
2013-03-27 03:15:23 +00:00
drh
6c5696381e Fix a comment in os_unix.c. No code changes.
FossilOrigin-Name: 72813b8ec924b91583c679668f7c4561dff82a02
2013-03-26 18:48:11 +00:00
drh
c86e51358b Change the name of the Pager.pFree field to Pager.pMmapFreelist.
FossilOrigin-Name: 611bd824c24a60d298f28705de323fa2e813a308
2013-03-26 14:36:11 +00:00
dan
0aed84d19f In btree.c, save the positions of any open cursors before moving any pages around to auto-vacuum the database on commit.
FossilOrigin-Name: 30c0a69363931a72d1c34e5be71646932398d172
2013-03-26 14:16:20 +00:00
drh
41f89cc676 Previous check-in accidently left mmap turned off by default. This checkin
fixes that.  Unfortunately, shared.test is now segfaulting.  All other
veryquick tests appear to work, however.

FossilOrigin-Name: a850c7319c20b5757983443df05cf2aa4250053b
2013-03-26 01:07:50 +00:00
drh
0d0614bdc6 Memory-mapped I/O is now on by default. The "PRAGMA mmap_limit(N)" can be
used to issue a hint to the VFS to limit mmap space to N bytes.  The VFS
is free to ignore that hint if desired.  However, if "PRAGMA mmap_limit(0)"
is used, xFetch is never called.

FossilOrigin-Name: 1b37c4effdd03aa2ea938a71b4f22ed27391689b
2013-03-25 23:09:28 +00:00
drh
d1ab8065c1 Add munmap and mremap to the set of os interfaces that can be overloaded
in os_unix.c.

FossilOrigin-Name: 8776047bd776bbf266eb9c3b56683badb84ae73e
2013-03-25 20:50:25 +00:00
dan
b7e3a326fe Use mremap() on Linux.
FossilOrigin-Name: 431aecc8600c29c203546e48d256510510238887
2013-03-25 20:30:13 +00:00
drh
dee6554811 Merge all recent trunk changes into the experimental-mmap branch.
FossilOrigin-Name: a607d63f0b6a3d3785e9385187d3e6b92e14fc70
2013-03-25 19:57:26 +00:00
dan
893c0ffc29 Add a test that simulates an error in mmap().
FossilOrigin-Name: 6ec7367d8e98425f00eeb8215ca8964313c1d0b7
2013-03-25 19:05:07 +00:00
dan
a64d5a15b7 Simulate OOM errors in the sqlite3OsFetch() function. Run malloc.test as part of the "mmap" permutation.
FossilOrigin-Name: 77443ef2cd0b29b7822eea544ab8c6c4a93cb67b
2013-03-25 18:25:49 +00:00
dan
df737fe6f5 Change the signature of the xUnfetch method to "int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p)".
FossilOrigin-Name: 115b830509e8f0aa9d5965c1e9cd4f2ed9d01938
2013-03-25 17:00:24 +00:00
dan
aef49d7141 Remove unnecessary code to round the size of a memory mapping to 4KB from os_unix.c. Rename SQLITE_IOERR_MREMAP to SQLITE_IOERR_MMAP. Fix other small issues in os_unix.c.
FossilOrigin-Name: dce35c01a5fe66d2970075b1e3f0376026485e4c
2013-03-25 16:28:54 +00:00
dan
11ac84635b Do not return SQLITE_IOERR when the user attempts to open a small file that is not a database with mmap enabled. Instead return SQLITE_NOTADB.
FossilOrigin-Name: bbcaab3e80d0ff776d8567094b137d1483b3377b
2013-03-25 14:31:39 +00:00
dan
a1afc7425a Fix a case in the pager where an xFetch() reference was being leaked following an OOM error.
FossilOrigin-Name: 5885ba6ce768658ec25b60747430d147b315b55c
2013-03-25 13:50:49 +00:00
dan
e115ff8171 Add a second test for [38b1ae018f].
FossilOrigin-Name: 5062db672c00c3365d51cd6b39815078f5b6b525
2013-03-25 12:02:45 +00:00
dan
1cb90c668c In fts3, when filtering lists for hits in a specific column, edit the list in place in the same way as it is for NEAR filtering. Fix for [38b1ae018f].
FossilOrigin-Name: f85f9103cffa5c8ba6a63a68beb90817147ba080
2013-03-25 11:38:44 +00:00
drh
dba0cb2351 Remove the SQLITE_OMIT_MERGE_SORT compile-time option and its related code.
The merge sorter is now a required component.

FossilOrigin-Name: 8b44d6fb159e85267095e846cded2764c3bcb895
2013-03-24 22:56:49 +00:00
dan
f23da96636 Replace the sqlite3_io_methods.xMremap interface with sqlite3_io_methods.xFetch and xUnfetch.
FossilOrigin-Name: 1431be95579160fb70408d43e17fc23c7b69ab4a
2013-03-23 21:00:41 +00:00
dan
e5586a1a79 Improve a comment in wal.c. No code changes.
FossilOrigin-Name: 60b9f5e4dd2af54975ba78437239f0bebd472fd2
2013-03-23 17:29:06 +00:00
dan
9d56c6df9a Fix a case where a checkpoint operation could write to an invalid part of a memory mapped region.
FossilOrigin-Name: 8dbe89d05ce91428c69003f0da79d883fa23e2b5
2013-03-23 14:20:42 +00:00
mistachkin
2753388e8a In the winMremap VFS function, unmap the region prior to attempting to truncate the file.
FossilOrigin-Name: 8870c4cc6cda07154936644f7df25bd81d6ba38a
2013-03-23 12:15:27 +00:00
mistachkin
46fce002d9 Do not unmap the mapped file region in winTruncate as there may be outstanding pointers to it.
FossilOrigin-Name: f57a9c91e993f76ce8b923e06e721414980e8e61
2013-03-23 10:09:46 +00:00
mistachkin
daf9a5a402 Preliminary changes to support the xMremap VFS method on Windows.
FossilOrigin-Name: 75a85a1c6ac59f2d021c28fa2161afb1118deea4
2013-03-23 09:56:39 +00:00
dan
7909e54a22 Update wal mode tests so that they work with the mmap test permutation.
FossilOrigin-Name: f7295872a36539d10edaf0c633f935f25cf73657
2013-03-22 20:15:31 +00:00
drh
23f29ec628 Fix a potential NULL-pointer dereference in btreeSwapOutMmap().
FossilOrigin-Name: e81ccdcd87a1387f7ca08d4d7c899311e2180d32
2013-03-22 19:56:27 +00:00
dan
aa1d67b1d9 Fix a case where the mapped part of a database file may be written during a backup operation.
FossilOrigin-Name: c8d67aefff7299dd5c8abeb2a3a52109c0a823ee
2013-03-22 19:17:45 +00:00
dan
99bd10979a Allow the database file to be memory mapped in wal mode.
FossilOrigin-Name: d190ddabc386bc9654b99e33fb81b2f6e67b54d6
2013-03-22 18:20:14 +00:00
dan
c00033125d Add a fix for the assert() statements added by the previous commit.
FossilOrigin-Name: 19345416ed5e1ab5b0b35993b0b9069c2fb1683b
2013-03-22 17:46:11 +00:00
dan
6101d50471 Add assert statements to os_unix.c to ensure that any mapped region of the database file is not being read or written using the xRead() or xWrite() methods.
FossilOrigin-Name: 765615f9fba7c1765eb741cb98a09a28b464ee55
2013-03-22 08:58:38 +00:00
mistachkin
48864df97d Many spelling fixes in comments. No changes to code.
FossilOrigin-Name: 6f6e2d50941e444ebc83604daddcc034137a05b7
2013-03-21 21:20:32 +00:00
dan
b26e6c14fe Fix cases where xRead() was being used to read from a memory mapped part of the database file.
FossilOrigin-Name: 5c9e9df27b9f2c46cd55388a858d4e78ee564975
2013-03-21 20:39:55 +00:00
dan
7c49427fc2 Avoid calling xRead() on a part of the database file that is memory mapped.
FossilOrigin-Name: c8eac290a7240d69494bd0dad5ed1fdc2505f703
2013-03-21 20:00:07 +00:00
dan
5b068f8632 Fix a problem when opening a write-transaction while there exist read-only b-tree cursors in mmap mode.
FossilOrigin-Name: 32e0bbb73609ac3ad096a60f1de3095bc79fb0cc
2013-03-21 15:57:32 +00:00
dan
c71b45e619 Do not use the Linux mremap() call. Use the same strategy for xMremap() as on OSX instead.
FossilOrigin-Name: 5ed8ad780c991d2ca44003ee84350fb5e95ad58e
2013-03-21 14:47:47 +00:00
dan
d306e1a3a1 Optimize the xMremap method in os_unix.c some.
FossilOrigin-Name: 9529ed88a71fee02fae72dc86f0669bd6856ff92
2013-03-20 18:25:49 +00:00
dan
eb97b29345 When possible, use memory mapping when appending new pages to a database file.
FossilOrigin-Name: 14135da3cdbafd699563a29608f32347cda28338
2013-03-20 14:26:59 +00:00
drh
0e5fba790a Fix text-to-numeric type casting so that it works correctly on UTF16
strings that contain characters where the LSB is numeric but the MSB
is non-zero.  Ticket [689137afb6da41]

FossilOrigin-Name: 5b22053f918d16f593227a432a5d5b4c195bb0b5
2013-03-20 12:04:29 +00:00
dan
eecc398374 Add test file mmap1.test.
FossilOrigin-Name: aee1f53a74e636776cbbc11bdd5516432ad50533
2013-03-20 10:07:43 +00:00
dan
5d8a137218 Add the sqlite3_io_methods.xMremap() method to the VFS interface. Also "PRAGMA mmap_size".
FossilOrigin-Name: 6183f1bd86ceed76d22d9762f3d7eb33262c62d1
2013-03-19 19:28:06 +00:00
drh
1ffe7c7fab Also export the sqlite3changeset interfaces in the amalgamated version of
the sessions extension.

FossilOrigin-Name: 5b399f2bc43612c52ea2289001d852d7ba6f9750
2013-03-19 17:10:10 +00:00
drh
339d6c6d17 Bring makefiles and build scripts into alignment with the sessions branch.
No changes to code.

FossilOrigin-Name: d1f41089aba075eef45fd696599e5d3a74c84d0c
2013-03-19 16:12:40 +00:00
drh
e191e2c6d0 Include the sqlite3session.h header file in with sqlite3.h. Make sure
the session APIs are all public.

FossilOrigin-Name: ec490336bc6629d3910667ece1bbc4685a199546
2013-03-19 15:23:18 +00:00
drh
ce3ca25cbc Clarifications to the documentation for the sqlite3_aggregate_context() API.
Also, shorten an over-length source line in sqlite.h.in.

FossilOrigin-Name: 4fe2db1d866c80fe51f7fddbf9ce6753fb55b5f6
2013-03-18 17:18:18 +00:00
drh
c03edc0b62 Adjust the MSVC makefile so that it correctly handles the sessions
extension being included in the amalgamation.  Import the test case
changes that appeared in 3.7.16 final.

FossilOrigin-Name: 9bac09a99aef5f18386037b409869d760c520d53
2013-03-18 16:24:33 +00:00
drh
5b4b255151 Version 3.7.16
FossilOrigin-Name: 66d5f2b76750f3520eb7a495f6247206758f5b90
2013-03-18 11:39:23 +00:00
dan
a72014faf5 When possible, use memcpy() to and from the mapped region instead of xWrite() and xRead().
FossilOrigin-Name: f8ca5622d99bedca957caa9ad311d798f63b3ce9
2013-03-16 20:19:21 +00:00
dan
7af6547a5a Fix a dropped error code in pager.c.
FossilOrigin-Name: 022fdc986b33701abfd39621072ac3d9f9f7d43e
2013-03-15 19:13:42 +00:00
dan
11dcd11913 Allow read-only cursors to use mmap pages even if there is an open write transaction.
FossilOrigin-Name: b387e2f9d24dccac1fd040e309f6fc7ec1cfffba
2013-03-15 18:29:18 +00:00
dan
b2d3de3bf4 Use mmap() to read from the database file in rollback mode. This branch is unix only for now.
FossilOrigin-Name: 6f21d9cbf5d457e63a7282015a89ae785526cf6d
2013-03-14 18:34:37 +00:00
mistachkin
38b4daa122 Fix typos in MSVC makefile.
FossilOrigin-Name: 2d15c2685750b930c5b7e2f06cb056b24a037967
2013-03-13 19:02:39 +00:00
drh
8ce2b0956a Fix main.mk so that it builds the amalgamation correctly.
FossilOrigin-Name: 0b84e277245f10f928c010ea5958923681c6d582
2013-03-13 12:20:15 +00:00
drh
498dcae0f0 Fix a compiler warning in sqlite3VdbePreUpdateHook().
Add sqlite3session.c to the amalgamation.
Fix the Makefile.in to work with sessions.

FossilOrigin-Name: e54b0225f226a163ec874df7d4b738efba12b3a7
2013-03-13 11:42:00 +00:00
dan
27e6df4e41 Enhance tests for ticket [4dd95f6943].
FossilOrigin-Name: 0b452734faa0839c817f040322e7733e423bfce2
2013-03-13 07:02:04 +00:00
dan
bfb5a031e5 Merge latest trunk changes into this branch.
FossilOrigin-Name: d6cd3c780c6bc718d37e0f0b884e3e9a423d57be
2013-03-13 06:34:51 +00:00
drh
b19cad6b94 Fix the ORDER BY with IN constraint logic so that it works with all
combinations of DESC on the ORDER BY clause, on the RHS of the IN operator,
and in the index used by ORDER BY and IN.  
Fix for ticket [4dd95f6943fbd18].

FossilOrigin-Name: 839aa91faf1db7025d90fa3c65e50efb829b053b
2013-03-13 00:13:25 +00:00
drh
725e1ae52e Add a single new test case to the ORDER BY with IN logic verify that if the
RHS of the IN is a descending index that it still works.  Add testcase()
macros to the ORDER BY with IN logic to help verify that corner cases are
tested.

FossilOrigin-Name: 7e7356f1552cd53ea363d1ded3b2c221c9d0be01
2013-03-12 23:58:42 +00:00
mistachkin
706627b870 Fix typo in sqlite3_close() function documentation reported on the mailing list.
FossilOrigin-Name: c9a75d890f06cf3806d7b8879824a11d3a8e7016
2013-03-12 23:03:42 +00:00
drh
3c60421864 Fix a test case that had an ambiguous result.
FossilOrigin-Name: 38c6bddf8cf15fb358858da6da457046f40b61ce
2013-03-12 22:13:33 +00:00
mistachkin
f5840160b7 Fix typo in sqlite3_close() function documentation reported on the mailing list.
FossilOrigin-Name: 7232093d6c6871a9f4ea155ab215e3b39c1c322d
2013-03-12 20:58:21 +00:00
drh
1ccce44937 Fix the ORDER BY optimization with IN constraints when the RHS of the
IN constraint is a descending index.

FossilOrigin-Name: 62316ebaca933f7e5df2018e8360a2b74234f30a
2013-03-12 20:38:51 +00:00
drh
d383216383 Revise the patch to make it easier to understand.
FossilOrigin-Name: 3ce7eb0265b5be4e23264ae41332b947011ff1ad
2013-03-12 18:49:25 +00:00
dan
d7e8689078 Add test cases for [4dd95f6943].
FossilOrigin-Name: 723c144c76fc171e5d19072d6d42a08013921ec6
2013-03-12 18:44:49 +00:00
drh
7a3e147ee2 Revised fix for the DESC ORDER BY and IN constraint bug,
ticket [4dd95f6943fbd18].  The previous check-in was incorrect.

FossilOrigin-Name: 8b2eb7a43b4580f04c14ea8600cf080e0e7f384d
2013-03-12 18:40:20 +00:00
drh
0fe456bb29 A proposed fix for the DESC ORDER BY bug of ticket [4dd95f6943fbd18].
Seems to work, but lots more testing is needed prior to moving to trunk.

FossilOrigin-Name: 614a038ad2fe111687d2bc1c0aa716d7eb8fdd7c
2013-03-12 18:34:50 +00:00
dan
1bc8b87e46 Merge recent changes to trunk into sessions branch.
FossilOrigin-Name: 62adb0e0d70e619becb68ffd2625d979bcc777cd
2013-03-12 11:38:59 +00:00
dan
881bd79293 Define _BSD_SOURCE when building on OpenBSD. This is required for fchmod().
FossilOrigin-Name: f9027cb47bdec8dcebf1f038921b28d9e9928c18
2013-03-11 13:37:52 +00:00
dan
b606ec52c7 Fixes for compiling with SQLITE_OMIT_AUTOVACUUM and/or SQLITE_OMIT_TRIGGER defined.
FossilOrigin-Name: 1da15adba8f6eec69c24ec6385d6f1a7905a388f
2013-03-11 11:57:30 +00:00
dan
09ff9e1664 Fixes for compiling with SQLITE_OMIT_AUTOVACUUM and/or SQLITE_OMIT_TRIGGER defined.
FossilOrigin-Name: 938b91e8552516772060d4e55e2f79cca4c13e27
2013-03-11 11:49:03 +00:00
dan
3da0df9d18 Add a test case for the problem fixed by the previous commit.
FossilOrigin-Name: e899b058a703158012c054974bd9a909d75144d8
2013-03-09 14:49:07 +00:00