Compare commits

...

220 Commits

Author SHA1 Message Date
dan 26c8d0ca21 Fix a problem handling expressions like "(a, b) IN (SELECT ... ORDER BY 1, 2)" when there is an index on "a" but not "b".
FossilOrigin-Name: 7f2c5c9ee3628c968306a5ab2e5a9a761f1b8055
2016-09-07 19:37:20 +00:00
drh c097e122b9 Simplify the affinity handling logic in codeAllEqualityTerms(). Logically
the same, just a little easier to read and understand.

FossilOrigin-Name: bbab9621f512b04684163b98b6fc669c68038044
2016-09-07 13:30:40 +00:00
drh af6f65fb26 Merge fixes from trunk.
FossilOrigin-Name: 193f036c87857bd77577ceb462af5034c7cc77da
2016-09-07 13:12:13 +00:00
drh fc8b40f2f6 Fix the ".read" command in the command-line shell so that it understands
that the input is not interactive.

FossilOrigin-Name: d8451fe84d09db6ec7e1bd5f0708ea1b5e85f3d6
2016-09-07 10:10:18 +00:00
drh 57a8c61501 The ORDER BY LIMIT optimization is not valid unless the inner-most IN operator
loop is actually used by the query plan.
Fix for ticket [0c4df46116e90f92].

FossilOrigin-Name: 820644b886f81e991fceb5f1c3290b8959b34528
2016-09-07 01:51:46 +00:00
drh 63cecc4173 Remove obsolete vector-IN test cases. Fix a bad testcase() macro.
FossilOrigin-Name: ab3f8f193a7ec36018bf26c9231a1a6a58b6a523
2016-09-06 19:08:21 +00:00
drh 1431807a0b Fix corer cases of vector IN operators where the RHS is a compound SELECT
that includes an ORDER BY clause.

FossilOrigin-Name: 8329ac6f8d1edcc19c3e0559abe9a8011dbe1497
2016-09-06 18:51:25 +00:00
dan 773d3afaa3 Remove an unnecessary branch from expr.c.
FossilOrigin-Name: 7cc9746c5414e02012efb8180f9eca2646800e74
2016-09-06 17:21:17 +00:00
drh c7a77ae1c6 Avoid unnecessary memory allocations for aiMap in codeEqualityConstraints.
FossilOrigin-Name: 70319c3d76abd1e403fcf2a62668736b92a5f3d5
2016-09-06 17:13:40 +00:00
drh aaf8a0643e Avoid a NULL pointer deref in codeAllEqualityConstraints() following an OOM.
FossilOrigin-Name: c6e528c1c0f17c69c7745b018afa36694118258f
2016-09-06 16:53:53 +00:00
dan 1c12657f9a Simplify the fix in commit [7d9bd22c].
FossilOrigin-Name: bd5a342008575bf66f63881a0bebf43741f2a67b
2016-09-06 16:33:24 +00:00
drh 099a0f5f54 Fix the header comment on codeEqualityTerm().
FossilOrigin-Name: b7e710e406ed22bcc316099b5e200b6bb2d9c872
2016-09-06 15:25:53 +00:00
dan 83c434e68d Fix a problem handling (a, b) IN (SELECT ...) expressions when there is an index on just one of "a" or "b".
FossilOrigin-Name: 231c72d9f651f3a70d5c8af080f3ff181b89d939
2016-09-06 14:58:15 +00:00
drh ed24da4b16 Enhance the sqlite3GetTempRange() and sqlite3ReleaseTempRange() internal
routines so that they use sqlite3GetTempReg() and sqlite3ReleaseTempReg()
when nReg==1.

FossilOrigin-Name: 4071da2f87a2f24a279ac3bced8c794ad374b47c
2016-09-06 14:37:05 +00:00
dan fad0e70c63 Fix a typo in a comment in expr.c.
FossilOrigin-Name: 288e934f356ff6276b3e7581ac0f998ca6e93610
2016-09-06 12:04:50 +00:00
drh 9f24b53dcc Simplified logic to extract a column from a row value.
FossilOrigin-Name: e8f105c3009e9b667db2afc0088b020a2b94d370
2016-09-05 22:50:48 +00:00
drh c1bcd9cc3e Fix an assert() so that it does C-compiler does not combine an assert()
conditional with a production code conditional and thereby confuse the mutation
testing script.

FossilOrigin-Name: 2fa5288a7ef43f1fb26037c1b5e84b7b90400623
2016-09-05 19:57:46 +00:00
drh 3fffbf9327 Simplifications to the SQLITE_KEEPNULL flag on VDBE comparison operators.
FossilOrigin-Name: 96269f0179a7d8fa44ee278cef362962368c59ef
2016-09-05 15:02:41 +00:00
drh 083aefc732 Do vector comparison size checking early - at name resolution time - to
forestall future problems.

FossilOrigin-Name: ae127bcc0a5827786853f47b229021435d6098d7
2016-09-05 12:12:56 +00:00
drh b29e60c448 Catch vector size mismatch problems during name resolution to avoid later
problems.

FossilOrigin-Name: 56562a0346170cf7b72445976864b058437a8ac3
2016-09-05 12:02:34 +00:00
dan 5c3340bd47 Fix a crash that could occur under certain circumstances if the vectors on either side of a comparison operator were of a different size.
FossilOrigin-Name: 42670935aba152ba774c2a8bdcbe72b943309d68
2016-09-05 09:44:45 +00:00
dan 80aa545337 Fix a problem causing the affinity of sub-select row-value elements to be ignored in some contextes.
FossilOrigin-Name: 7d9bd22c0715ede2592ee1fa7ebc215aded1ca1b
2016-09-03 19:52:12 +00:00
drh 8f9d1ad8d5 Merge the fuzzershell enhancement from trunk.
FossilOrigin-Name: ed206048484667e4fe6aaeadd65882537d74bd35
2016-09-03 16:24:43 +00:00
drh 9f6dd025ba Build the generate_series(START,END,STEP) table-valued function into
fuzzershell, to make it easier to construct compact test cases that contain
actual data.

FossilOrigin-Name: 672c21bcf09c5bfb67e061456a56be45409c4f34
2016-09-03 16:23:42 +00:00
dan 2718960316 Consider the affinity of "b" when using an "a IN (SELECT b ...)" expression with an index on "a". Fix for [199df416].
FossilOrigin-Name: f5e49855412e389a8a410db5d7ffb2e3634c5fa3
2016-09-03 15:31:20 +00:00
drh 4910a76d45 Performance optimizations.
FossilOrigin-Name: f1d06c49ba0d814dc7ffb538aac3f4e6251fd8f0
2016-09-03 01:46:15 +00:00
drh 55a6f6dc72 Merge recent changes from trunk.
FossilOrigin-Name: c7271fbde1aebb15daaedb7f1fa75fe410fd46f6
2016-09-02 23:56:32 +00:00
dan c6952addf7 Add a test case for the OOM handled by the previous commit.
FossilOrigin-Name: 9bdf7ca1b317fe0ba7efea38fb395bf6130ac89a
2016-09-02 21:34:17 +00:00
drh 76729ed4be Correctly detect an OOM occurring in the setDestPgsz() subroutine of
backup.

FossilOrigin-Name: d9d8a048d4b621435870b4f8dd13b2938ac2f8fd
2016-09-02 21:17:51 +00:00
dan 033564cca9 Within a backup operation, ensure that a read-transaction is opened on the source database before its page size is read. This ensures the page-size used to write to the backup database is the same as its actual page-size, which is important for ZipVFS databases.
FossilOrigin-Name: 7908fc604991d81140c182b97981fd724ad126ae
2016-09-02 17:18:20 +00:00
dan e5a0cfa161 Have "sqldiff --rbu" ignore rows with NULL values in primary key fields. RBU can't handle such rows and the documentation already says sqldiff ignores them. Because the code now uses "=" instead of "IS" to filter on primary key columns, diffs on virtual tables are faster now too.
FossilOrigin-Name: f4ba894a86aa195bcbe2fa69e91cd870ec3fb577
2016-09-01 14:03:28 +00:00
dan d0d49b9ca3 If SQLITE_ENABLE_ZIPVFS is defined, journal_mode=off is configured and a savepoint or statement rollback is attempted, move the pager into the error state to prevent the transaction from being committed. This makes it safe to use journal_mode=off with zipvfs under some conditions.
FossilOrigin-Name: 38d31e189e7c7899e14455f2c083aa676ce4d4c0
2016-09-01 09:35:20 +00:00
dan a87070a271 Use some of the example code from the sessions documenatation in the sessions test cases.
FossilOrigin-Name: 6602974d17536bcb904a794bddedffd58926794b
2016-08-29 14:18:18 +00:00
drh 2e5c5052fd Fix typos in comments. No changes to running code.
FossilOrigin-Name: a07269f2a0f87e0b736127f528f6caf3b63f9052
2016-08-27 20:21:51 +00:00
dan 6650190891 Fix some comments in sqlite3session.h. No changes to code.
FossilOrigin-Name: 78cd64e202fcbe9ce69070b0f48ccd0c6b48538d
2016-08-27 18:35:55 +00:00
dan 57b60432ba Fixes to fts5 snippet() function.
FossilOrigin-Name: d464a7b18d212720a4f4e2fa4e204f1aca99c837
2016-08-27 18:34:06 +00:00
drh 888e1faf95 Merge updates from trunk.
FossilOrigin-Name: 082fd5f8ac227dbb983da0a772485268af40a484
2016-08-27 14:13:58 +00:00
drh 1ad78c5791 Fix the extra comments (added with -DSQLITE_ENABLE_EXPLAIN_COMMENTS) so that
the sense of <, <=, >, and >= tests is correct and so that the
SQLITE_STOREP2 version is shown correctly.  These changes are already in the
rowvalue branch but are added here since they are technically unrelated to
rowvalue.

FossilOrigin-Name: 4d43c4698eef4e3db7556813f0274b4018c7c2b9
2016-08-27 14:05:12 +00:00
drh 88e665fd0b Fix the "Synopsis" on the OP_Lt, OP_Le, OP_Gt, and OP_Ge opcodes, which
has been backwards for time out of mind.

FossilOrigin-Name: f51248dcfa22e989dacde41021e96a65f12c5ca8
2016-08-27 01:41:53 +00:00
drh 106526e1bc Fix a minor problem in sqlite3FindInIndex() related to rowids being used
as part of the index.

FossilOrigin-Name: 829f802be7d4647dd815b739bbc9e1d1ac6a224d
2016-08-26 22:09:01 +00:00
drh a84a283d18 Fix the sqlite3FindInIndex() to ensure that it always uses a prefix of
the index and uses no repeated columns.  Enhanced comments.

FossilOrigin-Name: b9fc89e432fbe4e5b41959a42797641907e075e3
2016-08-26 21:15:35 +00:00
drh 363fb95bc3 Add an EXPLAIN QUERY PLAN line for when a index is used to implement
an IN operator.

FossilOrigin-Name: 171aa833a2e1650c3d9cf9bd6438ae46f6c35871
2016-08-26 19:54:12 +00:00
dan 4b4f51148a Add test cases to rowvalue2.test.
FossilOrigin-Name: 078bb69e99891ba3b76a39ac974990714c43908f
2016-08-26 19:47:30 +00:00
drh 6fc8f36490 Enhance sqlite3FindInIndex() so that it is able to make use of the
primary keys at the end of an index.

FossilOrigin-Name: 4b589fbfcc4265902de0f552961d2df497a184da
2016-08-26 19:31:29 +00:00
drh 0c36fca004 Fix a post-OOM crash in updateRangeAffinityStr(). Add several ALWAYS()
macros on unreachable branches.

FossilOrigin-Name: 87d40195ae5cc2abd9bae45073a615db81263285
2016-08-26 18:17:08 +00:00
dan b7ca2177d7 Fix a problem with affinity changes and vector range comparisons.
FossilOrigin-Name: b34413ac7e34369b4420e57b0132249dca68a7b0
2016-08-26 17:54:46 +00:00
drh 0dfa4f6fcc Allow ROWID values in indexed vector comparisons.
FossilOrigin-Name: b0cc6be4eb81f21b11796e1f14d4412bf21dea6e
2016-08-26 13:19:49 +00:00
dan 61441c3493 Fix a problem in internal function sqlite3OpenTableAndIndices causing an operand of an unrelated VM instruction to be overwritten. Fix for [ef360601].
FossilOrigin-Name: 7090147903337864d54ecfb2cd84a3f823973167
2016-08-26 12:00:50 +00:00
mistachkin 8e16b2d3e6 Rename a test procedure in 'speed3.test' to avoid a name collision.
FossilOrigin-Name: 84de17bc688f1df2be1a34420470d1b16f8f4e56
2016-08-26 04:32:59 +00:00
drh 64bcb8cfbb Comment improvements. Put ALWAYS and NEVER macros on three unreachable
branches.

FossilOrigin-Name: 397617009e07004596476d6f5644fdf84c376f54
2016-08-26 03:42:57 +00:00
mistachkin 975c800dd8 Adapt the special case of '$' in item names for test 'vtabH-3.1' as well.
FossilOrigin-Name: e4aeaa2bc73b57f1ef134cc4f54e2a652a20b5c9
2016-08-26 02:10:50 +00:00
mistachkin 0a9428d0a7 Make the test 'vtabH-3.1' work when there are less than 5 top-level items.
FossilOrigin-Name: 328f79bb5713abbecaeb0ef3fb37f56a0946b915
2016-08-26 01:47:22 +00:00
mistachkin 7dd7d98bbf Support running the fstree tests in 'vtabH.test' on Windows when not using the system drive.
FossilOrigin-Name: 3680f95ff34fdcf6a18a99268678a56e4be5a023
2016-08-26 01:17:12 +00:00
drh a28f85b076 Remove an unreachable branch from sqlite3ExprAffinity()
FossilOrigin-Name: 9d96f61481704e5ec399ee425f0ebb246902ecc5
2016-08-26 01:02:09 +00:00
mistachkin f10122d535 Fix typos in 'vtabF.test' file. No changes to code.
FossilOrigin-Name: a8546feec9388d96934b16e516a165cd37d32ce9
2016-08-25 23:24:09 +00:00
drh 3cc19132da Merge recent changes from trunk.
FossilOrigin-Name: 5789aab8ef59ae1cdfdae123b078ee03da6e08ed
2016-08-25 22:31:44 +00:00
drh fb82820a38 Fix the sqlite3_trace_v2() interface so that it goes disabled if either the
callback or mask arguments are zero, in accordance with the documentation.

FossilOrigin-Name: 37e6c54b1afc634844026b3fe874dd2d550c6558
2016-08-25 22:06:37 +00:00
drh e347d3e813 Refactor the sqlite3ExprCodeIN() routine for improved maintainability.
FossilOrigin-Name: b56705ae6374db9db82613ef89faa1a1e6b00a18
2016-08-25 21:14:34 +00:00
drh 0a1082aec2 Another fix in the IN-operator algorithm description.
FossilOrigin-Name: f474aeac4fa62d87e73189868d7c7a295ffb7265
2016-08-25 17:47:36 +00:00
drh 1373c3a8c5 Further refinement of the in-operator.md documentation.
FossilOrigin-Name: df0648373a50006ca18d692e12552d1d53d549e3
2016-08-25 17:40:32 +00:00
drh ecb87ac88d Improvements to IN operator code generator comments. Avoid unnecessary
Copy operations on the LHS of the IN operator.

FossilOrigin-Name: b6344298783a1207cba3f635939ddc9ba922ab67
2016-08-25 15:46:25 +00:00
drh ee0f22fd3b Corrections to the IN-operator notes.
FossilOrigin-Name: 25033ee94538289ba7e0147da30a18300047123f
2016-08-25 14:23:59 +00:00
drh 539f2fef03 Add notes on the implementation of the IN operator.
FossilOrigin-Name: d256b2caeb9e3eb5dd88bb569ec71f91e9991c81
2016-08-25 14:00:15 +00:00
drh 18016ad2bb Simplified VDBE code for the vector NOT IN null-scanning loop.
FossilOrigin-Name: 7ae504e62e9bbbbd85a676f3c3922b7fd0cc73d2
2016-08-24 21:54:47 +00:00
drh 72e26dec86 Improved extended comments of comparison operators when the SQLITE_STOREP2
flags is set on P5.  No changes to non-debug code.

FossilOrigin-Name: bbc1b016164ed0793e07302614384d52119463e0
2016-08-24 21:24:04 +00:00
drh 62659b2a80 In sqlite3FindInIndex(), improve internal comments and avoid an
unreachable branch.

FossilOrigin-Name: 55945fc12f8157e32e6850e41575c0c6422d29e7
2016-08-24 18:51:23 +00:00
dan 37ff4d4c77 Fix a bug in the fts5 snippet function causing it to return text containing zero phrase instances.
FossilOrigin-Name: b174ed2bde43a1872374ce18b85ac9f067e86fbb
2016-08-24 18:50:47 +00:00
mistachkin 24b6b81cb0 Sync up the MSVC autoconf makefile.
FossilOrigin-Name: 77f7c31a3aa44798cfa5f557242caffb593ce7af
2016-08-24 18:21:58 +00:00
drh 321e828d03 Fix more unreachable branches.
FossilOrigin-Name: 6099c180db55396d6307538a5428ae5ef1b82d10
2016-08-24 17:49:07 +00:00
drh d0b67a8654 Add a NEVER() on an unreachable branch in comparisonAffinity().
FossilOrigin-Name: 505a2f20eac62d4e170f003255c8984e4f3b0918
2016-08-24 15:37:31 +00:00
dan 7887d7f24d Fix a buffer overrun in the code for handling IN(...) operators when the LHS of the operator contains indexed columns or expressions.
FossilOrigin-Name: f41a0391b732a8c4ad188163f34a0f4a22237bb5
2016-08-24 12:22:17 +00:00
drh ac6b47d164 The previous OOM fix was bad. Back it out and replace it with a better one.
FossilOrigin-Name: 1e3bc3698a4b779e6af8e3c727929c4dbddf3edb
2016-08-24 00:51:48 +00:00
drh 894241c847 Avoid a potential null-pointer dereference following an OOM.
FossilOrigin-Name: 25f6ed8de4df9c9890d4a352a6d11084433e82ea
2016-08-24 00:25:27 +00:00
drh e835bc1285 Simplify the row value misuse error message.
FossilOrigin-Name: 838c50a5bf46fd0340839d577fa28ba02b4f2034
2016-08-23 19:02:55 +00:00
drh 66860af3dd Fix a problem with rowvalue UPDATE when the rowvalue is not the left-most and
the RHS is a multi-column subquery.

FossilOrigin-Name: e149e6b93a9afb3d574309c0db60e221e24078f7
2016-08-23 18:30:10 +00:00
drh abb9d5f189 Fix an uninitialized variable in CASE expression code generation.
FossilOrigin-Name: c8ffae05e13033ec7425bf0f002df31f550bb7f1
2016-08-23 17:30:55 +00:00
drh 6ae3ab0036 Fix the SQLITE_USER_AUTHENTICATION login check so that the SQLITE_AUTH_USER
error code correctly propagates and is not overwritten by SQLITE_ERROR.

FossilOrigin-Name: c640489db2037f1a284d7b85fa753ccdac1b8f79
2016-08-23 14:42:15 +00:00
drh cbfe1101b3 Add support for the SQLITE_DBCONFIG_MAINDBNAME configuration option.
FossilOrigin-Name: 7839519349c7371cdb4e16a215eacd27004cbc62
2016-08-22 20:10:01 +00:00
drh 12abf408ff Fix the vector BETWEEN operator so that it only evaluates the left-most
vector expression once.  Add support for vector comparisons in the CASE
operator.

FossilOrigin-Name: 07e69f43a294d35b5145a2b0242ee42d50adab14
2016-08-22 14:30:05 +00:00
drh db45bd5e82 Reinstate the mechanism in BETWEEN that avoids evaluating the first expression
more than once, but fix the affinity extractor so that it works with this
mechanism.  The de-duplication of the first expression still does not work
for vector expressions, though.

FossilOrigin-Name: 2f39987f21bd6dae8d2be610a1fd5f06f8878e9e
2016-08-22 00:48:58 +00:00
drh 84b19a3da1 The docs promise the in "x BETWEEN y AND z" the x expression is only evaluated
once.  That is no longer true, and so some tests are failing.  This needs to
be fixed before merging to trunk.

FossilOrigin-Name: e50d264fdc2f08d19202c68f73f18df301cb233d
2016-08-20 22:49:28 +00:00
drh d832da7f40 Further comment enhancements. No changes to code.
FossilOrigin-Name: d4562a9e7b1eaff41466210e3a0caaf374ec5a92
2016-08-20 21:11:25 +00:00
drh 76dbe7a8d0 Clarification of code comments in expr.c. Clean up the implementations
of sqlite3ExprIsVector() and sqlite3ExprVectorSize() slightly.

FossilOrigin-Name: 4fb66d6592b141a4a71359250dbd1ac454569cb9
2016-08-20 21:02:38 +00:00
drh 8bd0d58e1c Fixes for problems following OOM errors.
FossilOrigin-Name: 9041ee4a6f0e8389297f887f1431ab5cfe783390
2016-08-20 18:06:14 +00:00
dan 783e778f38 Fix other minor problems with the fts5 snippet() function.
FossilOrigin-Name: b56b2a85cf377686727f3929208ede43f797cf76
2016-08-20 17:23:45 +00:00
drh 9854260bca Do not duplicate the Expr.pLeft subtree of a TK_SELECT_COLUMN node.
FossilOrigin-Name: 8384c77ebb3f65fbc54c199885926f2066f0b140
2016-08-20 17:00:16 +00:00
dan f358009a93 Fix a segfault that could occur if a query that used a vector comparison contained certain types of syntax errors.
FossilOrigin-Name: 203f07c5e140e74cf91d0c1e20135c21236f0fc1
2016-08-20 15:01:24 +00:00
drh 9e730f0bb8 Improvements to the vector comparison splitter in exprAnalyze().
FossilOrigin-Name: a3ffd283bc931b04170ef737e56bced33d27f06d
2016-08-20 12:00:05 +00:00
drh 8762ec1935 Improvements to comments. No code changes.
FossilOrigin-Name: 4165d20f64d778a4e48f511a37cfced8579d4dbe
2016-08-20 01:06:22 +00:00
drh a1251bc40d Add support for vector assignments in the SET clause of an UPDATE statement.
FossilOrigin-Name: f320d47d6b7b08d9552c8444004bc256348bda90
2016-08-20 00:51:37 +00:00
drh fc7f27b9d2 Change the way TK_SELECT_COLUMN is handled so that the subquery is only
generated once even if part of the vector comparison is used for indexing
and the other part is now.  This change also is a pathway to vector assignment
in UPDATE statements.

FossilOrigin-Name: d8feea7dcde83179bff303072426561cfe825e58
2016-08-20 00:07:01 +00:00
drh 8d25cb90cd Replace the magic number (-2) with its symbol XN_EXPR in the
exprMightBeIndexed() routine.  No logic changes.

FossilOrigin-Name: d4a5af69cc3bde6f8c02075c07b4d47a0252392d
2016-08-19 19:58:06 +00:00
drh 39a11819f3 Improved comments on sqlite3CodeSubquery(). No changes to code.
FossilOrigin-Name: acea4ee136def4815d22eec240c5903a72bde9bd
2016-08-19 19:12:58 +00:00
drh a15a8bc822 Show the WhereTerm.iField value on debugging output, when it is non-zero.
FossilOrigin-Name: 931c95358d8bc02f3e3d8ee4e545a07b2d2c97e8
2016-08-19 18:40:17 +00:00
dan c9e75fb23a Register any built-in fts5 module before loading automatic extensions. This allows automatic extensions to register fts5 tokenizers and auxiliary functions.
FossilOrigin-Name: b10e31dce8e590e1ba30f512374a8c16656bcc72
2016-08-19 18:37:35 +00:00
drh 4602b8e89d Fix an obsolete comment on codeEqualityTerm(). No changes to code.
FossilOrigin-Name: d07be5afb0a915769382dfd815403f8832cb3eec
2016-08-19 18:28:00 +00:00
drh b684fd5c4a Merge recent enhancements from trunk.
FossilOrigin-Name: b17872363b60edab05a5d382a44038aad91e4d9f
2016-08-19 15:41:24 +00:00
drh 05a41ee9ec Merge the VACUUM attached database enhancement from trunk.
FossilOrigin-Name: 12d5e38d269ede27cd38a031a395915301fffe56
2016-08-19 15:17:51 +00:00
drh fcc31545bc Enhance the VACUUM command so that it can operate on an attached database.
FossilOrigin-Name: 083f9e6270fa4faa402b91231271da4f3915c79f
2016-08-19 15:15:55 +00:00
drh 6a754dc767 Disable row counting on queries run while doing a VACUUM.
FossilOrigin-Name: ad35ef116296e5d6aaeb9ef260bf35bee3bd6d20
2016-08-19 15:12:38 +00:00
dan 7ca1ea16ff Have the fts5 snippet() function avoid favouring snippets that begin with sentences that do not contain search terms. Add an extra bias in favour of the first sentence in the document.
FossilOrigin-Name: d8180af2adfc101dfce95a0498b5cd7b30643b30
2016-08-19 14:25:38 +00:00
drh 9ef5e7708a Add the capability to VACUUM an attached database by specifying the schema
name as an argument to the VACUUM command.  Since version 2.0, VACUUM has
accepted an argument which was silently ignored.  Now it has meaning.

FossilOrigin-Name: 29d63059b4d2bb612523ac55ebfef040d054a64f
2016-08-19 14:20:56 +00:00
drh da84dcae54 Add the SQLITE_DBCONFIG_MAINDBNAME interface.
FossilOrigin-Name: d6e3d5796c9991ca0af45ed92ce36f55efc02348
2016-08-18 22:44:22 +00:00
drh 61ea610cd0 Change the name of Db.zName to Db.zDbSName for improved long-term code
maintainability.

FossilOrigin-Name: cb9865e14db1c0076618f13400151112f84960cb
2016-08-18 22:19:03 +00:00
drh e59be01072 Fix a zName to zDbSName conversion missed in the previous check-in.
FossilOrigin-Name: d7cf423cdccada2b0a4b7cc79ccf5f35d6f43212
2016-08-18 20:56:39 +00:00
drh 03181c8c27 Fix a SQL NULL handling bug in the vector IN operator code generation.
FossilOrigin-Name: 936146b12e27784f15a68fe65732c6d92c3a12f3
2016-08-18 19:04:57 +00:00
drh 48cb3a7600 Display SELECT_COLUMN expressions in the .wheretrace debugging output.
FossilOrigin-Name: 3b27a5da100037f75a4efc15e0354a6aa94194f8
2016-08-18 18:09:10 +00:00
drh db97e56217 Display VECTOR expressions in .wheretrace and .selecttrace debugging output.
FossilOrigin-Name: 157347e2580e5078c4081d602e9d1a82d194e719
2016-08-18 17:55:57 +00:00
drh c8d0b0b9d4 Since the TK_VECTOR token is not actually used by the parser, make it an
extra token code added by the tool/addopcodes.tcl script during parser build.

FossilOrigin-Name: b40b202c1f82808d2240e87b22f1e78b2208cb26
2016-08-18 15:36:03 +00:00
drh 5ea494425f Merge recent enhancements from trunk.
FossilOrigin-Name: 4768a1066cb9c7627064d7efec44188d6755cb03
2016-08-18 15:21:16 +00:00
drh a79e10b665 Simplify the vector comparison code generator logic, and the resulting
VDBE code.

FossilOrigin-Name: e2ad0b5d8e1e83118c12889150aca2f2a6b2bdde
2016-08-18 15:15:29 +00:00
dan b39a5ac229 Adjust some tests to account for recent changes to the fts5 snippet function.
FossilOrigin-Name: 184ecbe9c0c3280a22cdeda5c7836a7b280c3e1f
2016-08-18 14:47:48 +00:00
drh 69c338263a Rename the Db.zName field to Db.zDbSName to make it more descriptive and to
distinguish it from all of the other "zName" variables scattered throughout
the code.

FossilOrigin-Name: 92a22f01343a898455fd61c3b8e7d7c954f5b569
2016-08-18 14:33:11 +00:00
dan e7036202bc Bias the fts5 snippet() function to return snippets that look like they start at the start of sentences.
FossilOrigin-Name: 60de159476edbd48dc363f7f77f09c32ea68422f
2016-08-17 19:05:12 +00:00
dan 8c2b1fde58 Fix a problem in the fts5 snippet() auxiliary function.
FossilOrigin-Name: a861713cc6a3868a1c89240e8340bc7b2b9559da
2016-08-17 11:14:39 +00:00
drh 0f832ddc06 Fix a bug in destructor processing of Lemon. That has no impact on the
SQLite grammar.  The bug was introduced by prior work to optimize the
Lemon-generated parser used by SQLite.

FossilOrigin-Name: f9035b8e2ea331801402bcb62b203ab092949770
2016-08-16 16:46:40 +00:00
drh 0f825a7e26 Remove an unnecessary stack variable from sqlite3VdbeExec().
FossilOrigin-Name: c54bd9c82dd34951dc87848c0b19fcccaef928db
2016-08-13 14:17:02 +00:00
drh af69eda63e Improvements to commits. No code changes.
FossilOrigin-Name: 18f5a3bee4f870be4644a6042a20081c46edb7d0
2016-08-13 13:03:46 +00:00
drh a2f629251f Fix to the vector less-than operator. All legacy tests passing now.
FossilOrigin-Name: ec70a67ebc997f457be4d52d8affc37e142dc3ff
2016-08-13 12:37:47 +00:00
dan 460d38f15e Fix an fts5 problem with corrupt database handling found by address-sanitizer.
FossilOrigin-Name: e22252e1da4cd9e41b970970a1c4f466aa6cc133
2016-08-13 10:34:12 +00:00
drh 79752b6e63 Attempt to simplify the logic and generated code for vector comparisons.
Basic comparison operators are working, but there are many indexing test
failures still to be worked through.

FossilOrigin-Name: dfc028cfbe7657d20727a2670ecadb1575eb8cbb
2016-08-13 10:02:17 +00:00
dan 3b96d1e2e4 Fix a buffer overread in fts5.
FossilOrigin-Name: fcfbee6c7d33a9ae7feb46044a0c2fe680460d39
2016-08-13 06:38:31 +00:00
drh 471b4b92bd Add VdbeCoverage() macros on newly added VDBE branch operations.
FossilOrigin-Name: 381aa73141db8ec59adbcb09e71af660ee4ae5ce
2016-08-12 11:25:49 +00:00
drh a48d7e7749 Fix a post-OOM memory leak.
FossilOrigin-Name: 14009b32b955b42cfd5f0c2ce7d4b3ce19ce201e
2016-08-12 11:01:20 +00:00
dan 1bf4ca7c42 Add the "modeof=<filename>" URI parameter to os_unix.c - used to specify a file to copy permissions from when a new database is created. Also allow passing NULL as the second parameter to sqlite3rbu_vacuum().
FossilOrigin-Name: ed406d31ff54ee3de8db91690a966e5c561f8f94
2016-08-11 18:05:47 +00:00
drh 088645b090 Merge recent changes from trunk.
FossilOrigin-Name: 959677b97ba15f786936c762e2e68df1151d7ed0
2016-08-11 12:31:21 +00:00
dan 17994e3bca Fix some problems with handling "no such collation sequence" errors.
FossilOrigin-Name: 8278be06fa69e3266866220bdaf5be45a5fcfa23
2016-08-11 12:01:52 +00:00
dan 6ff4627d5d Fix a 1 byte buffer overwrite in the "sqldiff --rbu" command.
FossilOrigin-Name: ab83d7077da80ddbcf399d0797d79e964dc64f0e
2016-08-11 09:55:55 +00:00
drh c73bd0a5cc Fix a harmless compiler warning in FTS5.
FossilOrigin-Name: 2ea0c8b46eefd4874f021f8dfd344be751f2034f
2016-08-11 01:24:56 +00:00
drh 93ca3933d1 Optimization to sqlite3WhereExprUsage().
FossilOrigin-Name: 95493058fcf40306727a281f21c5a2a0011b7d02
2016-08-10 20:02:21 +00:00
drh e104dd3cc3 List of MATCH operator names in isMatchOfColumn() should be constant.
FossilOrigin-Name: 7319d676aaf95ba7391379f4cdf193b6aa898893
2016-08-10 19:43:29 +00:00
drh 922802c44e Performance enhancement in the expression walker.
FossilOrigin-Name: ebccbd96094ac64de39dbd0d220d3a7afd8cd40e
2016-08-10 18:56:32 +00:00
drh f5dbe7f8d8 Tweaks to pcache1TruncateUnsafe() to make it slightly smaller and faster and
easier to test.

FossilOrigin-Name: 059f4e2efefb7b9deaf539110c19bceaeb10c6ce
2016-08-10 15:02:49 +00:00
drh 167fbbe195 Rearrange the code inside sqlite3RunParser() routine so that sqlite3Parser()
is only called from a single place.  This allows sqlite3Parser() to be
in-lined, which results in a 0.25% overall performance gain.

FossilOrigin-Name: 25d1d02b3ea126ade22b2a72649ae55509aa1777
2016-08-10 14:40:00 +00:00
drh 765fecf010 Increment the version number to 3.15.
FossilOrigin-Name: 8c2701e70ab2553d7a586ff5fe7afa02d8c63199
2016-08-10 13:34:16 +00:00
drh 701b68879c Improved comments on the lempar.c parser template. Adjust the
YY_SHIFT_USE_DFLT constant in the Lemon-generated parser tables so as
to guarantee that it is always out of range of the yy_lookahead[] table.

FossilOrigin-Name: 83622f3f50030e4d6abafb99d99742928aaf157c
2016-08-10 13:30:43 +00:00
drh d9fabbcc5b Fix pcache1TruncateUnsafe() run faster for the case where iLimit is
very close to iMaxKey.

FossilOrigin-Name: b07a26df06a2ffb946ff8a1cc7f43eaf701a94b5
2016-08-10 11:50:12 +00:00
drh c83db9e4e1 Performance optimization in the yy_find_shift_action() routine of the
Lemon-generated parser.

FossilOrigin-Name: ba6663beefcc8060e6f3be6ab37c13fdbb08b7de
2016-08-10 01:43:30 +00:00
drh 8d57d7af23 Fix harmless compiler warning.
FossilOrigin-Name: 9a5a4f6e3bc265fecf79a7f63d14abbf239da636
2016-08-09 21:01:52 +00:00
dan ccf03677a3 Minor update to the way fts5 column filters are parsed.
FossilOrigin-Name: 14864f2b8470fe98dbd17f59963bf1be8d4962f9
2016-08-09 19:48:37 +00:00
dan 882ef0b8c0 Have fts5 interpret column lists that begin with a "-" character as "match any column except" lists.
FossilOrigin-Name: e517545650631d1e8a7ee63c6646a8b183a0a894
2016-08-09 19:26:57 +00:00
dan 9cd4933ec1 Add rowvalue5.test, which should have been part of the previous commit on this branch.
FossilOrigin-Name: ea03e219ced87777f0c3c6bbb0274078dbb829e2
2016-08-09 05:48:40 +00:00
dan 6256c1c242 Fix some cases involving row values and virtual tables.
FossilOrigin-Name: 156a41f30a0afd9a70e6c26470dcc468a11bd402
2016-08-08 20:15:41 +00:00
dan 1d9bc9b7a0 Fix the EXPLAIN QUERY PLAN output for row value range constaints that use an index.
FossilOrigin-Name: bb60651163553c5e46bf7b2805490570cea647b8
2016-08-08 18:42:08 +00:00
dan adeb970da2 Merge trunk changes with this branch.
FossilOrigin-Name: 0e927a7e0250a65fd8e97b322cd69e93fadd13f0
2016-08-08 16:52:11 +00:00
drh e22c375659 Version 3.14
FossilOrigin-Name: d5e98057028abcf7217d0d2b2e29bbbcdf09d6de
2016-08-08 13:40:27 +00:00
drh 6da466e4f4 Fix documentation typos. No changes to code.
FossilOrigin-Name: ebc396a19fa79bea208ecda277ffff5d02166d0b
2016-08-07 18:52:11 +00:00
dan e099b67c20 Have the TEA package build without SQLITE_OMIT_DEPRECATED. As it uses recently deprecated interfaces sqlite3_profile() and sqlite3_trace().
FossilOrigin-Name: 95578898835b933901603bd4d5e063f1219a016f
2016-08-05 20:54:45 +00:00
dan 43c1ce390f Undo commit [f250166bb]. It is required to handle IO and other errors that occur within a VACUUM of a Zipvfs database.
FossilOrigin-Name: ae72513af37cd806a6d94aaa7c47a740e119d3b1
2016-08-05 16:16:26 +00:00
drh 5360b55c6c Remove an incorrect ALWAYS() statement and add a test case to show when
the condition is sometimes false.

FossilOrigin-Name: 0f57effa3642e66a863f32cc7fba86d167084af3
2016-08-05 15:34:42 +00:00
drh 0aafa9c89c Fix a very obscure problem following OOM in sqlite3_declare_vtab().
FossilOrigin-Name: 68eac74874d0646369bef3650c6cb271cca62ab4
2016-08-05 14:35:47 +00:00
drh 70ae0e93ec Revert the SQLITE_APICALL changes for now. That changes needs further
research before it is released.  Deferred until 3.15.

FossilOrigin-Name: 9adda385267d1a0ecff259b42a284913668441a2
2016-08-04 13:23:28 +00:00
drh cc15313cc9 Add the experimental SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION compile-time option.
When enabled, the "unknown function" error is suppressed for EXPLAIN and
a no-op function named "unknown()" is substituted.  This facilitiates using
the command-line shell to analyze queries from applications that contain
many application-defined functions that are not normally available to the
shell.

FossilOrigin-Name: b7f30a9ff20d580fdaecdcf2b644d09ad6c2575e
2016-08-04 12:35:17 +00:00
drh dd545d3bf2 Make sure the ORDER BY LIMIT optimization is not applied if the inner-most
loop can only have a single iteration and is hence not really a loop.

FossilOrigin-Name: 13e3bd3de6b434b6182ef36be108d7ee0be8ca53
2016-08-04 09:09:44 +00:00
dan 3d1fb1dd75 Fix a problem with estimating the number of rows visited by a query that uses a multi-column IN(SELECT...) constraint.
FossilOrigin-Name: 3c2f908f5b7312570cfa74afcf4252a857cb5237
2016-08-03 18:00:49 +00:00
dan 2c628ea9d9 Fix another problem involving vector range constraints and mixed ASC/DESC indexes.
FossilOrigin-Name: 1559f4c43473e107f7196eea3ee91c53ede22999
2016-08-03 16:39:04 +00:00
dan d66e5794d1 Fix stat4-based cost estimates for vector range constraints.
FossilOrigin-Name: 18af74abc8ceae47ab9fbee3e3e5bb37db8fcba5
2016-08-03 16:14:33 +00:00
drh c0d269e96c Fix a typo in a comment in btree.c. No changes to code.
FossilOrigin-Name: 722c12816347ee9fce7a090cfebef2c5841e7445
2016-08-03 14:51:16 +00:00
drh a36e01a772 Fix the --help output on fuzzcheck so that it fix in an 80-character window.
FossilOrigin-Name: b91444b5db8465f09d112455e722c888b3f94329
2016-08-03 13:40:54 +00:00
dan 78f9bb6c71 Add new test file rowvaluefault.test.
FossilOrigin-Name: e496b2d63984311e6ae117677e6c2417ae24b6bc
2016-08-02 20:45:56 +00:00
drh c330887291 Fix a unused variable that comes up with -DSQLITE_OMIT_DATETIME_FUNCS.
FossilOrigin-Name: e2f9919e34c70761e4e275eeffca8ccf9159223c
2016-08-02 20:42:24 +00:00
mistachkin 3dffcf911f The 'replace.tcl' tool should use Unix line-endings.
FossilOrigin-Name: 50de96314f75494dc1f5b14d62c595a70c4e0638
2016-08-02 19:29:56 +00:00
dan 51d82d1d24 Add tests and fixes for vector operations that use sub-queries with different combinations of LIMIT, OFFSET and ORDER BY clauses.
FossilOrigin-Name: 092b1c5ff53c9f3cfed079c46e3353d93f99303e
2016-08-02 18:50:15 +00:00
dan f9b2e05c75 Fix SQLITE_OMIT_SUBQUERY builds.
FossilOrigin-Name: 339f85f414a484e44d2502d1ff7281caf9b7c838
2016-08-02 17:45:00 +00:00
dan d05a7144cd Fix a problem with vector range constraints and mixed ASC/DESC indexes.
FossilOrigin-Name: e2ad30c8b5366fd8e50f36c62345ed03ec613c47
2016-08-02 17:07:51 +00:00
dan 080508a186 Merge latest trunk changes into this branch.
FossilOrigin-Name: d468101b421e073e9debd7381bde1d36af31369e
2016-08-02 16:24:10 +00:00
dan 95a08c065a Add missing comments and make some code on this branch clearer.
FossilOrigin-Name: 6937677cc2c2db6b21f997559f88a339466cd15b
2016-08-02 16:18:35 +00:00
drh b7203cde29 Updates to requirements marks. No changes to code.
FossilOrigin-Name: b23c10ac8f65bc88a6c7d88e140217222eb4cbe5
2016-08-02 13:26:34 +00:00
dan 914b7e4238 Fix a problem introduced by [77948b5eceab92a7] causing duplicate calls to be made to the xSavepoint() method of virtual tables under some circumstances.
FossilOrigin-Name: e64a4173d2899acf13b73e6e28f2e164fd638a75
2016-08-02 11:29:16 +00:00
drh 38b802dfd7 Fix harmless compiler warnings in sqlite3_status().
FossilOrigin-Name: 7c38a79cdd42aaa45715aea330d10ca859098837
2016-08-02 08:45:26 +00:00
drh 19eb77bbe0 Update the wordcount.c test program and add a new script "time-wordcount.sh"
for additional performance testing.

FossilOrigin-Name: d8ef9f58643f13dd3d16dcde0d829ae08324f04b
2016-08-01 21:17:53 +00:00
dan 553168c706 Fix a problem with vector range constraints involving the rowid column. And other issues.
FossilOrigin-Name: 3ef75d45ebcd8ede91596d69e55fe7d685008a60
2016-08-01 20:14:31 +00:00
drh b0df540d7a Fix other harmless compiler warnings.
FossilOrigin-Name: 90d2c490fc2ed4e073711b84f989ca4d496dcfb5
2016-08-01 17:06:44 +00:00
dan 4df049faec Remove a duplicate typedef from loadext.c (remaining copy is in sqlite3ext.h).
FossilOrigin-Name: fd184e5a8f4577aa9a817eb55e771d8d1021b946
2016-08-01 16:57:30 +00:00
dan d7d19b7137 Add an extra compiler switch to loadext.test to ensure that it picks up the correct version of sqlite3.h when building a test extension.
FossilOrigin-Name: e57fa6af32a1d1bf7be64b26850730f7e714b6c6
2016-08-01 16:50:50 +00:00
dan 870a0705fe Fix a problem with IN(...) constraints where the LHS is a sub-select that is an aggregate query.
FossilOrigin-Name: 1f4dba87da4a44ad26223ad965731164c0d9bad9
2016-08-01 16:37:43 +00:00
drh 8ef24b8deb Update releasetest.tcl to automatically do one round of tests with
USE_STDCALL=1 when running on Windows with MSVC.

FossilOrigin-Name: a6a112de485eb9d15f6fa75568dcb876f00abb64
2016-08-01 15:00:00 +00:00
drh 32c83c8b9e Avoid making unnecessary changes to the signatures of the
sqlite3_auto_extension() and sqlite3_cancel_auto_extension() interfaces.

FossilOrigin-Name: b6ea2f21f602031ef4dbd47462ac11b0bb0d5de6
2016-08-01 14:35:48 +00:00
dan 5c288b929a Fix problems with vector == comparisons and NULL values.
FossilOrigin-Name: 059d0d05354e6efab7892c97b339ffa0b5303587
2016-07-30 21:02:33 +00:00
mistachkin 19e76b2a7c Fix harmless compiler warning seen with MSVC.
FossilOrigin-Name: 390a38a142d36d2c57b3f21aab72edcde450125d
2016-07-30 18:54:54 +00:00
dan cb17ce9300 Merge latest trunk with this branch.
FossilOrigin-Name: 63ae02d084a332250ff6fd8d8c80e53bf5422a68
2016-07-30 17:59:39 +00:00
dan 625015e0c9 Remove the EP_Vector expression flag.
FossilOrigin-Name: e9d9c6d46b46160fad6aa6e3441a65a09157515f
2016-07-30 16:39:28 +00:00
dan 19ff12dd76 Fix some issues with vector range constraints and the column cache. Also vector range constraints and rowid columns.
FossilOrigin-Name: 42607366bfc2dceb1013797a973b3b8df75dcb4d
2016-07-29 20:58:19 +00:00
dan 145b4ea519 Change the way "(a, b) = (SELECT *)" expressions are handled in where.c if there is an index on one of the columns only.
FossilOrigin-Name: 4dfebff2924f46284d5b9cda69175f79b29d6028
2016-07-29 18:12:12 +00:00
mistachkin 11f69b879c Using the header file 'intrin.h' requires MSVC 2005 or later.
FossilOrigin-Name: 9fae75c08b7d3b3e13734193ad8398ef6971cbac
2016-07-29 17:36:27 +00:00
mistachkin be56ad31b7 For test 'shell1-5.0', disable round-trip testing for characters in the range 0xE0 to 0xEF on Linux, due to intermittent shell portability issues.
FossilOrigin-Name: 544c990afd3b64064cc4d970ec5d7eb23eeb9914
2016-07-29 04:12:18 +00:00
mistachkin d62c07d42e Fix typo in a test file interactive output string.
FossilOrigin-Name: 4fedd7902371935e1374ca7df3ffd4c4cf93959b
2016-07-29 02:04:36 +00:00
drh 50972b71e1 Merge additional linkage macro changes from the branch.
FossilOrigin-Name: 8b0eb22ee12b23421dcb8dbeb46909d813788a0b
2016-07-29 01:55:42 +00:00
drh e363d50db8 Further refinement to the calling convention macros.
FossilOrigin-Name: 45588de385d2a721b3e9f04beb6c7b789dd27d42
2016-07-29 01:49:36 +00:00
mistachkin df27352e37 Merge updates from trunk.
FossilOrigin-Name: 71ffa195f5a48280ee522d80ab82e8cdea636961
2016-07-29 01:47:18 +00:00
mistachkin fefe82876c Update the autoconf makefile for MSVC.
FossilOrigin-Name: 2daf20980d4cb9ed36372778ae1f3e595e503549
2016-07-29 01:46:57 +00:00
drh 99bbcc8287 Undo some unhelpful changes to skip-scan scoring that were added
by the check-in [9e2b2681] that improved scoring of index scan.

FossilOrigin-Name: c7d51934a4f30d096bb79fc509fc9dd0df5d89a4
2016-07-29 01:32:36 +00:00
mistachkin c08556844e Add macro necessary for building several extensions when the __stdcall calling convention is not in use.
FossilOrigin-Name: bc8c9b55ddf5227dc6b2116486f4a19bf54fce2b
2016-07-29 01:31:49 +00:00
mistachkin 2d45d7bfab Missed a couple Tcl command deletion callbacks.
FossilOrigin-Name: fc5c187602acceedf7152b6927616d134f779a8f
2016-07-28 23:58:25 +00:00
mistachkin afe18262b4 Use the SQLITE_TCLAPI macro in several extensions that were missed in the previous check-in.
FossilOrigin-Name: df2543652b835353c03956dfbd3e35e5b191372e
2016-07-28 23:54:45 +00:00
mistachkin 85bd982ba0 More compiler warning fixes for GCC related to the auto-extension mechanism.
FossilOrigin-Name: b8218129bc848c61fa6910feae4141dac6ad86fc
2016-07-28 22:53:10 +00:00
mistachkin 78d5e02f99 The return type used by the auto-extension entry points is 'int', not 'void'.
FossilOrigin-Name: bf9c86c74f30136a106f37603a6c7dcc76caf41d
2016-07-28 22:46:53 +00:00
mistachkin 177d0f0b47 Make sure all the auto-extension mechanism function signatures match up precisely.
FossilOrigin-Name: 87ba69b5ca4a8e4ef2bbaaf07a0ff13fc5cd4721
2016-07-28 22:38:31 +00:00
mistachkin 44e95d4f02 Make the extension auto-loading mechanism work with the __stdcall calling convention. Also, fix a couple Tcl command calling conventions missed in the previous check-in.
FossilOrigin-Name: 3ea567c4b07b2a7a027b9b5cb8250ab687803698
2016-07-28 22:23:26 +00:00
dan 7b35a77b1a Fix further issues with multi-column IN(...) operators. Also some error handling cases surrounding row values.
FossilOrigin-Name: cc3f6542bec99b00d2698889bcea2aa0b587efa0
2016-07-28 19:47:15 +00:00
mistachkin e37f7397c9 The 'sqlite3ext.h' content should be processed before being included in the amalgamation.
FossilOrigin-Name: cbe1de4799df4d512bc175f51ed99c6ec6d5a4d1
2016-07-28 19:28:35 +00:00
drh 3a22fdab9a Decorate all interfaces with calling convention macros.
FossilOrigin-Name: fd784887e125bf95f4799ad09cbcba6795173487
2016-07-28 18:55:57 +00:00
mistachkin c0bebc1dcf All SQLite API functions and callbacks in the 'sqlite3ext.h' header file must be decorated with the calling convention.
FossilOrigin-Name: 97fc6e4328fe72cdd10f11a4b4bc9ce14bdc537f
2016-07-28 18:49:20 +00:00
mistachkin 7c60b26691 Fixup reserved function pointers in the Tcl stubs table and several macros containing Tcl function pointers.
FossilOrigin-Name: 959cd0131a5c717679b6e250229794679efe7f69
2016-07-28 18:18:53 +00:00
mistachkin a121cc7c60 Adjustments to get 'testfixture.exe' compiling with Tcl 8.6 when __stdcall is enabled.
FossilOrigin-Name: 90e89ec9c8efff057a9e43c612427fc5c97ab52d
2016-07-28 18:06:52 +00:00
mistachkin 7617e4a8a4 Make sure the SQLITE_TCLAPI macro is always defined.
FossilOrigin-Name: f2f1323cc4d2ad2d6794dbfae8d50b747213e85d
2016-07-28 17:11:20 +00:00
mistachkin f27a80cf18 More work on getting the 'testfixture.exe' target to work correctly.
FossilOrigin-Name: 36b72fd609cf151f3db0e65b450d7cd515f2ac49
2016-07-28 16:09:52 +00:00
mistachkin fe0c0d2088 Modify the mksqlite3h.tcl tool to handle the syscall typedef specially.
FossilOrigin-Name: 478a84efa6ea13629227ba8970c8ef8545d31074
2016-07-28 15:38:34 +00:00
drh 4194ff6598 Change mksqlite3h.tcl to automatically insert the SQLITE_CALLBACK calling
convention macros.

FossilOrigin-Name: 11ab9c9ab562df98c20abf126a8bac178aef77a8
2016-07-28 15:09:02 +00:00
mistachkin 52b1dbb5fc Allow the 'testfixture.exe' target to be compiled with the __stdcall calling convention.
FossilOrigin-Name: e8be3dfeabaa31b3490793cf8230faae1204be15
2016-07-28 14:37:04 +00:00
dan 34c125747d Merge latest trunk changes into this branch.
FossilOrigin-Name: 9685880f7baeb670739fdcf2d9df08e22abaa699
2016-07-28 13:59:21 +00:00
mistachkin 69def7ff2f Work in progress on setting a calling convention for all callback functions.
FossilOrigin-Name: 02b8040e1add02734d2dbc6c59737ab74ff8fb18
2016-07-28 04:14:37 +00:00
dan d49fd4e89a Fix some problems with multi-column IN(SELECT...) processing.
FossilOrigin-Name: 719a3b2035a335ca8b9704646b1d641011e3ea0e
2016-07-27 19:33:04 +00:00
dan d9ed09d47b Merge latest trunk changes into this branch.
FossilOrigin-Name: d4f3d52c5a11fc7ad7e8cad76361edbcef13a12f
2016-07-26 18:15:35 +00:00
dan 8da209b169 Fix where.c handling of "IN (SELECT ...)" expressions when the SELECT returns more than one result column. Also error handling for other row value constructor cases.
FossilOrigin-Name: 061b8006034f06a0311b4304c8b14d2c8b0153df
2016-07-26 18:06:08 +00:00
dan ba00e30a3a Allow vector IN(SELECT ...) expressions to use an index if either all the indexed columns are declared NOT NULL or if there is no difference between the expression evaluating to 0 and NULL (as in a WHERE clause).
FossilOrigin-Name: e2fd6f49b1b145bec09c581cc982b89429643ae9
2016-07-23 20:24:06 +00:00
dan 4097d0ca79 Merge latest trunk changes with this branch.
FossilOrigin-Name: 60fed5cdd4a44aefa1b4d505adeb7936f2f0b952
2016-07-22 17:58:05 +00:00
dan cfbb5e82db Modifications towards better vector IN(...) support on this branch. Not activated yet.
FossilOrigin-Name: 34e35c71b25b0aa2d8931040feb260a78cc48c49
2016-07-13 19:48:13 +00:00
mistachkin 709947a315 Merge comment typo fixes from trunk.
FossilOrigin-Name: 728c5aa436a5f55c86b019c415a2b71d1b0a8fd6
2016-07-10 19:35:45 +00:00
dan 71c57db099 Add some support for using row value constructors in certain parts of SQL expressions. There are many bugs on this branch.
FossilOrigin-Name: b2204215b231202aef7a218411cc2ddaecf28f35
2016-07-09 20:23:55 +00:00
165 changed files with 6591 additions and 1849 deletions
+2
View File
@@ -558,7 +558,9 @@ TESTOPTS = --verbose=file --output=test-out.txt
# Extra compiler options for various shell tools
#
SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4
# SHELL_OPT += -DSQLITE_ENABLE_FTS5
SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5
+11
View File
@@ -24,6 +24,13 @@ USE_AMALGAMATION = 1
USE_FULLWARN = 0
!ENDIF
# Set this non-0 to enable full runtime error checks (-RTC1, etc). This
# has no effect if (any) optimizations are enabled.
#
!IFNDEF USE_RUNTIME_CHECKS
USE_RUNTIME_CHECKS = 0
!ENDIF
# Set this non-0 to use "stdcall" calling convention for the core library
# and shell executable.
#
@@ -835,6 +842,10 @@ RCC = $(RCC) -D_DEBUG
!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
TCC = $(TCC) -Od
BCC = $(BCC) -Od
!IF $(USE_RUNTIME_CHECKS)!=0
TCC = $(TCC) -RTC1
BCC = $(BCC) -RTC1
!ENDIF
!ELSEIF $(OPTIMIZATIONS)>=3
TCC = $(TCC) -Ox
BCC = $(BCC) -Ox
+1 -1
View File
@@ -1 +1 @@
3.14.0
3.15.0
+11
View File
@@ -24,6 +24,13 @@ TOP = .
USE_FULLWARN = 0
!ENDIF
# Set this non-0 to enable full runtime error checks (-RTC1, etc). This
# has no effect if (any) optimizations are enabled.
#
!IFNDEF USE_RUNTIME_CHECKS
USE_RUNTIME_CHECKS = 0
!ENDIF
# Set this non-0 to use "stdcall" calling convention for the core library
# and shell executable.
#
@@ -740,6 +747,10 @@ RCC = $(RCC) -D_DEBUG
!IF $(DEBUG)>1 || $(OPTIMIZATIONS)==0
TCC = $(TCC) -Od
BCC = $(BCC) -Od
!IF $(USE_RUNTIME_CHECKS)!=0
TCC = $(TCC) -RTC1
BCC = $(BCC) -RTC1
!ENDIF
!ELSEIF $(OPTIMIZATIONS)>=3
TCC = $(TCC) -Ox
BCC = $(BCC) -Ox
-1
View File
@@ -78,7 +78,6 @@ TEA_ADD_LIBS([])
TEA_ADD_CFLAGS([-DSQLITE_ENABLE_FTS3=1])
TEA_ADD_CFLAGS([-DSQLITE_3_SUFFIX_ONLY=1])
TEA_ADD_CFLAGS([-DSQLITE_ENABLE_RTREE=1])
TEA_ADD_CFLAGS([-DSQLITE_OMIT_DEPRECATED=1])
TEA_ADD_STUB_SOURCES([])
TEA_ADD_TCL_SOURCES([])
Vendored
+9 -9
View File
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for sqlite 3.14.0.
# Generated by GNU Autoconf 2.69 for sqlite 3.15.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -726,8 +726,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='sqlite'
PACKAGE_TARNAME='sqlite'
PACKAGE_VERSION='3.14.0'
PACKAGE_STRING='sqlite 3.14.0'
PACKAGE_VERSION='3.15.0'
PACKAGE_STRING='sqlite 3.15.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures sqlite 3.14.0 to adapt to many kinds of systems.
\`configure' configures sqlite 3.15.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1528,7 +1528,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of sqlite 3.14.0:";;
short | recursive ) echo "Configuration of sqlite 3.15.0:";;
esac
cat <<\_ACEOF
@@ -1652,7 +1652,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
sqlite configure 3.14.0
sqlite configure 3.15.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2071,7 +2071,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by sqlite $as_me 3.14.0, which was
It was created by sqlite $as_me 3.15.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -12151,7 +12151,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by sqlite $as_me 3.14.0, which was
This file was extended by sqlite $as_me 3.15.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -12217,7 +12217,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
sqlite config.status 3.14.0
sqlite config.status 3.15.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
+5 -1
View File
@@ -99,7 +99,11 @@ static void scalarFunc(
#ifdef SQLITE_TEST
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include <string.h>
/*
+12 -5
View File
@@ -18,7 +18,14 @@
** that the sqlite3_tokenizer_module.xLanguage() method is invoked correctly.
*/
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
# ifndef SQLITE_TCLAPI
# define SQLITE_TCLAPI
# endif
#endif
#include <string.h>
#include <assert.h>
@@ -143,7 +150,7 @@ static int nm_match_count(
/*
** Tclcmd: fts3_near_match DOCUMENT EXPR ?OPTIONS?
*/
static int fts3_near_match_cmd(
static int SQLITE_TCLAPI fts3_near_match_cmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -278,7 +285,7 @@ static int fts3_near_match_cmd(
** # Restore initial incr-load settings:
** eval fts3_configure_incr_load $cfg
*/
static int fts3_configure_incr_load_cmd(
static int SQLITE_TCLAPI fts3_configure_incr_load_cmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -488,7 +495,7 @@ static int testTokenizerLanguage(
}
#endif
static int fts3_test_tokenizer_cmd(
static int SQLITE_TCLAPI fts3_test_tokenizer_cmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -517,7 +524,7 @@ static int fts3_test_tokenizer_cmd(
return TCL_OK;
}
static int fts3_test_varint_cmd(
static int SQLITE_TCLAPI fts3_test_varint_cmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
+5 -1
View File
@@ -224,7 +224,11 @@ int sqlite3Fts3InitTokenizer(
#ifdef SQLITE_TEST
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include <string.h>
/*
+1 -2
View File
@@ -318,7 +318,7 @@ struct Fts5ExtensionApi {
** behaviour. The structure methods are expected to function as follows:
**
** xCreate:
** This function is used to allocate and inititalize a tokenizer instance.
** This function is used to allocate and initialize a tokenizer instance.
** A tokenizer instance is required to actually tokenize text.
**
** The first argument passed to this function is a copy of the (void*)
@@ -577,4 +577,3 @@ struct fts5_api {
#endif
#endif /* _FTS5_H */
+1
View File
@@ -737,6 +737,7 @@ void sqlite3Fts5ParseNodeFree(Fts5ExprNode*);
void sqlite3Fts5ParseSetDistance(Fts5Parse*, Fts5ExprNearset*, Fts5Token*);
void sqlite3Fts5ParseSetColset(Fts5Parse*, Fts5ExprNearset*, Fts5Colset*);
Fts5Colset *sqlite3Fts5ParseColsetInvert(Fts5Parse*, Fts5Colset*);
void sqlite3Fts5ParseFinished(Fts5Parse *pParse, Fts5ExprNode *p);
void sqlite3Fts5ParseNear(Fts5Parse *pParse, Fts5Token*);
+185 -45
View File
@@ -189,7 +189,7 @@ static int fts5HighlightCb(
if( p->iRangeEnd>0 && iPos==p->iRangeEnd ){
fts5HighlightAppend(&rc, p, &p->zIn[p->iOff], iEndOff - p->iOff);
p->iOff = iEndOff;
if( iPos<p->iter.iEnd ){
if( iPos>=p->iter.iStart && iPos<p->iter.iEnd ){
fts5HighlightAppend(&rc, p, p->zClose, -1);
}
}
@@ -246,6 +246,115 @@ static void fts5HighlightFunction(
** End of highlight() implementation.
**************************************************************************/
/*
** Context object passed to the fts5SentenceFinderCb() function.
*/
typedef struct Fts5SFinder Fts5SFinder;
struct Fts5SFinder {
int iPos; /* Current token position */
int nFirstAlloc; /* Allocated size of aFirst[] */
int nFirst; /* Number of entries in aFirst[] */
int *aFirst; /* Array of first token in each sentence */
const char *zDoc; /* Document being tokenized */
};
/*
** Add an entry to the Fts5SFinder.aFirst[] array. Grow the array if
** necessary. Return SQLITE_OK if successful, or SQLITE_NOMEM if an
** error occurs.
*/
static int fts5SentenceFinderAdd(Fts5SFinder *p, int iAdd){
if( p->nFirstAlloc==p->nFirst ){
int nNew = p->nFirstAlloc ? p->nFirstAlloc*2 : 64;
int *aNew;
aNew = (int*)sqlite3_realloc(p->aFirst, nNew*sizeof(int));
if( aNew==0 ) return SQLITE_NOMEM;
p->aFirst = aNew;
p->nFirstAlloc = nNew;
}
p->aFirst[p->nFirst++] = iAdd;
return SQLITE_OK;
}
/*
** This function is an xTokenize() callback used by the auxiliary snippet()
** function. Its job is to identify tokens that are the first in a sentence.
** For each such token, an entry is added to the SFinder.aFirst[] array.
*/
static int fts5SentenceFinderCb(
void *pContext, /* Pointer to HighlightContext object */
int tflags, /* Mask of FTS5_TOKEN_* flags */
const char *pToken, /* Buffer containing token */
int nToken, /* Size of token in bytes */
int iStartOff, /* Start offset of token */
int iEndOff /* End offset of token */
){
int rc = SQLITE_OK;
if( (tflags & FTS5_TOKEN_COLOCATED)==0 ){
Fts5SFinder *p = (Fts5SFinder*)pContext;
if( p->iPos>0 ){
int i;
char c = 0;
for(i=iStartOff-1; i>=0; i--){
c = p->zDoc[i];
if( c!=' ' && c!='\t' && c!='\n' && c!='\r' ) break;
}
if( i!=iStartOff-1 && (c=='.' || c==':') ){
rc = fts5SentenceFinderAdd(p, p->iPos);
}
}else{
rc = fts5SentenceFinderAdd(p, 0);
}
p->iPos++;
}
return rc;
}
static int fts5SnippetScore(
const Fts5ExtensionApi *pApi, /* API offered by current FTS version */
Fts5Context *pFts, /* First arg to pass to pApi functions */
int nDocsize, /* Size of column in tokens */
unsigned char *aSeen, /* Array with one element per query phrase */
int iCol, /* Column to score */
int iPos, /* Starting offset to score */
int nToken, /* Max tokens per snippet */
int *pnScore, /* OUT: Score */
int *piPos /* OUT: Adjusted offset */
){
int rc;
int i;
int ip = 0;
int ic = 0;
int iOff = 0;
int iFirst = -1;
int nInst;
int nScore = 0;
int iLast = 0;
rc = pApi->xInstCount(pFts, &nInst);
for(i=0; i<nInst && rc==SQLITE_OK; i++){
rc = pApi->xInst(pFts, i, &ip, &ic, &iOff);
if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff<(iPos+nToken) ){
nScore += (aSeen[ip] ? 1 : 1000);
aSeen[ip] = 1;
if( iFirst<0 ) iFirst = iOff;
iLast = iOff + pApi->xPhraseSize(pFts, ip);
}
}
*pnScore = nScore;
if( piPos ){
int iAdj = iFirst - (nToken - (iLast-iFirst)) / 2;
if( (iAdj+nToken)>nDocsize ) iAdj = nDocsize - nToken;
if( iAdj<0 ) iAdj = 0;
*piPos = iAdj;
}
return rc;
}
/*
** Implementation of snippet() function.
*/
@@ -267,9 +376,10 @@ static void fts5SnippetFunction(
unsigned char *aSeen; /* Array of "seen instance" flags */
int iBestCol; /* Column containing best snippet */
int iBestStart = 0; /* First token of best snippet */
int iBestLast; /* Last token of best snippet */
int nBestScore = 0; /* Score of best snippet */
int nColSize = 0; /* Total size of iBestCol in tokens */
Fts5SFinder sFinder; /* Used to find the beginnings of sentences */
int nCol;
if( nVal!=5 ){
const char *zErr = "wrong number of arguments to function snippet()";
@@ -277,13 +387,13 @@ static void fts5SnippetFunction(
return;
}
nCol = pApi->xColumnCount(pFts);
memset(&ctx, 0, sizeof(HighlightContext));
iCol = sqlite3_value_int(apVal[0]);
ctx.zOpen = (const char*)sqlite3_value_text(apVal[1]);
ctx.zClose = (const char*)sqlite3_value_text(apVal[2]);
zEllips = (const char*)sqlite3_value_text(apVal[3]);
nToken = sqlite3_value_int(apVal[4]);
iBestLast = nToken-1;
iBestCol = (iCol>=0 ? iCol : 0);
nPhrase = pApi->xPhraseCount(pFts);
@@ -291,65 +401,95 @@ static void fts5SnippetFunction(
if( aSeen==0 ){
rc = SQLITE_NOMEM;
}
if( rc==SQLITE_OK ){
rc = pApi->xInstCount(pFts, &nInst);
}
for(i=0; rc==SQLITE_OK && i<nInst; i++){
int ip, iSnippetCol, iStart;
memset(aSeen, 0, nPhrase);
rc = pApi->xInst(pFts, i, &ip, &iSnippetCol, &iStart);
if( rc==SQLITE_OK && (iCol<0 || iSnippetCol==iCol) ){
int nScore = 1000;
int iLast = iStart - 1 + pApi->xPhraseSize(pFts, ip);
int j;
aSeen[ip] = 1;
for(j=i+1; rc==SQLITE_OK && j<nInst; j++){
int ic; int io; int iFinal;
rc = pApi->xInst(pFts, j, &ip, &ic, &io);
iFinal = io + pApi->xPhraseSize(pFts, ip) - 1;
if( rc==SQLITE_OK && ic==iSnippetCol && iLast<iStart+nToken ){
nScore += aSeen[ip] ? 1000 : 1;
aSeen[ip] = 1;
if( iFinal>iLast ) iLast = iFinal;
memset(&sFinder, 0, sizeof(Fts5SFinder));
for(i=0; i<nCol; i++){
if( iCol<0 || iCol==i ){
int nDoc;
int nDocsize;
int ii;
sFinder.iPos = 0;
sFinder.nFirst = 0;
rc = pApi->xColumnText(pFts, i, &sFinder.zDoc, &nDoc);
if( rc!=SQLITE_OK ) break;
rc = pApi->xTokenize(pFts,
sFinder.zDoc, nDoc, (void*)&sFinder,fts5SentenceFinderCb
);
if( rc!=SQLITE_OK ) break;
rc = pApi->xColumnSize(pFts, i, &nDocsize);
if( rc!=SQLITE_OK ) break;
for(ii=0; rc==SQLITE_OK && ii<nInst; ii++){
int ip, ic, io;
int iAdj;
int nScore;
int jj;
rc = pApi->xInst(pFts, ii, &ip, &ic, &io);
if( ic!=i || rc!=SQLITE_OK ) continue;
memset(aSeen, 0, nPhrase);
rc = fts5SnippetScore(pApi, pFts, nDocsize, aSeen, i,
io, nToken, &nScore, &iAdj
);
if( rc==SQLITE_OK && nScore>nBestScore ){
nBestScore = nScore;
iBestCol = i;
iBestStart = iAdj;
nColSize = nDocsize;
}
}
if( rc==SQLITE_OK && nScore>nBestScore ){
iBestCol = iSnippetCol;
iBestStart = iStart;
iBestLast = iLast;
nBestScore = nScore;
if( rc==SQLITE_OK && sFinder.nFirst && nDocsize>nToken ){
for(jj=0; jj<(sFinder.nFirst-1); jj++){
if( sFinder.aFirst[jj+1]>io ) break;
}
if( sFinder.aFirst[jj]<io ){
int nScore;
memset(aSeen, 0, nPhrase);
rc = fts5SnippetScore(pApi, pFts, nDocsize, aSeen, i,
sFinder.aFirst[jj], nToken, &nScore, 0
);
nScore += (sFinder.aFirst[jj]==0 ? 120 : 100);
if( rc==SQLITE_OK && nScore>nBestScore ){
nBestScore = nScore;
iBestCol = i;
iBestStart = sFinder.aFirst[jj];
nColSize = nDocsize;
}
}
}
}
}
}
if( rc==SQLITE_OK ){
rc = pApi->xColumnSize(pFts, iBestCol, &nColSize);
}
if( rc==SQLITE_OK ){
rc = pApi->xColumnText(pFts, iBestCol, &ctx.zIn, &ctx.nIn);
}
if( rc==SQLITE_OK && nColSize==0 ){
rc = pApi->xColumnSize(pFts, iBestCol, &nColSize);
}
if( ctx.zIn ){
if( rc==SQLITE_OK ){
rc = fts5CInstIterInit(pApi, pFts, iBestCol, &ctx.iter);
}
if( (iBestStart+nToken-1)>iBestLast ){
iBestStart -= (iBestStart+nToken-1-iBestLast) / 2;
}
if( iBestStart+nToken>nColSize ){
iBestStart = nColSize - nToken;
}
if( iBestStart<0 ) iBestStart = 0;
ctx.iRangeStart = iBestStart;
ctx.iRangeEnd = iBestStart + nToken - 1;
if( iBestStart>0 ){
fts5HighlightAppend(&rc, &ctx, zEllips, -1);
}
/* Advance iterator ctx.iter so that it points to the first coalesced
** phrase instance at or following position iBestStart. */
while( ctx.iter.iStart>=0 && ctx.iter.iStart<iBestStart && rc==SQLITE_OK ){
rc = fts5CInstIterNext(&ctx.iter);
}
if( rc==SQLITE_OK ){
rc = pApi->xTokenize(pFts, ctx.zIn, ctx.nIn, (void*)&ctx,fts5HighlightCb);
}
@@ -358,15 +498,15 @@ static void fts5SnippetFunction(
}else{
fts5HighlightAppend(&rc, &ctx, zEllips, -1);
}
if( rc==SQLITE_OK ){
sqlite3_result_text(pCtx, (const char*)ctx.zOut, -1, SQLITE_TRANSIENT);
}else{
sqlite3_result_error_code(pCtx, rc);
}
sqlite3_free(ctx.zOut);
}
if( rc==SQLITE_OK ){
sqlite3_result_text(pCtx, (const char*)ctx.zOut, -1, SQLITE_TRANSIENT);
}else{
sqlite3_result_error_code(pCtx, rc);
}
sqlite3_free(ctx.zOut);
sqlite3_free(aSeen);
sqlite3_free(sFinder.aFirst);
}
/************************************************************************/
+30 -1
View File
@@ -167,6 +167,7 @@ static int fts5ExprGetToken(
case ',': tok = FTS5_COMMA; break;
case '+': tok = FTS5_PLUS; break;
case '*': tok = FTS5_STAR; break;
case '-': tok = FTS5_MINUS; break;
case '\0': tok = FTS5_EOF; break;
case '"': {
@@ -1658,7 +1659,7 @@ int sqlite3Fts5ExprClonePhrase(
if( rc==SQLITE_OK ){
Fts5Colset *pColsetOrig = pOrig->pNode->pNear->pColset;
if( pColsetOrig ){
int nByte = sizeof(Fts5Colset) + pColsetOrig->nCol * sizeof(int);
int nByte = sizeof(Fts5Colset) + (pColsetOrig->nCol-1) * sizeof(int);
Fts5Colset *pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&rc, nByte);
if( pColset ){
memcpy(pColset, pColsetOrig, nByte);
@@ -1793,6 +1794,34 @@ static Fts5Colset *fts5ParseColset(
return pNew;
}
/*
** Allocate and return an Fts5Colset object specifying the inverse of
** the colset passed as the second argument. Free the colset passed
** as the second argument before returning.
*/
Fts5Colset *sqlite3Fts5ParseColsetInvert(Fts5Parse *pParse, Fts5Colset *p){
Fts5Colset *pRet;
int nCol = pParse->pConfig->nCol;
pRet = (Fts5Colset*)sqlite3Fts5MallocZero(&pParse->rc,
sizeof(Fts5Colset) + sizeof(int)*nCol
);
if( pRet ){
int i;
int iOld = 0;
for(i=0; i<nCol; i++){
if( iOld>=p->nCol || p->aiCol[iOld]!=i ){
pRet->aiCol[pRet->nCol++] = i;
}else{
iOld++;
}
}
}
sqlite3_free(p);
return pRet;
}
Fts5Colset *sqlite3Fts5ParseColset(
Fts5Parse *pParse, /* Store SQLITE_NOMEM here if required */
Fts5Colset *pColset, /* Existing colset object */
+32 -4
View File
@@ -702,7 +702,6 @@ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){
return pRet;
}
/*
** Release a reference to data record returned by an earlier call to
** fts5DataRead().
@@ -711,6 +710,18 @@ static void fts5DataRelease(Fts5Data *pData){
sqlite3_free(pData);
}
static Fts5Data *fts5LeafRead(Fts5Index *p, i64 iRowid){
Fts5Data *pRet = fts5DataRead(p, iRowid);
if( pRet ){
if( pRet->szLeaf>pRet->nn ){
p->rc = FTS5_CORRUPT;
fts5DataRelease(pRet);
pRet = 0;
}
}
return pRet;
}
static int fts5IndexPrepareStmt(
Fts5Index *p,
sqlite3_stmt **ppStmt,
@@ -1519,7 +1530,7 @@ static void fts5SegIterNextPage(
pIter->pLeaf = pIter->pNextLeaf;
pIter->pNextLeaf = 0;
}else if( pIter->iLeafPgno<=pSeg->pgnoLast ){
pIter->pLeaf = fts5DataRead(p,
pIter->pLeaf = fts5LeafRead(p,
FTS5_SEGMENT_ROWID(pSeg->iSegid, pIter->iLeafPgno)
);
}else{
@@ -2022,9 +2033,8 @@ static void fts5SegIterNext(
if( pLeaf->nn>pLeaf->szLeaf ){
pIter->iPgidxOff = pLeaf->szLeaf + fts5GetVarint32(
&pLeaf->p[pLeaf->szLeaf], pIter->iEndofDoclist
);
);
}
}
else if( pLeaf->nn>pLeaf->szLeaf ){
pIter->iPgidxOff = pLeaf->szLeaf + fts5GetVarint32(
@@ -2269,6 +2279,11 @@ static void fts5LeafSeek(
iTermOff += nKeep;
iOff = iTermOff;
if( iOff>=n ){
p->rc = FTS5_CORRUPT;
return;
}
/* Read the nKeep field of the next term. */
fts5FastGetVarint32(a, iOff, nKeep);
}
@@ -3195,6 +3210,15 @@ static void fts5IterSetOutputs_Nocolset(Fts5Iter *pIter, Fts5SegIter *pSeg){
}
}
/*
** xSetOutputs callback used when the Fts5Colset object has nCol==0 (match
** against no columns at all).
*/
static void fts5IterSetOutputs_ZeroColset(Fts5Iter *pIter, Fts5SegIter *pSeg){
UNUSED_PARAM(pSeg);
pIter->base.nData = 0;
}
/*
** xSetOutputs callback used by detail=col when there is a column filter
** and there are 100 or more columns. Also called as a fallback from
@@ -3300,6 +3324,10 @@ static void fts5IterSetOutputCb(int *pRc, Fts5Iter *pIter){
pIter->xSetOutputs = fts5IterSetOutputs_Nocolset;
}
else if( pIter->pColset->nCol==0 ){
pIter->xSetOutputs = fts5IterSetOutputs_ZeroColset;
}
else if( pConfig->eDetail==FTS5_DETAIL_FULL ){
pIter->xSetOutputs = fts5IterSetOutputs_Full;
}
+20 -13
View File
@@ -14,7 +14,14 @@
#ifdef SQLITE_TEST
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
# ifndef SQLITE_TCLAPI
# define SQLITE_TCLAPI
# endif
#endif
#ifdef SQLITE_ENABLE_FTS5
@@ -78,7 +85,7 @@ static int f5tResultToErrorCode(const char *zRes){
return SQLITE_ERROR;
}
static int f5tDbAndApi(
static int SQLITE_TCLAPI f5tDbAndApi(
Tcl_Interp *interp,
Tcl_Obj *pObj,
sqlite3 **ppDb,
@@ -164,7 +171,7 @@ static int xTokenizeCb(
return rc;
}
static int xF5tApi(void*, Tcl_Interp*, int, Tcl_Obj *CONST []);
static int SQLITE_TCLAPI xF5tApi(void*, Tcl_Interp*, int, Tcl_Obj *CONST []);
static int xQueryPhraseCb(
const Fts5ExtensionApi *pApi,
@@ -209,7 +216,7 @@ static void xSetAuxdataDestructor(void *p){
**
** Description...
*/
static int xF5tApi(
static int SQLITE_TCLAPI xF5tApi(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -602,7 +609,7 @@ static void xF5tDestroy(void *pCtx){
**
** Description...
*/
static int f5tCreateFunction(
static int SQLITE_TCLAPI f5tCreateFunction(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -672,7 +679,7 @@ static int xTokenizeCb2(
**
** Description...
*/
static int f5tTokenize(
static int SQLITE_TCLAPI f5tTokenize(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -878,7 +885,7 @@ static int f5tTokenizerTokenize(
/*
** sqlite3_fts5_token ?-colocated? TEXT START END
*/
static int f5tTokenizerReturn(
static int SQLITE_TCLAPI f5tTokenizerReturn(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -949,7 +956,7 @@ static void f5tDelTokenizer(void *pCtx){
** SCRIPT2 should invoke the [sqlite3_fts5_token] command once for each
** token within the tokenized text.
*/
static int f5tCreateTokenizer(
static int SQLITE_TCLAPI f5tCreateTokenizer(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -992,7 +999,7 @@ static int f5tCreateTokenizer(
return TCL_OK;
}
static void xF5tFree(ClientData clientData){
static void SQLITE_TCLAPI xF5tFree(ClientData clientData){
ckfree(clientData);
}
@@ -1001,7 +1008,7 @@ static void xF5tFree(ClientData clientData){
**
** Set or clear the global "may-be-corrupt" flag. Return the old value.
*/
static int f5tMayBeCorrupt(
static int SQLITE_TCLAPI f5tMayBeCorrupt(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1033,7 +1040,7 @@ static unsigned int f5t_fts5HashKey(int nSlot, const char *p, int n){
return (h % nSlot);
}
static int f5tTokenHash(
static int SQLITE_TCLAPI f5tTokenHash(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1058,7 +1065,7 @@ static int f5tTokenHash(
return TCL_OK;
}
static int f5tRegisterMatchinfo(
static int SQLITE_TCLAPI f5tRegisterMatchinfo(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1083,7 +1090,7 @@ static int f5tRegisterMatchinfo(
return TCL_OK;
}
static int f5tRegisterTok(
static int SQLITE_TCLAPI f5tRegisterTok(
void * clientData,
Tcl_Interp *interp,
int objc,
+7 -1
View File
@@ -120,10 +120,17 @@ cnearset(A) ::= colset(X) COLON nearset(Y). {
%type colsetlist {Fts5Colset*}
%destructor colsetlist { sqlite3_free($$); }
colset(A) ::= MINUS LCP colsetlist(X) RCP. {
A = sqlite3Fts5ParseColsetInvert(pParse, X);
}
colset(A) ::= LCP colsetlist(X) RCP. { A = X; }
colset(A) ::= STRING(X). {
A = sqlite3Fts5ParseColset(pParse, 0, &X);
}
colset(A) ::= MINUS STRING(X). {
A = sqlite3Fts5ParseColset(pParse, 0, &X);
A = sqlite3Fts5ParseColsetInvert(pParse, A);
}
colsetlist(A) ::= colsetlist(Y) STRING(X). {
A = sqlite3Fts5ParseColset(pParse, Y, &X); }
@@ -131,7 +138,6 @@ colsetlist(A) ::= STRING(X). {
A = sqlite3Fts5ParseColset(pParse, 0, &X);
}
%type nearset {Fts5ExprNearset*}
%type nearphrases {Fts5ExprNearset*}
%destructor nearset { sqlite3Fts5ParseNearsetFree($$); }
+62 -29
View File
@@ -72,42 +72,56 @@ foreach {tn doc res} {
2.2 {o X o o o o o o} {o [X] o o o o o...}
2.3 {o o X o o o o o} {o o [X] o o o o...}
2.4 {o o o X o o o o} {o o o [X] o o o...}
2.5 {o o o o X o o o} {...o o o [X] o o o}
2.6 {o o o o o X o o} {...o o o o [X] o o}
2.7 {o o o o o o X o} {...o o o o o [X] o}
2.5 {o o o o X o o o} {o o o o [X] o o...}
2.6 {o o o o o X o o} {o o o o o [X] o...}
2.7 {o o o o o o X o} {o o o o o o [X]...}
2.8 {o o o o o o o X} {...o o o o o o [X]}
2.9 {o o o o o o o X o} {...o o o o o [X] o}
2.10 {o o o o o o o X o o} {...o o o o [X] o o}
2.11 {o o o o o o o X o o o} {...o o o [X] o o o}
2.12 {o o o o o o o X o o o o} {...o o o [X] o o o...}
3.1 {X o o o o o o o o} {[X] o o o o o o...}
3.2 {o X o o o o o o o} {o [X] o o o o o...}
3.3 {o o X o o o o o o} {o o [X] o o o o...}
3.4 {o o o X o o o o o} {o o o [X] o o o...}
3.5 {o o o o X o o o o} {...o o o [X] o o o...}
3.6 {o o o o o X o o o} {...o o o [X] o o o}
3.7 {o o o o o o X o o} {...o o o o [X] o o}
3.8 {o o o o o o o X o} {...o o o o o [X] o}
3.9 {o o o o o o o o X} {...o o o o o o [X]}
3.5 {o o o o o o o X o o o o} {...o o o [X] o o o...}
3.6 {o o o o o o o o X o o o} {...o o o [X] o o o}
3.7 {o o o o o o o o o X o o} {...o o o o [X] o o}
3.8 {o o o o o o o o o o X o} {...o o o o o [X] o}
3.9 {o o o o o o o o o o o X} {...o o o o o o [X]}
4.1 {X o o o o o X o o} {[X] o o o o o [X]...}
4.2 {o X o o o o o X o} {...[X] o o o o o [X]...}
4.3 {o o X o o o o o X} {...[X] o o o o o [X]}
4.2 {o o o o o o o X o o o o o X o} {...[X] o o o o o [X]...}
4.3 {o o o o o o o o X o o o o o X} {...[X] o o o o o [X]}
5.1 {X o o o o X o o o} {[X] o o o o [X] o...}
5.2 {o X o o o o X o o} {...[X] o o o o [X] o...}
5.3 {o o X o o o o X o} {...[X] o o o o [X] o}
5.4 {o o o X o o o o X} {...o [X] o o o o [X]}
5.2 {o o o o o o o X o o o o X o o} {...[X] o o o o [X] o...}
5.3 {o o o o o o o o X o o o o X o} {...[X] o o o o [X] o}
5.4 {o o o o o o o o o X o o o o X} {...o [X] o o o o [X]}
6.1 {X o o o X o o o} {[X] o o o [X] o o...}
6.2 {o X o o o X o o o} {o [X] o o o [X] o...}
6.3 {o o X o o o X o o} {...o [X] o o o [X] o...}
6.4 {o o o X o o o X o} {...o [X] o o o [X] o}
6.5 {o o o o X o o o X} {...o o [X] o o o [X]}
6.3 {o o o o o o o X o o o X o o} {...o [X] o o o [X] o...}
6.4 {o o o o o o o o X o o o X o} {...o [X] o o o [X] o}
6.5 {o o o o o o o o o X o o o X} {...o o [X] o o o [X]}
7.1 {X o o X o o o o o} {[X] o o [X] o o o...}
7.2 {o X o o X o o o o} {o [X] o o [X] o o...}
7.3 {o o X o o X o o o} {...o [X] o o [X] o o...}
7.4 {o o o X o o X o o} {...o [X] o o [X] o o}
7.5 {o o o o X o o X o} {...o o [X] o o [X] o}
7.6 {o o o o o X o o X} {...o o o [X] o o [X]}
7.3 {o o o o o o o X o o X o o o} {...o [X] o o [X] o o...}
7.4 {o o o o o o o o X o o X o o} {...o [X] o o [X] o o}
7.5 {o o o o o o o o o X o o X o} {...o o [X] o o [X] o}
7.6 {o o o o o o o o o o X o o X} {...o o o [X] o o [X]}
8.1 {o o o o o o o o o X o o o o o o o o o o o o o o o o X X X o o o}
{...o o [X] [X] [X] o o...}
8.2 {o o o o o o o. o o X o o o o o o o o o o o o o o o o X X X o o o}
{...o o [X] o o o o...}
8.3 {o o o o X o o o o o o o o o o o o o o o o o o o o o X X X o o o}
{o o o o [X] o o...}
} {
do_snippet_test 1.$tn $doc X $res
}
@@ -124,24 +138,43 @@ if {[detail_is_full]} {
2.1 {X Y o o o o o o} {[X Y] o o o o o...}
2.2 {o X Y o o o o o} {o [X Y] o o o o...}
2.3 {o o X Y o o o o} {o o [X Y] o o o...}
2.4 {o o o X Y o o o} {...o o [X Y] o o o}
2.5 {o o o o X Y o o} {...o o o [X Y] o o}
2.6 {o o o o o X Y o} {...o o o o [X Y] o}
2.7 {o o o o o o X Y} {...o o o o o [X Y]}
2.4 {o o o o o o o X Y o o o} {...o o [X Y] o o o}
2.5 {o o o o o o o o X Y o o} {...o o o [X Y] o o}
2.6 {o o o o o o o o o X Y o} {...o o o o [X Y] o}
2.7 {o o o o o o o o o o X Y} {...o o o o o [X Y]}
3.1 {X Y o o o o o o o} {[X Y] o o o o o...}
3.2 {o X Y o o o o o o} {o [X Y] o o o o...}
3.3 {o o X Y o o o o o} {o o [X Y] o o o...}
3.4 {o o o X Y o o o o} {...o o [X Y] o o o...}
3.5 {o o o o X Y o o o} {...o o [X Y] o o o}
3.6 {o o o o o X Y o o} {...o o o [X Y] o o}
3.7 {o o o o o o X Y o} {...o o o o [X Y] o}
3.8 {o o o o o o o X Y} {...o o o o o [X Y]}
3.4 {o o o o o o o X Y o o o o} {...o o [X Y] o o o...}
3.5 {o o o o o o o o X Y o o o} {...o o [X Y] o o o}
3.6 {o o o o o o o o o X Y o o} {...o o o [X Y] o o}
3.7 {o o o o o o o o o o X Y o} {...o o o o [X Y] o}
3.8 {o o o o o o o o o o o X Y} {...o o o o o [X Y]}
} {
do_snippet_test 2.$tn $doc "X + Y" $res
}
}
do_execsql_test 4.0 {
CREATE VIRTUAL TABLE x1 USING fts5(a, b);
INSERT INTO x1 VALUES('xyz', '1 2 3 4 5 6 7 8 9 10 11 12 13');
SELECT snippet(x1, 1, '[', ']', '...', 5) FROM x1('xyz');
} {
{1 2 3 4 5...}
}
do_execsql_test 5.0 {
CREATE VIRTUAL TABLE p1 USING fts5(a, b);
INSERT INTO p1 VALUES(
'x a a a a a a a a a a',
'a a a a a a a a a a a a a a a a a a a x'
);
}
do_execsql_test 5.1 {
SELECT snippet(p1, 0, '[', ']', '...', 6) FROM p1('x');
} {{[x] a a a a a...}}
} ;# foreach_detail_mode
finish_test
+59
View File
@@ -0,0 +1,59 @@
# 2016 August 10
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#*************************************************************************
# This file implements regression tests for SQLite library. The
# focus of this script is testing the FTS5 module.
#
source [file join [file dirname [info script]] fts5_common.tcl]
set testprefix fts5colset
# If SQLITE_ENABLE_FTS5 is not defined, omit this file.
ifcapable !fts5 {
finish_test
return
}
foreach_detail_mode $::testprefix {
if {[detail_is_none]} continue
do_execsql_test 1.0 {
CREATE VIRTUAL TABLE t1 USING fts5(a, b, c, d, detail=%DETAIL%);
INSERT INTO t1 VALUES('a', 'b', 'c', 'd'); -- 1
INSERT INTO t1 VALUES('d', 'a', 'b', 'c'); -- 2
INSERT INTO t1 VALUES('c', 'd', 'a', 'b'); -- 3
INSERT INTO t1 VALUES('b', 'c', 'd', 'a'); -- 4
}
foreach {tn q res} {
1 "a" {1 2 3 4}
2 "{a} : a" {1}
3 "-{a} : a" {2 3 4}
4 "- {a c} : a" {2 4}
5 " - {d d c} : a" {1 2}
6 "- {d c b a} : a" {}
7 "-{\"a\"} : b" {1 2 3}
8 "- c : a" {1 2 4}
9 "-c : a" {1 2 4}
10 "-\"c\" : a" {1 2 4}
} {
breakpoint
do_execsql_test 1.$tn {
SELECT rowid FROM t1($q)
} $res
}
}
finish_test
+3 -3
View File
@@ -37,7 +37,7 @@ do_execsql_test 1.0 {
}
set mask [expr 31 << 31]
if 1 {
if 0 {
# Test 1:
#
@@ -84,6 +84,8 @@ foreach {tno stmt} {
}
}
}
# Using the same database as the 1.* tests.
#
# Run N-1 tests, where N is the number of bytes in the rightmost leaf page
@@ -212,8 +214,6 @@ foreach {tn nCut} {
# do_test 4.$tn.x { expr $nCorrupt>0 } 1
}
}
set doc [string repeat "A B C " 1000]
do_execsql_test 5.0 {
CREATE VIRTUAL TABLE x5 USING fts5(tt);
+4 -4
View File
@@ -160,12 +160,12 @@ foreach {tn query snippet} {
the maximum x value.
}
4 "rollback" {
...[ROLLBACK]. Instead, the pending statement
will return SQLITE_ABORT upon next access after the [ROLLBACK].
Pending statements no longer block [ROLLBACK]. Instead, the pending
statement will return SQLITE_ABORT upon...
}
5 "rOllback" {
...[ROLLBACK]. Instead, the pending statement
will return SQLITE_ABORT upon next access after the [ROLLBACK].
Pending statements no longer block [ROLLBACK]. Instead, the pending
statement will return SQLITE_ABORT upon...
}
6 "lang*" {
Added support for the FTS4 [languageid] option.
+1
View File
@@ -1223,6 +1223,7 @@ static void jsonQuoteFunc(
sqlite3_value **argv
){
JsonString jx;
UNUSED_PARAM(argc);
jsonInit(&jx, ctx);
jsonAppendValue(&jx, argv[0]);
+1 -1
View File
@@ -167,7 +167,7 @@ static void percentStep(sqlite3_context *pCtx, int argc, sqlite3_value **argv){
/*
** Compare to doubles for sorting using qsort()
*/
static int doubleCmp(const void *pA, const void *pB){
static int SQLITE_CDECL doubleCmp(const void *pA, const void *pB){
double a = *(double*)pA;
double b = *(double*)pB;
if( a==b ) return 0;
+1 -1
View File
@@ -2231,7 +2231,7 @@ static int spellfix1Score(int iDistance, int iRank){
** Compare two spellfix1_row objects for sorting purposes in qsort() such
** that they sort in order of increasing distance.
*/
static int spellfix1RowCompare(const void *A, const void *B){
static int SQLITE_CDECL spellfix1RowCompare(const void *A, const void *B){
const struct spellfix1_row *a = (const struct spellfix1_row*)A;
const struct spellfix1_row *b = (const struct spellfix1_row*)B;
return a->iScore - b->iScore;
+1 -1
View File
@@ -809,7 +809,7 @@ int sqlite3_vfsstat_init(
vstat_vfs.base.szOsFile = sizeof(VStatFile) + vstat_vfs.pVfs->szOsFile;
rc = sqlite3_vfs_register(&vstat_vfs.base, 1);
if( rc==SQLITE_OK ){
rc = sqlite3_auto_extension((void(*)(void))vstatRegister);
rc = sqlite3_auto_extension(vstatRegister);
}
if( rc==SQLITE_OK ) rc = SQLITE_OK_LOAD_PERMANENTLY;
return rc;
+10
View File
@@ -140,6 +140,15 @@ foreach {tn init mod} {
);
}
4 {
CREATE TABLE x1(a, b, c, PRIMARY KEY(a, b, c));
INSERT INTO x1 VALUES('u', 'v', NULL);
INSERT INTO x1 VALUES('x', 'y', 'z');
INSERT INTO x1 VALUES('a', NULL, 'b');
} {
INSERT INTO x1 VALUES('a', 'b', 'c');
}
} {
catch { db close }
@@ -280,5 +289,6 @@ tablE t1 USING FTs5(c);
}
}
finish_test
+2
View File
@@ -361,6 +361,8 @@ foreach {bReopen} { 0 1 } {
}
} {
if {$tn=="vtab"} { ifcapable !fts5 break }
foreach {tn2 rbusql r1 r2} {
1 {
CREATE TABLE data0_t1(a, b, c, rbu_rowid, rbu_control);
+42
View File
@@ -156,7 +156,49 @@ foreach step {0 1} {
trigger tr1 t1 0 {CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN SELECT 1; END}
}
}
}
#-------------------------------------------------------------------------
# Test that passing a NULL value as the second argument to
# sqlite3rbu_vacuum() causes it to:
#
# * Use <database>-vacuum as the state db, and
# * Set the state db permissions to the same as those on the db file.
#
db close
if {$::tcl_platform(platform)=="unix"} {
forcedelete test.db
sqlite3 db test.db
do_execsql_test 5.0 {
CREATE TABLE t1(a, b);
INSERT INTO t1 VALUES(1, 2);
INSERT INTO t1 VALUES(3, 4);
INSERT INTO t1 VALUES(5, 6);
INSERT INTO t1 VALUES(7, 8);
}
db close
foreach {tn perm} {
1 00755
2 00666
3 00644
4 00444
} {
forcedelete test.db-vacuum
do_test 5.$tn.1 {
file attributes test.db -permissions $perm
sqlite3rbu_vacuum rbu test.db
rbu step
} {SQLITE_OK}
do_test 5.$tn.2 { file exists test.db-vacuum } 1
do_test 5.$tn.3 { file attributes test.db-vacuum -permissions} $perm
rbu close
}
}
finish_test
+25 -7
View File
@@ -2334,15 +2334,18 @@ static RbuState *rbuLoadState(sqlite3rbu *p){
** error occurs, leave an error code and message in the RBU handle.
*/
static void rbuOpenDatabase(sqlite3rbu *p){
assert( p->rc==SQLITE_OK );
assert( p->dbMain==0 && p->dbRbu==0 );
assert( rbuIsVacuum(p) || p->zTarget!=0 );
assert( p->rc || (p->dbMain==0 && p->dbRbu==0) );
assert( p->rc || rbuIsVacuum(p) || p->zTarget!=0 );
/* Open the RBU database */
p->dbRbu = rbuOpenDbhandle(p, p->zRbu, 1);
if( p->rc==SQLITE_OK && rbuIsVacuum(p) ){
sqlite3_file_control(p->dbRbu, "main", SQLITE_FCNTL_RBUCNT, (void*)p);
if( p->zState==0 ){
const char *zFile = sqlite3_db_filename(p->dbRbu, "main");
p->zState = rbuMPrintf(p, "file://%s-vacuum?modeof=%s", zFile, zFile);
}
}
/* If using separate RBU and state databases, attach the state database to
@@ -3477,8 +3480,7 @@ static sqlite3rbu *openRbuHandle(
sqlite3rbu *p;
size_t nTarget = zTarget ? strlen(zTarget) : 0;
size_t nRbu = strlen(zRbu);
size_t nState = zState ? strlen(zState) : 0;
size_t nByte = sizeof(sqlite3rbu) + nTarget+1 + nRbu+1+ nState+1;
size_t nByte = sizeof(sqlite3rbu) + nTarget+1 + nRbu+1;
p = (sqlite3rbu*)sqlite3_malloc64(nByte);
if( p ){
@@ -3500,8 +3502,7 @@ static sqlite3rbu *openRbuHandle(
memcpy(p->zRbu, zRbu, nRbu+1);
pCsr += nRbu+1;
if( zState ){
p->zState = pCsr;
memcpy(p->zState, zState, nState+1);
p->zState = rbuMPrintf(p, "%s", zState);
}
rbuOpenDatabase(p);
}
@@ -3611,6 +3612,20 @@ static sqlite3rbu *openRbuHandle(
return p;
}
/*
** Allocate and return an RBU handle with all fields zeroed except for the
** error code, which is set to SQLITE_MISUSE.
*/
static sqlite3rbu *rbuMisuseError(void){
sqlite3rbu *pRet;
pRet = sqlite3_malloc64(sizeof(sqlite3rbu));
if( pRet ){
memset(pRet, 0, sizeof(sqlite3rbu));
pRet->rc = SQLITE_MISUSE;
}
return pRet;
}
/*
** Open and return a new RBU handle.
*/
@@ -3619,6 +3634,7 @@ sqlite3rbu *sqlite3rbu_open(
const char *zRbu,
const char *zState
){
if( zTarget==0 || zRbu==0 ){ return rbuMisuseError(); }
/* TODO: Check that zTarget and zRbu are non-NULL */
return openRbuHandle(zTarget, zRbu, zState);
}
@@ -3630,6 +3646,7 @@ sqlite3rbu *sqlite3rbu_vacuum(
const char *zTarget,
const char *zState
){
if( zTarget==0 ){ return rbuMisuseError(); }
/* TODO: Check that both arguments are non-NULL */
return openRbuHandle(0, zTarget, zState);
}
@@ -3707,6 +3724,7 @@ int sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
rbuEditErrmsg(p);
rc = p->rc;
*pzErrmsg = p->zErrmsg;
sqlite3_free(p->zState);
sqlite3_free(p);
}else{
rc = SQLITE_NOMEM;
+12 -6
View File
@@ -104,7 +104,7 @@
** may also be named data<integer>_<target>, where <integer> is any sequence
** of zero or more numeric characters (0-9). This can be significant because
** tables within the RBU database are always processed in order sorted by
** name. By judicious selection of the the <integer> portion of the names
** name. By judicious selection of the <integer> portion of the names
** of the RBU tables the user can therefore control the order in which they
** are processed. This can be useful, for example, to ensure that "external
** content" FTS4 tables are updated before their underlying content tables.
@@ -319,16 +319,22 @@ sqlite3rbu *sqlite3rbu_open(
** An RBU vacuum is similar to SQLite's built-in VACUUM command, except
** that it can be suspended and resumed like an RBU update.
**
** The second argument to this function, which may not be NULL, identifies
** a database in which to store the state of the RBU vacuum operation if
** it is suspended. The first time sqlite3rbu_vacuum() is called, to start
** an RBU vacuum operation, the state database should either not exist or
** be empty (contain no tables). If an RBU vacuum is suspended by calling
** The second argument to this function identifies a database in which
** to store the state of the RBU vacuum operation if it is suspended. The
** first time sqlite3rbu_vacuum() is called, to start an RBU vacuum
** operation, the state database should either not exist or be empty
** (contain no tables). If an RBU vacuum is suspended by calling
** sqlite3rbu_close() on the RBU handle before sqlite3rbu_step() has
** returned SQLITE_DONE, the vacuum state is stored in the state database.
** The vacuum can be resumed by calling this function to open a new RBU
** handle specifying the same target and state databases.
**
** If the second argument passed to this function is NULL, then the
** name of the state database is "<database>-vacuum", where <database>
** is the name of the target database file. In this case, on UNIX, if the
** state database is not already present in the file-system, it is created
** with the same permissions as the target db is made.
**
** This function does not delete the state database after an RBU vacuum
** is completed, even if it created it. However, if the call to
** sqlite3rbu_close() returns any value other than SQLITE_OK, the contents
+22 -11
View File
@@ -17,7 +17,14 @@
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU)
#include "sqlite3rbu.h"
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
# ifndef SQLITE_TCLAPI
# define SQLITE_TCLAPI
# endif
#endif
#include <assert.h>
/* From main.c */
@@ -49,7 +56,7 @@ void test_rbu_delta(sqlite3_context *pCtx, int nArg, sqlite3_value **apVal){
}
static int test_sqlite3rbu_cmd(
static int SQLITE_TCLAPI test_sqlite3rbu_cmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -192,7 +199,7 @@ static int test_sqlite3rbu_cmd(
/*
** Tclcmd: sqlite3rbu CMD <target-db> <rbu-db> ?<state-db>?
*/
static int test_sqlite3rbu(
static int SQLITE_TCLAPI test_sqlite3rbu(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -222,7 +229,7 @@ static int test_sqlite3rbu(
/*
** Tclcmd: sqlite3rbu_vacuum CMD <target-db> <state-db>
*/
static int test_sqlite3rbu_vacuum(
static int SQLITE_TCLAPI test_sqlite3rbu_vacuum(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -233,13 +240,13 @@ static int test_sqlite3rbu_vacuum(
const char *zTarget;
const char *zStateDb = 0;
if( objc!=4 ){
Tcl_WrongNumArgs(interp, 1, objv, "NAME TARGET-DB STATE-DB");
if( objc!=3 && objc!=4 ){
Tcl_WrongNumArgs(interp, 1, objv, "NAME TARGET-DB ?STATE-DB?");
return TCL_ERROR;
}
zCmd = Tcl_GetString(objv[1]);
zTarget = Tcl_GetString(objv[2]);
zStateDb = Tcl_GetString(objv[3]);
if( objc==4 ) zStateDb = Tcl_GetString(objv[3]);
pRbu = sqlite3rbu_vacuum(zTarget, zStateDb);
Tcl_CreateObjCommand(interp, zCmd, test_sqlite3rbu_cmd, (ClientData)pRbu, 0);
@@ -250,7 +257,7 @@ static int test_sqlite3rbu_vacuum(
/*
** Tclcmd: sqlite3rbu_create_vfs ?-default? NAME PARENT
*/
static int test_sqlite3rbu_create_vfs(
static int SQLITE_TCLAPI test_sqlite3rbu_create_vfs(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -285,7 +292,7 @@ static int test_sqlite3rbu_create_vfs(
/*
** Tclcmd: sqlite3rbu_destroy_vfs NAME
*/
static int test_sqlite3rbu_destroy_vfs(
static int SQLITE_TCLAPI test_sqlite3rbu_destroy_vfs(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -306,7 +313,7 @@ static int test_sqlite3rbu_destroy_vfs(
/*
** Tclcmd: sqlite3rbu_internal_test
*/
static int test_sqlite3rbu_internal_test(
static int SQLITE_TCLAPI test_sqlite3rbu_internal_test(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -347,7 +354,11 @@ int SqliteRbu_Init(Tcl_Interp *interp){
}
#else
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
int SqliteRbu_Init(Tcl_Interp *interp){ return TCL_OK; }
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU) */
#endif /* defined(SQLITE_TEST) */
+1 -1
View File
@@ -1542,7 +1542,7 @@ static int rtreeFilter(
if( idxNum==1 ){
/* Special case - lookup by rowid. */
RtreeNode *pLeaf; /* Leaf on which the required cell resides */
RtreeSearchPoint *p; /* Search point for the the leaf */
RtreeSearchPoint *p; /* Search point for the leaf */
i64 iRowid = sqlite3_value_int64(argv[0]);
i64 iNode = 0;
rc = findLeafNode(pRtree, iRowid, &pLeaf, &iNode);
+3
View File
@@ -75,6 +75,9 @@ proc do_common_sql {sql} {
}
proc changeset_from_sql {sql {dbname main}} {
if {$dbname == "main"} {
return [sql_exec_changeset db $sql]
}
set rc [catch {
sqlite3session S db $dbname
db eval "SELECT name FROM $dbname.sqlite_master WHERE type = 'table'" {
+7 -3
View File
@@ -727,12 +727,12 @@ int sqlite3changeset_concat(
/*
** Changegroup handle.
** CAPI3REF: Changegroup Handle
*/
typedef struct sqlite3_changegroup sqlite3_changegroup;
/*
** CAPI3REF: Combine two or more changesets into a single changeset.
** CAPI3REF: Create A New Changegroup Object
**
** An sqlite3_changegroup object is used to combine two or more changesets
** (or patchsets) into a single changeset (or patchset). A single changegroup
@@ -769,6 +769,8 @@ typedef struct sqlite3_changegroup sqlite3_changegroup;
int sqlite3changegroup_new(sqlite3_changegroup **pp);
/*
** CAPI3REF: Add A Changeset To A Changegroup
**
** Add all changes within the changeset (or patchset) in buffer pData (size
** nData bytes) to the changegroup.
**
@@ -844,6 +846,8 @@ int sqlite3changegroup_new(sqlite3_changegroup **pp);
int sqlite3changegroup_add(sqlite3_changegroup*, int nData, void *pData);
/*
** CAPI3REF: Obtain A Composite Changeset From A Changegroup
**
** Obtain a buffer containing a changeset (or patchset) representing the
** current contents of the changegroup. If the inputs to the changegroup
** were themselves changesets, the output is a changeset. Or, if the
@@ -872,7 +876,7 @@ int sqlite3changegroup_output(
);
/*
** Delete a changegroup object.
** CAPI3REF: Delete A Changegroup Object
*/
void sqlite3changegroup_delete(sqlite3_changegroup*);
+137 -26
View File
@@ -5,7 +5,14 @@
#include "sqlite3session.h"
#include <assert.h>
#include <string.h>
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
# ifndef SQLITE_TCLAPI
# define SQLITE_TCLAPI
# endif
#endif
typedef struct TestSession TestSession;
struct TestSession {
@@ -22,6 +29,107 @@ struct TestStreamInput {
int iData; /* Bytes of data already read by sessions */
};
/*
** Extract an sqlite3* db handle from the object passed as the second
** argument. If successful, set *pDb to point to the db handle and return
** TCL_OK. Otherwise, return TCL_ERROR.
*/
static int dbHandleFromObj(Tcl_Interp *interp, Tcl_Obj *pObj, sqlite3 **pDb){
Tcl_CmdInfo info;
if( 0==Tcl_GetCommandInfo(interp, Tcl_GetString(pObj), &info) ){
Tcl_AppendResult(interp, "no such handle: ", Tcl_GetString(pObj), 0);
return TCL_ERROR;
}
*pDb = *(sqlite3 **)info.objClientData;
return TCL_OK;
}
/*************************************************************************
** The following code is copied byte-for-byte from the sessions module
** documentation. It is used by some of the sessions modules tests to
** ensure that the example in the documentation does actually work.
*/
/*
** Argument zSql points to a buffer containing an SQL script to execute
** against the database handle passed as the first argument. As well as
** executing the SQL script, this function collects a changeset recording
** all changes made to the "main" database file. Assuming no error occurs,
** output variables (*ppChangeset) and (*pnChangeset) are set to point
** to a buffer containing the changeset and the size of the changeset in
** bytes before returning SQLITE_OK. In this case it is the responsibility
** of the caller to eventually free the changeset blob by passing it to
** the sqlite3_free function.
**
** Or, if an error does occur, return an SQLite error code. The final
** value of (*pChangeset) and (*pnChangeset) are undefined in this case.
*/
int sql_exec_changeset(
sqlite3 *db, /* Database handle */
const char *zSql, /* SQL script to execute */
int *pnChangeset, /* OUT: Size of changeset blob in bytes */
void **ppChangeset /* OUT: Pointer to changeset blob */
){
sqlite3_session *pSession = 0;
int rc;
/* Create a new session object */
rc = sqlite3session_create(db, "main", &pSession);
/* Configure the session object to record changes to all tables */
if( rc==SQLITE_OK ) rc = sqlite3session_attach(pSession, NULL);
/* Execute the SQL script */
if( rc==SQLITE_OK ) rc = sqlite3_exec(db, zSql, 0, 0, 0);
/* Collect the changeset */
if( rc==SQLITE_OK ){
rc = sqlite3session_changeset(pSession, pnChangeset, ppChangeset);
}
/* Delete the session object */
sqlite3session_delete(pSession);
return rc;
}
/************************************************************************/
/*
** Tclcmd: sql_exec_changeset DB SQL
*/
static int SQLITE_TCLAPI test_sql_exec_changeset(
void * clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *CONST objv[]
){
const char *zSql;
sqlite3 *db;
void *pChangeset;
int nChangeset;
int rc;
if( objc!=3 ){
Tcl_WrongNumArgs(interp, 1, objv, "DB SQL");
return TCL_ERROR;
}
if( dbHandleFromObj(interp, objv[1], &db) ) return TCL_ERROR;
zSql = (const char*)Tcl_GetString(objv[2]);
rc = sql_exec_changeset(db, zSql, &nChangeset, &pChangeset);
if( rc!=SQLITE_OK ){
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "error in sql_exec_changeset()", 0);
return TCL_ERROR;
}
Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(pChangeset, nChangeset));
sqlite3_free(pChangeset);
return TCL_OK;
}
#define SESSION_STREAM_TCL_VAR "sqlite3session_streams"
/*
@@ -107,7 +215,7 @@ static int testStreamOutput(
** $session patchset
** $session table_filter SCRIPT
*/
static int test_session_cmd(
static int SQLITE_TCLAPI test_session_cmd(
void *clientData,
Tcl_Interp *interp,
int objc,
@@ -240,7 +348,7 @@ static int test_session_cmd(
return TCL_OK;
}
static void test_session_del(void *clientData){
static void SQLITE_TCLAPI test_session_del(void *clientData){
TestSession *p = (TestSession*)clientData;
if( p->pFilterScript ) Tcl_DecrRefCount(p->pFilterScript);
sqlite3session_delete(p->pSession);
@@ -250,7 +358,7 @@ static void test_session_del(void *clientData){
/*
** Tclcmd: sqlite3session CMD DB-HANDLE DB-NAME
*/
static int test_sqlite3session(
static int SQLITE_TCLAPI test_sqlite3session(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -606,7 +714,7 @@ static int testStreamInput(
/*
** sqlite3changeset_apply DB CHANGESET CONFLICT-SCRIPT ?FILTER-SCRIPT?
*/
static int test_sqlite3changeset_apply(
static int SQLITE_TCLAPI test_sqlite3changeset_apply(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -661,7 +769,7 @@ static int test_sqlite3changeset_apply(
/*
** sqlite3changeset_apply_replace_all DB CHANGESET
*/
static int test_sqlite3changeset_apply_replace_all(
static int SQLITE_TCLAPI test_sqlite3changeset_apply_replace_all(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -696,7 +804,7 @@ static int test_sqlite3changeset_apply_replace_all(
/*
** sqlite3changeset_invert CHANGESET
*/
static int test_sqlite3changeset_invert(
static int SQLITE_TCLAPI test_sqlite3changeset_invert(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -735,7 +843,7 @@ static int test_sqlite3changeset_invert(
/*
** sqlite3changeset_concat LEFT RIGHT
*/
static int test_sqlite3changeset_concat(
static int SQLITE_TCLAPI test_sqlite3changeset_concat(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -783,7 +891,7 @@ static int test_sqlite3changeset_concat(
/*
** sqlite3session_foreach VARNAME CHANGESET SCRIPT
*/
static int test_sqlite3session_foreach(
static int SQLITE_TCLAPI test_sqlite3session_foreach(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -912,23 +1020,26 @@ static int test_sqlite3session_foreach(
}
int TestSession_Init(Tcl_Interp *interp){
Tcl_CreateObjCommand(interp, "sqlite3session", test_sqlite3session, 0, 0);
Tcl_CreateObjCommand(
interp, "sqlite3session_foreach", test_sqlite3session_foreach, 0, 0
);
Tcl_CreateObjCommand(
interp, "sqlite3changeset_invert", test_sqlite3changeset_invert, 0, 0
);
Tcl_CreateObjCommand(
interp, "sqlite3changeset_concat", test_sqlite3changeset_concat, 0, 0
);
Tcl_CreateObjCommand(
interp, "sqlite3changeset_apply", test_sqlite3changeset_apply, 0, 0
);
Tcl_CreateObjCommand(
interp, "sqlite3changeset_apply_replace_all",
test_sqlite3changeset_apply_replace_all, 0, 0
);
struct Cmd {
const char *zCmd;
Tcl_ObjCmdProc *xProc;
} aCmd[] = {
{ "sqlite3session", test_sqlite3session },
{ "sqlite3session_foreach", test_sqlite3session_foreach },
{ "sqlite3changeset_invert", test_sqlite3changeset_invert },
{ "sqlite3changeset_concat", test_sqlite3changeset_concat },
{ "sqlite3changeset_apply", test_sqlite3changeset_apply },
{ "sqlite3changeset_apply_replace_all",
test_sqlite3changeset_apply_replace_all },
{ "sql_exec_changeset", test_sql_exec_changeset },
};
int i;
for(i=0; i<sizeof(aCmd)/sizeof(struct Cmd); i++){
struct Cmd *p = &aCmd[i];
Tcl_CreateObjCommand(interp, p->zCmd, p->xProc, 0, 0);
}
return TCL_OK;
}
+2
View File
@@ -470,6 +470,8 @@ TESTOPTS = --verbose=file --output=test-out.txt
# Extra compiler options for various shell tools
#
SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5
+169 -155
View File
@@ -1,24 +1,24 @@
C Disable\sthe\sauthorizer\scallback\swhen\sreparsing\sthe\sschema.\s\sThis\savoids\nundesirable\sauthorization\sfailures\sfollowing\san\sALTER\sTABLE.
D 2016-07-28T18:38:13.187
F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db
C Fix\sa\sproblem\shandling\sexpressions\slike\s"(a,\sb)\sIN\s(SELECT\s...\sORDER\sBY\s1,\s2)"\swhen\sthere\sis\san\sindex\son\s"a"\sbut\snot\s"b".
D 2016-09-07T19:37:20.043
F Makefile.in cfd8fb987cd7a6af046daa87daa146d5aad0e088
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc d66d0395c38571aab3804f8db0fa20707ae4609a
F Makefile.msc 5017381e4853b1472e01d5bb926be1268eba429c
F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7
F VERSION cb29eb11e493dd85b3eeec4053c03949bf98478e
F VERSION 25e2e333adeff5965520bc8db999c658898c972d
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
F autoconf/Makefile.am 1a47d071e3d5435f8f7ebff7eb6703848bbd65d4
F autoconf/Makefile.msc 0eca137c12542bd76c253a2d24380f29ade59b95
F autoconf/Makefile.msc a535edafb6165629715b0ba8e21c98ab80732e80
F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7
F autoconf/README.txt 4f04b0819303aabaa35fff5f7b257fb0c1ef95f1
F autoconf/configure.ac cacf2616abf6e4a569bde2ef365c143caeec40bc
F autoconf/tea/Makefile.in b438a7020446c8a8156e8d97c8914a04833da6fd
F autoconf/tea/README 3e9a3c060f29a44344ab50aec506f4db903fb873
F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43
F autoconf/tea/configure.ac 93d43c79e936fb16556e22498177d7e8571efa04
F autoconf/tea/configure.ac 8aa16e3f0a5ca7959d4af198f46934ec187d395f
F autoconf/tea/doc/sqlite3.n e1fe45d4f5286ee3d0ccc877aca2a0def488e9bb
F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523
F autoconf/tea/pkgIndex.tcl.in 3ef61715cf1c7bdcff56947ffadb26bc991ca39d
@@ -30,7 +30,7 @@ F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63
F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977
F config.h.in 6376abec766e9a0785178b1823b5a587e9f1ccbc
F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55
F configure 35ce04a15ca046262bf9baaa2ced9337708cc653 x
F configure 3f44893bc0e51c30653e02b0fd4dc2ab585e446a x
F configure.ac b5d3df43161374f8dffd2e5f4b88fbb51685b975
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
F doc/lemon.html e2118945e5f07ed146b45c9cd2b2dd6eabb8ebf2
@@ -62,7 +62,7 @@ F ext/fts2/fts2_hash.c 011a1d32de45bb1b519a1fd0048e857d6a843558
F ext/fts2/fts2_hash.h 1824b99dfd8d0225facbdb26a2c87289b2e7dcf8
F ext/fts2/fts2_icu.c 51c5cd3c04954badd329fa738c95fcdb717b5188
F ext/fts2/fts2_porter.c 2cd4a507bf3c3085fe66f59b0f2a325f65aaacf5
F ext/fts2/fts2_tokenizer.c 3dbe8058e97afb55fff3ea844120ce3208b114cc
F ext/fts2/fts2_tokenizer.c b529493d55e55497213c37e1f31680a77746be26
F ext/fts2/fts2_tokenizer.h 27a1a99ca2d615cf7e142839b8d79e8751b4529e
F ext/fts2/fts2_tokenizer1.c 07e223eecb483d448313b5f1553a4f299a7fb7a1
F ext/fts2/mkfts2amal.tcl 974d5d438cb3f7c4a652639262f82418c1e4cff0
@@ -81,9 +81,9 @@ F ext/fts3/fts3_icu.c deb46f7020d87ea7a14a433fb7a7f4bef42a9652
F ext/fts3/fts3_porter.c 3565faf04b626cddf85f03825e86056a4562c009
F ext/fts3/fts3_snippet.c 68ae118b0f834ea53d2b89e4087fc0f0b8c4ee4e
F ext/fts3/fts3_term.c 88c55a6fa1a51ab494e33dced0401a6c28791fd7
F ext/fts3/fts3_test.c a940cf104d545ad1abf926956ce65db2aa5af0cf
F ext/fts3/fts3_test.c 79f2a7fbb3f672fa032e5a432ca274ea3ee93c34
F ext/fts3/fts3_tokenize_vtab.c a27593ab19657166f6fa5ec073b678cc29a75860
F ext/fts3/fts3_tokenizer.c 3cf21cd2212db17a88d4ef7da0fd8a80275979a1
F ext/fts3/fts3_tokenizer.c a22bf311a71f3efa9d7012d8cc48fc9b0f3dace7
F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3
F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004
F ext/fts3/fts3_unicode.c a93f5edc0aff44ef8b06d7cb55b52026541ca145
@@ -97,24 +97,24 @@ F ext/fts3/unicode/UnicodeData.txt cd07314edb62d49fde34debdaf92fa2aa69011e7
F ext/fts3/unicode/mkunicode.tcl 2debed3f582d77b3fdd0b8830880250021571fd8
F ext/fts3/unicode/parseunicode.tcl da577d1384810fb4e2b209bf3313074353193e95
F ext/fts5/extract_api_docs.tcl a36e54ec777172ddd3f9a88daf593b00848368e0
F ext/fts5/fts5.h b770c5e0a8d2ee071ddffc7ab722dbf3474a8abe
F ext/fts5/fts5Int.h 9bd0c7c64285b5b368eca0ac63613185c5ad24ba
F ext/fts5/fts5_aux.c daa57fb45216491814520bbb587e97bf81ced458
F ext/fts5/fts5.h 62f3e33ceeb9a428db139f9c012186b371da1cc7
F ext/fts5/fts5Int.h b2eda36e0f224365c8e23dc8f559311834f1c13f
F ext/fts5/fts5_aux.c 2f20784a344701d4c72986e2e692062dd47d568c
F ext/fts5/fts5_buffer.c 4c1502d4c956cd092c89ce4480867f9d8bf325cd
F ext/fts5/fts5_config.c 5af9c360e99669d29f06492c370892394aba0857
F ext/fts5/fts5_expr.c bcb238ee4ac1164302ab528487520488516bd030
F ext/fts5/fts5_expr.c 1ee97156421919e497595bfa962bb88ad1665401
F ext/fts5/fts5_hash.c 880998e596b60f078348d48732ca4ad9a90caad2
F ext/fts5/fts5_index.c b429e23fabb57506f71e406997cc46b89190dc97
F ext/fts5/fts5_index.c 2d146d5c547f60d22d6fc4014d5e2b64248cd7c4
F ext/fts5/fts5_main.c f85281445dcf8be32d18841c93a6f90fe27dbfe2
F ext/fts5/fts5_storage.c de0ed8a06738bde433afe11e92295ceaffbc4e58
F ext/fts5/fts5_tcl.c f8731e0508299bd43f1a2eff7dbeaac870768966
F ext/fts5/fts5_tcl.c 4a901f00c8553740dba63511603f5527d741c26a
F ext/fts5/fts5_test_mi.c 783b86697ebf773c18fc109992426c0173a055bc
F ext/fts5/fts5_test_tok.c db08af63673c3a7d39f053b36fd6e065017706be
F ext/fts5/fts5_tokenize.c 2ce7b44183538ec46b7907726262ee43ffdd39a8
F ext/fts5/fts5_unicode2.c b450b209b157d598f7b9df9f837afb75a14c24bf
F ext/fts5/fts5_varint.c a5aceacda04dafcbae725413d7a16818ecd65738
F ext/fts5/fts5_vocab.c dba72ca393d71c2588548b51380387f6b44c77a8
F ext/fts5/fts5parse.y fcc5e92e570d38cab38488b2109cbf67468923b2
F ext/fts5/fts5parse.y e51b375403421b8b37428a89b095d00597129aae
F ext/fts5/mkportersteps.tcl 5acf962d2e0074f701620bb5308155fa1e4a63ba
F ext/fts5/test/fts5_common.tcl b01c584144b5064f30e6c648145a2dd6bc440841
F ext/fts5/test/fts5aa.test bd2d88182b9f7f30d300044048ad14683306b745
@@ -122,7 +122,7 @@ F ext/fts5/test/fts5ab.test 30325a89453280160106be411bba3acf138e6d1b
F ext/fts5/test/fts5ac.test 55cad4275a1f5acabfe14d8442a8046b47e49e5f
F ext/fts5/test/fts5ad.test 36995f0586f30f5602074e012b9224c71ec5171c
F ext/fts5/test/fts5ae.test 612dcb51f4069226791ff14c17dbfb3138c56f20
F ext/fts5/test/fts5af.test be858a96b1f5de66ba6d64f0021bd8b2408e126c
F ext/fts5/test/fts5af.test c92825778ed2adc80014832762c056bbe968ef88
F ext/fts5/test/fts5ag.test 27180de76c03036be75ee80b93d8c5f540014071
F ext/fts5/test/fts5ah.test dfb7897711dbcda1dacb038aec310daca139fcf5
F ext/fts5/test/fts5ai.test 3909d0b949b2afcaae4d5795cd79153da75381df
@@ -135,12 +135,13 @@ F ext/fts5/test/fts5aux.test 5dd158a1e7869e27e9762a2a452b189c728d1be3
F ext/fts5/test/fts5auxdata.test 141a7cbffcceb1bd2799b4b29c183ff8780d586e
F ext/fts5/test/fts5bigpl.test 04ee0d7eebbebf17c31f5a0b5c5f9494eac3a0cb
F ext/fts5/test/fts5bigtok.test 017a9397b14e7598883a6328ead4a6539b42d59a
F ext/fts5/test/fts5colset.test 1cdf56e079316005aabda790059aee86f2222ee4
F ext/fts5/test/fts5columnsize.test a8cfef21ffa1c264b9f670a7d94eeaccb5341c07
F ext/fts5/test/fts5config.test 7788b9c058074d640dfcdd81d97b6a9480000368
F ext/fts5/test/fts5conflict.test 26f4e46c4d31e16221794832a990dc4e30e18de5
F ext/fts5/test/fts5content.test 9a952c95518a14182dc3b59e3c8fa71cda82a4e1
F ext/fts5/test/fts5corrupt.test c2ad090192708150d50d961278df10ae7a4b8b62
F ext/fts5/test/fts5corrupt2.test 26c0a39dd9ff73207e6229f83b50b21d37c7658c
F ext/fts5/test/fts5corrupt2.test 128eb6e2d26b09f4da339e581f424b3321e0fdaa
F ext/fts5/test/fts5corrupt3.test f77f65e386231daf62902466b40ff998b2c8ce4f
F ext/fts5/test/fts5detail.test ef5c690535a797413acaf5ad9b8ab5d49972df69
F ext/fts5/test/fts5determin.test 10648edb75ef1e196b10978fd21a9be0c31e09c3
@@ -189,7 +190,7 @@ F ext/fts5/test/fts5tok1.test beb894c6f3468f10a574302f69ebe4436b0287c7
F ext/fts5/test/fts5tok2.test dcacb32d4a2a3f0dd3215d4a3987f78ae4be21a2
F ext/fts5/test/fts5tokenizer.test ea4df698b35cc427ebf2ba22829d0e28386d8c89
F ext/fts5/test/fts5unicode.test fbef8d8a3b4b88470536cc57604a82ca52e51841
F ext/fts5/test/fts5unicode2.test c1dd890ba32b7609adba78e420faa847abe43b59
F ext/fts5/test/fts5unicode2.test 529ac7e8648c943bc87bfed1e427128a2f3f9e33
F ext/fts5/test/fts5unicode3.test 35c3d02aa7acf7d43d8de3bfe32c15ba96e8928e
F ext/fts5/test/fts5unindexed.test e9539d5b78c677315e7ed8ea911d4fd25437c680
F ext/fts5/test/fts5update.test 57c7012a7919889048947addae10e0613df45529
@@ -212,18 +213,18 @@ F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2
F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f
F ext/misc/fuzzer.c 7c64b8197bb77b7d64eff7cac7848870235d4c25
F ext/misc/ieee754.c f190d0cc5182529acb15babd177781be1ac1718c
F ext/misc/json1.c d51a764ba43a49e191bc3536238bfab3def258ca
F ext/misc/json1.c 9799e4252b305edcbe659329eec3ca80ed85f968
F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342
F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63
F ext/misc/percentile.c 92699c8cd7d517ff610e6037e56506f8904dae2e
F ext/misc/regexp.c a68d25c659bd2d893cd1215667bbf75ecb9dc7d4
F ext/misc/rot13.c 1ac6f95f99b575907b9b09c81a349114cf9be45a
F ext/misc/scrub.c 1c5bfb8b0cd18b602fcb55755e84abf0023ac2fb
F ext/misc/series.c e11e534ada797d5b816d7e7a93c022306563ca35
F ext/misc/showauth.c 732578f0fe4ce42d577e1c86dc89dd14a006ab52
F ext/misc/spellfix.c bf1b922c2750698e9a3d4c50cce6974adb7e93be
F ext/misc/spellfix.c a4723b6aff748a417b5091b68a46443265c40f0d
F ext/misc/totype.c 4a167594e791abeed95e0a8db028822b5e8fe512
F ext/misc/vfslog.c fe40fab5c077a40477f7e5eba994309ecac6cc95
F ext/misc/vfsstat.c 6110aeeaab2f1df17a923c8a8acef3c74f6dc515
F ext/misc/vfsstat.c bf10ef0bc51e1ad6756629e1edb142f7a8db1178
F ext/misc/vtshim.c babb0dc2bf116029e3e7c9a618b8a1377045303e
F ext/misc/wholenumber.c 784b12543d60702ebdd47da936e278aa03076212
F ext/rbu/rbu.c b2c0b5e6ae1a89affc0edfc127ebfa5f637a0ce4
@@ -244,20 +245,20 @@ F ext/rbu/rbuB.test c25bc325b8072a766e56bb76c001866b405925c2
F ext/rbu/rbuC.test efe47db508a0269b683cb2a1913a425ffd39a831
F ext/rbu/rbu_common.tcl a38e8e2d4a50fd6aaf151633714c1b1d2fae3ead
F ext/rbu/rbucrash.test 8d2ed5d4b05fef6c00c2a6b5f7ead71fa172a695
F ext/rbu/rbudiff.test b3c7675810b81de98a930a87fcd40d9ae545619d
F ext/rbu/rbudiff.test d099b56b073a737cfe1b8e9f67b77940130719cb
F ext/rbu/rbufault.test cc0be8d5d392d98b0c2d6a51be377ea989250a89
F ext/rbu/rbufault2.test 9a7f19edd6ea35c4c9f807d8a3db0a03a5670c06
F ext/rbu/rbufault3.test 54a399888ac4af44c68f9f58afbed23149428bca
F ext/rbu/rbufts.test 828cd689da825f0a7b7c53ffc1f6f7fdb6fa5bda
F ext/rbu/rbuprogress.test 2023a7df2c523e3df1cb532eff811cda385a789a
F ext/rbu/rbuprogress.test e3e25fb7622641b8f2df7c6b7a7eb6fddfc46a4b
F ext/rbu/rbusave.test 0f43b6686084f426ddd040b878426452fd2c2f48
F ext/rbu/rbuvacuum.test 4a977447c15c2581ab668781d9ef4294382530e0
F ext/rbu/rbuvacuum2.test 45009e127c3fb385e5c0fd5a8a63fb922a79d0ab
F ext/rbu/sqlite3rbu.c 948677ee0ec57da51148e6c5f64ac68afcf36ab2
F ext/rbu/sqlite3rbu.h db8858120c9be14b60c9225f9da28221f5f6b945
F ext/rbu/test_rbu.c 9f043b74c46c45b231f4313aed1fccb379a76fe6
F ext/rbu/rbuvacuum2.test 2569205b74ff40fbf3bda2fce33a58eb40eebdcc
F ext/rbu/sqlite3rbu.c e074c38798b90591f7f0cf0032d62f152ce5a95e
F ext/rbu/sqlite3rbu.h 6fb6294c34a9ca93b5894a33bca530c6f08decba
F ext/rbu/test_rbu.c 5aa22616afac6f71ebd3d9bc9bf1006cfabcca88
F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
F ext/rtree/rtree.c d26a815b0df1c412a6881dae8d7fd3c9c08cce68
F ext/rtree/rtree.c 0b450226001c8ae4622e382b2aff79127581a763
F ext/rtree/rtree.h 834dbcb82dc85b2481cde6a07cdadfddc99e9b9e
F ext/rtree/rtree1.test 42dadfc7b44a436cd74a1bebc0b9b689e4eaf7ec
F ext/rtree/rtree2.test acbb3a4ce0f4fbc2c304d2b4b784cfa161856bba
@@ -296,19 +297,19 @@ F ext/session/sessionD.test d4744c78334162851d2a2f285c7e603e31b49aa2
F ext/session/sessionE.test e60a238c47f0feb3bb707e7f35e22be09c7e8f26
F ext/session/sessionF.test c2f178d4dfd723a5fd94a730ea2ccb44c669e3ce
F ext/session/sessionG.test 01ef705096a9d3984eebdcca79807a211dee1b60
F ext/session/session_common.tcl a1293167d14774b5e728836720497f40fe4ea596
F ext/session/session_common.tcl 9b696a341cf1d3744823715ed92bb19749b6c3d4
F ext/session/sessionfault.test da273f2712b6411e85e71465a1733b8501dbf6f7
F ext/session/sessionfault2.test 04aa0bc9aa70ea43d8de82c4f648db4de1e990b0
F ext/session/sqlite3session.c 37485891b4add26cf61495df193c419f36556a32
F ext/session/sqlite3session.h 69bf73cfd71e58f2ae5d2aa935b2c1a541aee555
F ext/session/test_session.c 464f2c8bf502795d95969387eb8e93f68c513c15
F ext/session/sqlite3session.h 7b9037818ee61f7429ca83e9866885ca6de5f764
F ext/session/test_session.c eb0bd6c1ea791c1d66ee4ef94c16500dad936386
F ext/userauth/sqlite3userauth.h 19cb6f0e31316d0ee4afdfb7a85ef9da3333a220
F ext/userauth/user-auth.txt e6641021a9210364665fe625d067617d03f27b04
F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60
F main.mk e9d66f1b1c4874221d12d940be3ce5f397c10741
F main.mk 1883ecab643b136e8ab3fdc33785e6ea8b5ceb46
F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
@@ -320,35 +321,36 @@ F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
F src/alter.c cc28ab933ae615b22add0d609794ffb6596b42ea
F src/analyze.c 37fedc80ac966ce1745811746e68e4d8fa64c7fe
F src/attach.c 771153bd1f4ab0b97a44a13dde2c7e5e1efeba22
F src/auth.c 5c8e0f37f785f935f589496801edd19840485853
F src/backup.c 6df65fdd569c901a418887a1a76f82ec35044556
F src/alter.c 299117695b1f21ac62dfc5b608588810ba22ed0d
F src/analyze.c 8b62b2cf4da85451534ac0af82cafc418d837f68
F src/attach.c 4711ff365df4072b8c3dcd55db5d12dcf8ffa0c6
F src/auth.c 930b376a9c56998557367e6f7f8aaeac82a2a792
F src/backup.c 92c2e3b5fcb47626413717138617f4d32f08aea4
F src/bitvec.c 3ee4c8b2c94ed3a7377256e18199e6ff5cf33f63
F src/btmutex.c bc87dd3b062cc26edfe79918de2200ccb8d41e73
F src/btree.c 6a42efa461cf3a0c33e8755e9d236371ac80d1b3
F src/btree.c 2551bd3ecb8b8988fb8b23aabadfb214dbc38e46
F src/btree.h 075c45707c0f8f8af118f739f36df8098a08b7da
F src/btreeInt.h c18b7d2a3494695133e4e60ee36061d37f45d9a5
F src/build.c d1fdfd7ab8f5447e494ef15825973bf0719527c6
F src/build.c c2ccfcdd99e18894a8750e215b8d9c5398a3c073
F src/callback.c 2e76147783386374bf01b227f752c81ec872d730
F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
F src/ctime.c e77f3dc297b4b65c96da78b4ae4272fdfae863d7
F src/date.c 1cc9fb516ec9932c6fd4d2a0d2f8bc4480145c39
F src/dbstat.c 4f6f7f52b49beb9636ffbd517cfe44a402ba4ad0
F src/delete.c 4aba4214a377ce8ddde2d2e609777bcc8235200f
F src/expr.c fbc17c717a80b5b61158ea8f25b5af6f8cad66f8
F src/date.c 95c9a8d00767e7221a8e9a31f4e913fc8029bf6b
F src/dbstat.c 19ee7a4e89979d4df8e44cfac7a8f905ec89b77d
F src/delete.c 76c084f0265f4a3cd1ecf17eee112a94f1ccbc05
F src/expr.c 028c34005cb804abe8f73453ac08baa44f4b63f9
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
F src/fkey.c bc4145347595b7770f9a598cff1c848302cf5413
F src/func.c 61a4114cf7004f10c542cfabbab9f2bcb9033045
F src/fkey.c e2be0968c1adc679c87e467aa5b4f167588f38a8
F src/func.c 29cc9acb170ec1387b9f63eb52cd85f8de96c771
F src/global.c c45ea22aff29334f6a9ec549235ac3357c970015
F src/hash.c 55b5fb474100cee0b901edaf203e26c970940f36
F src/hash.h ab34c5c54a9e9de2e790b24349ba5aab3dbb4fd4
F src/hwtime.h 747c1bbe9df21a92e9c50f3bbec1de841dc5e5da
F src/insert.c 8f4e9fcbd8e95e85f15647ba8b413b18d556ec2b
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
F src/insert.c 3edb5a1bda44df13531fedfcde5fbcc2fc04c222
F src/legacy.c 75d3023be8f0d2b99d60f905090341a03358c58e
F src/loadext.c 5dd8b5a67d32a98bb75657c2a9e48b2cedbf13a4
F src/main.c 16c1b2114eae8804caf3a8de8cb47bf2c6d83ad3
F src/loadext.c dd7a2b77902cc66c22555aef02e1a682554b7aec
F src/main.c 9821bb4d2399bc5a0b8a5dfc06bede2d1520255c
F src/malloc.c 1443d1ad95d67c21d77af7ae3f44678252f0efec
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
F src/mem1.c 6919bcf12f221868ea066eec27e579fed95ce98b
@@ -367,106 +369,106 @@ F src/os.c add02933b1dce7a39a005b00a2f5364b763e9a24
F src/os.h 8e976e59eb4ca1c0fca6d35ee803e38951cb0343
F src/os_common.h b2f4707a603e36811d9b1a13278bffd757857b85
F src/os_setup.h 0dbaea40a7d36bf311613d31342e0b99e2536586
F src/os_unix.c a9443cdab41d7f3cdf0df3a5aab62fd6e1c9b234
F src/os_unix.c be9ca0f901a2b6c1bc93dc338f4863675180c189
F src/os_win.c 520f23475f1de530c435d30b67b7b15fe90874b0
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
F src/pager.c c368634b888b1c8740aea83b36bfd266f2443e60
F src/pager.h 031a87445e5e0afc85312d1c380e123ad6c7aeaf
F src/parse.y 99b676e6fc2f4e331ab93e76b3987cffdbd28efa
F src/pager.c bf5b71bde3e9b6110e7d6990607db881f6a471a2
F src/pager.h 966d2769e76ae347c8a32c4165faf6e6cb64546d
F src/parse.y 0e0b6d46a990d01e4ca1e9d7e1d2d9b5a98f6bcb
F src/pcache.c 5583c8ade4b05075a60ba953ef471d1c1a9c05df
F src/pcache.h 2cedcd8407eb23017d92790b112186886e179490
F src/pcache1.c 7f51d2b541aab57596adf62db2c4bb025d34f04d
F src/pragma.c c8b499756658cb8b82cfdbb5845c22cf11f297aa
F src/pcache1.c 4bb7a6a5300c67d0b033d25adb509c120c03e812
F src/pragma.c d932ba278654617cdd281f88a790a3185fca7c44
F src/pragma.h 64c78a648751b9f4f297276c4eb7507b14b4628c
F src/prepare.c 22df6171aec1d86904ed2ad30c2348a5748aa04e
F src/prepare.c 0fcf16eaacc90c1059055519a76b75b516a59a88
F src/printf.c a5f0ca08ddede803c241266abb46356ec748ded1
F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
F src/resolve.c cca3aa77b95706df5d635a2141a4d1de60ae6598
F src/resolve.c 24f40fd0c3475821d1ad762a3f2c3455cc839b42
F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac
F src/select.c f3c6e9065fb34f6a23af27ec7f1f717ffbfc2ee4
F src/shell.c 9351fc6de11e1d908648c0a92d85627138e3dee5
F src/sqlite.h.in c6e68a4a47610631822a4f8f83a44c9f75339331
F src/select.c 244f9cc5e4662987cd2ef5c22d1b7027560f3425
F src/shell.c de7c7e98846cacbfbe062cbd98bca899dfb720e3
F src/sqlite.h.in 4a030e254e204570444b34bf7d40fb4a5416089e
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h 46f300b6e300e0fa916d7d58c44b53415b8471a9
F src/sqliteInt.h d25c18c1272a7811e2569c39bfc2fca96156eead
F src/sqlite3ext.h 8648034aa702469afb553231677306cc6492a1ae
F src/sqliteInt.h c9e010a79ab4ed7bdc910a24d8f08f3c6d5f822c
F src/sqliteLimit.h c0373387c287c8d0932510b5547ecde31b5da247
F src/status.c 5b18f9526900f61189ab0b83f1ef41d9f871a2ab
F src/status.c a9e66593dfb28a9e746cba7153f84d49c1ddc4b1
F src/table.c 5226df15ab9179b9ed558d89575ea0ce37b03fc9
F src/tclsqlite.c 5c213bf5fee084390f632df2328cf0821d483799
F src/test1.c 186e3b53c402b7a73bcb4ade2b77709675c39fe3
F src/test2.c 5586f43fcd9a1be0830793cf9d354082c261b25b
F src/test3.c c75c8af0eadb335236c9e61b51044c58a8f7dd59
F src/test4.c d168f83cc78d02e8d35567bb5630e40dcd85ac1e
F src/test5.c 5a34feec76d9b3a86aab30fd4f6cc9c48cbab4c1
F src/test6.c a684b7abd01352ab50cb79c0bf727e6b3f381a3d
F src/test7.c 9c89a4f1ed6bb13af0ed805b8d782bd83fcd57e3
F src/test8.c fa262391d3edea6490a71bfaa8fed477ccbbac75
F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60
F src/test_async.c 21e11293a2f72080eda70e1124e9102044531cd8
F src/test_autoext.c dea8a01a7153b9adc97bd26161e4226329546e12
F src/test_backup.c 2e6e6a081870150f20c526a2e9d0d29cda47d803
F src/test_bestindex.c f9e6807c52aa532e4775321ce3ed8e47c907ed45
F src/test_blob.c b2551a9b5573232db5f66f292307c37067937239
F src/test_btree.c 2e9978eca99a9a4bfa8cae949efb00886860a64f
F src/test_config.c 7003f6f35134de6f19c6588f44783e43390ea277
F src/test_demovfs.c 0de72c2c89551629f58486fde5734b7d90758852
F src/tclsqlite.c bdae822f21e229b6daced15938b6343ce44ef454
F src/test1.c 8574e41c1bf103727909b37351b3690cc07bc8a7
F src/test2.c b7174313e993754303a8b33c43df7c44b46857ab
F src/test3.c 1339a40be39650ae83894b6578f971dc7f96ea8a
F src/test4.c 18ec393bb4d0ad1de729f0b94da7267270f3d8e6
F src/test5.c 328aae2c010c57a9829d255dc099d6899311672d
F src/test6.c 55aa2775c154415dcf4ed7cd1e19a193122b3a02
F src/test7.c 5612e9aecf934d6df7bba6ce861fdf5ba5456010
F src/test8.c 4f4904721167b32f7a4fa8c7b32a07a673d6cc86
F src/test9.c 12e5ba554d2d1cbe0158f6ab3f7ffcd7a86ee4e5
F src/test_async.c 195ab49da082053fdb0f949c114b806a49ca770a
F src/test_autoext.c 915d245e736652a219a907909bb6710f0d587871
F src/test_backup.c bf5da90c9926df0a4b941f2d92825a01bbe090a0
F src/test_bestindex.c d23f80d334c59662af69191854c76b8d3d0c8c96
F src/test_blob.c a0f7ad49a0c9d4b72f693fe2a71c58d7e507174d
F src/test_btree.c 8b2dc8b8848cf3a4db93f11578f075e82252a274
F src/test_config.c 4d3d4a886416f369771d69a6dba926866deda788
F src/test_demovfs.c a0c3bdd45ed044115c2c9f7779e56eafff18741e
F src/test_devsym.c 4e58dec2602d8e139ca08659f62a62450587cb58
F src/test_fs.c f10f840ca4f8c72e4837908bd8347ac4bcab074b
F src/test_func.c 37453d346cfcf118774efd5bf6187f7e6a7e3254
F src/test_hexio.c abfdecb6fa58c354623978efceb088ca18e379cd
F src/test_init.c 66b33120ffe9cd853b5a905ec850d51151337b32
F src/test_intarray.c 870124b95ec4c645d4eb84f15efb7133528fb1a5
F src/test_fs.c e16cbe68d3b107e00a907c20a9a02629870eb69b
F src/test_func.c a2b4993da973b0ea60dd5d51a7066238ede8c329
F src/test_hexio.c 1d4469ca61ab202a1fcec6543f584d2407205e8d
F src/test_init.c 4413c211a94b62157ca4c145b3f27c497f03c664
F src/test_intarray.c 988fc61cb0ff539f4172c0d95f15287c92516f64
F src/test_intarray.h f3b7672f5d1056eac563c0d6ea8480a660b1475c
F src/test_journal.c d3b83f2bcb7792c709e57abddc456a2b1818643a
F src/test_loadext.c 337056bae59f80b9eb00ba82088b39d0f4fe6dfd
F src/test_malloc.c 6b27e947eeeb70d11aa65406ed28d749e39b6356
F src/test_multiplex.c eafc567ebe162e36f17b5062285dfe90461cf8e9
F src/test_malloc.c c05f6c40bd6c8bfe5f1718212f81fd5687f91766
F src/test_multiplex.c 7c5b218d855cd0505a43185d55283b3fc257c8da
F src/test_multiplex.h 5436d03f2d0501d04f3ed50a75819e190495b635
F src/test_mutex.c dbdfaff8580071f2212a0deae3325a93a737819c
F src/test_mutex.c 7f4337ba23ee6b1d2ec81c189653608cb069926a
F src/test_onefile.c 416f87a28d6d673352d33fc4b1c7d39db878e50f
F src/test_osinst.c ad0233b1dabb0390e25edded4ebd79a2a61538c6
F src/test_osinst.c 98ef31ff03d55497829ca0f6c74a9f4e1aa48690
F src/test_pcache.c a5cd24730cb43c5b18629043314548c9169abb00
F src/test_quota.c 180813f43683be5725458fc1ff13ac455d8e722d
F src/test_quota.c 6cb9297115b551f433a9ad1741817a9831abed99
F src/test_quota.h 2a8ad1952d1d2ca9af0ce0465e56e6c023b5e15d
F src/test_rtree.c 43fff4c5a01576d6d213f27472598801a247890c
F src/test_schema.c 2bdba21b82f601da69793e1f1d11bf481a79b091
F src/test_rtree.c 671f3fae50ff116ef2e32a3bf1fe21b5615b4b7b
F src/test_schema.c f575932cb6274d12147a77e13ea4b49d52408513
F src/test_server.c a2615049954cbb9cfb4a62e18e2f0616e4dc38fe
F src/test_sqllog.c 0d138a8180a312bf996b37fa66da5c5799d4d57b
F src/test_superlock.c 06797157176eb7085027d9dd278c0d7a105e3ec9
F src/test_syscall.c 268c072541162564a882c57f54a6fee12ef4a4d2
F src/test_tclvar.c d86412527da65468ee6fa1b8607c65d0af736bc4
F src/test_thread.c af391ec03d23486dffbcc250b7e58e073f172af9
F src/test_vfs.c 4d02f38bfb8f7f273da7ba84bfe000f5babf206c
F src/test_superlock.c 4839644b9201da822f181c5bc406c0b2385f672e
F src/test_syscall.c 1073306ba2e9bfc886771871a13d3de281ed3939
F src/test_tclvar.c df9fe1213c2634687a9ca0b0bec0d2119d359ae3
F src/test_thread.c 911d15fb14e19c0c542bdc8aabf981c2f10a4858
F src/test_vfs.c f0186261a24de2671d080bcd8050732f0cb64f6e
F src/test_vfstrace.c bab9594adc976cbe696ff3970728830b4c5ed698
F src/test_windirent.c 8f5fada630348558d5745b334702f301da1ffc61
F src/test_windirent.h b12055cab6227f7be10f5c19296f67c60cc5e2a5
F src/test_windirent.c 600398db0198ca1c77ca183831bf456746b6f5c4
F src/test_windirent.h 7edc57e2faa727026dbd5d010dd0e2e665d5aa01
F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c
F src/tokenize.c 3b29883b0ce4a6c6f643965b66b5ca6613178e59
F src/treeview.c c56d6ddbed564efda746236b35bcbb8238daac4b
F src/trigger.c e14840ee0c3e549e758ec9bf3e4146e166002280
F src/update.c 4f05ea8cddfa367d045e03589756c02199e8f9bd
F src/tokenize.c 78c8085bc7af1922aa687f0f4bbd716821330de5
F src/treeview.c f51b75a28b377adde9f79bc3deb6c7770bcf97c0
F src/trigger.c 11e20b3b12c847b3b9055594c0f1631266bb53fc
F src/update.c 8179e699dbd45b92934fd02d3d8e3732e8da8802
F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c
F src/util.c 810ec3f22e2d1b62e66c30fe3621ebdedd23584d
F src/vacuum.c 9dd2f5d276bc6094d8f1d85ecd41b30c1a002a43
F src/vdbe.c ea260b61e73b11a71e70b28a8e25866e2899e5da
F src/vacuum.c 913970b9d86dd6c2b8063ef1af421880f1464ec3
F src/vdbe.c 3148d5d47816c5ad2ed3c62beb3086cbbcaab107
F src/vdbe.h 67bc551f7faf04c33493892e4b378aada823ed10
F src/vdbeInt.h c59381049af5c7751a83456c39b80d1a6fde1f9d
F src/vdbeapi.c c3f6715a99995c11748ecad91d25e93fd9fc390b
F src/vdbeaux.c a32d79aeaa88dc2b97c261172d952d395254a055
F src/vdbeblob.c 83d2d266383157b02e2b809350bb197e89d7895b
F src/vdbemem.c 1ecaa5ee0caff07255f25d04e8dc88befb6f88d1
F src/vdbeapi.c a32d61b7dd05e6890d8fd44d2805f55e2f5ba9f3
F src/vdbeaux.c 83458783d241cfd6691141c8a105832ee50258e5
F src/vdbeblob.c 3e82a797b60c3b9fed7b8de8c539ca7607874937
F src/vdbemem.c e67dc6d8177fd1830efb5d15e17793408251a187
F src/vdbesort.c 91fda3909326860382b0ca8aa251e609c6a9d62c
F src/vdbetrace.c 41963d5376f0349842b5fc4aaaaacd7d9cdc0834
F src/vtab.c 948d2d4984219eee37a7bf427d6667e21e6eb92e
F src/vtab.c e02cacb5c7ae742631edeb9ae9f53d399f093fd8
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
F src/wal.c 02eeecc265f6ffd0597378f5d8ae9070b62a406a
F src/wal.h 6dd221ed384afdc204bc61e25c23ef7fd5a511f2
F src/walker.c 0f142b5bd3ed2041fc52d773880748b212e63354
F src/where.c 8ccc01f9227d41bfaf09360f108583be4a36d3b1
F src/whereInt.h e5b939701a7ceffc5a3a8188a37f9746416ebcd0
F src/wherecode.c 99707d11907c71d289ee9553d2d1a22f1fd8ba41
F src/whereexpr.c d7dcbf14ce1b5876c1f76496162c30fcba669563
F src/walker.c 2d2cc7fb0f320f7f415215d7247f3c584141ac09
F src/where.c edbd73a87ba2e186928e9bfc14348b1bbb2628c5
F src/whereInt.h 14dd243e13b81cbb0a66063d38b70f93a7d6e613
F src/wherecode.c d172dcf99932ba698dd304edc9a368cd52b4b2e5
F src/whereexpr.c e3db778ed205e982f31960896db71c50612ae009
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
F test/affinity2.test a6d901b436328bd67a79b41bb0ac2663918fe3bd
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
@@ -523,7 +525,7 @@ F test/backup2.test 34986ef926ea522911a51dfdb2f8e99b7b75ebcf
F test/backup4.test 8f6fd48e0dfde77b9a3bb26dc471ede3e101df32
F test/backup5.test ee5da6d7fe5082f5b9b0bbfa31d016f52412a2e4
F test/backup_ioerr.test 4c3c7147cee85b024ecf6e150e090c32fdbb5135
F test/backup_malloc.test 7162d604ec2b4683c4b3799a48657fb8b5e2d450
F test/backup_malloc.test 833d1b90561a6dbab00079b9591bd4fc90b7c2e1
F test/badutf.test d5360fc31f643d37a973ab0d8b4fb85799c3169f
F test/badutf2.test f5bc7f2d280670ecd79b9cf4f0f1760c607fe51f
F test/bc_common.tcl b5e42d80305be95697e6370e015af571e5333a1c
@@ -624,7 +626,7 @@ F test/date.test 984ac1e3e5e031386866f034006148d3972b4a65
F test/dbstatus.test 73149851b3aff14fc6db478e58f9083a66422cf5
F test/dbstatus2.test e93ab03bfae6d62d4d935f20de928c19ca0ed0ab
F test/default.test 0cb49b1c315a0d81c81d775e407f66906a2a604d
F test/delete.test e1bcdf8926234e27aac24b346ad83d3329ec8b6f
F test/delete.test acc38fca8ee4851467705b1c2cfea64cd26667e5
F test/delete2.test 3a03f2cca1f9a67ec469915cb8babd6485db43fa
F test/delete3.test 555e84a00a99230b7d049d477a324a631126a6ab
F test/delete4.test 21d2113217eeaacac2d99defe14fe6611615ae86
@@ -643,7 +645,7 @@ F test/e_createtable.test d4c6059d44dcd4b636de9aae322766062b471844
F test/e_delete.test ab39084f26ae1f033c940b70ebdbbd523dc4962e
F test/e_droptrigger.test 3cd080807622c13e5bbb61fc9a57bd7754da2412
F test/e_dropview.test 0c9f7f60989164a70a67a9d9c26d1083bc808306
F test/e_expr.test 03a84a6fa9bd3472112d6bd4599f5269f5f74803
F test/e_expr.test 1ffa8866d38e7becc76893a8829e9432050e5716
F test/e_fkey.test a1783fe1f759e1990e6a11adfcf0702dac4d0707
F test/e_fts3.test 5c02288842e4f941896fd44afdef564dd5fc1459
F test/e_insert.test 3de217e95094d3d165992a6de1164bbc4bd92dc7
@@ -654,7 +656,7 @@ F test/e_select2.test aceb80ab927d46fba5ce7586ebabf23e2bb0604f
F test/e_totalchanges.test b12ee5809d3e63aeb83238dd501a7bca7fd72c10
F test/e_update.test f46c2554d915c9197548681e8d8c33a267e84528
F test/e_uri.test 25385396082b67fd02ae0038b95a3b3575fe0519
F test/e_vacuum.test 120f29ea56bdce4d43279527ece894ab5d1729d3
F test/e_vacuum.test 9e5e47e4059a779c777f47e0f560fc82c99336df
F test/e_wal.test ae9a593207a77d711443ee69ffe081fda9243625
F test/e_walauto.test 248af31e73c98df23476a22bdb815524c9dc3ba8
F test/e_walckpt.test 28c371a6bb5e5fe7f31679c1df1763a19d19e8a0
@@ -746,7 +748,7 @@ F test/fts3aux2.test 7ae2b2c13aefdf4169279a27a5f51780ce57f6ba
F test/fts3b.test e93bbb653e52afde110ad53bbd793f14fe7a8984
F test/fts3c.test fc723a9cf10b397fdfc2b32e73c53c8b1ec02958
F test/fts3comp1.test a0f5b16a2df44dd0b15751787130af2183167c0c
F test/fts3conf.test 1c8b8adb0ab28a41b68d1514df44380bd7353402
F test/fts3conf.test 60317efd562080e198b5bdc9fcd222ce32cf01d7
F test/fts3corrupt.test 2710b77983cc7789295ddbffea52c1d3b7506dbb
F test/fts3corrupt2.test 6d96efae2f8a6af3eeaf283aba437e6d0e5447ba
F test/fts3cov.test e0fb00d8b715ddae4a94c305992dfc3ef70353d7
@@ -807,7 +809,7 @@ F test/fuzz2.test 76dc35b32b6d6f965259508508abce75a6c4d7e1
F test/fuzz3.test b47377143f0c80f91ed29d722861077ff34415d5
F test/fuzz_common.tcl a87dfbb88c2a6b08a38e9a070dabd129e617b45b
F test/fuzz_malloc.test 328f70aaca63adf29b4c6f06505ed0cf57ca7c26
F test/fuzzcheck.c f01d432d001ba29e7916df8411be7d4e7cddc574
F test/fuzzcheck.c f2e8102f7829f7b946ebdb6f1a16c6f942d9de66
F test/fuzzdata1.db 7ee3227bad0e7ccdeb08a9e6822916777073c664
F test/fuzzdata2.db f03a420d3b822cc82e4f894ca957618fbe9c4973
F test/fuzzdata3.db c6586d3e3cef0fbc18108f9bb649aa77bfc38aba
@@ -822,7 +824,7 @@ F test/hook.test 3b7b99d0eece6d279812c2aef6fa08bdfabc633e
F test/icu.test 73956798bace8982909c00476b216714a6d0559a
F test/ieee754.test 806fc0ce7f305f57e3331eaceeddcfec9339e607
F test/imposter1.test c3f1db2d3db2c24611a6596a3fc0ffc14f1466c8
F test/in.test 61d940ced6817bee66e4e0b09d5bc8608f57134b
F test/in.test 20c5529986998949908f889c8208b2cd894b2cc9
F test/in2.test 5d4c61d17493c832f7d2d32bef785119e87bde75
F test/in3.test 3cbf58c87f4052cee3a58b37b6389777505aa0c0
F test/in4.test d2b38cba404bc4320f4fe1b595b3d163f212c068
@@ -888,8 +890,8 @@ F test/like.test 81632c437a947bf1f7130b19537da6a1a844806a
F test/like2.test 3b2ee13149ba4a8a60b59756f4e5d345573852da
F test/like3.test 3608a2042b6f922f900fbfd5d3ce4e7eca57f7c4
F test/limit.test 0c99a27a87b14c646a9d583c7c89fd06c352663e
F test/limit2.test 55c9f4d08c89311e00afd75045ee1a2aca205cb4
F test/loadext.test 42a3b8166dfcadcb0e0c8710dc520d97c31a8b98
F test/limit2.test ac97b8d07060a0280162ba4159e4c0c765861127
F test/loadext.test d077450695ddb5c1ea3ad7d48e5f5850fe732ad9
F test/loadext2.test 0408380b57adca04004247179837a18e866a74f7
F test/lock.test be4fe08118fb988fed741f429b7dd5d65e1c90db
F test/lock2.test 5242d8ac4e2d59c403aebff606af449b455aceff
@@ -941,7 +943,7 @@ F test/misc4.test 0d8be3466adf123a7791a66ba2bc8e8d229e87f3
F test/misc5.test fff0f75e834bc09a39f6079320dd8c37de956f4f
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
F test/misc7.test edd0b63e2ee29a256900b0514f6fff27e19e9bb2
F test/misc8.test 21ac9d35a5e110279ae9e1588b8914f54de1c60b
F test/misc8.test ba03aaa08f02d62fbb8d3b2f5595c1b33aa9bbc5
F test/misuse.test 3c34719944ba045cc6c188a4852ba04680728912
F test/mmap1.test d2cfc1635171c434dcff0ece2f1c8e0a658807ce
F test/mmap2.test 9d6dd9ddb4ad2379f29cc78f38ce1e63ed418022
@@ -1010,7 +1012,7 @@ F test/rdonly.test 64e2696c322e3538df0b1ed624e21f9a23ed9ff8
F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8
F test/regexp2.test aa7ffcc21350007a78361b82bcf3b74d12227144
F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
F test/releasetest.tcl 3a66c7b8fbe55bcd97c907217c3d812d1d3c6b93
F test/releasetest.tcl 53560b838b79c468ec9973e0dfa3d8892628887f
F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb
F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea
F test/rollback2.test 8435d6ff0f13f51d2a4181c232e706005fa90fc5
@@ -1018,6 +1020,16 @@ F test/rollbackfault.test 0e646aeab8840c399cfbfa43daab46fd609cf04a
F test/rowallock.test 3f88ec6819489d0b2341c7a7528ae17c053ab7cc
F test/rowhash.test 0bc1d31415e4575d10cacf31e1a66b5cc0f8be81
F test/rowid.test 5b7509f384f4f6fae1af3c8c104c8ca299fea18d
F test/rowvalue.test 753eb744b7efeb5ac643d35d6e1e5066452ccf79
F test/rowvalue2.test 060d238b7e5639a7c5630cb5e63e311b44efef2b
F test/rowvalue3.test 01399b7bf150b0d41abce76c18072da777c2500c
F test/rowvalue4.test 4b556d7de161a0dd8cff095c336e913986398bea
F test/rowvalue5.test c1adfb2ea104e181f70d55bbd80d803b9917b22b
F test/rowvalue6.test d19b54feb604d5601f8614b15e214e0774c01087
F test/rowvalue7.test 5d06ff19d9e6969e574a2e662a531dd0c67801a8
F test/rowvalue8.test 5900eddad9e2c3c2e26f1a95f74aafc1232ee5e0
F test/rowvalue9.test e24f9eb02baffc6a67b6eed9e40d4c612c98079d
F test/rowvaluefault.test 7b16485e3f2b371f3e3d05455b8ded6d0c090244
F test/rtree.test 0c8d9dd458d6824e59683c19ab2ffa9ef946f798
F test/run-wordcount.sh 891e89c4c2d16e629cd45951d4ed899ad12afc09
F test/savepoint.test c671fdbd34cd3bfe1518a777526ada595180cf8d
@@ -1027,7 +1039,7 @@ F test/savepoint5.test 0735db177e0ebbaedc39812c8d065075d563c4fd
F test/savepoint6.test f41279c5e137139fa5c21485773332c7adb98cd7
F test/savepoint7.test cde525ea3075283eb950cdcdefe23ead4f700daa
F test/savepointfault.test f044eac64b59f09746c7020ee261734de82bf9b2
F test/scanstatus.test 030acbbdcea6a3fc676fee99edc84f6f16c0cf92
F test/scanstatus.test 5253c219e331318a437f436268e0e82345700285
F test/schema.test 8f7999be894260f151adf15c2c7540f1c6d6a481
F test/schema2.test 906408621ea881fdb496d878b1822572a34e32c5
F test/schema3.test 1bc1008e1f8cb5654b248c55f27249366eb7ed38
@@ -1041,7 +1053,7 @@ F test/select3.test 2ce595f8fb8e2ac10071d3b4e424cadd4634a054
F test/select4.test 5389d9895968d1196c457d59b3ee6515d771d328
F test/select5.test e758b8ef94f69b111df4cb819008856655dcd535
F test/select6.test 39eac4a5c03650b2b473c532882273283ee8b7a0
F test/select7.test 95e370c42d47c3c52377d05e9ffc01ccff7c1f61
F test/select7.test f659f231489349e8c5734e610803d7654207318f
F test/select8.test 8c8f5ae43894c891efc5755ed905467d1d67ad5d
F test/select9.test aebc2bb0c3bc44606125033cbcaac2c8d1f33a95
F test/selectA.test 101e722370ac6e84978c2958b8931c78b10a1709
@@ -1065,16 +1077,16 @@ F test/sharedA.test 0cdf1a76dfa00e6beee66af5b534b1e8df2720f5
F test/sharedB.test 16cc7178e20965d75278f410943109b77b2e645e
F test/shared_err.test 2f2aee20db294b9924e81f6ccbe60f19e21e8506
F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304
F test/shell1.test 77896b65f1cde4ee79e38b2c0ed8578a8f4000e5
F test/shell1.test 65b10cd8a90cda9b5af9100a45689a57dcc01a31
F test/shell2.test e242a9912f44f4c23c3d1d802a83e934e84c853b
F test/shell3.test da513d522ef6f01cee8475dcf8332bff8982b3dd
F test/shell4.test 69995ee1cc278eb149aa8746ce1f935f4eaf98b9
F test/shell4.test 89ad573879a745974ff2df20ff97c5d6ffffbd5d
F test/shell5.test 50a732c1c2158b1cd62cf53975ce1ea7ce6b9dc9
F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5
F test/shrink.test 1b4330b1fd9e818c04726d45cb28db73087535ce
F test/sidedelete.test f0ad71abe6233e3b153100f3b8d679b19a488329
F test/skipscan1.test d37a75b4be4eb9dedeb69b4f38b1d0a74b5021d7
F test/skipscan1.test f2d4482f195f018c3732374d3985fc34bcc3ae1a
F test/skipscan2.test d1d1450952b7275f0b0a3a981f0230532743951a
F test/skipscan3.test ec5bab3f81c7038b43450e7b3062e04a198bdbb5
F test/skipscan5.test 67817a4b6857c47e0e33ba3e506da6f23ef68de2
@@ -1093,7 +1105,7 @@ F test/speed1.test f2974a91d79f58507ada01864c0e323093065452
F test/speed1p.explain d841e650a04728b39e6740296b852dccdca9b2cb
F test/speed1p.test b180e98609c7677382cf618c0ec9b69f789033a8
F test/speed2.test 53177056baf6556dcbdcf032bbdfc41c1aa74ded
F test/speed3.test d32043614c08c53eafdc80f33191d5bd9b920523
F test/speed3.test 694affeb9100526007436334cf7d08f3d74b85ef
F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715
F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
F test/speed4p.test 0e51908951677de5a969b723e03a27a1c45db38b
@@ -1104,12 +1116,12 @@ F test/spellfix3.test 0f9efaaa502a0e0a09848028518a6fb096c8ad33
F test/sqldiff1.test 28cd737cf1b0078b1ec1bbf425e674c47785835e
F test/sqllimits1.test a74ee2a3740b9f9c2437c246d8fb77354862a142
F test/sqllog.test 6af6cb0b09f4e44e1917e06ce85be7670302517a
F test/stat.test ab95d28503d0f6d98ffd8ce204643c9da090ebf1
F test/stat.test f8f1279ffffabe6df825723af18cc6e0ae70a893
F test/statfault.test f525a7bf633e50afd027700e9a486090684b1ac1
F test/stmt.test 64844332db69cf1a735fcb3e11548557fc95392f
F test/subquery.test d7268d193dd33d5505df965399d3a594e76ae13f
F test/subquery2.test 438f8a7da1457277b22e4176510f7659b286995f
F test/subselect.test d24fd8757daf97dafd2e889c73ea4c4272dcf4e4
F test/subselect.test 0966aa8e720224dbd6a5e769a3ec2a723e332303
F test/substr.test 18f57c4ca8a598805c4d64e304c418734d843c1a
F test/subtype1.test 7fe09496352f97053af1437150751be2d0a0cae8
F test/superlock.test ec94f0556b6488d97f71c79f9061ae08d9ab8f12
@@ -1129,7 +1141,7 @@ F test/temptable.test d2c9b87a54147161bcd1822e30c1d1cd891e5b30
F test/temptable2.test cd396beb41117a5302fff61767c35fa4270a0d5e
F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637
F test/temptrigger.test 8ec228b0db5d7ebc4ee9b458fc28cb9e7873f5e1
F test/tester.tcl 949b4a73bd0324b7c796818d0d6a6715712932b3
F test/tester.tcl 4ce5afd5e192db4cae178e1a983b060e0f08c5d6
F test/thread001.test 9f22fd3525a307ff42a326b6bc7b0465be1745a5
F test/thread002.test e630504f8a06c00bf8bbe68528774dd96aeb2e58
F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7
@@ -1142,6 +1154,7 @@ F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b
F test/threadtest2.c a70a8e94bef23339d34226eb9521015ef99f4df8
F test/threadtest3.c 38a612ea62854349ed66372f330a40d73c5cf956
F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925
F test/time-wordcount.sh 8e0b0f8109367827ad5d58f5cc849705731e4b90
F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c
F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660
F test/tkt-2a5629202f.test 0521bd25658428baa26665aa53ffed9367d33af2
@@ -1311,7 +1324,7 @@ F test/tt3_lookaside1.c 0377e202c3c2a50d688cb65ba203afeda6fafeb9
F test/tt3_stress.c c57d804716165811d979d4a719e05baccd79277f
F test/tt3_vacuum.c 1753f45917699c9c1f66b64c717a717c9379f776
F test/types.test bf816ce73c7dfcfe26b700c19f97ef4050d194ff
F test/types2.test 3555aacf8ed8dc883356e59efc314707e6247a84
F test/types2.test 1aeb81976841a91eef292723649b5c4fe3bc3cac
F test/types3.test 99e009491a54f4dc02c06bdbc0c5eea56ae3e25a
F test/unique.test 93f8b2ef5ea51b9495f8d6493429b1fd0f465264
F test/unique2.test 3674e9f2a3f1fbbfd4772ac74b7a97090d0f77d2
@@ -1325,6 +1338,7 @@ F test/vacuum.test ce91c39f7f91a4273bf620efad21086b5aa6ef1d
F test/vacuum2.test aa048abee196c16c9ba308465494009057b79f9b
F test/vacuum3.test 77ecdd54592b45a0bcb133339f99f1ae0ae94d0d
F test/vacuum4.test d3f8ecff345f166911568f397d2432c16d2867d9
F test/vacuum5.test 99d4a0629252f9ef2fc642caefe92436a744db3a
F test/vacuummem.test e53a3fdca4612a99c515e1afe7934728a2383764
F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
F test/veryquick.test 57ab846bacf7b90cf4e9a672721ea5c5b669b661
@@ -1343,8 +1357,8 @@ F test/vtabB.test 04df5dc531b9f44d9ca65b9c1b79f12b5922a796
F test/vtabC.test 4528f459a13136f982e75614d120aef165f17292
F test/vtabD.test 05b3f1d77117271671089e48719524b676842e96
F test/vtabE.test d5024aa42754962f6bb0afd261681686488e7afe
F test/vtabF.test fd5ad376f5a34fe0891df1f3cddb4fe7c3eb077e
F test/vtabH.test 5f5157a1501d9889ec35c1a1832f69612dd31444
F test/vtabF.test 1918844c7c902f6a16c8dacf1ec8f84886d6e78b
F test/vtabH.test 97f61b0253260831af6232163f7852e2653baed6
F test/vtabI.test 751b07636700dbdea328e4265b6077ccd6811a3f
F test/vtab_alter.test 9e374885248f69e251bdaacf480b04a197f125e5
F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8
@@ -1374,7 +1388,7 @@ F test/walmode.test 4022fe03ae6e830583672caa101f046438a0473c
F test/walnoshm.test 84ca10c544632a756467336b7c3b864d493ee496
F test/waloverwrite.test dad2f26567f1b45174e54fbf9a8dc1cb876a7f03
F test/walpersist.test 8c6b7e3ec1ba91b5e4dc4e0921d6d3f87cd356a6
F test/walprotocol.test 059cb75484a1ecf6357a2c1b3324b8156749221e
F test/walprotocol.test 0b92feb132ccebd855494d917d3f6c2d717ace20
F test/walro.test 4ab7ac01b77c2f894235c699d59e3e3c7f15a160
F test/walshared.test 0befc811dcf0b287efae21612304d15576e35417
F test/walslow.test c05c68d4dc2700a982f89133ce103a1a84cc285f
@@ -1416,13 +1430,13 @@ F test/without_rowid3.test aad4f9d383e199349b6c7e508a778f7dff5dff79
F test/without_rowid4.test 4e08bcbaee0399f35d58b5581881e7a6243d458a
F test/without_rowid5.test 89b1c587bd92a0590e440da33e7666bf4891572a
F test/without_rowid6.test 1f99644e6508447fb050f73697350c7ceca3392e
F test/wordcount.c 2a0a6c0d0e8e8bbbac1f06d72a6791828c37c0cf
F test/wordcount.c 97856eec21fd00d77da720007b1888c383f63dcf
F test/zeroblob.test 3857870fe681b8185654414a9bccfde80b62a0fa
F test/zerodamage.test e59a56443d6298ecf7435f618f0b27654f0c849e
F tool/GetFile.cs a15e08acb5dd7539b75ba23501581d7c2b462cb5
F tool/GetTclKit.bat 629d87562e0487c386db630033931d12d62e6372
F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91
F tool/addopcodes.tcl 2b089684eb8b7d0db64cf9d8e6d2fe1b6d279e8d
F tool/addopcodes.tcl 10c889c4a65ec6c5604e4a47306fa77ff57ae189
F tool/build-all-msvc.bat 3e4e4043b53f1aede4308e0d2567bbd773614630 x
F tool/build-shell.sh 950f47c6174f1eea171319438b93ba67ff5bf367
F tool/cg_anno.tcl 692ce4b8693d59e3a3de77ca97f4139ecfa641b0 x
@@ -1431,12 +1445,12 @@ F tool/dbhash.c a06228aa21ebc4e6ea8daa486601d938499238a5
F tool/extract.c 054069d81b095fbdc189a6f5d4466e40380505e2
F tool/fast_vacuum.c 5ba0d6f5963a0a63bdc42840f678bad75b2ebce1
F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439
F tool/fuzzershell.c 94019b185caceffc9f7c7b678a6489e42bc2aefa
F tool/fuzzershell.c f294ca67a10e87db76af130d75b2c94be36359c6
F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4
F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5
F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce
F tool/lemon.c 09a96bed19955697a5e20c49ad863ec2005815a2
F tool/lempar.c 57ffa9852901f6abc45981f0d882f31d1ccb06c0
F tool/lemon.c e4fb7d888873ac88f20a41c84a7d1e61f5209a6d
F tool/lempar.c 147e42a5cd83ce38275fde0d07a5df3330cb9b3b
F tool/libvers.c caafc3b689638a1d88d44bc5f526c2278760d9b9
F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862
F tool/logest.c 11346aa019e2e77a00902aa7d0cabd27bd2e8cca
@@ -1448,7 +1462,7 @@ F tool/mkopcodeh.tcl a01d2c1d8a6205b03fc635adf3735b4c523befd3
F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
F tool/mkpragmatab.tcl f0d5bb266d1d388cf86fce5ba01a891e95d72d41
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
F tool/mksqlite3c-noext.tcl 87240b09c20042999b41d5fabe091b7111287835
F tool/mksqlite3c-noext.tcl aa58ea3be311c81821c2cd3209f55e46b07ab656
F tool/mksqlite3c.tcl 63af8429841f08552e6da1d93b3dee4a93ff8071
F tool/mksqlite3h.tcl e7b106fc4f29fbc258e8ba9b88d9108332ea2ade
F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b
@@ -1457,7 +1471,7 @@ F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091
F tool/omittest.tcl 34d7ac01fe4fd18e3637f64abe12c40eca0f6b97
F tool/opcodesum.tcl 740ed206ba8c5040018988129abbf3089a0ccf4a
F tool/pagesig.c ff0ca355fd3c2398e933da5e22439bbff89b803b
F tool/replace.tcl 7727c60a04299b65a92f5e1590896fea0f25b9e0
F tool/replace.tcl 60f91e8dd06ab81f74d213ecbd9c9945f32ac048
F tool/restore_jrnl.tcl 6957a34f8f1f0f8285e07536225ec3b292a9024a
F tool/rollback-test.c 9fc98427d1e23e84429d7e6d07d9094fbdec65a5
F tool/run-speed-test.sh f95d19fd669b68c4c38b6b475242841d47c66076
@@ -1475,7 +1489,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 7ce07da76b5e745783e703a834417d725b7d45fd
F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c
F tool/sqldiff.c 4478f0d30230de6adde90bdb0bfe60f68c5ab782
F tool/sqldiff.c 7f567367d87fdb493e3e65169569a10d9f330c3f
F tool/srcck1.c 371de5363b70154012955544f86fdee8f6e5326f
F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43
F tool/symbols-mingw.sh 4dbcea7e74768305384c9fd2ed2b41bbf9f0414d
@@ -1508,7 +1522,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 81f9cf86c48f3cd43755ded4dc97388ec650f8af
R ae8bfc7314166cec8de9b44e7e9859e8
U drh
Z 7b0f6930a62d02daa8f4147d6dafd3a6
P bbab9621f512b04684163b98b6fc669c68038044
R 09b192e18dc26d97d5a589656b60205f
U dan
Z 3d9ebf68fced17edbc91ddfab98198fe
+1 -1
View File
@@ -1 +1 @@
805d01cdabb48a69eb986a7f084e53eb25d76b7f
7f2c5c9ee3628c968306a5ab2e5a9a761f1b8055
+2 -2
View File
@@ -413,7 +413,7 @@ void sqlite3AlterRenameTable(
pTab = sqlite3LocateTableItem(pParse, 0, &pSrc->a[0]);
if( !pTab ) goto exit_rename_table;
iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
zDb = db->aDb[iDb].zName;
zDb = db->aDb[iDb].zDbSName;
db->flags |= SQLITE_PreferBuiltin;
/* Get a NULL terminated version of the new table name. */
@@ -611,7 +611,7 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
assert( sqlite3BtreeHoldsAllMutexes(db) );
iDb = sqlite3SchemaToIndex(db, pNew->pSchema);
zDb = db->aDb[iDb].zName;
zDb = db->aDb[iDb].zDbSName;
zTab = &pNew->zName[16]; /* Skip the "sqlite_altertab_" prefix on the name */
pCol = &pNew->aCol[pNew->nCol-1];
pDflt = pCol->pDflt;
+6 -6
View File
@@ -210,14 +210,14 @@ static void openStatTable(
for(i=0; i<ArraySize(aTable); i++){
const char *zTab = aTable[i].zName;
Table *pStat;
if( (pStat = sqlite3FindTable(db, zTab, pDb->zName))==0 ){
if( (pStat = sqlite3FindTable(db, zTab, pDb->zDbSName))==0 ){
if( aTable[i].zCols ){
/* The sqlite_statN table does not exist. Create it. Note that a
** side-effect of the CREATE TABLE statement is to leave the rootpage
** of the new table in register pParse->regRoot. This is important
** because the OpenWrite opcode below will be needing it. */
sqlite3NestedParse(pParse,
"CREATE TABLE %Q.%s(%s)", pDb->zName, zTab, aTable[i].zCols
"CREATE TABLE %Q.%s(%s)", pDb->zDbSName, zTab, aTable[i].zCols
);
aRoot[i] = pParse->regRoot;
aCreateTbl[i] = OPFLAG_P2ISREG;
@@ -232,7 +232,7 @@ static void openStatTable(
if( zWhere ){
sqlite3NestedParse(pParse,
"DELETE FROM %Q.%s WHERE %s=%Q",
pDb->zName, zTab, zWhereType, zWhere
pDb->zDbSName, zTab, zWhereType, zWhere
);
}else{
/* The sqlite_stat[134] table already exists. Delete all rows. */
@@ -994,7 +994,7 @@ static void analyzeOneTable(
assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
#ifndef SQLITE_OMIT_AUTHORIZATION
if( sqlite3AuthCheck(pParse, SQLITE_ANALYZE, pTab->zName, 0,
db->aDb[iDb].zName ) ){
db->aDb[iDb].zDbSName ) ){
return;
}
#endif
@@ -1384,7 +1384,7 @@ void sqlite3Analyze(Parse *pParse, Token *pName1, Token *pName2){
/* Form 3: Analyze the fully qualified table name */
iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pTableName);
if( iDb>=0 ){
zDb = db->aDb[iDb].zName;
zDb = db->aDb[iDb].zDbSName;
z = sqlite3NameFromToken(db, pTableName);
if( z ){
if( (pIdx = sqlite3FindIndex(db, z, zDb))!=0 ){
@@ -1844,7 +1844,7 @@ int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
/* Load new statistics out of the sqlite_stat1 table */
sInfo.db = db;
sInfo.zDatabase = db->aDb[iDb].zName;
sInfo.zDatabase = db->aDb[iDb].zDbSName;
if( sqlite3FindTable(db, "sqlite_stat1", sInfo.zDatabase)!=0 ){
zSql = sqlite3MPrintf(db,
"SELECT tbl,idx,stat FROM %Q.sqlite_stat1", sInfo.zDatabase);
+5 -5
View File
@@ -97,7 +97,7 @@ static void attachFunc(
goto attach_error;
}
for(i=0; i<db->nDb; i++){
char *z = db->aDb[i].zName;
char *z = db->aDb[i].zDbSName;
assert( z && zName );
if( sqlite3StrICmp(z, zName)==0 ){
zErrDyn = sqlite3MPrintf(db, "database %s is already in use", zName);
@@ -162,8 +162,8 @@ static void attachFunc(
sqlite3BtreeLeave(aNew->pBt);
}
aNew->safety_level = SQLITE_DEFAULT_SYNCHRONOUS+1;
aNew->zName = sqlite3DbStrDup(db, zName);
if( rc==SQLITE_OK && aNew->zName==0 ){
aNew->zDbSName = sqlite3DbStrDup(db, zName);
if( rc==SQLITE_OK && aNew->zDbSName==0 ){
rc = SQLITE_NOMEM_BKPT;
}
@@ -275,7 +275,7 @@ static void detachFunc(
for(i=0; i<db->nDb; i++){
pDb = &db->aDb[i];
if( pDb->pBt==0 ) continue;
if( sqlite3StrICmp(pDb->zName, zName)==0 ) break;
if( sqlite3StrICmp(pDb->zDbSName, zName)==0 ) break;
}
if( i>=db->nDb ){
@@ -433,7 +433,7 @@ void sqlite3FixInit(
db = pParse->db;
assert( db->nDb>iDb );
pFix->pParse = pParse;
pFix->zDb = db->aDb[iDb].zName;
pFix->zDb = db->aDb[iDb].zDbSName;
pFix->pSchema = db->aDb[iDb].pSchema;
pFix->zType = zType;
pFix->pName = pName;
+3 -3
View File
@@ -107,9 +107,9 @@ int sqlite3AuthReadCol(
const char *zCol, /* Column name */
int iDb /* Index of containing database. */
){
sqlite3 *db = pParse->db; /* Database handle */
char *zDb = db->aDb[iDb].zName; /* Name of attached database */
int rc; /* Auth callback return code */
sqlite3 *db = pParse->db; /* Database handle */
char *zDb = db->aDb[iDb].zDbSName; /* Schema name of attached database */
int rc; /* Auth callback return code */
if( db->init.busy ) return SQLITE_OK;
rc = db->xAuth(db->pAuthArg, SQLITE_READ, zTab,zCol,zDb,pParse->zAuthContext
+22 -11
View File
@@ -196,7 +196,6 @@ sqlite3_backup *sqlite3_backup_init(
p->isAttached = 0;
if( 0==p->pSrc || 0==p->pDest
|| setDestPgsz(p)==SQLITE_NOMEM
|| checkReadTransaction(pDestDb, p->pDest)!=SQLITE_OK
){
/* One (or both) of the named databases did not exist or an OOM
@@ -384,14 +383,6 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){
rc = SQLITE_OK;
}
/* Lock the destination database, if it is not locked already. */
if( SQLITE_OK==rc && p->bDestLocked==0
&& SQLITE_OK==(rc = sqlite3BtreeBeginTrans(p->pDest, 2))
){
p->bDestLocked = 1;
sqlite3BtreeGetMeta(p->pDest, BTREE_SCHEMA_VERSION, &p->iDestSchema);
}
/* If there is no open read-transaction on the source database, open
** one now. If a transaction is opened here, then it will be closed
** before this function exits.
@@ -401,6 +392,24 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){
bCloseTrans = 1;
}
/* If the destination database has not yet been locked (i.e. if this
** is the first call to backup_step() for the current backup operation),
** try to set its page size to the same as the source database. This
** is especially important on ZipVFS systems, as in that case it is
** not possible to create a database file that uses one page size by
** writing to it with another. */
if( p->bDestLocked==0 && rc==SQLITE_OK && setDestPgsz(p)==SQLITE_NOMEM ){
rc = SQLITE_NOMEM;
}
/* Lock the destination database, if it is not locked already. */
if( SQLITE_OK==rc && p->bDestLocked==0
&& SQLITE_OK==(rc = sqlite3BtreeBeginTrans(p->pDest, 2))
){
p->bDestLocked = 1;
sqlite3BtreeGetMeta(p->pDest, BTREE_SCHEMA_VERSION, &p->iDestSchema);
}
/* Do not allow backup if the destination database is in WAL mode
** and the page sizes are different between source and destination */
pgszSrc = sqlite3BtreeGetPageSize(p->pSrc);
@@ -777,13 +786,15 @@ int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){
** sqlite3_backup_step(), we can guarantee that the copy finishes
** within a single call (unless an error occurs). The assert() statement
** checks this assumption - (p->rc) should be set to either SQLITE_DONE
** or an error code.
*/
** or an error code. */
sqlite3_backup_step(&b, 0x7FFFFFFF);
assert( b.rc!=SQLITE_OK );
rc = sqlite3_backup_finish(&b);
if( rc==SQLITE_OK ){
pTo->pBt->btsFlags &= ~BTS_PAGESIZE_FIXED;
}else{
sqlite3PagerClearCache(sqlite3BtreePager(b.pDest));
}
assert( sqlite3BtreeIsInTrans(pTo)==0 );
+1 -1
View File
@@ -6385,7 +6385,7 @@ static void insertCell(
/*
** A CellArray object contains a cache of pointers and sizes for a
** consecutive sequence of cells that might be held multiple pages.
** consecutive sequence of cells that might be held on multiple pages.
*/
typedef struct CellArray CellArray;
struct CellArray {
+37 -29
View File
@@ -153,8 +153,8 @@ void sqlite3FinishCoding(Parse *pParse){
if( pParse->nTableLock>0 && db->init.busy==0 ){
sqlite3UserAuthInit(db);
if( db->auth.authLevel<UAUTH_User ){
pParse->rc = SQLITE_AUTH_USER;
sqlite3ErrorMsg(pParse, "user not authenticated");
pParse->rc = SQLITE_AUTH_USER;
return;
}
}
@@ -318,10 +318,11 @@ Table *sqlite3FindTable(sqlite3 *db, const char *zName, const char *zDatabase){
#endif
for(i=OMIT_TEMPDB; i<db->nDb; i++){
int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */
if( zDatabase!=0 && sqlite3StrICmp(zDatabase, db->aDb[j].zName) ) continue;
assert( sqlite3SchemaMutexHeld(db, j, 0) );
p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName);
if( p ) break;
if( zDatabase==0 || sqlite3StrICmp(zDatabase, db->aDb[j].zDbSName)==0 ){
assert( sqlite3SchemaMutexHeld(db, j, 0) );
p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName);
if( p ) break;
}
}
return p;
}
@@ -395,7 +396,7 @@ Table *sqlite3LocateTableItem(
assert( p->pSchema==0 || p->zDatabase==0 );
if( p->pSchema ){
int iDb = sqlite3SchemaToIndex(pParse->db, p->pSchema);
zDb = pParse->db->aDb[iDb].zName;
zDb = pParse->db->aDb[iDb].zDbSName;
}else{
zDb = p->zDatabase;
}
@@ -423,7 +424,7 @@ Index *sqlite3FindIndex(sqlite3 *db, const char *zName, const char *zDb){
int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */
Schema *pSchema = db->aDb[j].pSchema;
assert( pSchema );
if( zDb && sqlite3StrICmp(zDb, db->aDb[j].zName) ) continue;
if( zDb && sqlite3StrICmp(zDb, db->aDb[j].zDbSName) ) continue;
assert( sqlite3SchemaMutexHeld(db, j, 0) );
p = sqlite3HashFind(&pSchema->idxHash, zName);
if( p ) break;
@@ -492,8 +493,8 @@ void sqlite3CollapseDatabaseArray(sqlite3 *db){
for(i=j=2; i<db->nDb; i++){
struct Db *pDb = &db->aDb[i];
if( pDb->pBt==0 ){
sqlite3DbFree(db, pDb->zName);
pDb->zName = 0;
sqlite3DbFree(db, pDb->zDbSName);
pDb->zDbSName = 0;
continue;
}
if( j<i ){
@@ -713,7 +714,7 @@ int sqlite3FindDbName(sqlite3 *db, const char *zName){
if( zName ){
Db *pDb;
for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){
if( 0==sqlite3StrICmp(pDb->zName, zName) ) break;
if( 0==sqlite3StrICmp(pDb->zDbSName, zName) ) break;
}
}
return i;
@@ -772,7 +773,7 @@ int sqlite3TwoPartName(
return -1;
}
}else{
assert( db->init.iDb==0 || db->init.busy );
assert( db->init.iDb==0 || db->init.busy || (db->flags & SQLITE_Vacuum)!=0);
iDb = db->init.iDb;
*pUnqual = pName1;
}
@@ -883,7 +884,7 @@ void sqlite3StartTable(
SQLITE_CREATE_VIEW,
SQLITE_CREATE_TEMP_VIEW
};
char *zDb = db->aDb[iDb].zName;
char *zDb = db->aDb[iDb].zDbSName;
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){
goto begin_table_error;
}
@@ -902,7 +903,7 @@ void sqlite3StartTable(
** collisions.
*/
if( !IN_DECLARE_VTAB ){
char *zDb = db->aDb[iDb].zName;
char *zDb = db->aDb[iDb].zDbSName;
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
goto begin_table_error;
}
@@ -1995,7 +1996,7 @@ void sqlite3EndTable(
"UPDATE %Q.%s "
"SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q "
"WHERE rowid=#%d",
db->aDb[iDb].zName, SCHEMA_TABLE(iDb),
db->aDb[iDb].zDbSName, SCHEMA_TABLE(iDb),
zType,
p->zName,
p->zName,
@@ -2010,13 +2011,13 @@ void sqlite3EndTable(
/* Check to see if we need to create an sqlite_sequence table for
** keeping track of autoincrement keys.
*/
if( p->tabFlags & TF_Autoincrement ){
if( (p->tabFlags & TF_Autoincrement)!=0 ){
Db *pDb = &db->aDb[iDb];
assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
if( pDb->pSchema->pSeqTab==0 ){
sqlite3NestedParse(pParse,
"CREATE TABLE %Q.sqlite_sequence(name,seq)",
pDb->zName
pDb->zDbSName
);
}
}
@@ -2330,7 +2331,7 @@ static void destroyRootPage(Parse *pParse, int iTable, int iDb){
*/
sqlite3NestedParse(pParse,
"UPDATE %Q.%s SET rootpage=%d WHERE #%d AND rootpage=#%d",
pParse->db->aDb[iDb].zName, SCHEMA_TABLE(iDb), iTable, r1, r1);
pParse->db->aDb[iDb].zDbSName, SCHEMA_TABLE(iDb), iTable, r1, r1);
#endif
sqlite3ReleaseTempReg(pParse, r1);
}
@@ -2406,7 +2407,7 @@ static void sqlite3ClearStatTables(
const char *zName /* Name of index or table */
){
int i;
const char *zDbName = pParse->db->aDb[iDb].zName;
const char *zDbName = pParse->db->aDb[iDb].zDbSName;
for(i=1; i<=4; i++){
char zTab[24];
sqlite3_snprintf(sizeof(zTab),zTab,"sqlite_stat%d",i);
@@ -2459,7 +2460,7 @@ void sqlite3CodeDropTable(Parse *pParse, Table *pTab, int iDb, int isView){
if( pTab->tabFlags & TF_Autoincrement ){
sqlite3NestedParse(pParse,
"DELETE FROM %Q.sqlite_sequence WHERE name=%Q",
pDb->zName, pTab->zName
pDb->zDbSName, pTab->zName
);
}
#endif
@@ -2473,7 +2474,7 @@ void sqlite3CodeDropTable(Parse *pParse, Table *pTab, int iDb, int isView){
*/
sqlite3NestedParse(pParse,
"DELETE FROM %Q.%s WHERE tbl_name=%Q and type!='trigger'",
pDb->zName, SCHEMA_TABLE(iDb), pTab->zName);
pDb->zDbSName, SCHEMA_TABLE(iDb), pTab->zName);
if( !isView && !IsVirtual(pTab) ){
destroyTable(pParse, pTab);
}
@@ -2527,7 +2528,7 @@ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, int noErr){
{
int code;
const char *zTab = SCHEMA_TABLE(iDb);
const char *zDb = db->aDb[iDb].zName;
const char *zDb = db->aDb[iDb].zDbSName;
const char *zArg2 = 0;
if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb)){
goto exit_drop_table;
@@ -2768,7 +2769,7 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
#ifndef SQLITE_OMIT_AUTHORIZATION
if( sqlite3AuthCheck(pParse, SQLITE_REINDEX, pIndex->zName, 0,
db->aDb[iDb].zName ) ){
db->aDb[iDb].zDbSName ) ){
return;
}
#endif
@@ -3020,7 +3021,7 @@ void sqlite3CreateIndex(
goto exit_create_index;
}
}
if( sqlite3FindIndex(db, zName, pDb->zName)!=0 ){
if( sqlite3FindIndex(db, zName, pDb->zDbSName)!=0 ){
if( !ifNotExist ){
sqlite3ErrorMsg(pParse, "index %s already exists", zName);
}else{
@@ -3037,13 +3038,20 @@ void sqlite3CreateIndex(
if( zName==0 ){
goto exit_create_index;
}
/* Automatic index names generated from within sqlite3_declare_vtab()
** must have names that are distinct from normal automatic index names.
** The following statement converts "sqlite3_autoindex..." into
** "sqlite3_butoindex..." in order to make the names distinct.
** The "vtab_err.test" test demonstrates the need of this statement. */
if( IN_DECLARE_VTAB ) zName[7]++;
}
/* Check for authorization to create an index.
*/
#ifndef SQLITE_OMIT_AUTHORIZATION
{
const char *zDb = pDb->zName;
const char *zDb = pDb->zDbSName;
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iDb), 0, zDb) ){
goto exit_create_index;
}
@@ -3358,7 +3366,7 @@ void sqlite3CreateIndex(
*/
sqlite3NestedParse(pParse,
"INSERT INTO %Q.%s VALUES('index',%Q,%Q,#%d,%Q);",
db->aDb[iDb].zName, SCHEMA_TABLE(iDb),
db->aDb[iDb].zDbSName, SCHEMA_TABLE(iDb),
pIndex->zName,
pTab->zName,
iMem,
@@ -3492,7 +3500,7 @@ void sqlite3DropIndex(Parse *pParse, SrcList *pName, int ifExists){
{
int code = SQLITE_DROP_INDEX;
Table *pTab = pIndex->pTable;
const char *zDb = db->aDb[iDb].zName;
const char *zDb = db->aDb[iDb].zDbSName;
const char *zTab = SCHEMA_TABLE(iDb);
if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){
goto exit_drop_index;
@@ -3510,7 +3518,7 @@ void sqlite3DropIndex(Parse *pParse, SrcList *pName, int ifExists){
sqlite3BeginWriteOperation(pParse, 1, iDb);
sqlite3NestedParse(pParse,
"DELETE FROM %Q.%s WHERE name=%Q AND type='index'",
db->aDb[iDb].zName, SCHEMA_TABLE(iDb), pIndex->zName
db->aDb[iDb].zDbSName, SCHEMA_TABLE(iDb), pIndex->zName
);
sqlite3ClearStatTables(pParse, iDb, "idx", pIndex->zName);
sqlite3ChangeCookie(pParse, iDb);
@@ -4055,7 +4063,7 @@ void sqlite3CodeVerifyNamedSchema(Parse *pParse, const char *zDb){
int i;
for(i=0; i<db->nDb; i++){
Db *pDb = &db->aDb[i];
if( pDb->pBt && (!zDb || 0==sqlite3StrICmp(zDb, pDb->zName)) ){
if( pDb->pBt && (!zDb || 0==sqlite3StrICmp(zDb, pDb->zDbSName)) ){
sqlite3CodeVerifySchema(pParse, i);
}
}
@@ -4302,7 +4310,7 @@ void sqlite3Reindex(Parse *pParse, Token *pName1, Token *pName2){
if( iDb<0 ) return;
z = sqlite3NameFromToken(db, pObjName);
if( z==0 ) return;
zDb = db->aDb[iDb].zName;
zDb = db->aDb[iDb].zDbSName;
pTab = sqlite3FindTable(db, z, zDb);
if( pTab ){
reindexTable(pParse, pTab, 0);
-1
View File
@@ -1112,7 +1112,6 @@ static void currentTimeFunc(
){
time_t t;
char *zFormat = (char *)sqlite3_user_data(context);
sqlite3 *db;
sqlite3_int64 iT;
struct tm *pTm;
struct tm sNow;
+2 -2
View File
@@ -602,7 +602,7 @@ static int statFilter(
" UNION ALL "
"SELECT name, rootpage, type"
" FROM \"%w\".%s WHERE rootpage!=0"
" ORDER BY name", pTab->db->aDb[pCsr->iDb].zName, zMaster);
" ORDER BY name", pTab->db->aDb[pCsr->iDb].zDbSName, zMaster);
if( zSql==0 ){
return SQLITE_NOMEM_BKPT;
}else{
@@ -656,7 +656,7 @@ static int statColumn(
default: { /* schema */
sqlite3 *db = sqlite3_context_db_handle(ctx);
int iDb = pCsr->iDb;
sqlite3_result_text(ctx, db->aDb[iDb].zName, -1, SQLITE_STATIC);
sqlite3_result_text(ctx, db->aDb[iDb].zDbSName, -1, SQLITE_STATIC);
break;
}
}
+2 -2
View File
@@ -102,7 +102,7 @@ void sqlite3MaterializeView(
if( pFrom ){
assert( pFrom->nSrc==1 );
pFrom->a[0].zName = sqlite3DbStrDup(db, pView->zName);
pFrom->a[0].zDatabase = sqlite3DbStrDup(db, db->aDb[iDb].zName);
pFrom->a[0].zDatabase = sqlite3DbStrDup(db, db->aDb[iDb].zDbSName);
assert( pFrom->a[0].pOn==0 );
assert( pFrom->a[0].pUsing==0 );
}
@@ -289,7 +289,7 @@ void sqlite3DeleteFrom(
}
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
assert( iDb<db->nDb );
zDb = db->aDb[iDb].zName;
zDb = db->aDb[iDb].zDbSName;
rcauth = sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb);
assert( rcauth==SQLITE_OK || rcauth==SQLITE_DENY || rcauth==SQLITE_IGNORE );
if( rcauth==SQLITE_DENY ){
+952 -270
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -871,7 +871,7 @@ void sqlite3FkCheck(
if( (db->flags&SQLITE_ForeignKeys)==0 ) return;
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
zDb = db->aDb[iDb].zName;
zDb = db->aDb[iDb].zDbSName;
/* Loop through all the foreign key constraints for which pTab is the
** child table (the table that the foreign key definition is part of). */
+26 -3
View File
@@ -1316,6 +1316,26 @@ static void trimFunc(
}
#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
/*
** The "unknown" function is automatically substituted in place of
** any unrecognized function name when doing an EXPLAIN or EXPLAIN QUERY PLAN
** when the SQLITE_ENABLE_UNKNOWN_FUNCTION compile-time option is used.
** When the "sqlite3" command-line shell is built using this functionality,
** that allows an EXPLAIN or EXPLAIN QUERY PLAN for complex queries
** involving application-defined functions to be examined in a generic
** sqlite3 shell.
*/
static void unknownFunc(
sqlite3_context *context,
int argc,
sqlite3_value **argv
){
/* no-op */
}
#endif /*SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION*/
/* IMP: R-25361-16150 This function is omitted from SQLite by default. It
** is only available if the SQLITE_SOUNDEX compile-time option is used
** when SQLite is built.
@@ -1786,13 +1806,16 @@ void sqlite3RegisterBuiltinFunctions(void){
AGGREGATE(group_concat, 2, 0, 0, groupConcatStep, groupConcatFinalize),
LIKEFUNC(glob, 2, &globInfo, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
#ifdef SQLITE_CASE_SENSITIVE_LIKE
#ifdef SQLITE_CASE_SENSITIVE_LIKE
LIKEFUNC(like, 2, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
LIKEFUNC(like, 3, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE),
#else
#else
LIKEFUNC(like, 2, &likeInfoNorm, SQLITE_FUNC_LIKE),
LIKEFUNC(like, 3, &likeInfoNorm, SQLITE_FUNC_LIKE),
#endif
#endif
#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
FUNCTION(unknown, -1, 0, 0, unknownFunc ),
#endif
FUNCTION(coalesce, 1, 0, 0, 0 ),
FUNCTION(coalesce, 0, 0, 0, 0 ),
FUNCTION2(coalesce, -1, 0, 0, noopFunc, SQLITE_FUNC_COALESCE),
+107
View File
@@ -0,0 +1,107 @@
IN-Operator Implementation Notes
================================
## Definitions:
An IN operator has one of the following formats:
>
x IN (y1,y2,y3,...,yN)
x IN (subquery)
The "x" is referred to as the LHS (left-hand side). The list or subquery
on the right is called the RHS (right-hand side). If the RHS is a list
it must be a non-empty list. But if the RHS is a subquery, it can be an
empty set.
The LHS can be a scalar (a single quantity) or a vector (a list of
two or or more values) or a subquery that returns one or more columns.
We use the term "vector" to mean an actually list of values or a
subquery that returns two or more columns. An isolated value or
a subquery that returns a single columns is called a scalar.
The RHS can be a subquery that returns a single column, a subquery
that returns two or more columns, or a list of scalars. It is not
currently support for the RHS to be a list of vectors.
The number of columns for LHS must match the number of columns for
the RHS. If the RHS is a list of values, then the LHS must be a
scalar. If the RHS is a subquery returning N columns, then the LHS
must be a vector of size N.
NULL values can occur in either or both of the LHS and RHS.
If the LHS contains only
NULL values then we say that it is a "total-NULL". If the LHS contains
some NULL values and some non-NULL values, then it is a "partial-NULL".
For a scalar, there is no difference between a partial-NULL and a total-NULL.
The RHS is a partial-NULL if any row contains a NULL value. The RHS is
a total-NULL if it contains one or more rows that contain only NULL values.
The LHS is called "non-NULL" if it contains no NULL values. The RHS is
called "non-NULL" if it contains no NULL values in any row.
The result of an IN operator is one of TRUE, FALSE, or NULL. A NULL result
means that it cannot be determined if the LHS is contained in the RHS due
to the presence of NULL values. In some contexts (for example, when the IN
operator occurs in a WHERE clause)
the system only needs a binary result: TRUE or NOT-TRUE. One can also
to define a binary result of FALSE and NOT-FALSE, but
it turns out that no extra optimizations are possible in that case, so if
the FALSE/NOT-FALSE binary is needed, we have to compute the three-state
TRUE/FALSE/NULL result and then combine the TRUE and NULL values into
NOT-FALSE.
A "NOT IN" operator is computed by first computing the equivalent IN
operator, then interchanging the TRUE and FALSE results.
## Simple Full-Scan Algorithm
The following algorithm always compute the correct answer. However, this
algorithm is suboptimal, especially if there are many rows on the RHS.
1. Set the null-flag to false
2. For each row in the RHS:
<ol type='a'>
<li> Compare the LHS against the RHS
<li> If the LHS exactly matches the RHS, immediately return TRUE
<li> If the comparison result is NULL, set the null-flag to true
</ol>
3. If the null-flag is true, return NULL.
4. Return FALSE
## Optimized Algorithm
The following procedure computes the same answer as the simple full-scan
algorithm, though it does so with less work in the common case. This
is the algorithm that is implemented in SQLite.
1. If the RHS is a constant list of length 1 or 2, then rewrite the
IN operator as a simple expression. Implement
x IN (y1,y2)
as if it were
x=y1 OR x=y2
This is the INDEX_NOOP optimization and is only undertaken if the
IN operator is used for membership testing. If the IN operator is
driving a loop, then skip this step entirely.
2. Check the LHS to see if it is a partial-NULL and if it is, jump
ahead to step 5.
3. Do a binary search of the RHS using the LHS as a probe. If
an exact match is found, return TRUE.
4. If the RHS is non-NULL then return FALSE.
5. If we do not need to distinguish between FALSE and NULL,
then return FALSE.
6. For each row in the RHS, compare that row against the LHS and
if the result is NULL, immediately return NULL. In the case
of a scalar IN operator, we only need to look at the very first
row the RHS because for a scalar RHS, all NULLs will always come
first. If the RHS is empty, this step is a no-op.
7. Return FALSE.
+12 -8
View File
@@ -200,7 +200,9 @@ static int readsTable(Parse *p, int iDb, Table *pTab){
/*
** Locate or create an AutoincInfo structure associated with table pTab
** which is in database iDb. Return the register number for the register
** that holds the maximum rowid.
** that holds the maximum rowid. Return zero if pTab is not an AUTOINCREMENT
** table. (Also return zero when doing a VACUUM since we do not want to
** update the AUTOINCREMENT counters during a VACUUM.)
**
** There is at most one AutoincInfo structure per table even if the
** same table is autoincremented multiple times due to inserts within
@@ -223,7 +225,9 @@ static int autoIncBegin(
Table *pTab /* The table we are writing to */
){
int memId = 0; /* Register holding maximum rowid */
if( pTab->tabFlags & TF_Autoincrement ){
if( (pTab->tabFlags & TF_Autoincrement)!=0
&& (pParse->db->flags & SQLITE_Vacuum)==0
){
Parse *pToplevel = sqlite3ParseToplevel(pParse);
AutoincInfo *pInfo;
@@ -547,7 +551,7 @@ void sqlite3Insert(
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
assert( iDb<db->nDb );
pDb = &db->aDb[iDb];
zDb = pDb->zName;
zDb = pDb->zDbSName;
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0, zDb) ){
goto insert_cleanup;
}
@@ -1777,15 +1781,15 @@ int sqlite3OpenTableAndIndices(
for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
int iIdxCur = iBase++;
assert( pIdx->pSchema==pTab->pSchema );
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
if( piDataCur ) *piDataCur = iIdxCur;
p5 = 0;
}
if( aToOpen==0 || aToOpen[i+1] ){
sqlite3VdbeAddOp3(v, op, iIdxCur, pIdx->tnum, iDb);
sqlite3VdbeSetP4KeyInfo(pParse, pIdx);
VdbeComment((v, "%s", pIdx->zName));
}
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
if( piDataCur ) *piDataCur = iIdxCur;
}else{
sqlite3VdbeChangeP5(v, p5);
VdbeComment((v, "%s", pIdx->zName));
}
}
if( iBase>pParse->nTab ) pParse->nTab = iBase;
+19 -12
View File
@@ -21,7 +21,6 @@
#include <string.h>
#ifndef SQLITE_OMIT_LOAD_EXTENSION
/*
** Some API routines are omitted when various features are
** excluded from a build of SQLite. Substitute a NULL pointer
@@ -111,6 +110,10 @@
#define sqlite3_blob_reopen 0
#endif
#if defined(SQLITE_OMIT_TRACE)
# define sqlite3_trace_v2 0
#endif
/*
** The following structure contains pointers to all SQLite API routines.
** A pointer to this structure is passed into extensions when they are
@@ -416,7 +419,10 @@ static const sqlite3_api_routines sqlite3Apis = {
sqlite3_strlike,
sqlite3_db_cacheflush,
/* Version 3.12.0 and later */
sqlite3_system_errno
sqlite3_system_errno,
/* Version 3.14.0 and later */
sqlite3_trace_v2,
sqlite3_expanded_sql
};
/*
@@ -439,7 +445,7 @@ static int sqlite3LoadExtension(
){
sqlite3_vfs *pVfs = db->pVfs;
void *handle;
int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
sqlite3_loadext_entry xInit;
char *zErrmsg = 0;
const char *zEntry;
char *zAltEntry = 0;
@@ -498,8 +504,7 @@ static int sqlite3LoadExtension(
}
return SQLITE_ERROR;
}
xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
sqlite3OsDlSym(pVfs, handle, zEntry);
xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry);
/* If no entry point was specified and the default legacy
** entry point name "sqlite3_extension_init" was not found, then
@@ -531,8 +536,7 @@ static int sqlite3LoadExtension(
}
memcpy(zAltEntry+iEntry, "_init", 6);
zEntry = zAltEntry;
xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
sqlite3OsDlSym(pVfs, handle, zEntry);
xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry);
}
if( xInit==0 ){
if( pzErrMsg ){
@@ -662,7 +666,9 @@ static SQLITE_WSD struct sqlite3AutoExtList {
** Register a statically linked extension that is automatically
** loaded by every new database connection.
*/
int sqlite3_auto_extension(void (*xInit)(void)){
int sqlite3_auto_extension(
void (*xInit)(void)
){
int rc = SQLITE_OK;
#ifndef SQLITE_OMIT_AUTOINIT
rc = sqlite3_initialize();
@@ -707,7 +713,9 @@ int sqlite3_auto_extension(void (*xInit)(void)){
** Return 1 if xInit was found on the list and removed. Return 0 if xInit
** was not on the list.
*/
int sqlite3_cancel_auto_extension(void (*xInit)(void)){
int sqlite3_cancel_auto_extension(
void (*xInit)(void)
){
#if SQLITE_THREADSAFE
sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
#endif
@@ -756,7 +764,7 @@ void sqlite3AutoLoadExtensions(sqlite3 *db){
u32 i;
int go = 1;
int rc;
int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*);
sqlite3_loadext_entry xInit;
wsdAutoextInit;
if( wsdAutoext.nExt==0 ){
@@ -773,8 +781,7 @@ void sqlite3AutoLoadExtensions(sqlite3 *db){
xInit = 0;
go = 0;
}else{
xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*))
wsdAutoext.aExt[i];
xInit = (sqlite3_loadext_entry)wsdAutoext.aExt[i];
}
sqlite3_mutex_leave(mutex);
zErrmsg = 0;
+20 -10
View File
@@ -789,6 +789,11 @@ int sqlite3_db_config(sqlite3 *db, int op, ...){
int rc;
va_start(ap, op);
switch( op ){
case SQLITE_DBCONFIG_MAINDBNAME: {
db->aDb[0].zDbSName = va_arg(ap,char*);
rc = SQLITE_OK;
break;
}
case SQLITE_DBCONFIG_LOOKASIDE: {
void *pBuf = va_arg(ap, void*); /* IMP: R-26835-10964 */
int sz = va_arg(ap, int); /* IMP: R-47871-25994 */
@@ -1838,6 +1843,8 @@ int sqlite3_trace_v2(
}
#endif
sqlite3_mutex_enter(db->mutex);
if( mTrace==0 ) xTrace = 0;
if( xTrace==0 ) mTrace = 0;
db->mTrace = mTrace;
db->xTrace = xTrace;
db->pTraceArg = pArg;
@@ -2932,9 +2939,9 @@ static int openDatabase(
/* The default safety_level for the main database is FULL; for the temp
** database it is OFF. This matches the pager layer defaults.
*/
db->aDb[0].zName = "main";
db->aDb[0].zDbSName = "main";
db->aDb[0].safety_level = SQLITE_DEFAULT_SYNCHRONOUS+1;
db->aDb[1].zName = "temp";
db->aDb[1].zDbSName = "temp";
db->aDb[1].safety_level = PAGER_SYNCHRONOUS_OFF;
db->magic = SQLITE_MAGIC_OPEN;
@@ -2948,11 +2955,20 @@ static int openDatabase(
*/
sqlite3Error(db, SQLITE_OK);
sqlite3RegisterPerConnectionBuiltinFunctions(db);
rc = sqlite3_errcode(db);
#ifdef SQLITE_ENABLE_FTS5
/* Register any built-in FTS5 module before loading the automatic
** extensions. This allows automatic extensions to register FTS5
** tokenizers and auxiliary functions. */
if( !db->mallocFailed && rc==SQLITE_OK ){
rc = sqlite3Fts5Init(db);
}
#endif
/* Load automatic extensions - extensions that have been registered
** using the sqlite3_automatic_extension() API.
*/
rc = sqlite3_errcode(db);
if( rc==SQLITE_OK ){
sqlite3AutoLoadExtensions(db);
rc = sqlite3_errcode(db);
@@ -2981,12 +2997,6 @@ static int openDatabase(
}
#endif
#ifdef SQLITE_ENABLE_FTS5
if( !db->mallocFailed && rc==SQLITE_OK ){
rc = sqlite3Fts5Init(db);
}
#endif
#ifdef SQLITE_ENABLE_ICU
if( !db->mallocFailed && rc==SQLITE_OK ){
rc = sqlite3IcuInit(db);
@@ -3895,7 +3905,7 @@ Btree *sqlite3DbNameToBtree(sqlite3 *db, const char *zDbName){
int i;
for(i=0; i<db->nDb; i++){
if( db->aDb[i].pBt
&& (zDbName==0 || sqlite3StrICmp(zDbName, db->aDb[i].zName)==0)
&& (zDbName==0 || sqlite3StrICmp(zDbName, db->aDb[i].zDbSName)==0)
){
return db->aDb[i].pBt;
}
+31 -8
View File
@@ -5529,6 +5529,27 @@ static UnixUnusedFd *findReusableFd(const char *zPath, int flags){
return pUnused;
}
/*
** Find the mode, uid and gid of file zFile.
*/
static int getFileMode(
const char *zFile, /* File name */
mode_t *pMode, /* OUT: Permissions of zFile */
uid_t *pUid, /* OUT: uid of zFile. */
gid_t *pGid /* OUT: gid of zFile. */
){
struct stat sStat; /* Output of stat() on database file */
int rc = SQLITE_OK;
if( 0==osStat(zFile, &sStat) ){
*pMode = sStat.st_mode & 0777;
*pUid = sStat.st_uid;
*pGid = sStat.st_gid;
}else{
rc = SQLITE_IOERR_FSTAT;
}
return rc;
}
/*
** This function is called by unixOpen() to determine the unix permissions
** to create new files with. If no error occurs, then SQLITE_OK is returned
@@ -5564,7 +5585,6 @@ static int findCreateFileMode(
if( flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL) ){
char zDb[MAX_PATHNAME+1]; /* Database file path */
int nDb; /* Number of valid bytes in zDb */
struct stat sStat; /* Output of stat() on database file */
/* zPath is a path to a WAL or journal file. The following block derives
** the path to the associated database file from zPath. This block handles
@@ -5595,15 +5615,18 @@ static int findCreateFileMode(
memcpy(zDb, zPath, nDb);
zDb[nDb] = '\0';
if( 0==osStat(zDb, &sStat) ){
*pMode = sStat.st_mode & 0777;
*pUid = sStat.st_uid;
*pGid = sStat.st_gid;
}else{
rc = SQLITE_IOERR_FSTAT;
}
rc = getFileMode(zDb, pMode, pUid, pGid);
}else if( flags & SQLITE_OPEN_DELETEONCLOSE ){
*pMode = 0600;
}else if( flags & SQLITE_OPEN_URI ){
/* If this is a main database file and the file was opened using a URI
** filename, check for the "modeof" parameter. If present, interpret
** its value as a filename and try to copy the mode, uid and gid from
** that file. */
const char *z = sqlite3_uri_parameter(zPath, "modeof");
if( z ){
rc = getFileMode(z, pMode, pUid, pGid);
}
}
return rc;
}
+30 -2
View File
@@ -6656,7 +6656,11 @@ int sqlite3PagerOpenSavepoint(Pager *pPager, int nSavepoint){
** savepoint. If no errors occur, SQLITE_OK is returned.
*/
int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){
int rc = pPager->errCode; /* Return code */
int rc = pPager->errCode;
#ifdef SQLITE_ENABLE_ZIPVFS
if( op==SAVEPOINT_RELEASE ) rc = SQLITE_OK;
#endif
assert( op==SAVEPOINT_RELEASE || op==SAVEPOINT_ROLLBACK );
assert( iSavepoint>=0 || op==SAVEPOINT_ROLLBACK );
@@ -6697,6 +6701,20 @@ int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){
rc = pagerPlaybackSavepoint(pPager, pSavepoint);
assert(rc!=SQLITE_DONE);
}
#ifdef SQLITE_ENABLE_ZIPVFS
/* If the cache has been modified but the savepoint cannot be rolled
** back journal_mode=off, put the pager in the error state. This way,
** if the VFS used by this pager includes ZipVFS, the entire transaction
** can be rolled back at the ZipVFS level. */
else if(
pPager->journalMode==PAGER_JOURNALMODE_OFF
&& pPager->eState>=PAGER_WRITER_CACHEMOD
){
pPager->errCode = SQLITE_ABORT;
pPager->eState = PAGER_ERROR;
}
#endif
}
return rc;
@@ -7157,6 +7175,17 @@ sqlite3_backup **sqlite3PagerBackupPtr(Pager *pPager){
return &pPager->pBackup;
}
#ifndef SQLITE_OMIT_VACUUM
/*
** Unless this is an in-memory or temporary database, clear the pager cache.
*/
void sqlite3PagerClearCache(Pager *pPager){
assert( MEMDB==0 || pPager->tempFile );
if( pPager->tempFile==0 ) pager_reset(pPager);
}
#endif
#ifndef SQLITE_OMIT_WAL
/*
** This function is called when the user invokes "PRAGMA wal_checkpoint",
@@ -7382,5 +7411,4 @@ int sqlite3PagerWalFramesize(Pager *pPager){
}
#endif
#endif /* SQLITE_OMIT_DISKIO */
+1
View File
@@ -203,6 +203,7 @@ const char *sqlite3PagerJournalname(Pager*);
void *sqlite3PagerTempSpace(Pager*);
int sqlite3PagerIsMemdb(Pager*);
void sqlite3PagerCacheStat(Pager *, int, int, int *);
void sqlite3PagerClearCache(Pager*);
int sqlite3SectorSize(sqlite3_file *);
/* Functions used to truncate the database file. */
+19 -2
View File
@@ -789,10 +789,16 @@ setlist(A) ::= setlist(A) COMMA nm(X) EQ expr(Y). {
A = sqlite3ExprListAppend(pParse, A, Y.pExpr);
sqlite3ExprListSetName(pParse, A, &X, 1);
}
setlist(A) ::= setlist(A) COMMA LP idlist(X) RP EQ expr(Y). {
A = sqlite3ExprListAppendVector(pParse, A, X, Y.pExpr);
}
setlist(A) ::= nm(X) EQ expr(Y). {
A = sqlite3ExprListAppend(pParse, 0, Y.pExpr);
sqlite3ExprListSetName(pParse, A, &X, 1);
}
setlist(A) ::= LP idlist(X) RP EQ expr(Y). {
A = sqlite3ExprListAppendVector(pParse, 0, X, Y.pExpr);
}
////////////////////////// The INSERT command /////////////////////////////////
//
@@ -946,6 +952,17 @@ term(A) ::= CTIME_KW(OP). {
}
}
expr(A) ::= LP(L) nexprlist(X) COMMA expr(Y) RP(R). {
ExprList *pList = sqlite3ExprListAppend(pParse, X, Y.pExpr);
A.pExpr = sqlite3PExpr(pParse, TK_VECTOR, 0, 0, 0);
if( A.pExpr ){
A.pExpr->x.pList = pList;
spanSet(&A, &L, &R);
}else{
sqlite3ExprListDelete(pParse->db, pList);
}
}
expr(A) ::= expr(A) AND(OP) expr(Y). {spanBinaryExpr(pParse,@OP,&A,&Y);}
expr(A) ::= expr(A) OR(OP) expr(Y). {spanBinaryExpr(pParse,@OP,&A,&Y);}
expr(A) ::= expr(A) LT|GT|GE|LE(OP) expr(Y).
@@ -1285,8 +1302,8 @@ cmd ::= DROP INDEX ifexists(E) fullname(X). {sqlite3DropIndex(pParse, X, E);}
//
%ifndef SQLITE_OMIT_VACUUM
%ifndef SQLITE_OMIT_ATTACH
cmd ::= VACUUM. {sqlite3Vacuum(pParse);}
cmd ::= VACUUM nm. {sqlite3Vacuum(pParse);}
cmd ::= VACUUM. {sqlite3Vacuum(pParse,0);}
cmd ::= VACUUM nm(X). {sqlite3Vacuum(pParse,&X);}
%endif SQLITE_OMIT_ATTACH
%endif SQLITE_OMIT_VACUUM
+27 -7
View File
@@ -632,12 +632,30 @@ static void pcache1TruncateUnsafe(
PCache1 *pCache, /* The cache to truncate */
unsigned int iLimit /* Drop pages with this pgno or larger */
){
TESTONLY( unsigned int nPage = 0; ) /* To assert pCache->nPage is correct */
unsigned int h;
TESTONLY( int nPage = 0; ) /* To assert pCache->nPage is correct */
unsigned int h, iStop;
assert( sqlite3_mutex_held(pCache->pGroup->mutex) );
for(h=0; h<pCache->nHash; h++){
PgHdr1 **pp = &pCache->apHash[h];
assert( pCache->iMaxKey >= iLimit );
assert( pCache->nHash > 0 );
if( pCache->iMaxKey - iLimit < pCache->nHash ){
/* If we are just shaving the last few pages off the end of the
** cache, then there is no point in scanning the entire hash table.
** Only scan those hash slots that might contain pages that need to
** be removed. */
h = iLimit % pCache->nHash;
iStop = pCache->iMaxKey % pCache->nHash;
TESTONLY( nPage = -10; ) /* Disable the pCache->nPage validity check */
}else{
/* This is the general case where many pages are being removed.
** It is necessary to scan the entire hash table */
h = pCache->nHash/2;
iStop = h - 1;
}
for(;;){
PgHdr1 **pp;
PgHdr1 *pPage;
assert( h<pCache->nHash );
pp = &pCache->apHash[h];
while( (pPage = *pp)!=0 ){
if( pPage->iKey>=iLimit ){
pCache->nPage--;
@@ -646,11 +664,13 @@ static void pcache1TruncateUnsafe(
pcache1FreePage(pPage);
}else{
pp = &pPage->pNext;
TESTONLY( nPage++; )
TESTONLY( if( nPage>=0 ) nPage++; )
}
}
if( h==iStop ) break;
h = (h+1) % pCache->nHash;
}
assert( pCache->nPage==nPage );
assert( nPage<0 || pCache->nPage==(unsigned)nPage );
}
/******************************************************************************/
@@ -1127,7 +1147,7 @@ static void pcache1Destroy(sqlite3_pcache *p){
PGroup *pGroup = pCache->pGroup;
assert( pCache->bPurgeable || (pCache->nMax==0 && pCache->nMin==0) );
pcache1EnterMutex(pGroup);
pcache1TruncateUnsafe(pCache, 0);
if( pCache->nPage ) pcache1TruncateUnsafe(pCache, 0);
assert( pGroup->nMaxPage >= pCache->nMax );
pGroup->nMaxPage -= pCache->nMax;
assert( pGroup->nMinPage >= pCache->nMin );
+7 -7
View File
@@ -338,7 +338,7 @@ void sqlite3Pragma(
}
assert( pId2 );
zDb = pId2->n>0 ? pDb->zName : 0;
zDb = pId2->n>0 ? pDb->zDbSName : 0;
if( sqlite3AuthCheck(pParse, SQLITE_PRAGMA, zLeft, zRight, zDb) ){
goto pragma_out;
}
@@ -1191,10 +1191,10 @@ void sqlite3Pragma(
setAllColumnNames(v, 3, azCol); assert( 3==ArraySize(azCol) );
for(i=0; i<db->nDb; i++){
if( db->aDb[i].pBt==0 ) continue;
assert( db->aDb[i].zName!=0 );
assert( db->aDb[i].zDbSName!=0 );
sqlite3VdbeMultiLoad(v, 1, "iss",
i,
db->aDb[i].zName,
db->aDb[i].zDbSName,
sqlite3BtreeGetFilename(db->aDb[i].pBt));
sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 3);
}
@@ -1483,7 +1483,7 @@ void sqlite3Pragma(
sqlite3VdbeChangeP5(v, (u8)i);
addr = sqlite3VdbeAddOp1(v, OP_IsNull, 2); VdbeCoverage(v);
sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0,
sqlite3MPrintf(db, "*** in database %s ***\n", db->aDb[i].zName),
sqlite3MPrintf(db, "*** in database %s ***\n", db->aDb[i].zDbSName),
P4_DYNAMIC);
sqlite3VdbeAddOp3(v, OP_Move, 2, 4, 1);
sqlite3VdbeAddOp3(v, OP_Concat, 4, 3, 2);
@@ -1922,15 +1922,15 @@ void sqlite3Pragma(
Btree *pBt;
const char *zState = "unknown";
int j;
if( db->aDb[i].zName==0 ) continue;
if( db->aDb[i].zDbSName==0 ) continue;
pBt = db->aDb[i].pBt;
if( pBt==0 || sqlite3BtreePager(pBt)==0 ){
zState = "closed";
}else if( sqlite3_file_control(db, i ? db->aDb[i].zName : 0,
}else if( sqlite3_file_control(db, i ? db->aDb[i].zDbSName : 0,
SQLITE_FCNTL_LOCKSTATE, &j)==SQLITE_OK ){
zState = azLockName[j];
}
sqlite3VdbeMultiLoad(v, 1, "ss", db->aDb[i].zName, zState);
sqlite3VdbeMultiLoad(v, 1, "ss", db->aDb[i].zDbSName, zState);
sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 2);
}
break;
+6 -4
View File
@@ -73,6 +73,7 @@ int sqlite3InitCallback(void *pInit, int argc, char **argv, char **NotUsed){
** structures that describe the table, index, or view.
*/
int rc;
u8 saved_iDb = db->init.iDb;
sqlite3_stmt *pStmt;
TESTONLY(int rcp); /* Return code from sqlite3_prepare() */
@@ -83,7 +84,8 @@ int sqlite3InitCallback(void *pInit, int argc, char **argv, char **NotUsed){
TESTONLY(rcp = ) sqlite3_prepare(db, argv[2], -1, &pStmt, 0);
rc = db->errCode;
assert( (rc&0xFF)==(rcp&0xFF) );
db->init.iDb = 0;
db->init.iDb = saved_iDb;
assert( saved_iDb==0 || (db->flags & SQLITE_Vacuum)!=0 );
if( SQLITE_OK!=rc ){
if( db->init.orphanTrigger ){
assert( iDb==1 );
@@ -107,7 +109,7 @@ int sqlite3InitCallback(void *pInit, int argc, char **argv, char **NotUsed){
** to do here is record the root page number for that index.
*/
Index *pIndex;
pIndex = sqlite3FindIndex(db, argv[0], db->aDb[iDb].zName);
pIndex = sqlite3FindIndex(db, argv[0], db->aDb[iDb].zDbSName);
if( pIndex==0 ){
/* This can occur if there exists an index on a TEMP table which
** has the same name as another index on a permanent index. Since
@@ -286,7 +288,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){
char *zSql;
zSql = sqlite3MPrintf(db,
"SELECT name, rootpage, sql FROM \"%w\".%s ORDER BY rowid",
db->aDb[iDb].zName, zMasterName);
db->aDb[iDb].zDbSName, zMasterName);
#ifndef SQLITE_OMIT_AUTHORIZATION
{
sqlite3_xauth xAuth;
@@ -561,7 +563,7 @@ static int sqlite3Prepare(
assert( sqlite3BtreeHoldsMutex(pBt) );
rc = sqlite3BtreeSchemaLocked(pBt);
if( rc ){
const char *zDb = db->aDb[i].zName;
const char *zDb = db->aDb[i].zDbSName;
sqlite3ErrorWithMsg(db, rc, "database schema is locked: %s", zDb);
testcase( db->flags & SQLITE_ReadUncommitted );
goto end_prepare;
+34 -3
View File
@@ -221,8 +221,8 @@ static int lookupName(
zDb = 0;
}else{
for(i=0; i<db->nDb; i++){
assert( db->aDb[i].zName );
if( sqlite3StrICmp(db->aDb[i].zName,zDb)==0 ){
assert( db->aDb[i].zDbSName );
if( sqlite3StrICmp(db->aDb[i].zDbSName,zDb)==0 ){
pSchema = db->aDb[i].pSchema;
break;
}
@@ -718,7 +718,11 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
sqlite3ErrorMsg(pParse, "misuse of aggregate function %.*s()", nId,zId);
pNC->nErr++;
is_agg = 0;
}else if( no_such_func && pParse->db->init.busy==0 ){
}else if( no_such_func && pParse->db->init.busy==0
#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
&& pParse->explain==0
#endif
){
sqlite3ErrorMsg(pParse, "no such function: %.*s", nId, zId);
pNC->nErr++;
}else if( wrong_num_args ){
@@ -772,6 +776,33 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
notValid(pParse, pNC, "parameters", NC_IsCheck|NC_PartIdx|NC_IdxExpr);
break;
}
case TK_EQ:
case TK_NE:
case TK_LT:
case TK_LE:
case TK_GT:
case TK_GE:
case TK_IS:
case TK_ISNOT: {
int nLeft, nRight;
if( pParse->db->mallocFailed ) break;
assert( pExpr->pRight!=0 );
assert( pExpr->pLeft!=0 );
nLeft = sqlite3ExprVectorSize(pExpr->pLeft);
nRight = sqlite3ExprVectorSize(pExpr->pRight);
if( nLeft!=nRight ){
testcase( pExpr->op==TK_EQ );
testcase( pExpr->op==TK_NE );
testcase( pExpr->op==TK_LT );
testcase( pExpr->op==TK_LE );
testcase( pExpr->op==TK_GT );
testcase( pExpr->op==TK_GE );
testcase( pExpr->op==TK_IS );
testcase( pExpr->op==TK_ISNOT );
sqlite3ErrorMsg(pParse, "row value misused");
}
break;
}
}
return (pParse->nErr || pParse->db->mallocFailed) ? WRC_Abort : WRC_Continue;
}
+32 -66
View File
@@ -88,7 +88,7 @@ static void clearSelect(sqlite3 *db, Select *p, int bFree){
void sqlite3SelectDestInit(SelectDest *pDest, int eDest, int iParm){
pDest->eDest = (u8)eDest;
pDest->iSDParm = iParm;
pDest->affSdst = 0;
pDest->zAffSdst = 0;
pDest->iSdst = 0;
pDest->nSdst = 0;
}
@@ -659,30 +659,6 @@ static void codeDistinct(
sqlite3ReleaseTempReg(pParse, r1);
}
#ifndef SQLITE_OMIT_SUBQUERY
/*
** Generate an error message when a SELECT is used within a subexpression
** (example: "a IN (SELECT * FROM table)") but it has more than 1 result
** column. We do this in a subroutine because the error used to occur
** in multiple places. (The error only occurs in one place now, but we
** retain the subroutine to minimize code disruption.)
*/
static int checkForMultiColumnSelectError(
Parse *pParse, /* Parse context. */
SelectDest *pDest, /* Destination of SELECT results */
int nExpr /* Number of result columns returned by SELECT */
){
int eDest = pDest->eDest;
if( nExpr>1 && (eDest==SRT_Mem || eDest==SRT_Set) ){
sqlite3ErrorMsg(pParse, "only a single result allowed for "
"a SELECT that is part of an expression");
return 1;
}else{
return 0;
}
}
#endif
/*
** This routine generates the code for the inside of the inner loop
** of a SELECT.
@@ -892,19 +868,19 @@ static void selectInnerLoop(
** item into the set table with bogus data.
*/
case SRT_Set: {
assert( nResultCol==1 );
pDest->affSdst =
sqlite3CompareAffinity(pEList->a[0].pExpr, pDest->affSdst);
if( pSort ){
/* At first glance you would think we could optimize out the
** ORDER BY in this case since the order of entries in the set
** does not matter. But there might be a LIMIT clause, in which
** case the order does matter */
pushOntoSorter(pParse, pSort, p, regResult, regResult, 1, nPrefixReg);
pushOntoSorter(
pParse, pSort, p, regResult, regResult, nResultCol, nPrefixReg);
}else{
int r1 = sqlite3GetTempReg(pParse);
sqlite3VdbeAddOp4(v, OP_MakeRecord, regResult,1,r1, &pDest->affSdst, 1);
sqlite3ExprCacheAffinityChange(pParse, regResult, 1);
assert( sqlite3Strlen30(pDest->zAffSdst)==nResultCol );
sqlite3VdbeAddOp4(v, OP_MakeRecord, regResult, nResultCol,
r1, pDest->zAffSdst, nResultCol);
sqlite3ExprCacheAffinityChange(pParse, regResult, nResultCol);
sqlite3VdbeAddOp2(v, OP_IdxInsert, iParm, r1);
sqlite3ReleaseTempReg(pParse, r1);
}
@@ -920,13 +896,14 @@ static void selectInnerLoop(
}
/* If this is a scalar select that is part of an expression, then
** store the results in the appropriate memory cell and break out
** of the scan loop.
** store the results in the appropriate memory cell or array of
** memory cells and break out of the scan loop.
*/
case SRT_Mem: {
assert( nResultCol==1 );
assert( nResultCol==pDest->nSdst );
if( pSort ){
pushOntoSorter(pParse, pSort, p, regResult, regResult, 1, nPrefixReg);
pushOntoSorter(
pParse, pSort, p, regResult, regResult, nResultCol, nPrefixReg);
}else{
assert( regResult==iParm );
/* The LIMIT clause will jump out of the loop for us */
@@ -1241,14 +1218,14 @@ static void generateSortTail(
sqlite3VdbeResolveLabel(v, pSort->labelBkOut);
}
iTab = pSort->iECursor;
if( eDest==SRT_Output || eDest==SRT_Coroutine ){
if( eDest==SRT_Output || eDest==SRT_Coroutine || eDest==SRT_Mem ){
regRowid = 0;
regRow = pDest->iSdst;
nSortData = nColumn;
}else{
regRowid = sqlite3GetTempReg(pParse);
regRow = sqlite3GetTempReg(pParse);
nSortData = 1;
regRow = sqlite3GetTempRange(pParse, nColumn);
nSortData = nColumn;
}
nKey = pOrderBy->nExpr - pSort->nOBSat;
if( pSort->sortFlags & SORTFLAG_UseSorter ){
@@ -1283,16 +1260,14 @@ static void generateSortTail(
}
#ifndef SQLITE_OMIT_SUBQUERY
case SRT_Set: {
assert( nColumn==1 );
sqlite3VdbeAddOp4(v, OP_MakeRecord, regRow, 1, regRowid,
&pDest->affSdst, 1);
sqlite3ExprCacheAffinityChange(pParse, regRow, 1);
assert( nColumn==sqlite3Strlen30(pDest->zAffSdst) );
sqlite3VdbeAddOp4(v, OP_MakeRecord, regRow, nColumn, regRowid,
pDest->zAffSdst, nColumn);
sqlite3ExprCacheAffinityChange(pParse, regRow, nColumn);
sqlite3VdbeAddOp2(v, OP_IdxInsert, iParm, regRowid);
break;
}
case SRT_Mem: {
assert( nColumn==1 );
sqlite3ExprCodeMove(pParse, regRow, iParm, 1);
/* The LIMIT clause will terminate the loop for us */
break;
}
@@ -1311,7 +1286,11 @@ static void generateSortTail(
}
}
if( regRowid ){
sqlite3ReleaseTempReg(pParse, regRow);
if( eDest==SRT_Set ){
sqlite3ReleaseTempRange(pParse, regRow, nColumn);
}else{
sqlite3ReleaseTempReg(pParse, regRow);
}
sqlite3ReleaseTempReg(pParse, regRowid);
}
/* The bottom of the loop
@@ -1458,7 +1437,7 @@ static const char *columnTypeImpl(
zOrigTab = pTab->zName;
if( pNC->pParse ){
int iDb = sqlite3SchemaToIndex(pNC->pParse->db, pTab->pSchema);
zOrigDb = pNC->pParse->db->aDb[iDb].zName;
zOrigDb = pNC->pParse->db->aDb[iDb].zDbSName;
}
#else
if( iCol<0 ){
@@ -1813,7 +1792,7 @@ Table *sqlite3ResultSetOfSelect(Parse *pParse, Select *pSelect){
*/
static SQLITE_NOINLINE Vdbe *allocVdbe(Parse *pParse){
Vdbe *v = pParse->pVdbe = sqlite3VdbeCreate(pParse);
if( v ) sqlite3VdbeAddOp0(v, OP_Init);
if( v ) sqlite3VdbeAddOp2(v, OP_Init, 0, 1);
if( pParse->pToplevel==0
&& OptimizationEnabled(pParse->db,SQLITE_FactorOutConst)
){
@@ -2652,18 +2631,15 @@ static int generateOutputSubroutine(
}
#ifndef SQLITE_OMIT_SUBQUERY
/* If we are creating a set for an "expr IN (SELECT ...)" construct,
** then there should be a single item on the stack. Write this
** item into the set table with bogus data.
/* If we are creating a set for an "expr IN (SELECT ...)".
*/
case SRT_Set: {
int r1;
assert( pIn->nSdst==1 || pParse->nErr>0 );
pDest->affSdst =
sqlite3CompareAffinity(p->pEList->a[0].pExpr, pDest->affSdst);
testcase( pIn->nSdst>1 );
r1 = sqlite3GetTempReg(pParse);
sqlite3VdbeAddOp4(v, OP_MakeRecord, pIn->iSdst, 1, r1, &pDest->affSdst,1);
sqlite3ExprCacheAffinityChange(pParse, pIn->iSdst, 1);
sqlite3VdbeAddOp4(v, OP_MakeRecord, pIn->iSdst, pIn->nSdst,
r1, pDest->zAffSdst, pIn->nSdst);
sqlite3ExprCacheAffinityChange(pParse, pIn->iSdst, pIn->nSdst);
sqlite3VdbeAddOp2(v, OP_IdxInsert, pDest->iSDParm, r1);
sqlite3ReleaseTempReg(pParse, r1);
break;
@@ -4414,7 +4390,7 @@ static int selectExpander(Walker *pWalker, Select *p){
continue;
}
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
zSchemaName = iDb>=0 ? db->aDb[iDb].zName : "*";
zSchemaName = iDb>=0 ? db->aDb[iDb].zDbSName : "*";
}
for(j=0; j<pTab->nCol; j++){
char *zName = pTab->aCol[j].zName;
@@ -4897,16 +4873,6 @@ int sqlite3Select(
}
#endif
/* If writing to memory or generating a set
** only a single column may be output.
*/
#ifndef SQLITE_OMIT_SUBQUERY
if( checkForMultiColumnSelectError(pParse, pDest, p->pEList->nExpr) ){
goto select_end;
}
#endif
/* Try to flatten subqueries in the FROM clause up into the main query
*/
#if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW)
+4 -2
View File
@@ -524,7 +524,7 @@ static char *local_getline(char *zLine, FILE *in){
#if defined(_WIN32) || defined(WIN32)
/* For interactive input on Windows systems, translate the
** multi-byte characterset characters into UTF-8. */
if( stdin_is_interactive ){
if( stdin_is_interactive && in==stdin ){
char *zTrans = sqlite3_win32_mbcs_to_utf8_v2(zLine, 0);
if( zTrans ){
int nTrans = strlen30(zTrans)+1;
@@ -2550,6 +2550,8 @@ static int sql_trace_callback(
void *pX
){
FILE *f = (FILE*)pArg;
UNUSED_PARAMETER(mType);
UNUSED_PARAMETER(pP);
if( f ){
const char *z = (const char*)pX;
int i = (int)strlen(z);
@@ -4903,7 +4905,7 @@ static int process_input(ShellState *p, FILE *in){
zLine = one_input_line(in, zLine, nSql>0);
if( zLine==0 ){
/* End of input */
if( stdin_is_interactive ) printf("\n");
if( in==0 && stdin_is_interactive ) printf("\n");
break;
}
if( seenInterrupt ){
+46 -16
View File
@@ -54,8 +54,17 @@ extern "C" {
#ifndef SQLITE_CDECL
# define SQLITE_CDECL
#endif
#ifndef SQLITE_APICALL
# define SQLITE_APICALL
#endif
#ifndef SQLITE_STDCALL
# define SQLITE_STDCALL
# define SQLITE_STDCALL SQLITE_APICALL
#endif
#ifndef SQLITE_CALLBACK
# define SQLITE_CALLBACK
#endif
#ifndef SQLITE_SYSAPI
# define SQLITE_SYSAPI
#endif
/*
@@ -1036,6 +1045,16 @@ struct sqlite3_io_methods {
*/
typedef struct sqlite3_mutex sqlite3_mutex;
/*
** CAPI3REF: Loadable Extension Thunk
**
** A pointer to the opaque sqlite3_api_routines structure is passed as
** the third parameter to entry points of [loadable extensions]. This
** structure must be typedefed in order to work around compiler warnings
** on some platforms.
*/
typedef struct sqlite3_api_routines sqlite3_api_routines;
/*
** CAPI3REF: OS Interface Object
**
@@ -1940,7 +1959,7 @@ struct sqlite3_mem_methods {
** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
** There should be two additional arguments.
** When the first argument to this interface is 1, then only the C-API is
** enabled and the SQL function remains disabled. If the first argment to
** enabled and the SQL function remains disabled. If the first argument to
** this interface is 0, then both the C-API and the SQL function are disabled.
** If the first argument is -1, then no changes are made to state of either the
** C-API or the SQL function.
@@ -1950,8 +1969,18 @@ struct sqlite3_mem_methods {
** be a NULL pointer, in which case the new setting is not reported back.
** </dd>
**
** <dt>SQLITE_DBCONFIG_MAINDBNAME</dt>
** <dd> ^This option is used to change the name of the "main" database
** schema. ^The sole argument is a pointer to a constant UTF8 string
** which will become the new schema name in place of "main". ^SQLite
** does not make a copy of the new main schema name string, so the application
** must ensure that the argument passed into this DBCONFIG option is unchanged
** until after the database connection closes.
** </dd>
**
** </dl>
*/
#define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */
#define SQLITE_DBCONFIG_LOOKASIDE 1001 /* void* int int */
#define SQLITE_DBCONFIG_ENABLE_FKEY 1002 /* int int* */
#define SQLITE_DBCONFIG_ENABLE_TRIGGER 1003 /* int int* */
@@ -2233,7 +2262,7 @@ int sqlite3_complete16(const void *sql);
** A busy handler must not close the database connection
** or [prepared statement] that invoked the busy handler.
*/
int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);
int sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*);
/*
** CAPI3REF: Set A Busy Timeout
@@ -4685,12 +4714,13 @@ sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
** SQLite will invoke the destructor function X with parameter P exactly
** once, when the metadata is discarded.
** SQLite is free to discard the metadata at any time, including: <ul>
** <li> when the corresponding function parameter changes, or
** <li> when [sqlite3_reset()] or [sqlite3_finalize()] is called for the
** SQL statement, or
** <li> when sqlite3_set_auxdata() is invoked again on the same parameter, or
** <li> during the original sqlite3_set_auxdata() call when a memory
** allocation error occurs. </ul>)^
** <li> ^(when the corresponding function parameter changes)^, or
** <li> ^(when [sqlite3_reset()] or [sqlite3_finalize()] is called for the
** SQL statement)^, or
** <li> ^(when sqlite3_set_auxdata() is invoked again on the same
** parameter)^, or
** <li> ^(during the original sqlite3_set_auxdata() call when a memory
** allocation error occurs.)^ </ul>
**
** Note the last bullet in particular. The destructor X in
** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the
@@ -5517,7 +5547,7 @@ SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N);
** column exists. ^The sqlite3_table_column_metadata() interface returns
** SQLITE_ERROR and if the specified column does not exist.
** ^If the column-name parameter to sqlite3_table_column_metadata() is a
** NULL pointer, then this routine simply checks for the existance of the
** NULL pointer, then this routine simply checks for the existence of the
** table and returns SQLITE_OK if the table exists and SQLITE_ERROR if it
** does not.
**
@@ -5651,8 +5681,8 @@ int sqlite3_load_extension(
**
** ^This interface enables or disables both the C-API
** [sqlite3_load_extension()] and the SQL function [load_extension()].
** Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..)
** to enable or disable only the C-API.
** ^(Use [sqlite3_db_config](db,[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION],..)
** to enable or disable only the C-API.)^
**
** <b>Security warning:</b> It is recommended that extension loading
** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method
@@ -5672,7 +5702,7 @@ int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
**
** ^(Even though the function prototype shows that xEntryPoint() takes
** no arguments and returns void, SQLite invokes xEntryPoint() with three
** arguments and expects and integer result as if the signature of the
** arguments and expects an integer result as if the signature of the
** entry point where as follows:
**
** <blockquote><pre>
@@ -5698,7 +5728,7 @@ int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
** See also: [sqlite3_reset_auto_extension()]
** and [sqlite3_cancel_auto_extension()]
*/
int sqlite3_auto_extension(void (*xEntryPoint)(void));
int sqlite3_auto_extension(void(*xEntryPoint)(void));
/*
** CAPI3REF: Cancel Automatic Extension Loading
@@ -5710,7 +5740,7 @@ int sqlite3_auto_extension(void (*xEntryPoint)(void));
** unregistered and it returns 0 if X was not on the list of initialization
** routines.
*/
int sqlite3_cancel_auto_extension(void (*xEntryPoint)(void));
int sqlite3_cancel_auto_extension(void(*xEntryPoint)(void));
/*
** CAPI3REF: Reset Automatic Extension Loading
@@ -8112,7 +8142,7 @@ int sqlite3_db_cacheflush(sqlite3*);
** ^The second parameter to the preupdate callback is a pointer to
** the [database connection] that registered the preupdate hook.
** ^The third parameter to the preupdate callback is one of the constants
** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to indentify the
** [SQLITE_INSERT], [SQLITE_DELETE], or [SQLITE_UPDATE] to identify the
** kind of update operation that is about to occur.
** ^(The fourth parameter to the preupdate callback is the name of the
** database within the database connection that is being modified. This
+10 -2
View File
@@ -19,8 +19,6 @@
#define SQLITE3EXT_H
#include "sqlite3.h"
typedef struct sqlite3_api_routines sqlite3_api_routines;
/*
** The following structure holds pointers to all of the SQLite API
** routines.
@@ -286,6 +284,16 @@ struct sqlite3_api_routines {
char *(*expanded_sql)(sqlite3_stmt*);
};
/*
** This is the function signature used for all extension entry points. It
** is also defined in the file "loadext.c".
*/
typedef int (*sqlite3_loadext_entry)(
sqlite3 *db, /* Handle to the database. */
char **pzErrMsg, /* Used to set error string on failure. */
const sqlite3_api_routines *pThunk /* Extension API function pointers. */
);
/*
** The following macros redefine the API routines so that they are
** redirected through the global sqlite3_api structure.
+37 -10
View File
@@ -42,6 +42,14 @@
** asterisks and the comment text.
*/
/*
** Make sure the Tcl calling convention macro is defined. This macro is
** only used by test code and Tcl integration code.
*/
#ifndef SQLITE_TCLAPI
# define SQLITE_TCLAPI
#endif
/*
** Make sure that rand_s() is available on Windows systems with MSVC 2005
** or higher.
@@ -226,7 +234,7 @@
** the SQLITE_DISABLE_INTRINSIC define.
*/
#if !defined(SQLITE_DISABLE_INTRINSIC)
# if defined(_MSC_VER) && _MSC_VER>=1300
# if defined(_MSC_VER) && _MSC_VER>=1400
# if !defined(_WIN32_WCE)
# include <intrin.h>
# pragma intrinsic(_byteswap_ushort)
@@ -1089,7 +1097,7 @@ typedef struct With With;
** databases may be attached.
*/
struct Db {
char *zName; /* Name of this database */
char *zDbSName; /* Name of this database. (schema name, not filename) */
Btree *pBt; /* The B*Tree structure for this database file */
u8 safety_level; /* How aggressive at syncing data to disk */
u8 bSyncSet; /* True if "PRAGMA synchronous=N" has been run */
@@ -1725,6 +1733,7 @@ struct CollSeq {
** operator is NULL. It is added to certain comparison operators to
** prove that the operands are always NOT NULL.
*/
#define SQLITE_KEEPNULL 0x08 /* Used by vector == or <> */
#define SQLITE_JUMPIFNULL 0x10 /* jumps if either operand is NULL */
#define SQLITE_STOREP2 0x20 /* Store result in reg[P2] rather than jump */
#define SQLITE_NULLEQ 0x80 /* NULL=NULL */
@@ -2289,9 +2298,11 @@ struct Expr {
int iTable; /* TK_COLUMN: cursor number of table holding column
** TK_REGISTER: register number
** TK_TRIGGER: 1 -> new, 0 -> old
** EP_Unlikely: 134217728 times likelihood */
** EP_Unlikely: 134217728 times likelihood
** TK_SELECT: 1st register of result vector */
ynVar iColumn; /* TK_COLUMN: column index. -1 for rowid.
** TK_VARIABLE: variable number (always >= 1). */
** TK_VARIABLE: variable number (always >= 1).
** TK_SELECT_COLUMN: column of the result vector */
i16 iAgg; /* Which entry in pAggInfo->aCol[] or ->aFunc[] */
i16 iRightJoinTable; /* If EP_FromJoin, the right table of the join */
u8 op2; /* TK_REGISTER: original value of Expr.op
@@ -2772,7 +2783,7 @@ struct Select {
*/
struct SelectDest {
u8 eDest; /* How to dispose of the results. On of SRT_* above. */
char affSdst; /* Affinity used when eDest==SRT_Set */
char *zAffSdst; /* Affinity used when eDest==SRT_Set */
int iSDParm; /* A parameter used by the eDest disposal method */
int iSdst; /* Base register where results are written */
int nSdst; /* Number of registers allocated */
@@ -3504,6 +3515,7 @@ char *sqlite3VMPrintf(sqlite3*,const char*, va_list);
#if defined(SQLITE_DEBUG)
void sqlite3TreeViewExpr(TreeView*, const Expr*, u8);
void sqlite3TreeViewBareExprList(TreeView*, const ExprList*, const char*);
void sqlite3TreeViewExprList(TreeView*, const ExprList*, u8, const char*);
void sqlite3TreeViewSelect(TreeView*, const Select*, u8);
void sqlite3TreeViewWith(TreeView*, const With*, u8);
@@ -3535,6 +3547,7 @@ Expr *sqlite3ExprFunction(Parse*,ExprList*, Token*);
void sqlite3ExprAssignVarNumber(Parse*, Expr*);
void sqlite3ExprDelete(sqlite3*, Expr*);
ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*);
ExprList *sqlite3ExprListAppendVector(Parse*,ExprList*,IdList*,Expr*);
void sqlite3ExprListSetSortOrder(ExprList*,int);
void sqlite3ExprListSetName(Parse*,ExprList*,Token*,int);
void sqlite3ExprListSetSpan(Parse*,ExprList*,ExprSpan*);
@@ -3693,8 +3706,8 @@ Table *sqlite3LocateTableItem(Parse*,u32 flags,struct SrcList_item *);
Index *sqlite3FindIndex(sqlite3*,const char*, const char*);
void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*);
void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*);
void sqlite3Vacuum(Parse*);
int sqlite3RunVacuum(char**, sqlite3*);
void sqlite3Vacuum(Parse*,Token*);
int sqlite3RunVacuum(char**, sqlite3*, int);
char *sqlite3NameFromToken(sqlite3*, Token*);
int sqlite3ExprCompare(Expr*, Expr*, int);
int sqlite3ExprListCompare(ExprList*, ExprList*, int);
@@ -3870,6 +3883,7 @@ const char *sqlite3IndexAffinityStr(sqlite3*, Index*);
void sqlite3TableAffinity(Vdbe*, Table*, int);
char sqlite3CompareAffinity(Expr *pExpr, char aff2);
int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity);
char sqlite3TableColumnAffinity(Table*,int);
char sqlite3ExprAffinity(Expr *pExpr);
int sqlite3Atoi64(const char*, i64*, int, u8);
int sqlite3DecOrHexToI64(const char*, i64*);
@@ -3935,7 +3949,7 @@ void sqlite3AlterRenameTable(Parse*, SrcList*, Token*);
int sqlite3GetToken(const unsigned char *, int *);
void sqlite3NestedParse(Parse*, const char*, ...);
void sqlite3ExpirePreparedStatements(sqlite3*);
int sqlite3CodeSubselect(Parse *, Expr *, int, int);
int sqlite3CodeSubselect(Parse*, Expr *, int, int);
void sqlite3SelectPrep(Parse*, Select*, NameContext*);
void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p);
int sqlite3MatchSpanName(const char*, const char*, const char*, const char*);
@@ -3990,12 +4004,20 @@ Expr *sqlite3CreateColumnExpr(sqlite3 *, SrcList *, int, int);
void sqlite3BackupRestart(sqlite3_backup *);
void sqlite3BackupUpdate(sqlite3_backup *, Pgno, const u8 *);
#ifndef SQLITE_OMIT_SUBQUERY
int sqlite3ExprCheckIN(Parse*, Expr*);
#else
# define sqlite3ExprCheckIN(x,y) SQLITE_OK
#endif
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
void sqlite3AnalyzeFunctions(void);
int sqlite3Stat4ProbeSetValue(Parse*,Index*,UnpackedRecord**,Expr*,u8,int,int*);
int sqlite3Stat4ProbeSetValue(
Parse*,Index*,UnpackedRecord**,Expr*,int,int,int*);
int sqlite3Stat4ValueFromExpr(Parse*, Expr*, u8, sqlite3_value**);
void sqlite3Stat4ProbeFree(UnpackedRecord*);
int sqlite3Stat4Column(sqlite3*, const void*, int, int, sqlite3_value**);
char sqlite3IndexColumnAffinity(sqlite3*, Index*, int);
#endif
/*
@@ -4148,7 +4170,7 @@ const char *sqlite3JournalModename(int);
#define IN_INDEX_NOOP_OK 0x0001 /* OK to return IN_INDEX_NOOP */
#define IN_INDEX_MEMBERSHIP 0x0002 /* IN operator used for membership test */
#define IN_INDEX_LOOP 0x0004 /* IN operator used as a loop */
int sqlite3FindInIndex(Parse *, Expr *, u32, int*);
int sqlite3FindInIndex(Parse *, Expr *, u32, int*, int*);
int sqlite3JournalOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, int);
int sqlite3JournalSize(sqlite3_vfs *);
@@ -4253,4 +4275,9 @@ int sqlite3ThreadJoin(SQLiteThread*, void**);
int sqlite3DbstatRegister(sqlite3*);
#endif
int sqlite3ExprVectorSize(Expr *pExpr);
int sqlite3ExprIsVector(Expr *pExpr);
Expr *sqlite3VectorFieldSubexpr(Expr*, int);
Expr *sqlite3ExprForVectorField(Parse*,Expr*,int);
#endif /* SQLITEINT_H */
+1 -1
View File
@@ -158,7 +158,7 @@ int sqlite3_status64(
return SQLITE_OK;
}
int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){
sqlite3_int64 iCur, iHwtr;
sqlite3_int64 iCur = 0, iHwtr = 0;
int rc;
#ifdef SQLITE_ENABLE_API_ARMOR
if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
+63 -22
View File
@@ -30,10 +30,17 @@
** If requested, include the SQLite compiler options file for MSVC.
*/
#if defined(INCLUDE_MSVC_H)
#include "msvc.h"
# include "msvc.h"
#endif
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
# ifndef SQLITE_TCLAPI
# define SQLITE_TCLAPI
# endif
#endif
#include <errno.h>
/*
@@ -204,7 +211,10 @@ static void closeIncrblobChannels(SqliteDb *pDb){
/*
** Close an incremental blob channel.
*/
static int incrblobClose(ClientData instanceData, Tcl_Interp *interp){
static int SQLITE_TCLAPI incrblobClose(
ClientData instanceData,
Tcl_Interp *interp
){
IncrblobChannel *p = (IncrblobChannel *)instanceData;
int rc = sqlite3_blob_close(p->pBlob);
sqlite3 *db = p->pDb->db;
@@ -233,7 +243,7 @@ static int incrblobClose(ClientData instanceData, Tcl_Interp *interp){
/*
** Read data from an incremental blob channel.
*/
static int incrblobInput(
static int SQLITE_TCLAPI incrblobInput(
ClientData instanceData,
char *buf,
int bufSize,
@@ -265,7 +275,7 @@ static int incrblobInput(
/*
** Write data to an incremental blob channel.
*/
static int incrblobOutput(
static int SQLITE_TCLAPI incrblobOutput(
ClientData instanceData,
CONST char *buf,
int toWrite,
@@ -298,7 +308,7 @@ static int incrblobOutput(
/*
** Seek an incremental blob channel.
*/
static int incrblobSeek(
static int SQLITE_TCLAPI incrblobSeek(
ClientData instanceData,
long offset,
int seekMode,
@@ -324,10 +334,17 @@ static int incrblobSeek(
}
static void incrblobWatch(ClientData instanceData, int mode){
static void SQLITE_TCLAPI incrblobWatch(
ClientData instanceData,
int mode
){
/* NO-OP */
}
static int incrblobHandle(ClientData instanceData, int dir, ClientData *hPtr){
static int SQLITE_TCLAPI incrblobHandle(
ClientData instanceData,
int dir,
ClientData *hPtr
){
return TCL_ERROR;
}
@@ -486,7 +503,7 @@ static void flushStmtCache(SqliteDb *pDb){
** TCL calls this procedure when an sqlite3 database command is
** deleted.
*/
static void DbDeleteCmd(void *db){
static void SQLITE_TCLAPI DbDeleteCmd(void *db){
SqliteDb *pDb = (SqliteDb*)db;
flushStmtCache(pDb);
closeIncrblobChannels(pDb);
@@ -1134,7 +1151,7 @@ static char *local_getline(char *zPrompt, FILE *in){
** It is invoked after evaluating the script SCRIPT to commit or rollback
** the transaction or savepoint opened by the [transaction] command.
*/
static int DbTransPostCmd(
static int SQLITE_TCLAPI DbTransPostCmd(
ClientData data[], /* data[0] is the Sqlite3Db* for $db */
Tcl_Interp *interp, /* Tcl interpreter */
int result /* Result of evaluating SCRIPT */
@@ -1681,7 +1698,7 @@ static int DbUseNre(void){
**
** $db eval SQL ?ARRAYNAME? SCRIPT
*/
static int DbEvalNextCmd(
static int SQLITE_TCLAPI DbEvalNextCmd(
ClientData data[], /* data[0] is the (DbEvalContext*) */
Tcl_Interp *interp, /* Tcl interpreter */
int result /* Result so far */
@@ -1791,7 +1808,12 @@ static void DbHookCmd(
** and calls that connection "db1". The second command causes this
** subroutine to be invoked.
*/
static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
static int SQLITE_TCLAPI DbObjCmd(
void *cd,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const*objv
){
SqliteDb *pDb = (SqliteDb*)cd;
int choice;
int rc = TCL_OK;
@@ -3234,7 +3256,7 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
** Adaptor that provides an objCmd interface to the NRE-enabled
** interface implementation.
*/
static int DbObjCmdAdaptor(
static int SQLITE_TCLAPI DbObjCmdAdaptor(
void *cd,
Tcl_Interp *interp,
int objc,
@@ -3259,7 +3281,12 @@ static int DbObjCmdAdaptor(
** The second argument is the name of the database file.
**
*/
static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
static int SQLITE_TCLAPI DbMain(
void *cd,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const*objv
){
SqliteDb *p;
const char *zArg;
char *zErrMsg;
@@ -3779,7 +3806,12 @@ static void MD5DigestToBase10x8(unsigned char digest[16], char zDigest[50]){
** A TCL command for md5. The argument is the text to be hashed. The
** Result is the hash in base64.
*/
static int md5_cmd(void*cd, Tcl_Interp *interp, int argc, const char **argv){
static int SQLITE_TCLAPI md5_cmd(
void*cd,
Tcl_Interp *interp,
int argc,
const char **argv
){
MD5Context ctx;
unsigned char digest[16];
char zBuf[50];
@@ -3803,7 +3835,12 @@ static int md5_cmd(void*cd, Tcl_Interp *interp, int argc, const char **argv){
** A TCL command to take the md5 hash of a file. The argument is the
** name of the file.
*/
static int md5file_cmd(void*cd, Tcl_Interp*interp, int argc, const char **argv){
static int SQLITE_TCLAPI md5file_cmd(
void*cd,
Tcl_Interp *interp,
int argc,
const char **argv
){
FILE *in;
MD5Context ctx;
void (*converter)(unsigned char*, char*);
@@ -3883,7 +3920,11 @@ static void md5finalize(sqlite3_context *context){
MD5DigestToBase16(digest, zBuf);
sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
}
int Md5_Register(sqlite3 *db){
int Md5_Register(
sqlite3 *db,
char **pzErrMsg,
const sqlite3_api_routines *pThunk
){
int rc = sqlite3_create_function(db, "md5sum", -1, SQLITE_UTF8, 0, 0,
md5step, md5finalize);
sqlite3_overload_function(db, "md5sum", -1); /* To exercise this API */
@@ -3931,7 +3972,7 @@ static const char *tclsh_main_loop(void);
#ifdef SQLITE_TEST
static void init_all(Tcl_Interp *);
static int init_all_cmd(
static int SQLITE_TCLAPI init_all_cmd(
ClientData cd,
Tcl_Interp *interp,
int objc,
@@ -3961,7 +4002,7 @@ static int init_all_cmd(
** to use the sqlite3_prepare_v2() function to prepare statements. If it
** is false, sqlite3_prepare().
*/
static int db_use_legacy_prepare_cmd(
static int SQLITE_TCLAPI db_use_legacy_prepare_cmd(
ClientData cd,
Tcl_Interp *interp,
int objc,
@@ -3998,7 +4039,7 @@ static int db_use_legacy_prepare_cmd(
** return the text representation of the most recently used statement
** handle.
*/
static int db_last_stmt_ptr(
static int SQLITE_TCLAPI db_last_stmt_ptr(
ClientData cd,
Tcl_Interp *interp,
int objc,
@@ -4123,7 +4164,7 @@ static void init_all(Tcl_Interp *interp){
Sqlitetesttclvar_Init(interp);
Sqlitetestfs_Init(interp);
SqlitetestThread_Init(interp);
SqlitetestOnefile_Init(interp);
SqlitetestOnefile_Init();
SqlitetestOsinst_Init(interp);
Sqlitetestbackup_Init(interp);
Sqlitetestintarray_Init(interp);
@@ -4167,7 +4208,7 @@ static void init_all(Tcl_Interp *interp){
#endif
#define TCLSH_MAIN main /* Needed to fake out mktclapp */
int TCLSH_MAIN(int argc, char **argv){
int SQLITE_CDECL TCLSH_MAIN(int argc, char **argv){
Tcl_Interp *interp;
#if !defined(_WIN32_WCE)
+210 -183
View File
File diff suppressed because it is too large Load Diff
+25 -21
View File
@@ -14,7 +14,11 @@
** testing of the SQLite library.
*/
#include "sqliteInt.h"
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
@@ -38,7 +42,7 @@ static void pager_test_reiniter(DbPage *pNotUsed){
**
** Open a new pager
*/
static int pager_open(
static int SQLITE_TCLAPI pager_open(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -75,7 +79,7 @@ static int pager_open(
**
** Close the given pager.
*/
static int pager_close(
static int SQLITE_TCLAPI pager_close(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -102,7 +106,7 @@ static int pager_close(
**
** Rollback changes
*/
static int pager_rollback(
static int SQLITE_TCLAPI pager_rollback(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -129,7 +133,7 @@ static int pager_rollback(
**
** Commit all changes
*/
static int pager_commit(
static int SQLITE_TCLAPI pager_commit(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -161,7 +165,7 @@ static int pager_commit(
**
** Start a new checkpoint.
*/
static int pager_stmt_begin(
static int SQLITE_TCLAPI pager_stmt_begin(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -188,7 +192,7 @@ static int pager_stmt_begin(
**
** Rollback changes to a checkpoint
*/
static int pager_stmt_rollback(
static int SQLITE_TCLAPI pager_stmt_rollback(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -216,7 +220,7 @@ static int pager_stmt_rollback(
**
** Commit changes to a checkpoint
*/
static int pager_stmt_commit(
static int SQLITE_TCLAPI pager_stmt_commit(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -243,7 +247,7 @@ static int pager_stmt_commit(
**
** Return pager statistics.
*/
static int pager_stats(
static int SQLITE_TCLAPI pager_stats(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -276,7 +280,7 @@ static int pager_stats(
**
** Return the size of the database file.
*/
static int pager_pagecount(
static int SQLITE_TCLAPI pager_pagecount(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -302,7 +306,7 @@ static int pager_pagecount(
**
** Return a pointer to a page from the database.
*/
static int page_get(
static int SQLITE_TCLAPI page_get(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -339,7 +343,7 @@ static int page_get(
** Return a pointer to a page if the page is already in cache.
** If not in cache, return an empty string.
*/
static int page_lookup(
static int SQLITE_TCLAPI page_lookup(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -367,7 +371,7 @@ static int page_lookup(
/*
** Usage: pager_truncate ID PGNO
*/
static int pager_truncate(
static int SQLITE_TCLAPI pager_truncate(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -392,7 +396,7 @@ static int pager_truncate(
**
** Drop a pointer to a page.
*/
static int page_unref(
static int SQLITE_TCLAPI page_unref(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -414,7 +418,7 @@ static int page_unref(
**
** Return the content of a page
*/
static int page_read(
static int SQLITE_TCLAPI page_read(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -438,7 +442,7 @@ static int page_read(
**
** Return the page number for a page.
*/
static int page_number(
static int SQLITE_TCLAPI page_number(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -462,7 +466,7 @@ static int page_number(
**
** Write something into a page.
*/
static int page_write(
static int SQLITE_TCLAPI page_write(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -498,7 +502,7 @@ static int page_write(
** new pages after N. If N is 2096 or bigger, this will test the
** ability of SQLite to write to large files.
*/
static int fake_big_file(
static int SQLITE_TCLAPI fake_big_file(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -551,7 +555,7 @@ static int fake_big_file(
**
** Set the PENDING_BYTE using the sqlite3_test_control() interface.
*/
static int testPendingByte(
static int SQLITE_TCLAPI testPendingByte(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -616,7 +620,7 @@ static int faultSimCallback(int x){
** appended, whenever sqlite3FaultSim() is called. Or, if SCRIPT is the
** empty string, cancel the sqlite3FaultSim() callback.
*/
static int faultInstallCmd(
static int SQLITE_TCLAPI faultInstallCmd(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -659,7 +663,7 @@ static int faultInstallCmd(
** Invoke the SQLITE_TESTCTRL_BITVEC_TEST operator on test_control.
** See comments on sqlite3BitvecBuiltinTest() for additional information.
*/
static int testBitvecBuiltinTest(
static int SQLITE_TCLAPI testBitvecBuiltinTest(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
+20 -16
View File
@@ -15,7 +15,11 @@
*/
#include "sqliteInt.h"
#include "btreeInt.h"
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include <stdlib.h>
#include <string.h>
@@ -33,7 +37,7 @@ static int nRefSqlite3 = 0;
**
** Open a new database
*/
static int btree_open(
static int SQLITE_TCLAPI btree_open(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -79,7 +83,7 @@ static int btree_open(
**
** Close the given database.
*/
static int btree_close(
static int SQLITE_TCLAPI btree_close(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -114,7 +118,7 @@ static int btree_close(
**
** Start a new transaction
*/
static int btree_begin_transaction(
static int SQLITE_TCLAPI btree_begin_transaction(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -143,7 +147,7 @@ static int btree_begin_transaction(
**
** Returns pager statistics
*/
static int btree_pager_stats(
static int SQLITE_TCLAPI btree_pager_stats(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -193,7 +197,7 @@ static int btree_pager_stats(
**
** Create a new cursor. Return the ID for the cursor.
*/
static int btree_cursor(
static int SQLITE_TCLAPI btree_cursor(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -242,7 +246,7 @@ static int btree_cursor(
**
** Close a cursor opened using btree_cursor.
*/
static int btree_close_cursor(
static int SQLITE_TCLAPI btree_close_cursor(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -279,7 +283,7 @@ static int btree_close_cursor(
** or 1 if the cursor was already on the last entry in the table or if
** the table is empty.
*/
static int btree_next(
static int SQLITE_TCLAPI btree_next(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -314,7 +318,7 @@ static int btree_next(
** Move the cursor to the first entry in the table. Return 0 if the
** cursor was left point to something and 1 if the table is empty.
*/
static int btree_first(
static int SQLITE_TCLAPI btree_first(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -349,7 +353,7 @@ static int btree_first(
** Return TRUE if the given cursor is not pointing at a valid entry.
** Return FALSE if the cursor does point to a valid entry.
*/
static int btree_eof(
static int SQLITE_TCLAPI btree_eof(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -378,7 +382,7 @@ static int btree_eof(
**
** Return the number of bytes of payload
*/
static int btree_payload_size(
static int SQLITE_TCLAPI btree_payload_size(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -416,7 +420,7 @@ static int btree_payload_size(
** This command returns nothing if it works. It returns an error message
** if something goes wrong.
*/
static int btree_varint_test(
static int SQLITE_TCLAPI btree_varint_test(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -500,7 +504,7 @@ static int btree_varint_test(
** sqlite3 db test.db
** set bt [btree_from_db db]
*/
static int btree_from_db(
static int SQLITE_TCLAPI btree_from_db(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -540,7 +544,7 @@ static int btree_from_db(
**
** Return true if the B-Tree is currently stored entirely in memory.
*/
static int btree_ismemdb(
static int SQLITE_TCLAPI btree_ismemdb(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -571,7 +575,7 @@ static int btree_ismemdb(
**
** Set the size of the cache used by btree $ID.
*/
static int btree_set_cache_size(
static int SQLITE_TCLAPI btree_set_cache_size(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -601,7 +605,7 @@ static int btree_set_cache_size(
**
** Set the size of the cache used by btree $ID.
*/
static int btree_insert(
static int SQLITE_TCLAPI btree_insert(
ClientData clientData,
Tcl_Interp *interp,
int objc,
+20 -16
View File
@@ -12,7 +12,11 @@
** Code for testing the SQLite library in a multithreaded environment.
*/
#include "sqliteInt.h"
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#if SQLITE_OS_UNIX && SQLITE_THREADSAFE
#include <stdlib.h>
#include <string.h>
@@ -121,7 +125,7 @@ static int parse_thread_id(Tcl_Interp *interp, const char *zArg){
** NAME should be an upper case letter. Start the thread running with
** an open connection to the given database.
*/
static int tcl_thread_create(
static int SQLITE_TCLAPI tcl_thread_create(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -170,7 +174,7 @@ static void thread_wait(Thread *p){
**
** Wait on thread ID to reach its idle state.
*/
static int tcl_thread_wait(
static int SQLITE_TCLAPI tcl_thread_wait(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -214,7 +218,7 @@ static void stop_thread(Thread *p){
** Cause a thread to shut itself down. Wait for the shutdown to be
** completed. If ID is "*" then stop all threads.
*/
static int tcl_thread_halt(
static int SQLITE_TCLAPI tcl_thread_halt(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -249,7 +253,7 @@ static int tcl_thread_halt(
** Wait on the most recent thread_step to complete, then return the
** number of columns in the result set.
*/
static int tcl_thread_argc(
static int SQLITE_TCLAPI tcl_thread_argc(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -281,7 +285,7 @@ static int tcl_thread_argc(
** Wait on the most recent thread_step to complete, then return the
** value of the N-th columns in the result set.
*/
static int tcl_thread_argv(
static int SQLITE_TCLAPI tcl_thread_argv(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -317,7 +321,7 @@ static int tcl_thread_argv(
** Wait on the most recent thread_step to complete, then return the
** name of the N-th columns in the result set.
*/
static int tcl_thread_colname(
static int SQLITE_TCLAPI tcl_thread_colname(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -353,7 +357,7 @@ static int tcl_thread_colname(
** Wait on the most recent operation to complete, then return the
** result code from that operation.
*/
static int tcl_thread_result(
static int SQLITE_TCLAPI tcl_thread_result(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -385,7 +389,7 @@ static int tcl_thread_result(
** Wait on the most recent operation to complete, then return the
** error string.
*/
static int tcl_thread_error(
static int SQLITE_TCLAPI tcl_thread_error(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -430,7 +434,7 @@ static void do_compile(Thread *p){
**
** Compile a new virtual machine.
*/
static int tcl_thread_compile(
static int SQLITE_TCLAPI tcl_thread_compile(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -483,7 +487,7 @@ static void do_step(Thread *p){
**
** Advance the virtual machine by one step
*/
static int tcl_thread_step(
static int SQLITE_TCLAPI tcl_thread_step(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -525,7 +529,7 @@ static void do_finalize(Thread *p){
**
** Finalize the virtual machine.
*/
static int tcl_thread_finalize(
static int SQLITE_TCLAPI tcl_thread_finalize(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -556,7 +560,7 @@ static int tcl_thread_finalize(
**
** Interchange the sqlite* pointer between two threads.
*/
static int tcl_thread_swap(
static int SQLITE_TCLAPI tcl_thread_swap(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -596,7 +600,7 @@ static int tcl_thread_swap(
** remove the pointer from the thread itself. Afterwards, the thread
** can be stopped and the connection can be used by the main thread.
*/
static int tcl_thread_db_get(
static int SQLITE_TCLAPI tcl_thread_db_get(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -627,7 +631,7 @@ static int tcl_thread_db_get(
** Usage: thread_db_put ID DB
**
*/
static int tcl_thread_db_put(
static int SQLITE_TCLAPI tcl_thread_db_put(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -659,7 +663,7 @@ static int tcl_thread_db_put(
** Return the database stmt pointer for the given thread. Then
** remove the pointer from the thread itself.
*/
static int tcl_thread_stmt_get(
static int SQLITE_TCLAPI tcl_thread_stmt_get(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
+9 -5
View File
@@ -17,7 +17,11 @@
*/
#include "sqliteInt.h"
#include "vdbeInt.h"
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include <stdlib.h>
#include <string.h>
@@ -26,7 +30,7 @@
** object with the encoded representation of the string, including
** the NULL terminator.
*/
static int binarize(
static int SQLITE_TCLAPI binarize(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -54,7 +58,7 @@ static int binarize(
** If <do-calls> is 0, then the calls to sqlite3_value_text() are not
** actually made.
*/
static int test_value_overhead(
static int SQLITE_TCLAPI test_value_overhead(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -118,7 +122,7 @@ static u8 name_to_enc(Tcl_Interp *interp, Tcl_Obj *pObj){
** Usage: test_translate <string/blob> <from enc> <to enc> ?<transient>?
**
*/
static int test_translate(
static int SQLITE_TCLAPI test_translate(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -182,7 +186,7 @@ static int test_translate(
** translation. If there is a problem an assert() will fail.
**/
void sqlite3UtfSelfTest(void);
static int test_translate_selftest(
static int SQLITE_TCLAPI test_translate_selftest(
void * clientData,
Tcl_Interp *interp,
int objc,
+12 -8
View File
@@ -16,7 +16,11 @@
*/
#if SQLITE_TEST /* This file is used for testing only */
#include "sqliteInt.h"
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#ifndef SQLITE_OMIT_DISKIO /* This file is a no-op if disk I/O is disabled */
@@ -807,7 +811,7 @@ static int processDevSymArgs(
** Simulate a crash immediately. This function does not return
** (writeListSync() calls exit(-1)).
*/
static int crashNowCmd(
static int SQLITE_TCLAPI crashNowCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -828,7 +832,7 @@ static int crashNowCmd(
** Parameter ENABLE must be a boolean value. If true, then the "crash"
** vfs is added to the system. If false, it is removed.
*/
static int crashEnableCmd(
static int SQLITE_TCLAPI crashEnableCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -903,7 +907,7 @@ static int crashEnableCmd(
** sqlite_crashparams -sect 1024 -char {atomic sequential} ./test.db 1
**
*/
static int crashParamsObjCmd(
static int SQLITE_TCLAPI crashParamsObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -950,7 +954,7 @@ error:
return TCL_ERROR;
}
static int devSymObjCmd(
static int SQLITE_TCLAPI devSymObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -973,7 +977,7 @@ static int devSymObjCmd(
/*
** tclcmd: unregister_devsim
*/
static int dsUnregisterObjCmd(
static int SQLITE_TCLAPI dsUnregisterObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -993,7 +997,7 @@ static int dsUnregisterObjCmd(
/*
** tclcmd: register_jt_vfs ?-default? PARENT-VFS
*/
static int jtObjCmd(
static int SQLITE_TCLAPI jtObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1031,7 +1035,7 @@ static int jtObjCmd(
/*
** tclcmd: unregister_jt_vfs
*/
static int jtUnregisterObjCmd(
static int SQLITE_TCLAPI jtUnregisterObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
+18 -14
View File
@@ -13,7 +13,11 @@
** Derived from test4.c.
*/
#include "sqliteInt.h"
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
/*
** This test only works on UNIX with a SQLITE_THREADSAFE build that includes
@@ -149,7 +153,7 @@ static int parse_client_id(Tcl_Interp *interp, const char *zArg){
** NAME should be an upper case letter. Start the thread running with
** an open connection to the given database.
*/
static int tcl_client_create(
static int SQLITE_TCLAPI tcl_client_create(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -202,7 +206,7 @@ static void client_wait(Thread *p){
**
** Wait on thread ID to reach its idle state.
*/
static int tcl_client_wait(
static int SQLITE_TCLAPI tcl_client_wait(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -246,7 +250,7 @@ static void stop_thread(Thread *p){
** Cause a client thread to shut itself down. Wait for the shutdown to be
** completed. If ID is "*" then stop all client threads.
*/
static int tcl_client_halt(
static int SQLITE_TCLAPI tcl_client_halt(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -294,7 +298,7 @@ static int tcl_client_halt(
** Wait on the most recent client_step to complete, then return the
** number of columns in the result set.
*/
static int tcl_client_argc(
static int SQLITE_TCLAPI tcl_client_argc(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -326,7 +330,7 @@ static int tcl_client_argc(
** Wait on the most recent client_step to complete, then return the
** value of the N-th columns in the result set.
*/
static int tcl_client_argv(
static int SQLITE_TCLAPI tcl_client_argv(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -362,7 +366,7 @@ static int tcl_client_argv(
** Wait on the most recent client_step to complete, then return the
** name of the N-th columns in the result set.
*/
static int tcl_client_colname(
static int SQLITE_TCLAPI tcl_client_colname(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -400,7 +404,7 @@ extern const char *sqlite3ErrName(int);
** Wait on the most recent operation to complete, then return the
** result code from that operation.
*/
static int tcl_client_result(
static int SQLITE_TCLAPI tcl_client_result(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -432,7 +436,7 @@ static int tcl_client_result(
** Wait on the most recent operation to complete, then return the
** error string.
*/
static int tcl_client_error(
static int SQLITE_TCLAPI tcl_client_error(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -477,7 +481,7 @@ static void do_compile(Thread *p){
**
** Compile a new virtual machine.
*/
static int tcl_client_compile(
static int SQLITE_TCLAPI tcl_client_compile(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -530,7 +534,7 @@ static void do_step(Thread *p){
**
** Advance the virtual machine by one step
*/
static int tcl_client_step(
static int SQLITE_TCLAPI tcl_client_step(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -572,7 +576,7 @@ static void do_finalize(Thread *p){
**
** Finalize the virtual machine.
*/
static int tcl_client_finalize(
static int SQLITE_TCLAPI tcl_client_finalize(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -616,7 +620,7 @@ static void do_reset(Thread *p){
**
** Finalize the virtual machine.
*/
static int tcl_client_reset(
static int SQLITE_TCLAPI tcl_client_reset(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
@@ -647,7 +651,7 @@ static int tcl_client_reset(
**
** Interchange the sqlite* pointer between two threads.
*/
static int tcl_client_swap(
static int SQLITE_TCLAPI tcl_client_swap(
void *NotUsed,
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int argc, /* Number of arguments */
+7 -3
View File
@@ -14,7 +14,11 @@
** testing of the SQLite library.
*/
#include "sqliteInt.h"
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include <stdlib.h>
#include <string.h>
@@ -1353,7 +1357,7 @@ static void moduleDestroy(void *p){
/*
** Register the echo virtual table module.
*/
static int register_echo_module(
static int SQLITE_TCLAPI register_echo_module(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -1393,7 +1397,7 @@ static int register_echo_module(
**
** sqlite3_declare_vtab DB SQL
*/
static int declare_vtab(
static int SQLITE_TCLAPI declare_vtab(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
+8 -4
View File
@@ -15,14 +15,18 @@
** as there is not much point in binding to Tcl.
*/
#include "sqliteInt.h"
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include <stdlib.h>
#include <string.h>
/*
** c_collation_test
*/
static int c_collation_test(
static int SQLITE_TCLAPI c_collation_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -63,7 +67,7 @@ error_out:
/*
** c_realloc_test
*/
static int c_realloc_test(
static int SQLITE_TCLAPI c_realloc_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -104,7 +108,7 @@ error_out:
/*
** c_misuse_test
*/
static int c_misuse_test(
static int SQLITE_TCLAPI c_misuse_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
+13 -6
View File
@@ -15,7 +15,14 @@
*/
#define TCL_THREADS
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
# ifndef SQLITE_TCLAPI
# define SQLITE_TCLAPI
# endif
#endif
#ifdef SQLITE_ENABLE_ASYNCIO
@@ -36,7 +43,7 @@ TCL_DECLARE_MUTEX(testasync_g_writerMutex);
/*
** sqlite3async_initialize PARENT-VFS ISDEFAULT
*/
static int testAsyncInit(
static int SQLITE_TCLAPI testAsyncInit(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -69,7 +76,7 @@ static int testAsyncInit(
/*
** sqlite3async_shutdown
*/
static int testAsyncShutdown(
static int SQLITE_TCLAPI testAsyncShutdown(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -93,7 +100,7 @@ static Tcl_ThreadCreateType tclWriterThread(ClientData pIsStarted){
**
** Start a new writer thread.
*/
static int testAsyncStart(
static int SQLITE_TCLAPI testAsyncStart(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -125,7 +132,7 @@ static int testAsyncStart(
** If the current writer thread is set to run forever then this
** command would block forever. To prevent that, an error is returned.
*/
static int testAsyncWait(
static int SQLITE_TCLAPI testAsyncWait(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -151,7 +158,7 @@ static int testAsyncWait(
/*
** sqlite3async_control OPTION ?VALUE?
*/
static int testAsyncControl(
static int SQLITE_TCLAPI testAsyncControl(
void * clientData,
Tcl_Interp *interp,
int objc,
+21 -14
View File
@@ -11,7 +11,14 @@
*************************************************************************
** Test extension for testing the sqlite3_auto_extension() function.
*/
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
# ifndef SQLITE_TCLAPI
# define SQLITE_TCLAPI
# endif
#endif
#include "sqlite3ext.h"
#ifndef SQLITE_OMIT_LOAD_EXTENSION
@@ -87,13 +94,13 @@ static int broken_init(
**
** Register the "sqr" extension to be loaded automatically.
*/
static int autoExtSqrObjCmd(
static int SQLITE_TCLAPI autoExtSqrObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *CONST objv[]
){
int rc = sqlite3_auto_extension((void*)sqr_init);
int rc = sqlite3_auto_extension((void(*)(void))sqr_init);
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return SQLITE_OK;
}
@@ -103,13 +110,13 @@ static int autoExtSqrObjCmd(
**
** Unregister the "sqr" extension.
*/
static int cancelAutoExtSqrObjCmd(
static int SQLITE_TCLAPI cancelAutoExtSqrObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *CONST objv[]
){
int rc = sqlite3_cancel_auto_extension((void*)sqr_init);
int rc = sqlite3_cancel_auto_extension((void(*)(void))sqr_init);
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return SQLITE_OK;
}
@@ -119,13 +126,13 @@ static int cancelAutoExtSqrObjCmd(
**
** Register the "cube" extension to be loaded automatically.
*/
static int autoExtCubeObjCmd(
static int SQLITE_TCLAPI autoExtCubeObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *CONST objv[]
){
int rc = sqlite3_auto_extension((void*)cube_init);
int rc = sqlite3_auto_extension((void(*)(void))cube_init);
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return SQLITE_OK;
}
@@ -135,13 +142,13 @@ static int autoExtCubeObjCmd(
**
** Unregister the "cube" extension.
*/
static int cancelAutoExtCubeObjCmd(
static int SQLITE_TCLAPI cancelAutoExtCubeObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *CONST objv[]
){
int rc = sqlite3_cancel_auto_extension((void*)cube_init);
int rc = sqlite3_cancel_auto_extension((void(*)(void))cube_init);
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return SQLITE_OK;
}
@@ -151,13 +158,13 @@ static int cancelAutoExtCubeObjCmd(
**
** Register the broken extension to be loaded automatically.
*/
static int autoExtBrokenObjCmd(
static int SQLITE_TCLAPI autoExtBrokenObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *CONST objv[]
){
int rc = sqlite3_auto_extension((void*)broken_init);
int rc = sqlite3_auto_extension((void(*)(void))broken_init);
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return SQLITE_OK;
}
@@ -167,13 +174,13 @@ static int autoExtBrokenObjCmd(
**
** Unregister the broken extension.
*/
static int cancelAutoExtBrokenObjCmd(
static int SQLITE_TCLAPI cancelAutoExtBrokenObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *CONST objv[]
){
int rc = sqlite3_cancel_auto_extension((void*)broken_init);
int rc = sqlite3_cancel_auto_extension((void(*)(void))broken_init);
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return SQLITE_OK;
}
@@ -186,7 +193,7 @@ static int cancelAutoExtBrokenObjCmd(
**
** Reset all auto-extensions
*/
static int resetAutoExtObjCmd(
static int SQLITE_TCLAPI resetAutoExtObjCmd(
void * clientData,
Tcl_Interp *interp,
int objc,
+11 -4
View File
@@ -13,7 +13,14 @@
**
*/
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
# ifndef SQLITE_TCLAPI
# define SQLITE_TCLAPI
# endif
#endif
#include "sqlite3.h"
#include <assert.h>
@@ -23,7 +30,7 @@ extern const char *sqlite3ErrName(int);
/* These functions are implemented in test1.c. */
extern int getDbPointer(Tcl_Interp *, const char *, sqlite3 **);
static int backupTestCmd(
static int SQLITE_TCLAPI backupTestCmd(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -98,7 +105,7 @@ static int backupTestCmd(
return TCL_OK;
}
static void backupTestFinish(ClientData clientData){
static void SQLITE_TCLAPI backupTestFinish(ClientData clientData){
sqlite3_backup *pBackup = (sqlite3_backup *)clientData;
sqlite3_backup_finish(pBackup);
}
@@ -107,7 +114,7 @@ static void backupTestFinish(ClientData clientData){
** sqlite3_backup CMDNAME DESTHANDLE DESTNAME SRCHANDLE SRCNAME
**
*/
static int backupTestInit(
static int SQLITE_TCLAPI backupTestInit(
ClientData clientData,
Tcl_Interp *interp,
int objc,
+6 -2
View File
@@ -93,7 +93,11 @@
#include "sqliteInt.h"
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -563,7 +567,7 @@ extern int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite3 **ppDb);
/*
** Register the echo virtual table module.
*/
static int register_tcl_module(
static int SQLITE_TCLAPI register_tcl_module(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
+10 -6
View File
@@ -12,7 +12,11 @@
**
*/
#include "sqliteInt.h"
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <assert.h>
@@ -95,7 +99,7 @@ static char *blobStringFromObj(Tcl_Obj *pObj){
**
** Tcl test harness for the sqlite3_blob_open() function.
*/
static int test_blob_open(
static int SQLITE_TCLAPI test_blob_open(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* Calling TCL interpreter */
int objc, /* Number of arguments */
@@ -146,7 +150,7 @@ static int test_blob_open(
/*
** sqlite3_blob_close HANDLE
*/
static int test_blob_close(
static int SQLITE_TCLAPI test_blob_close(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -174,7 +178,7 @@ static int test_blob_close(
/*
** sqlite3_blob_bytes HANDLE
*/
static int test_blob_bytes(
static int SQLITE_TCLAPI test_blob_bytes(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -210,7 +214,7 @@ static int test_blob_bytes(
** text representation of the returned error code (i.e. "SQLITE_NOMEM")
** and a Tcl exception is thrown.
*/
static int test_blob_read(
static int SQLITE_TCLAPI test_blob_read(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -262,7 +266,7 @@ static int test_blob_read(
** result is set to the text representation of the returned error code
** (i.e. "SQLITE_NOMEM") and a Tcl exception is thrown.
*/
static int test_blob_write(
static int SQLITE_TCLAPI test_blob_write(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
+6 -2
View File
@@ -14,7 +14,11 @@
** testing of the SQLite library.
*/
#include "btreeInt.h"
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
/*
** Usage: sqlite3_shared_cache_report
@@ -22,7 +26,7 @@
** Return a list of file that are shared and the number of
** references to each file.
*/
int sqlite3BtreeSharedCacheReport(
int SQLITE_TCLAPI sqlite3BtreeSharedCacheReport(
void * clientData,
Tcl_Interp *interp,
int objc,
+5 -1
View File
@@ -24,7 +24,11 @@
# include "os_win.h"
#endif
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include <stdlib.h>
#include <string.h>
+10 -3
View File
@@ -641,10 +641,17 @@ sqlite3_vfs *sqlite3_demovfs(void){
#ifdef SQLITE_TEST
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
# ifndef SQLITE_TCLAPI
# define SQLITE_TCLAPI
# endif
#endif
#if SQLITE_OS_UNIX
static int register_demovfs(
static int SQLITE_TCLAPI register_demovfs(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -653,7 +660,7 @@ static int register_demovfs(
sqlite3_vfs_register(sqlite3_demovfs(), 1);
return TCL_OK;
}
static int unregister_demovfs(
static int SQLITE_TCLAPI unregister_demovfs(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
+12 -4
View File
@@ -62,7 +62,11 @@
** SELECT * FROM fstree WHERE path LIKE '/home/dan/sqlite/%'
*/
#include "sqliteInt.h"
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include <stdlib.h>
#include <string.h>
@@ -495,9 +499,13 @@ static int fstreeFilter(
char aWild[2] = { '\0', '\0' };
#if SQLITE_OS_WIN
zRoot = sqlite3_mprintf("%s%c", getenv("SystemDrive"), '/');
const char *zDrive = windirent_getenv("fstreeDrive");
if( zDrive==0 ){
zDrive = windirent_getenv("SystemDrive");
}
zRoot = sqlite3_mprintf("%s%c", zDrive, '/');
nRoot = sqlite3Strlen30(zRoot);
zPrefix = sqlite3_mprintf("%s", getenv("SystemDrive"));
zPrefix = sqlite3_mprintf("%s", zDrive);
nPrefix = sqlite3Strlen30(zPrefix);
#else
zRoot = "/";
@@ -871,7 +879,7 @@ extern int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite3 **ppDb);
/*
** Register the echo virtual table module.
*/
static int register_fs_module(
static int SQLITE_TCLAPI register_fs_module(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
+19 -11
View File
@@ -13,7 +13,11 @@
** implements new SQL functions used by the test scripts.
*/
#include "sqlite3.h"
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <assert.h>
@@ -21,7 +25,6 @@
#include "sqliteInt.h"
#include "vdbeInt.h"
/*
** Allocate nByte bytes of space using sqlite3_malloc(). If the
** allocation fails, call sqlite3_result_error_nomem() to notify
@@ -640,7 +643,11 @@ static void test_setsubtype(
sqlite3_result_subtype(context, (unsigned int)sqlite3_value_int(argv[1]));
}
static int registerTestFunctions(sqlite3 *db){
static int registerTestFunctions(
sqlite3 *db,
char **pzErrMsg,
const sqlite3_api_routines *pThunk
){
static const struct {
char *zName;
signed char nArg;
@@ -689,16 +696,16 @@ static int registerTestFunctions(sqlite3 *db){
** the standard set of test functions to be loaded into each new
** database connection.
*/
static int autoinstall_test_funcs(
static int SQLITE_TCLAPI autoinstall_test_funcs(
void * clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *CONST objv[]
){
extern int Md5_Register(sqlite3*);
int rc = sqlite3_auto_extension((void*)registerTestFunctions);
extern int Md5_Register(sqlite3 *, char **, const sqlite3_api_routines *);
int rc = sqlite3_auto_extension((void(*)(void))registerTestFunctions);
if( rc==SQLITE_OK ){
rc = sqlite3_auto_extension((void*)Md5_Register);
rc = sqlite3_auto_extension((void(*)(void))Md5_Register);
}
Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
return TCL_OK;
@@ -717,7 +724,7 @@ static void tFinal(sqlite3_context *a){}
** Make various calls to sqlite3_create_function that do not have valid
** parameters. Verify that the error condition is detected and reported.
*/
static int abuse_create_function(
static int SQLITE_TCLAPI abuse_create_function(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -783,6 +790,7 @@ abuse_err:
return TCL_ERROR;
}
/*
** Register commands with the TCL interpreter.
*/
@@ -795,13 +803,13 @@ int Sqlitetest_func_Init(Tcl_Interp *interp){
{ "abuse_create_function", abuse_create_function },
};
int i;
extern int Md5_Register(sqlite3*);
extern int Md5_Register(sqlite3 *, char **, const sqlite3_api_routines *);
for(i=0; i<sizeof(aObjCmd)/sizeof(aObjCmd[0]); i++){
Tcl_CreateObjCommand(interp, aObjCmd[i].zName, aObjCmd[i].xProc, 0, 0);
}
sqlite3_initialize();
sqlite3_auto_extension((void*)registerTestFunctions);
sqlite3_auto_extension((void*)Md5_Register);
sqlite3_auto_extension((void(*)(void))registerTestFunctions);
sqlite3_auto_extension((void(*)(void))Md5_Register);
return TCL_OK;
}
+12 -8
View File
@@ -18,7 +18,11 @@
** easier and safer to build our own mechanism.
*/
#include "sqliteInt.h"
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <assert.h>
@@ -94,7 +98,7 @@ int sqlite3TestHexToBin(const unsigned char *zIn, int N, unsigned char *aOut){
** beginning of the file. Convert that information to hexadecimal
** and return the resulting HEX string.
*/
static int hexio_read(
static int SQLITE_TCLAPI hexio_read(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -144,7 +148,7 @@ static int hexio_read(
** Write DATA into file FILENAME beginning at OFFSET from the
** beginning of the file. DATA is expressed in hexadecimal.
*/
static int hexio_write(
static int SQLITE_TCLAPI hexio_write(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -192,7 +196,7 @@ static int hexio_write(
** the value of that integer. HEXDATA can contain between 2 and 8
** hexadecimal digits.
*/
static int hexio_get_int(
static int SQLITE_TCLAPI hexio_get_int(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -232,7 +236,7 @@ static int hexio_get_int(
**
** Render INTEGER has a 16-bit big-endian integer in hexadecimal.
*/
static int hexio_render_int16(
static int SQLITE_TCLAPI hexio_render_int16(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -259,7 +263,7 @@ static int hexio_render_int16(
**
** Render INTEGER has a 32-bit big-endian integer in hexadecimal.
*/
static int hexio_render_int32(
static int SQLITE_TCLAPI hexio_render_int32(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -289,7 +293,7 @@ static int hexio_render_int32(
** The UTF8 might not be well-formed. Run this string through
** sqlite3Utf8to8() convert it back to hex and return the result.
*/
static int utf8_to_utf8(
static int SQLITE_TCLAPI utf8_to_utf8(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -340,7 +344,7 @@ static int getFts3Varint(const char *p, sqlite_int64 *v){
** Read a varint from the start of BLOB. Set variable VARNAME to contain
** the interpreted value. Return the number of bytes of BLOB consumed.
*/
static int read_fts3varint(
static int SQLITE_TCLAPI read_fts3varint(
void * clientData,
Tcl_Interp *interp,
int objc,
+9 -5
View File
@@ -27,7 +27,11 @@
#include "sqliteInt.h"
#include <string.h>
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
static struct Wrapped {
sqlite3_pcache_methods2 pcache;
@@ -184,7 +188,7 @@ static void installInitWrappers(void){
sqlite3_config(SQLITE_CONFIG_PCACHE2, &pcachemethods);
}
static int init_wrapper_install(
static int SQLITE_TCLAPI init_wrapper_install(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -208,7 +212,7 @@ static int init_wrapper_install(
return TCL_OK;
}
static int init_wrapper_uninstall(
static int SQLITE_TCLAPI init_wrapper_uninstall(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -226,7 +230,7 @@ static int init_wrapper_uninstall(
return TCL_OK;
}
static int init_wrapper_clear(
static int SQLITE_TCLAPI init_wrapper_clear(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -243,7 +247,7 @@ static int init_wrapper_clear(
return TCL_OK;
}
static int init_wrapper_query(
static int SQLITE_TCLAPI init_wrapper_query(
ClientData clientData, /* Unused */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
+10 -3
View File
@@ -270,7 +270,14 @@ SQLITE_API int sqlite3_intarray_bind(
** Everything below is interface for testing this module.
*/
#ifdef SQLITE_TEST
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
# ifndef SQLITE_TCLAPI
# define SQLITE_TCLAPI
# endif
#endif
/*
** Routines to encode and decode pointers
@@ -286,7 +293,7 @@ extern const char *sqlite3ErrName(int);
** Invoke the sqlite3_intarray_create interface. A string that becomes
** the first parameter to sqlite3_intarray_bind.
*/
static int test_intarray_create(
static int SQLITE_TCLAPI test_intarray_create(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
@@ -322,7 +329,7 @@ static int test_intarray_create(
**
** Invoke the sqlite3_intarray_bind interface on the given array of integers.
*/
static int test_intarray_bind(
static int SQLITE_TCLAPI test_intarray_bind(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
+37 -33
View File
@@ -14,7 +14,11 @@
** memory allocation subsystem.
*/
#include "sqliteInt.h"
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <assert.h>
@@ -306,7 +310,7 @@ static int textToPointer(const char *z, void **pp){
**
** Raw test interface for sqlite3_malloc().
*/
static int test_malloc(
static int SQLITE_TCLAPI test_malloc(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -331,7 +335,7 @@ static int test_malloc(
**
** Raw test interface for sqlite3_realloc().
*/
static int test_realloc(
static int SQLITE_TCLAPI test_realloc(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -360,7 +364,7 @@ static int test_realloc(
**
** Raw test interface for sqlite3_free().
*/
static int test_free(
static int SQLITE_TCLAPI test_free(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -391,7 +395,7 @@ int sqlite3TestBinToHex(char*,int);
** Set a chunk of memory (obtained from malloc, probably) to a
** specified hex pattern.
*/
static int test_memset(
static int SQLITE_TCLAPI test_memset(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -437,7 +441,7 @@ static int test_memset(
**
** Return memory as hexadecimal text.
*/
static int test_memget(
static int SQLITE_TCLAPI test_memget(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -484,7 +488,7 @@ static int test_memget(
**
** Raw test interface for sqlite3_memory_used().
*/
static int test_memory_used(
static int SQLITE_TCLAPI test_memory_used(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -499,7 +503,7 @@ static int test_memory_used(
**
** Raw test interface for sqlite3_memory_highwater().
*/
static int test_memory_highwater(
static int SQLITE_TCLAPI test_memory_highwater(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -524,7 +528,7 @@ static int test_memory_highwater(
** Set the depth of backtracing. If SQLITE_MEMDEBUG is not defined
** then this routine is a no-op.
*/
static int test_memdebug_backtrace(
static int SQLITE_TCLAPI test_memdebug_backtrace(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -550,7 +554,7 @@ static int test_memdebug_backtrace(
**
** Write a summary of unfreed memory to FILENAME.
*/
static int test_memdebug_dump(
static int SQLITE_TCLAPI test_memdebug_dump(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -575,7 +579,7 @@ static int test_memdebug_dump(
**
** Return the total number of times malloc() has been called.
*/
static int test_memdebug_malloc_count(
static int SQLITE_TCLAPI test_memdebug_malloc_count(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -615,7 +619,7 @@ static int test_memdebug_malloc_count(
**
** To disable simulated failures, use a COUNTER of -1.
*/
static int test_memdebug_fail(
static int SQLITE_TCLAPI test_memdebug_fail(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -681,7 +685,7 @@ static int test_memdebug_fail(
** simulated failure occurs. A negative return value indicates that
** no malloc() failure is scheduled.
*/
static int test_memdebug_pending(
static int SQLITE_TCLAPI test_memdebug_pending(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -714,7 +718,7 @@ static int sqlite3_memdebug_title_count = 0;
**
** Each title overwrite the previous.
*/
static int test_memdebug_settitle(
static int SQLITE_TCLAPI test_memdebug_settitle(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -795,7 +799,7 @@ static void test_memdebug_log_clear(void){
Tcl_InitHashTable(&aMallocLog, MALLOC_LOG_KEYINTS);
}
static int test_memdebug_log(
static int SQLITE_TCLAPI test_memdebug_log(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -893,7 +897,7 @@ static int test_memdebug_log(
**
** A negative SIZE causes the buffer pointer to be NULL.
*/
static int test_config_scratch(
static int SQLITE_TCLAPI test_config_scratch(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -933,7 +937,7 @@ static int test_config_scratch(
**
** A negative SIZE causes the buffer pointer to be NULL.
*/
static int test_config_pagecache(
static int SQLITE_TCLAPI test_config_pagecache(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -976,7 +980,7 @@ static int test_config_pagecache(
** is certainty. 0 is never. PRNG_SEED is the pseudo-random number generator
** seed.
*/
static int test_alt_pcache(
static int SQLITE_TCLAPI test_alt_pcache(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1017,7 +1021,7 @@ static int test_alt_pcache(
**
** Enable or disable memory status reporting using SQLITE_CONFIG_MEMSTATUS.
*/
static int test_config_memstatus(
static int SQLITE_TCLAPI test_config_memstatus(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1038,7 +1042,7 @@ static int test_config_memstatus(
** Usage: sqlite3_config_lookaside SIZE COUNT
**
*/
static int test_config_lookaside(
static int SQLITE_TCLAPI test_config_lookaside(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1072,7 +1076,7 @@ static int test_config_lookaside(
** is 10KB in size. A BUFID of 0 indicates that the buffer should be NULL
** which will cause sqlite3_db_config() to allocate space on its own.
*/
static int test_db_config_lookaside(
static int SQLITE_TCLAPI test_db_config_lookaside(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1107,7 +1111,7 @@ static int test_db_config_lookaside(
/*
** Usage: sqlite3_config_heap NBYTE NMINALLOC
*/
static int test_config_heap(
static int SQLITE_TCLAPI test_config_heap(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1144,7 +1148,7 @@ static int test_config_heap(
/*
** Usage: sqlite3_config_heap_size NBYTE
*/
static int test_config_heap_size(
static int SQLITE_TCLAPI test_config_heap_size(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1174,7 +1178,7 @@ static int test_config_heap_size(
** Invoke sqlite3_config() or sqlite3_db_config() with invalid
** opcodes and verify that they return errors.
*/
static int test_config_error(
static int SQLITE_TCLAPI test_config_error(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1212,7 +1216,7 @@ static int test_config_error(
** Enables or disables interpretation of URI parameters by default using
** SQLITE_CONFIG_URI.
*/
static int test_config_uri(
static int SQLITE_TCLAPI test_config_uri(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1241,7 +1245,7 @@ static int test_config_uri(
** Enables or disables the use of the covering-index scan optimization.
** SQLITE_CONFIG_COVERING_INDEX_SCAN.
*/
static int test_config_cis(
static int SQLITE_TCLAPI test_config_cis(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1269,7 +1273,7 @@ static int test_config_cis(
**
** Set the minimum PMA size.
*/
static int test_config_pmasz(
static int SQLITE_TCLAPI test_config_pmasz(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1299,7 +1303,7 @@ static int test_config_pmasz(
**
** Write a summary of unfreed memsys3 allocations to FILENAME.
*/
static int test_dump_memsys3(
static int SQLITE_TCLAPI test_dump_memsys3(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1335,7 +1339,7 @@ static int test_dump_memsys3(
** Return a list of three elements which are the sqlite3_status() return
** code, the current value, and the high-water mark value.
*/
static int test_status(
static int SQLITE_TCLAPI test_status(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1392,7 +1396,7 @@ static int test_status(
** Return a list of three elements which are the sqlite3_db_status() return
** code, the current value, and the high-water mark value.
*/
static int test_db_status(
static int SQLITE_TCLAPI test_db_status(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1453,7 +1457,7 @@ static int test_db_status(
/*
** install_malloc_faultsim BOOLEAN
*/
static int test_install_malloc_faultsim(
static int SQLITE_TCLAPI test_install_malloc_faultsim(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1477,7 +1481,7 @@ static int test_install_malloc_faultsim(
/*
** sqlite3_install_memsys3
*/
static int test_install_memsys3(
static int SQLITE_TCLAPI test_install_memsys3(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1492,7 +1496,7 @@ static int test_install_memsys3(
return TCL_OK;
}
static int test_vfs_oom_test(
static int SQLITE_TCLAPI test_vfs_oom_test(
void * clientData,
Tcl_Interp *interp,
int objc,
+13 -6
View File
@@ -1197,7 +1197,7 @@ int sqlite3_multiplex_initialize(const char *zOrigVfsName, int makeDefault){
gMultiplex.sIoMethodsV2.xShmUnmap = multiplexShmUnmap;
sqlite3_vfs_register(&gMultiplex.sThisVfs, makeDefault);
sqlite3_auto_extension((void*)multiplexFuncInit);
sqlite3_auto_extension((void(*)(void))multiplexFuncInit);
return SQLITE_OK;
}
@@ -1229,14 +1229,21 @@ int sqlite3_multiplex_shutdown(int eForce){
/***************************** Test Code ***********************************/
#ifdef SQLITE_TEST
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
# ifndef SQLITE_TCLAPI
# define SQLITE_TCLAPI
# endif
#endif
extern const char *sqlite3ErrName(int);
/*
** tclcmd: sqlite3_multiplex_initialize NAME MAKEDEFAULT
*/
static int test_multiplex_initialize(
static int SQLITE_TCLAPI test_multiplex_initialize(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1267,7 +1274,7 @@ static int test_multiplex_initialize(
/*
** tclcmd: sqlite3_multiplex_shutdown
*/
static int test_multiplex_shutdown(
static int SQLITE_TCLAPI test_multiplex_shutdown(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1295,7 +1302,7 @@ static int test_multiplex_shutdown(
/*
** tclcmd: sqlite3_multiplex_dump
*/
static int test_multiplex_dump(
static int SQLITE_TCLAPI test_multiplex_dump(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1350,7 +1357,7 @@ static int test_multiplex_dump(
/*
** Tclcmd: test_multiplex_control HANDLE DBNAME SUB-COMMAND ?INT-VALUE?
*/
static int test_multiplex_control(
static int SQLITE_TCLAPI test_multiplex_control(
ClientData cd,
Tcl_Interp *interp,
int objc,
+16 -12
View File
@@ -12,7 +12,11 @@
** This file contains test logic for the sqlite3_mutex interfaces.
*/
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include "sqlite3.h"
#include "sqliteInt.h"
#include <stdlib.h>
@@ -152,7 +156,7 @@ static void counterMutexLeave(sqlite3_mutex *p){
/*
** sqlite3_shutdown
*/
static int test_shutdown(
static int SQLITE_TCLAPI test_shutdown(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -173,7 +177,7 @@ static int test_shutdown(
/*
** sqlite3_initialize
*/
static int test_initialize(
static int SQLITE_TCLAPI test_initialize(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -194,7 +198,7 @@ static int test_initialize(
/*
** install_mutex_counters BOOLEAN
*/
static int test_install_mutex_counters(
static int SQLITE_TCLAPI test_install_mutex_counters(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -255,7 +259,7 @@ static int test_install_mutex_counters(
/*
** read_mutex_counters
*/
static int test_read_mutex_counters(
static int SQLITE_TCLAPI test_read_mutex_counters(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -284,7 +288,7 @@ static int test_read_mutex_counters(
/*
** clear_mutex_counters
*/
static int test_clear_mutex_counters(
static int SQLITE_TCLAPI test_clear_mutex_counters(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -308,7 +312,7 @@ static int test_clear_mutex_counters(
** will be invalid since the mutex has already been freed. The
** return pointer just checks to see if the mutex really was allocated.
*/
static int test_alloc_mutex(
static int SQLITE_TCLAPI test_alloc_mutex(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -335,7 +339,7 @@ static int test_alloc_mutex(
**
** Or OPTION can be an raw integer.
*/
static int test_config(
static int SQLITE_TCLAPI test_config(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -397,7 +401,7 @@ static sqlite3_mutex *getStaticMutexPointer(
return counterMutexAlloc(iMutex);
}
static int test_enter_static_mutex(
static int SQLITE_TCLAPI test_enter_static_mutex(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -416,7 +420,7 @@ static int test_enter_static_mutex(
return TCL_OK;
}
static int test_leave_static_mutex(
static int SQLITE_TCLAPI test_leave_static_mutex(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -435,7 +439,7 @@ static int test_leave_static_mutex(
return TCL_OK;
}
static int test_enter_db_mutex(
static int SQLITE_TCLAPI test_enter_db_mutex(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -454,7 +458,7 @@ static int test_enter_db_mutex(
return TCL_OK;
}
static int test_leave_db_mutex(
static int SQLITE_TCLAPI test_leave_db_mutex(
void * clientData,
Tcl_Interp *interp,
int objc,
+9 -2
View File
@@ -1104,9 +1104,16 @@ int sqlite3_vfslog_register(sqlite3 *db){
#if defined(SQLITE_TEST) || defined(TCLSH)
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
# ifndef SQLITE_TCLAPI
# define SQLITE_TCLAPI
# endif
#endif
static int test_vfslog(
static int SQLITE_TCLAPI test_vfslog(
void *clientData,
Tcl_Interp *interp,
int objc,
+43 -36
View File
@@ -111,7 +111,7 @@ struct quotaFile {
/*
** An instance of the following object represents each open connection
** to a file that participates in quota tracking. This object is a
** to a file that participates in quota tracking. This object is a
** subclass of sqlite3_file. The sqlite3_file object for the underlying
** VFS is appended to this structure.
*/
@@ -154,11 +154,11 @@ static struct {
*/
sqlite3_vfs sThisVfs;
/* The sIoMethods defines the methods used by sqlite3_file objects
/* The sIoMethods defines the methods used by sqlite3_file objects
** associated with this shim. It is initialized at start-time and does
** not require a mutex.
**
** When the underlying VFS is called to open a file, it might return
** When the underlying VFS is called to open a file, it might return
** either a version 1 or a version 2 sqlite3_file object. This shim
** has to create a wrapper sqlite3_file of the same version. Hence
** there are two I/O method structures, one for version 1 and the other
@@ -190,7 +190,7 @@ static struct {
static void quotaEnter(void){ sqlite3_mutex_enter(gQuota.pMutex); }
static void quotaLeave(void){ sqlite3_mutex_leave(gQuota.pMutex); }
/* Count the number of open files in a quotaGroup
/* Count the number of open files in a quotaGroup
*/
static int quotaGroupOpenFileCount(quotaGroup *pGroup){
int N = 0;
@@ -399,7 +399,7 @@ static char *quota_utf8_to_mbcs(const char *zUtf8){
return zMbcs;
#else
return (char*)zUtf8; /* No-op on unix */
#endif
#endif
}
/*
@@ -410,7 +410,7 @@ static void quota_mbcs_free(char *zOld){
sqlite3_free(zOld);
#else
/* No-op on unix */
#endif
#endif
}
/************************* VFS Method Wrappers *****************************/
@@ -428,7 +428,7 @@ static int quotaOpen(
int flags, /* Flags to control the opening */
int *pOutFlags /* Flags showing results of opening */
){
int rc; /* Result code */
int rc; /* Result code */
quotaConn *pQuotaOpen; /* The new quota file descriptor */
quotaFile *pFile; /* Corresponding quotaFile obj */
quotaGroup *pGroup; /* The group file belongs to */
@@ -488,7 +488,7 @@ static int quotaDelete(
const char *zName, /* Name of file to be deleted */
int syncDir /* Do a directory sync after deleting */
){
int rc; /* Result code */
int rc; /* Result code */
quotaFile *pFile; /* Files in the quota */
quotaGroup *pGroup; /* The group file belongs to */
sqlite3_vfs *pOrigVfs = gQuota.pOrigVfs; /* Real VFS */
@@ -581,7 +581,7 @@ static int quotaWrite(
szNew = pGroup->iSize - pFile->iSize + iEnd;
if( szNew>pGroup->iLimit && pGroup->iLimit>0 ){
if( pGroup->xCallback ){
pGroup->xCallback(pFile->zFilename, &pGroup->iLimit, szNew,
pGroup->xCallback(pFile->zFilename, &pGroup->iLimit, szNew,
pGroup->pArg);
}
if( szNew>pGroup->iLimit && pGroup->iLimit>0 ){
@@ -738,7 +738,7 @@ static int quotaShmUnmap(sqlite3_file *pConn, int deleteFlag){
/*
** Initialize the quota VFS shim. Use the VFS named zOrigVfsName
** as the VFS that does the actual work. Use the default if
** zOrigVfsName==NULL.
** zOrigVfsName==NULL.
**
** The quota VFS shim is named "quota". It will become the default
** VFS if makeDefault is non-zero.
@@ -908,7 +908,7 @@ int sqlite3_quota_file(const char *zFilename){
if( rc==SQLITE_OK ){
zFull[strlen(zFull)+1] = '\0';
rc = quotaOpen(&gQuota.sThisVfs, zFull, fd,
rc = quotaOpen(&gQuota.sThisVfs, zFull, fd,
SQLITE_OPEN_READONLY | SQLITE_OPEN_MAIN_DB, &outFlags);
if( rc==SQLITE_OK ){
fd->pMethods->xFileSize(fd, &iSize);
@@ -1016,7 +1016,7 @@ size_t sqlite3_quota_fwrite(
szNew = pGroup->iSize - pFile->iSize + iEnd;
if( szNew>pGroup->iLimit && pGroup->iLimit>0 ){
if( pGroup->xCallback ){
pGroup->xCallback(pFile->zFilename, &pGroup->iLimit, szNew,
pGroup->xCallback(pFile->zFilename, &pGroup->iLimit, szNew,
pGroup->pArg);
}
if( szNew>pGroup->iLimit && pGroup->iLimit>0 ){
@@ -1203,7 +1203,7 @@ sqlite3_int64 sqlite3_quota_file_truesize(quota_FILE *p){
sqlite3_int64 sqlite3_quota_file_size(quota_FILE *p){
return p->pFile ? p->pFile->iSize : -1;
}
/*
** Determine the amount of data in bytes available for reading
** in the given file.
@@ -1275,10 +1275,17 @@ int sqlite3_quota_remove(const char *zFilename){
sqlite3_free(zFull);
return rc;
}
/***************************** Test Code ***********************************/
#ifdef SQLITE_TEST
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
# ifndef SQLITE_TCLAPI
# define SQLITE_TCLAPI
# endif
#endif
/*
** Argument passed to a TCL quota-over-limit callback.
@@ -1350,7 +1357,7 @@ static void tclCallbackDestructor(void *pObj){
/*
** tclcmd: sqlite3_quota_initialize NAME MAKEDEFAULT
*/
static int test_quota_initialize(
static int SQLITE_TCLAPI test_quota_initialize(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1379,7 +1386,7 @@ static int test_quota_initialize(
/*
** tclcmd: sqlite3_quota_shutdown
*/
static int test_quota_shutdown(
static int SQLITE_TCLAPI test_quota_shutdown(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1402,7 +1409,7 @@ static int test_quota_shutdown(
/*
** tclcmd: sqlite3_quota_set PATTERN LIMIT SCRIPT
*/
static int test_quota_set(
static int SQLITE_TCLAPI test_quota_set(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1456,7 +1463,7 @@ static int test_quota_set(
/*
** tclcmd: sqlite3_quota_file FILENAME
*/
static int test_quota_file(
static int SQLITE_TCLAPI test_quota_file(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1482,7 +1489,7 @@ static int test_quota_file(
/*
** tclcmd: sqlite3_quota_dump
*/
static int test_quota_dump(
static int SQLITE_TCLAPI test_quota_dump(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1530,7 +1537,7 @@ static int test_quota_dump(
/*
** tclcmd: sqlite3_quota_fopen FILENAME MODE
*/
static int test_quota_fopen(
static int SQLITE_TCLAPI test_quota_fopen(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1560,7 +1567,7 @@ extern void *sqlite3TestTextToPtr(const char*);
/*
** tclcmd: sqlite3_quota_fread HANDLE SIZE NELEM
*/
static int test_quota_fread(
static int SQLITE_TCLAPI test_quota_fread(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1594,7 +1601,7 @@ static int test_quota_fread(
/*
** tclcmd: sqlite3_quota_fwrite HANDLE SIZE NELEM CONTENT
*/
static int test_quota_fwrite(
static int SQLITE_TCLAPI test_quota_fwrite(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1622,7 +1629,7 @@ static int test_quota_fwrite(
/*
** tclcmd: sqlite3_quota_fclose HANDLE
*/
static int test_quota_fclose(
static int SQLITE_TCLAPI test_quota_fclose(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1644,7 +1651,7 @@ static int test_quota_fclose(
/*
** tclcmd: sqlite3_quota_fflush HANDLE ?HARDSYNC?
*/
static int test_quota_fflush(
static int SQLITE_TCLAPI test_quota_fflush(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1670,7 +1677,7 @@ static int test_quota_fflush(
/*
** tclcmd: sqlite3_quota_fseek HANDLE OFFSET WHENCE
*/
static int test_quota_fseek(
static int SQLITE_TCLAPI test_quota_fseek(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1708,7 +1715,7 @@ static int test_quota_fseek(
/*
** tclcmd: sqlite3_quota_rewind HANDLE
*/
static int test_quota_rewind(
static int SQLITE_TCLAPI test_quota_rewind(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1727,7 +1734,7 @@ static int test_quota_rewind(
/*
** tclcmd: sqlite3_quota_ftell HANDLE
*/
static int test_quota_ftell(
static int SQLITE_TCLAPI test_quota_ftell(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1748,7 +1755,7 @@ static int test_quota_ftell(
/*
** tclcmd: sqlite3_quota_ftruncate HANDLE SIZE
*/
static int test_quota_ftruncate(
static int SQLITE_TCLAPI test_quota_ftruncate(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1773,7 +1780,7 @@ static int test_quota_ftruncate(
/*
** tclcmd: sqlite3_quota_file_size HANDLE
*/
static int test_quota_file_size(
static int SQLITE_TCLAPI test_quota_file_size(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1794,7 +1801,7 @@ static int test_quota_file_size(
/*
** tclcmd: sqlite3_quota_file_truesize HANDLE
*/
static int test_quota_file_truesize(
static int SQLITE_TCLAPI test_quota_file_truesize(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1815,7 +1822,7 @@ static int test_quota_file_truesize(
/*
** tclcmd: sqlite3_quota_file_mtime HANDLE
*/
static int test_quota_file_mtime(
static int SQLITE_TCLAPI test_quota_file_mtime(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1838,7 +1845,7 @@ static int test_quota_file_mtime(
/*
** tclcmd: sqlite3_quota_remove FILENAME
*/
static int test_quota_remove(
static int SQLITE_TCLAPI test_quota_remove(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1862,7 +1869,7 @@ static int test_quota_remove(
** Test the glob pattern matching. Return 1 if TEXT matches PATTERN
** and return 0 if it does not.
*/
static int test_quota_glob(
static int SQLITE_TCLAPI test_quota_glob(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1888,7 +1895,7 @@ static int test_quota_glob(
** Return the number of bytes from the current file point to the end of
** the file.
*/
static int test_quota_file_available(
static int SQLITE_TCLAPI test_quota_file_available(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -1911,7 +1918,7 @@ static int test_quota_file_available(
**
** Return true if the file handle is in the error state.
*/
static int test_quota_ferror(
static int SQLITE_TCLAPI test_quota_ferror(
void * clientData,
Tcl_Interp *interp,
int objc,
+12 -4
View File
@@ -14,7 +14,11 @@
*/
#include "sqlite3.h"
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
/* Solely for the UNUSED_PARAMETER() macro. */
#include "sqliteInt.h"
@@ -353,7 +357,11 @@ static int bfs_query_func(sqlite3_rtree_query_info *p){
*************************************************************************/
#include <assert.h>
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
typedef struct Cube Cube;
struct Cube {
@@ -432,7 +440,7 @@ static int cube_geom(
}
#endif /* SQLITE_ENABLE_RTREE */
static int register_cube_geom(
static int SQLITE_TCLAPI register_cube_geom(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -460,7 +468,7 @@ static int register_cube_geom(
return TCL_OK;
}
static int register_circle_geom(
static int SQLITE_TCLAPI register_circle_geom(
void * clientData,
Tcl_Interp *interp,
int objc,
+8 -4
View File
@@ -35,10 +35,14 @@
** to be compiled into an sqlite dynamic extension.
*/
#ifdef SQLITE_TEST
#include "sqliteInt.h"
#include "tcl.h"
# include "sqliteInt.h"
# if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
# else
# include "tcl.h"
# endif
#else
#include "sqlite3ext.h"
# include "sqlite3ext.h"
SQLITE_EXTENSION_INIT1
#endif
@@ -302,7 +306,7 @@ extern int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite3 **ppDb);
/*
** Register the schema virtual table module.
*/
static int register_schema_module(
static int SQLITE_TCLAPI register_schema_module(
ClientData clientData, /* Not used */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
+11 -4
View File
@@ -256,7 +256,14 @@ int sqlite3demo_superlock(
#ifdef SQLITE_TEST
#include <tcl.h>
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
# ifndef SQLITE_TCLAPI
# define SQLITE_TCLAPI
# endif
#endif
struct InterpAndScript {
Tcl_Interp *interp;
@@ -264,11 +271,11 @@ struct InterpAndScript {
};
typedef struct InterpAndScript InterpAndScript;
static void superunlock_del(ClientData cd){
static void SQLITE_TCLAPI superunlock_del(ClientData cd){
sqlite3demo_superunlock((void *)cd);
}
static int superunlock_cmd(
static int SQLITE_TCLAPI superunlock_cmd(
ClientData cd,
Tcl_Interp *interp,
int objc,
@@ -300,7 +307,7 @@ static int superlock_busy(void *pCtx, int nBusy){
/*
** Tclcmd: sqlite3demo_superlock CMDNAME PATH VFS BUSY-HANDLER-SCRIPT
*/
static int superlock_cmd(
static int SQLITE_TCLAPI superlock_cmd(
ClientData cd,
Tcl_Interp *interp,
int objc,
+15 -11
View File
@@ -76,7 +76,11 @@
#include "sqliteInt.h"
#include "sqlite3.h"
#include "tcl.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <assert.h>
@@ -418,7 +422,7 @@ static void *ts_mremap(void *a, size_t b, size_t c, int d, ...){
return orig_mremap(a, b, c, d, pArg);
}
static int test_syscall_install(
static int SQLITE_TCLAPI test_syscall_install(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -454,7 +458,7 @@ static int test_syscall_install(
return TCL_OK;
}
static int test_syscall_uninstall(
static int SQLITE_TCLAPI test_syscall_uninstall(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -478,7 +482,7 @@ static int test_syscall_uninstall(
return TCL_OK;
}
static int test_syscall_reset(
static int SQLITE_TCLAPI test_syscall_reset(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -516,7 +520,7 @@ static int test_syscall_reset(
return TCL_OK;
}
static int test_syscall_exists(
static int SQLITE_TCLAPI test_syscall_exists(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -537,7 +541,7 @@ static int test_syscall_exists(
return TCL_OK;
}
static int test_syscall_fault(
static int SQLITE_TCLAPI test_syscall_fault(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -566,7 +570,7 @@ static int test_syscall_fault(
return TCL_OK;
}
static int test_syscall_errno(
static int SQLITE_TCLAPI test_syscall_errno(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -612,7 +616,7 @@ static int test_syscall_errno(
return TCL_OK;
}
static int test_syscall_list(
static int SQLITE_TCLAPI test_syscall_list(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -642,7 +646,7 @@ static int test_syscall_list(
return TCL_OK;
}
static int test_syscall_defaultvfs(
static int SQLITE_TCLAPI test_syscall_defaultvfs(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -664,7 +668,7 @@ static int ts_getpagesize(void){
return gSyscall.pgsz;
}
static int test_syscall_pagesize(
static int SQLITE_TCLAPI test_syscall_pagesize(
void * clientData,
Tcl_Interp *interp,
int objc,
@@ -699,7 +703,7 @@ static int test_syscall_pagesize(
return TCL_OK;
}
static int test_syscall(
static int SQLITE_TCLAPI test_syscall(
void * clientData,
Tcl_Interp *interp,
int objc,

Some files were not shown because too many files have changed in this diff Show More