drh
48baed4f77
Avoid unnecessary loads of columns in an aggregate query that are not
...
within an aggregate function and that are not part of the GROUP BY clause.
FossilOrigin-Name: e15e100660d290249ef235e7a8927b88296e56ec0f80ec626eecbd542adc7633
2018-06-05 23:21:11 +00:00
drh
8c2b6d784b
Add the OP_IfNoHope and OP_SeekHit opcodes used to reduce the number of
...
unnecessary sqlite3BtreeMovetoUnpacked() calls when checking for an early
exit on IN-operator loops. Futher optimizations are likely possible here.
FossilOrigin-Name: 6bf251af4347165a470d39457d61ab6d2a06c206db8f30bd8be5dbb388ae8a5b
2018-06-05 20:45:20 +00:00
dan
280c894b74
Calculate non-aggregate expressions in the SELECT list of an aggregate query
...
that does not use min() or max() once per group, instead of once per row
visited.
FossilOrigin-Name: dce2dfbe1590deb3ef5661230ae2d232bd492441195defbf698ac56f9629211c
2018-06-05 20:04:28 +00:00
dan
1c5ed624a0
Add implementation of last_value() window function.
...
FossilOrigin-Name: 2493ce1a402888f6a8f25e03052c25a4e9bca740639e98cb614f5e5160ac25d3
2018-06-05 16:16:17 +00:00
drh
86d0ea7558
Use an OP_NotFound opcode to cancel futile IN operators early. The current
...
implementation is suboptimal because it always runs teh OP_NotFound. This
still needs to be enhanced to only do the OP_NotFound if no results have been
seen on the current loop.
FossilOrigin-Name: 87a9fc504f9a78caf7a7949cc7ada0a19d61bfab51bb49a00a1607194c116212
2018-06-05 15:16:25 +00:00
drh
995bbbf993
Merge trunk changes.
...
FossilOrigin-Name: 047295c588e9fdf2ffa4e69e166f177fd193309531dc6a9ac755fb7a763adb72
2018-06-05 13:54:06 +00:00
drh
8e9deb61af
Update and correct the documentation on the OP_OpenRead, OP_OpenWrite,
...
and OP_ReopenIdx opcodes. No code changes other than the addition of
an assert().
FossilOrigin-Name: 8a0b730d0ea640d5cf75febe39b2162411a12eb5275765a85882158b5a085681
2018-06-05 13:43:02 +00:00
drh
00583291bd
Version 3.24.0
...
FossilOrigin-Name: c7ee0833225bfd8c5ec2f9bf62b97c4e04d03bd9566366d5221ac8fb199a87ca
2018-06-04 19:24:41 +00:00
dan
6bc5c9e788
Add implementation of window function ntile().
...
FossilOrigin-Name: 3f093f608c6cc193aac77e7eafa8006c27a7776682d9d7b6e743710dff41ae42
2018-06-04 18:55:11 +00:00
drh
6b27f5fab7
Merge recent changes from trunk.
...
FossilOrigin-Name: f8df2a8e28acdd9573a9ffc18027553f35f769a989f5dfbf81f31b0656ee6065
2018-06-04 13:27:39 +00:00
dan
2b1287cf44
Merge latest trunk changes into this branch.
...
FossilOrigin-Name: 83d6416a868fac81a78c9507185a48d00920e4322276245e285946f760915f4a
2018-06-04 08:28:18 +00:00
dan
f1abe3680e
Add support for window function cume_dist(). Improve tests for percent_rank().
...
FossilOrigin-Name: 76543f7dd3a2310f6e81a1bae17db9bb5d2cf10c1b87ed3f8394b3e75576078b
2018-06-04 08:22:09 +00:00
dan
dfa552f45b
Add support for window functions row_number(), rank(), dense_rank() and
...
percent_rank().
FossilOrigin-Name: 91c1cb7a217d0991a08256269f6c55ef185c25362d57b36bfbd2d85dab38e58f
2018-06-02 21:04:28 +00:00
drh
eb7df46e32
Avoid using a misaligned pointer.
...
FossilOrigin-Name: 1ecb3aa13de5c8dc611b814ff34010de0bd90aae73d88aa37a59c4627be4cc2d
2018-06-02 19:14:58 +00:00
drh
1fb7a60ca0
Fix the usage of posix_fallocate() so that it correctly responds to
...
EINVAL returns.
FossilOrigin-Name: ce2c3e7a875ede4366c48660ae8239d2b74e5f690ad5059844a45f1164f41e61
2018-06-02 19:01:54 +00:00
dan
69a4b383a2
Update a test case in malloc5.test to take into account that malloc()
...
sometimes returns slightly more space than requested.
FossilOrigin-Name: 3d5eae1c26353cdee89f31f1293b05c0edb494c775ba0912d9b4fda9ab0ef304
2018-06-02 17:00:57 +00:00
drh
5ba5f5b5d2
Work around a sanitizer warning about a pointer being only 4-byte aligned
...
instead of 8-byte aligned.
FossilOrigin-Name: 1b807b51cdf455b4f54216b73fd22bbc90f94e24222401e045f88cfd27f487e3
2018-06-02 16:32:04 +00:00
drh
789df14b11
Proposed fix for the use of posix_fallocate() so that it handles EINVAL
...
returns correctly.
FossilOrigin-Name: ab3a5539db82814cafb832cdaebd1e14566139306453ef9cdba6b244a994fe0b
2018-06-02 14:37:39 +00:00
drh
e893e2e4ee
Fix the CSV extension so that it works with single-column CSV files.
...
FossilOrigin-Name: e336cf00486bdc0ec04ecded2b7c874d73a87e6aba3544e3678bedfb9a4af3b6
2018-06-02 12:05:18 +00:00
drh
4344dbd3ab
Ensure that sqlite3AuthRead() is only call for TK_COLUMN and TK_TRIGGER
...
expression nodes. This fixes a harmless assert() identified by OSSFuzz.
Move the assert() into a position where it is tested even if the authorizer
is disabled.
FossilOrigin-Name: d0c3beef7cdc680c0768ddd18f766a4ca7be822c1eb1776b2f73b7433d9962dc
2018-06-02 11:31:15 +00:00
dan
f690b57206
Allow an entire partition to be cached in a temp table for all types of window
...
frames. This is required by nth_value() and others.
FossilOrigin-Name: b5b18f661341d8d450147e62d321791c706f16c0550bcd98eec3e0220c039189
2018-06-01 21:00:08 +00:00
dan
0f86c9d8fa
Fix a bug in the SQLITE_ENABLE_SORTER_REFERENCES code causing an out-of-bounds
...
array reference.
FossilOrigin-Name: 8cadaf587dc96370f9c8a1dccc366b93021e8cfe4526da9368a088828fd14faf
2018-06-01 13:30:45 +00:00
drh
416a801600
More documentation typo fixes. No code changes.
...
FossilOrigin-Name: 66c24513c2f6de98bd888c3e4c07bbb39fabf30ea9dd01eb255460054055347d
2018-05-31 19:14:52 +00:00
drh
8cdafc384e
Fix a harmless typo in a comment used to generate documentation.
...
FossilOrigin-Name: 5a2a88cb01ef4b299f9a5b2963f392a3bae90e8a7f84b190e67f86090f891e23
2018-05-31 19:00:20 +00:00
dan
c9a8668ac7
Allow min() and max() to be used as window functions.
...
FossilOrigin-Name: c16125a884a9131b707ac20033968c4c3177ea79625a15efb64d754568c6c7a0
2018-05-30 20:44:58 +00:00
drh
fc232d6f65
Add the Makefile.fallback makefile to the amalgamation tarball.
...
FossilOrigin-Name: ce3d04563337c9556d66e55acfb454789b0baa49a1be8fcc349251ce88236d62
2018-05-30 14:17:09 +00:00
drh
5d3112872d
Do not use the codec on the resetdb.test script.
...
FossilOrigin-Name: fe55cea0c80ab29120574c5c4a8473b83fc80f79d7e11bc7c326bfdb32aa3902
2018-05-30 07:36:55 +00:00
drh
8e02a180b9
Fix a typo in an error message in the CLI.
...
FossilOrigin-Name: 808839808141493c1e5122f40b2cdff725be0cd1212e03d609345dbff7af03e4
2018-05-30 07:24:41 +00:00
drh
6a8b94e266
Fix the parser so that it builds with -DSQLITE_OMIT_CTE.
...
FossilOrigin-Name: 86ee267ee86f5264774a9f215b1158aeaa2d605e77c205731b5ee3945d7de4c2
2018-05-30 01:14:20 +00:00
drh
3e62ddbf13
Fix a harmless compiler warning.
...
FossilOrigin-Name: 8d02c7a6a09f7520ad180b0d943db475894cd39b0ccdb2ad2c44009d5f25c8a6
2018-05-30 00:59:09 +00:00
drh
a0368d9396
Demonstration code on a possible technique for optimizing the use of IN
...
operator on columns to the right of multicolumn indexes. If the OP_Noop
generated where were really a new opcode that checked to see if there existed
any entries in the index with a matching prefix, it might prevent unnecessary
iterations of the IN operator.
FossilOrigin-Name: 92f0fe155d5546fc7f4a443d0630613dabe149061966308e5420fad652278f16
2018-05-30 00:54:23 +00:00
dan
ea93e2804d
Increase the number of database handles opened by test script oserror.test to
...
provoke an "out of file-descriptors" error to 20000 (from 2000).
FossilOrigin-Name: 3b00f73456c65dfc1827fdada9afb49245f9addfa684d5ae35e69a07f39164bf
2018-05-29 19:12:58 +00:00
dan
867e6de4d7
Fix autoinc.test and resetdb.test so that they work with all permutations.
...
FossilOrigin-Name: 89f56d6b0a6847b042a1556cdf79c598c9bfdbdd5f9529d508ca7b4d26a6ed38
2018-05-29 16:37:12 +00:00
drh
59ee43a78e
Add a comment to justify a goto statement. No code changes.
...
FossilOrigin-Name: f141d806476aabe592a15d83b72c9409d2cd6bd7f9cced1ea2513c134191430a
2018-05-29 15:18:31 +00:00
dan
1d40cdbd4b
More minor changes to test scripts.
...
FossilOrigin-Name: ce9b756f09df4feb485bbf9695f8c6774906eb1b2fb45a340b74ffd21c9adfd8
2018-05-29 14:29:28 +00:00
dan
d3e17ffbb7
Fix some test script issues caused by recent EXPLAIN QUERY PLAN enhancements.
...
FossilOrigin-Name: f808e22831c33bfe3d0dd44e209f64d527c23ca7c72be7c694736535afee1317
2018-05-29 14:06:55 +00:00
dan
66e82b47d9
Do not run test file "resetdb.test" as part of permutation "inmemory_journal".
...
FossilOrigin-Name: 4921e5bae4c12c3413cc0b2e58766cf2ac117ad95f92fcd1c2457db6cfabb054
2018-05-29 13:25:14 +00:00
dan
d6f784ef92
Further window frame tests and fixes.
...
FossilOrigin-Name: e74c6e91859ec395c12ba2742542ff176a1d8364dcfb66b862240746bef54efc
2018-05-28 18:30:45 +00:00
dan
fecfb3189b
Do not require a statement journal in cases where REPLACE conflict handling is
...
used to insert a single row, so long as the REPLACE operation cannot fire any
triggers or foreign key actions.
FossilOrigin-Name: 469a62ca33081854e54f3af6d93ab5a350484b149c8c8c4ee8be0ae5418382d9
2018-05-28 18:29:46 +00:00
drh
50baf3d525
When compiling with SQLITE_DEBUG, add run-time checks to ensure that no statement aborts unless either there have been no writes or else there is a statement journal.
...
FossilOrigin-Name: ce99c7724460b9cf4ccaf7f6bc1a522b5c34d5ad0683d465f7926b10f31f7d05
2018-05-28 18:25:19 +00:00
drh
341141c339
Fix the build so that it works with -DSQLITE_TEST_REALLOC_STRESS
...
FossilOrigin-Name: 90ba2b2e5ce2619e68879eb325b43639159f27eb462b9fb6795534c91200a3d2
2018-05-28 17:43:28 +00:00
drh
4031bafafb
When compiling with SQLITE_DEBUG, add run-time checks to ensure that no
...
statement aborts unless either there have been no writes or else there is
a statement journal.
FossilOrigin-Name: 5a4542dbcf17a9f7fed600897555c271e1651fd50eb41d0b126725b486e1d14c
2018-05-28 17:31:20 +00:00
dan
79d4544d53
More fixes for different window frame types.
...
FossilOrigin-Name: 2c85668a0f86bcfd3de4c65847ac252e136ce97409a2249c5f4f58e3756e9a69
2018-05-26 21:17:29 +00:00
drh
9201184711
Store application-defined function names as lower-case to avoid the need
...
for case conversions before calling xFindFunction on virtual tables.
Avoid using lookaside to store the destructors for application defined
functions, as lookaside should be reserved for transient allocations.
FossilOrigin-Name: 777189ce88799f93f393fd14fd716111c85bcdcb23690fd561f78ea2bd2ce5da
2018-05-26 16:00:26 +00:00
drh
7fc86b96ba
Add a single sentence of documentation about the virtual table
...
scan flags. No changes to code.
FossilOrigin-Name: 27b4fa5dd0defc6ddaf5d8cde6a1e1162b70d99bfdc69c1d2290621a6d23ed91
2018-05-26 13:55:04 +00:00
dan
09590aaa1b
Fix "RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING" window frame
...
processing.
FossilOrigin-Name: b4e9c686697a5211a3bfa47e63f0684e3d4241d8c292cffe1a967bc39ad7cd8f
2018-05-25 20:30:17 +00:00
dan
83023a3357
Merge latest trunk changes into this branch.
...
FossilOrigin-Name: 6232519899efc568465d8fcc9fcd79d46a2ce4ec05109d26d5eb1ebd239cd596
2018-05-25 09:36:27 +00:00
dan
e105dd7622
Fixes for "ROWS BETWEEN <expr> FOLLOWING AND <expr> FOLLOWING" and "ROWS
...
BETWEEN <expr> FOLLOWING AND UNBOUNDED FOLLOWING"
FossilOrigin-Name: 5ac44872fd5c4f92851e7bf57d7207bb4d67de88ea2b5c746ff97f20bd6352e1
2018-05-25 09:29:11 +00:00
drh
338e311acb
When doing a one-pass UPDATE or DELETE on virtual tables, close the cursor
...
prior to running VUpdate. This allows one-pass to work on virtual tables
that do not allow concurrent reads and writes. Enhance rtree to take
advantage of this new capability.
FossilOrigin-Name: b816023ce07d01024d5769e16db924374a49bf909edd12dc1344a0a1ef693db5
2018-05-24 23:51:57 +00:00
drh
30fc7f8009
New test case for reading and writing the same rtree concurrently.
...
FossilOrigin-Name: 3ba08e53d54165f5541756ad13a4c2f0b18516cb612a256e056ed1ff76c1fa83
2018-05-24 22:42:27 +00:00