dan
6fb2b54ceb
Fix a problem with using min() or max() as a window function.
...
FossilOrigin-Name: 801074ce63d3f4825cc9fa508c42629a9f74e7f9e35c5f238343bb1cff4fbae1
2018-06-19 17:13:11 +00:00
dan
c95f38d456
Fix problems with using window functions in CREATE VIEW statements.
...
FossilOrigin-Name: 943bccd2a6bd4cf3e0534c1fa46885bfa2ba7b780ddcdff9f1ea4cbb3f04e786
2018-06-18 20:34:43 +00:00
dan
f87e10c75e
Ensure that all four callbacks are provided when registering a window function
...
(otherwise SQLITE_MISUSE is returned).
FossilOrigin-Name: 5720dcd8b111b1f8712c8fb4b441ccb129e838db8c26a6e9e0f095dc6a851f6b
2018-06-18 17:36:41 +00:00
dan
660af939b0
Add new API function sqlite3_create_window_function(), for creating new
...
aggregate window functions.
FossilOrigin-Name: da03fb4318fd2613ec5c5b109a3974ac1120c19ed16bed4ca85bbdc4b35c998c
2018-06-18 16:55:22 +00:00
dan
13b08bb6ff
Add extra OOM test.
...
FossilOrigin-Name: ac251f72608c27c1512a0b3457524f5378a0b13d93d829cf0ed8bc178bc54a73
2018-06-15 20:46:12 +00:00
dan
6fde1799f8
Fix another problem in lead()/lag(). And some errors that could occur
...
following OOM faults.
FossilOrigin-Name: fadd4dc119d8df0d871f4d839b7a11070e2ffb8927e84b3e7a94f34196db3de3
2018-06-15 19:01:35 +00:00
dan
e0a5e20fa8
Fix a bug in the lead() and lag() window functions causing them to fail when
...
used in queries featuring multiple window functions.
FossilOrigin-Name: 3839fb18f917e4f705821198d624b19d84eb07f1ee29ad23314ab7cec6bf6a2b
2018-06-15 16:10:44 +00:00
dan
303451a8f7
Fix a problem with handling of statements containing two or more different
...
windows.
FossilOrigin-Name: 567e09ef2a8cd84a2481117e52595bed0f3b588745a9e441aae0f87680f3a2e8
2018-06-14 20:52:08 +00:00
dan
9a94722d48
Fix problem with window functions min() and max() when used with a PARTITION
...
clause and a frame starting point other than "UNBOUNDED PRECEDING".
FossilOrigin-Name: 43eb1e75a4d7ac0973ed8589bbaf379c24cdc8eacc4e613610d2d4c24d385dc1
2018-06-14 19:06:36 +00:00
dan
09882a75c4
Merge latest trunk changes into this branch.
...
FossilOrigin-Name: 5cf5f1808a51f9c2cfc98dd49b4f1ce860b53e935287f89868ce2fdbace8eb06
2018-06-14 14:30:51 +00:00
dan
54a9ab3f13
Improve comments and code legibility in new file window.c.
...
FossilOrigin-Name: bb915854d435bdd78f141d70e23527e97922ec176acd3ed8060c78dffc96bab8
2018-06-14 14:27:05 +00:00
dan
13078caac4
Fix problems with "RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING" window
...
frames.
FossilOrigin-Name: c34f31dbd79891249ee9485e91f6ea558ee1db62e04fb0fff2c051612b8fa5e7
2018-06-13 20:29:38 +00:00
drh
2f1f8801ed
Output infinity as 1e999 in the ".dump" command of the command-line shell.
...
FossilOrigin-Name: ee431d55eba618cfba414c3946b3162bc205a70dd4e43d74a7623be332b94c92
2018-06-13 17:19:20 +00:00
drh
4449437b56
Pad out the sqlite3_value structure to be a multiple of 8 bytes.
...
FossilOrigin-Name: f76dc33bde4b2180b935d1261492d9535772ed37e54489c1a33e9f11c7c90433
2018-06-13 16:52:38 +00:00
dan
c5861ce88f
Fix some test case numbers in expert1.test.
...
FossilOrigin-Name: b90c3c16c04589583d2d1619320bb45a0b012c5960f23bd4e3f9dbe7c84b2eae
2018-06-13 16:08:22 +00:00
dan
45f318275e
Unless SQLITE_OMIT_AUTOINIT is defined, allow sqlite3_vfs_unregister() to be called before sqlite3_initialize().
...
FossilOrigin-Name: ab6c1ae46d992f91ce0995274f48d545eb02ba92544aee89b188f2fc92b66f2a
2018-06-13 11:41:54 +00:00
dan
466ea9b1e2
Check that malloc() has not already failed when invoking the xUpdate() method
...
of a virtual table implementation. This fixes an assert() failure in FTS5 that
could occur following an OOM condition.
FossilOrigin-Name: e9a7e4d58f3716991309ca0e3f080717e473c7c231685954aceee36172f19cf2
2018-06-13 11:11:13 +00:00
drh
ea74c1db64
Add the unused SQLITE_CANTOPEN_DIRTYWAL result code. This code was used
...
in some historical versions on the apple-osx branch but was removed
by check-in [27e20d699872b2b8]. Restore it so that old code that actually
references that result code will still compile.
FossilOrigin-Name: 9f40383eed936a6921ef8dc94775eb55d03a761f36eda7be1b9cdd0a0d30fa80
2018-06-13 02:20:34 +00:00
dan
c0bb4459d3
Fix another issue to do with window-functions in aggregate queries.
...
FossilOrigin-Name: 6413e38a174044c28fa9b8b937e6c972d144547a246e6f2882e782538300d042
2018-06-12 20:53:38 +00:00
drh
5174f17485
Documentation update: clarify that sqlite3_errcode() and related interfaces
...
do not themselves modify the error code.
FossilOrigin-Name: 858fc52b237702b5e0381eebf5c158bffd7371ff0053a8583b8c175f8f691c82
2018-06-12 19:35:51 +00:00
drh
3086529f7c
Documentation updates: clarify the behavior of sqlite3_column and
...
sqlite3_value interfaces following an OOM error.
FossilOrigin-Name: 428c581e4bed1d140cfb670633c9c61b36be7bb30a862d2e1ae7eaee26dccb4f
2018-06-12 19:22:30 +00:00
dan
7392569f5e
Fix some problems with using window-functions in aggregate queries.
...
FossilOrigin-Name: fe7081e0952950f577234fcbb58f3c1efa4579267654fd2f713dc4804e470e7e
2018-06-12 18:40:17 +00:00
drh
58773a533c
Improvements to SCopy correctness tracking when SQLITE_DEBUG is enabled.
...
FossilOrigin-Name: b2973f2357a2c5e22e0d612c970adbc6d51cbc5e4ff7ac6d2b678722e553e8ec
2018-06-12 13:52:23 +00:00
drh
cd9e01427d
Fix the "Synopsis" on the OP_BitNot opcode.
...
FossilOrigin-Name: acd78df61188591d33ddb9b1b8c16bcc015f4dffac66314529caa747d4395c70
2018-06-12 13:16:57 +00:00
drh
dd2a8f5ee9
Improvements to the --enable and --disable options for the
...
amalgamation tarball.
FossilOrigin-Name: 02e337e0808947c7ef376b5a300cd3c461f1a368c9fe7ffd7ca5744f102641c2
2018-06-11 21:33:08 +00:00
dan
2a11bb23eb
Clarify the relationship between a Window object and its associated Expr.
...
FossilOrigin-Name: 0cd55e98a478740032f5569ddc00fa5b0e063e90db6e00ac7598c9b7c2fffeee
2018-06-11 20:50:25 +00:00
drh
8fa622d62b
Fix various --enable and --disable options on the top-level configure
...
script.
FossilOrigin-Name: 6fd7e8ceb96981cff023653a54b85bea0e1da3d706cd9f4383f5c5533213ef4d
2018-06-11 19:47:14 +00:00
dan
26522d1c45
Fix handling of window frames containing negative number of rows. e.g. "ROWS x
...
PRECEDING AND y PRECEDING" where (x<y).
FossilOrigin-Name: b6d9c7eda853420ae46a05bd432711e8bf9ebaa448c7d90ccfc0bcc338a87706
2018-06-11 18:16:51 +00:00
drh
ea64715976
Fix the column cache invalidation logic in the code for ROWID uniqueness
...
constraint checking in the INSERT command. This fixes ticket
[c2432ef9089ee73bd].
FossilOrigin-Name: 0b485a571c805a5bc431a231a196ff6034342c6548d92b09c52814dd57c89c75
2018-06-11 18:06:48 +00:00
drh
299bf7c2f0
Add the OP_SetTabCol and OP_VerifyTabCol opcodes, only when compiling with
...
SQLITE_DEBUG, to do run-time verification of the column cache.
FossilOrigin-Name: b37614a3670770919a7c7f8157c5fd6578d736447998640b52e5cef8174cadc2
2018-06-11 17:35:02 +00:00
drh
8d7b212c4c
Strengthen the sqlite3VdbeMemAboutToChange() run-time verification mechanism
...
to better detect missed calls to AboutToChange().
FossilOrigin-Name: 793e942205a12eedb7ecc5ad8a27e3e52bbd4e1d50a0d1453d04a83ba728884e
2018-06-11 13:10:45 +00:00
dan
72a9f0233b
Fix a typon in main.mk.
...
FossilOrigin-Name: e74f86f271d6ab1ecd17c1ee63ab2aa0885ca56624be7382872f04d46c48ed86
2018-06-11 11:19:35 +00:00
drh
9c3549aa2f
Always initialize the WhereClause.hasOr field that was added by check-in
...
[292724ffc4]. Error detected by OSSFuzz.
FossilOrigin-Name: 9faf41713e865f26485d9e90918d77c25be211384941eadda6a36237f52c25de
2018-06-11 01:30:03 +00:00
dan
980cf25b10
Update Makefile.msc to include window.c in the build.
...
FossilOrigin-Name: 16db73842ade5eb0fe02f257b91d1c7b41d830d3f17f8638b8fbaed309d9a852
2018-06-10 07:42:35 +00:00
drh
074544d181
Fix a typo in the amalgamation autoconf file.
...
FossilOrigin-Name: de0857f39620b7f5c921ddf8d11b11723b4ba3cfe52e43cf77e883697b7c1c4c
2018-06-09 20:52:45 +00:00
dan
96f55d0fa5
Merge recent trunk changes with this branch.
...
FossilOrigin-Name: c71f23590c25b4cecd27722e6c0fc8e3bf320d399c7d9398b7016dd5cf5b05eb
2018-06-09 18:09:44 +00:00
dan
d31e7addd6
Update the amalgamation build script to include window.c.
...
FossilOrigin-Name: 21d2f4a62eceab0de0b4669bf3e81eb71512211ed710ce0eb525695fb7309d6b
2018-06-09 17:58:51 +00:00
dan
8b98560d6e
Add support for FILTER clause on aggregate window functions.
...
FossilOrigin-Name: ceaf798ea09184bc0e7d3dcf3ad4d909d2e4e7018754a8417a813f33010140a7
2018-06-09 17:43:45 +00:00
drh
4ece2f2657
Slightly smaller and faster code by encapsulating wal-index hash table
...
location information in a separate WalHashLoc object rather than passing
around the various elements as separate variables.
FossilOrigin-Name: 538a365b7a32ab7fa84f59d7556242cfb59b76d287b6417eb3a823197a354e8e
2018-06-09 16:49:00 +00:00
drh
a46ba6cca5
Improved comments an presentation for the recent IN operator decision
...
improvement.
FossilOrigin-Name: 31e480f68dfd887cfd9114f9f9fec53d751d3ecc27e36f55c0166b51b2fbb08c
2018-06-09 14:13:46 +00:00
drh
ccf6db5e64
Performance improvement to sqlite3WhereExprUsage().
...
FossilOrigin-Name: fd0934139076848f2f2edfd3d74d54608531031a05a60ca6ac1d7016dcd538df
2018-06-09 02:49:11 +00:00
drh
1fe3ac7347
Compute the bitmask of indexed columns for each index once when the Index
...
objecct is constructed, instead of recomputing it every time it is needed.
FossilOrigin-Name: d735872ec383bbd220b08c61d25db9ff3675d2542b9e7867e7d6323a12e0cc23
2018-06-09 01:12:08 +00:00
drh
da230bd484
Avoid invoking the whereLoopAddOr() routine in the query planner if there
...
are no OR operators in the WHERE clause, thus speeding up query planning
slightly.
FossilOrigin-Name: 292724ffc4bfca435fff309383d488ffdbe1e314e5eb26da21cf2f621b64bce5
2018-06-09 00:09:58 +00:00
drh
7128b7c1f4
When the query planner has the opportunity to use an IN operater constraint
...
on a term of an index other than the left-most term, use the estimated number
of elements on the right-hand side of the IN operator to determine if makes
sense to use the IN operator with index looks, or to just do a scan over the
range of the table identified by the index terms to the left. Only do this
if sqlite_stat1 measurements are available as otherwise the performance
estimates will not be accurate enough to discern the best plan. Bias the
decision slightly in favor of using index lookups on each element of the IN
operator.
FossilOrigin-Name: 2cbbabdf5ef624d809fbb40d2d312a29e0b5f02756fc0dbf6985fc8b0c8d1ade
2018-06-08 23:23:53 +00:00
drh
6d6decb8d9
Only choose to scan an IN operator rather than use an index if we have
...
real STAT1 data to suggest it is advantageous.
FossilOrigin-Name: 30e874661dcc1a2ecb40df2ef74582151d85bb36c754a38548829a3b6285f18d
2018-06-08 21:21:01 +00:00
dan
e3bf632cc2
Add support for the WINDOW clause.
...
FossilOrigin-Name: 19c983b511f1c823fdfb051713681b4c779f02fa83b41189afca0a9b8b72048d
2018-06-08 20:58:27 +00:00
drh
982c41977c
Merge the btreeNext() assertion bug fix from trunk.
...
FossilOrigin-Name: 11bd66e09035039fbfc4c5631196962dd3f2e6634f5123a7b2fec17aeaaab07b
2018-06-08 19:54:07 +00:00
drh
f3cd0c82df
Fix an assert() that can be false for a corrupt database and a strange query
...
that uses a recursive SQL function to delete content from a corrupt database
file while it is being queried.
FossilOrigin-Name: 99057383acc8f92093530e216c621d40386a06fe98131ff0af6df524d80a6410
2018-06-08 19:13:57 +00:00
drh
da4c409aea
Consider doing a partial table scan to fulfill an IN operator rather
...
than using an index. Try to pick the plan with the lowest cost.
FossilOrigin-Name: 1fa40a78fef4516c39b217bff67efe7e7d2077cca00aae0ef5c2c9cff94f008b
2018-06-08 18:22:10 +00:00
dan
dacf1de95c
Do not flatten sub-queries that contain window functions.
...
FossilOrigin-Name: 236cb75bd1f0d5eb86aa5f52d8d548e7263c34633833dcea9dfc934f142113b8
2018-06-08 16:11:55 +00:00