Commit Graph

16654 Commits

Author SHA1 Message Date
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