Commit Graph

18526 Commits

Author SHA1 Message Date
drh
c76ed3d57d Merge in all recent trunk enhancements.
FossilOrigin-Name: 406f79183736b6ad360169b837172afef2c82a4312f5787db08c54167a44b15e
2018-01-04 19:54:55 +00:00
drh
35100fb194 Remove the snarky "_supported_" qualifier from the name of the
sqlite_offset() SQL function.

FossilOrigin-Name: a6eee0fcd89d3958f8720ebdb5f0a8558b4795d747128091dae283eb81c4f74f
2018-01-04 19:20:37 +00:00
drh
64c1990c00 Fix a broken documentation hyperlink. No code changes.
FossilOrigin-Name: d91e3f3d343d281af374dd23eea333e61228539023ad5c5aea622085e5863bc7
2018-01-04 16:40:44 +00:00
drh
9eb8dbad4d Add another test case (found by OSSFuzz) for the problem fixed in
check-in [2846458a] and described by ticket [dc3f932f5a147771].
No changes to code.

FossilOrigin-Name: 4165fae920a1176c68bfaa1f2cfe17df7f8dd8793519d458b71e3e63670b5495
2018-01-03 01:47:30 +00:00
drh
d9620b8555 Fix code indentation. No logic changes.
FossilOrigin-Name: e115f2583499df0c7ee991d372bed4b89aa717b10a4e4b10977864390cb4fc11
2018-01-02 21:29:42 +00:00
drh
4d795ef7e4 In the constraint resolution logic, be careful not to cache column values
in registers whose initialization might be bypassed by an OP_NoConflict opcode.
Fix for ticket [dc3f932f5a147771] reported by OSSFuzz.

FossilOrigin-Name: 2846458af5d029a8e4fdcc8f50873a44e57897bbfe6aee8a23a01ffc34c5579f
2018-01-02 18:11:11 +00:00
drh
595a0e2a4a Enhance the memvfs extension so that it can be read/write.
FossilOrigin-Name: 04c9197d589666299aef86ee6a56df63448c050274c9fba4af94f932752be237
2018-01-02 16:02:50 +00:00
drh
9199ac1048 Updates to the sqlite3_file_control() documentation. No changes to code.
FossilOrigin-Name: 240e32ab1f2a18e3c9b92f577b1cc8f8ecb4c68c44eac863d859491e042cb72a
2018-01-02 13:48:48 +00:00
drh
cde7b77932 Do not attempt to use pragma_module_list in the command-line shell unless
it has been compiled with -DSQLITE_INTROSPECTION_PRAGMAS.

FossilOrigin-Name: 39ca5fcd31c902cbade4da05125b0dbf2bc5e2b8901af1645f113c9d3dbc8209
2018-01-02 12:50:40 +00:00
drh
667a2a25ba The ".schema" command in the command-line shell now shows the structure of
table-valued functions and eponymous virtual tables if they are named on the
".schema" command line.  Example:  ".schema sql%" shows the structure of
the "sqlite_dbstat" and "sqlite_stmt" virtual tables.

FossilOrigin-Name: f80f6651df0b2843c6c9619a8f3e05c56cd50363402800a2e166e6eb664f7768
2018-01-02 00:04:37 +00:00
drh
1d315cf7b8 Improved name quoting and escaping in the auxiliary column info section
of the ".schema" output for views and virtual tables.

FossilOrigin-Name: d64b14e37d9624bf5d86059ddd091170d8e6d341a8043f84548b9b3dbb96a908
2018-01-01 21:49:43 +00:00
drh
ceba792a2f In the output of ".schema", show the column names of virtual tables and
views in a separate comment.

FossilOrigin-Name: 2234a87fa905312b23f46d52e06cff7cacbf23b187e16c4398a42e6bdae0ee9f
2018-01-01 21:28:25 +00:00
drh
c22b716e31 Minor simplification to the ".schema" logic in the command-line shell.
FossilOrigin-Name: add45c47288248ca3745e0fceb5e0d9062a852d173d93ff2ff1a0f8fdf3237dc
2018-01-01 20:11:23 +00:00
drh
470fc9ddaa Enable the introspection pragmas for command-line shell builds.
FossilOrigin-Name: 0b04223f256f5c1e06fa6e899727815ebf650f2dfcf8f36d6cbfb6cb62d4ead8
2018-01-01 19:33:12 +00:00
dan
0cde0c62b1 Have zipfile support DELETE commands.
FossilOrigin-Name: 01d4e866fb7b01aeada537d41c4a47747c7810e2028f51077ee5b8b78c348954
2017-12-30 18:32:27 +00:00
dan
db0cb303ad Rearrange things a bit so that writing to a zipfile does not invert the order
of objects it contains.

FossilOrigin-Name: f69e8194bfa7de436c96028730ebd57f186d2e6207792e172e1aa38c7f4211c9
2017-12-30 14:26:29 +00:00
dan
373dc3bb3f Update ext/misc/zipfile.c to support creating and adding entries to existing
zip archives.

FossilOrigin-Name: 2dec2dec592c0726ebe87b841b9c8d493dea7074a99f278eb1bf0b744d658a9d
2017-12-29 20:19:03 +00:00
drh
c64487b9c8 Add support for the sqlite_unsupported_offset() SQL function if and only
if compiled using -DSQLITE_ENABLE_OFFSET_SQL_FUNC.  Use that definition
when compiling the command-line shell.

FossilOrigin-Name: 4f1f1f521ae6da96b899e10bfeff6bc1ab7a45de0705076febaae20b441f48c6
2017-12-29 17:21:21 +00:00
drh
9af41ff452 Stricter test cases.
FossilOrigin-Name: 9406c0a685fd5ff3516a66402b0514a1440652822a5eecf0b7af85929f3079e8
2017-12-29 16:37:33 +00:00
drh
23b440f883 Fix a typo in the MSVC makefile.
FossilOrigin-Name: 89e5720a8d8d46d4e2f16f15678e91336117e64abc977174e2b345a30308d0d2
2017-12-29 15:19:03 +00:00
drh
092457b18c Change the function name to sqlite_unsupported_offset(X). Only enable the
function if compiled with -DSQLITE_ENABLE_OFFSET_SQL_FUNC.  The makefiles add
that definition to shell builds.

FossilOrigin-Name: 7a7f826e324b1a2c332e2f1d0740fd0babffcaca6275a798572f02ad367b99ab
2017-12-29 15:04:49 +00:00
drh
fe6d20e9f4 Enhance location(X) so that it works with indexes and WITHOUT ROWID tables.
The function might return an offset to the main table or to an index,
depending on whether the column X would be loaded from the main table or
from the index.

FossilOrigin-Name: dd94d6a880dfec4bddd247239b815b84964f804d24841e25f33f1d46a4b5274d
2017-12-29 14:33:54 +00:00
drh
7a8573bafa Merge recent enhancements from trunk.
FossilOrigin-Name: 6251e438f2a76170fd1e95aa512a46086ed88ab93b9b97a1dba97c4558689305
2017-12-29 13:35:09 +00:00
drh
ee052a1c94 Add test cases for the undocumented behavior of duplicate columns on an
INSERT or UPDATE.

FossilOrigin-Name: f4349c0c26611de8a7d5beb99431a575cf531cdeb0ca2413efabcf0a61e6f424
2017-12-29 12:50:43 +00:00
drh
6e42757644 The output of sqlite3_trace() now shows each command of a trigger as it is
evaluated.  This feature involved major changes to the parser, such as
removing the ExprSpan object and replacing it with a new mechanism for
capturing the original SQL text of phrases in the input SQL.

FossilOrigin-Name: 0fdf97efe5df745510c6b4b377a8ee5683a3a237630bfbd0f56e57c7c6e5b246
2017-12-27 22:09:53 +00:00
drh
e307e11d0a Omit all sqlite3_trace() output from the triggers associated with
foreign key constraints.

FossilOrigin-Name: fda08e3d10cc850664a356efdafcfc68187053849e1b00991b0b35d892a6776b
2017-12-27 21:30:34 +00:00
dan
b5090e4897 Improve the shell tool ".ar --list --verbose" command.
FossilOrigin-Name: b64681a644c419bb98d00980a6cb56ef5a0aff5ef5321955631f0b4c88aac283
2017-12-27 21:13:21 +00:00
drh
f259df5fc8 Show the text of individual statements within a trigger, as they
execute, as comments in the output from sqlite3_trace() and sqlite3_trace_v2().

FossilOrigin-Name: fe3d2b97d8945e6a9636472f77bcdc92cc5dda8b3e6e3a4fcbdd0a212ea5b9aa
2017-12-27 20:38:35 +00:00
drh
9b2e0435d2 Add and use the internal sqlite3DbSpanDup() interface.
FossilOrigin-Name: a8e1545cb7aacb6a26a8c92a3ad4a3d584d150c3a00d2828c8adbb1ee19fcb6d
2017-12-27 19:43:22 +00:00
drh
908cc6207f Merge recent enhancements from trunk.
FossilOrigin-Name: 76373091354f27577e5235e96cfaa4b31429a38d1e0e1d6e094c4cc323b92a0a
2017-12-27 19:27:26 +00:00
dan
5a78b81b1b Have the shell tool ".ar --list" and ".ar --extract" commands support zip
files. Currently the "-zip" switch is required.

FossilOrigin-Name: a532a0f6fd59e81086d46f09151ba7fb26725198231d902c71d0f95cb01dbe91
2017-12-27 18:54:11 +00:00
drh
2c804becea Enhance the Lemon parser generator so that it creates a faster parser at the
cost of slightly larger parser tables.  Add the ability to measure coverage
of the generated state machine when compiling with the -DYYCONVERGE option.
In SQLite, add the SQLITE_TESTCTRL_PARSER_COVERAGE test-control to query the
new parser coverage feature.

FossilOrigin-Name: 1b22b42e59793af19c69a2e5f6822883cc2687d4a0d9b9280bbff885276c6baa
2017-12-27 18:19:06 +00:00
drh
cf8e0e9cb7 The previous check-in had an error in the coverage reporting logic.
FossilOrigin-Name: ec9b19eb652e81cd3c8a5595eb39aac3aca4abe72136c4b65c9cc257594a9c92
2017-12-27 17:36:58 +00:00
drh
7038a991b0 Change the coverage measurement logic in the lemon-generated parser so that
it only checks for coverage of state/lookahead pairs that are valid syntax.
It turns out that some states are unreachable if the lookahead is not valid
syntax, because the states are only reachable through a shift following a
reduce, and the reduce does not happen if the lookahead is a syntax error.

FossilOrigin-Name: 9dce46508772bd0f9e940c4d44933154044bb58c1b3511dd0143287bf795dd6b
2017-12-27 17:14:50 +00:00
drh
7e7b753158 In the lemon-generated parser, do not report the End-of-input character and
the wildcard character as missed coverage.

FossilOrigin-Name: 3fe964873da16c0e0b1c4f1945f965d4137df7a307acd6a3eb6585ffbaa2afd1
2017-12-27 16:13:22 +00:00
drh
4396c61959 In LEMON, fix an off-by-one error that can make the lookahead table one
byte too smal.

FossilOrigin-Name: 93792bc58a2eccc7e07b14307388350bb376db32c5055b79a44e4fa8ff91d58e
2017-12-27 15:21:16 +00:00
dan
9ebfaad25d Add new file ext/misc/zipfile.c, containing a virtual table for read-only
access to simple zip archives.

FossilOrigin-Name: 8e366b99b13d765d8bf000a7ec5919e582702e51dc07c27a746b6002898a2302
2017-12-26 20:39:58 +00:00
drh
22716cbb0b Change the lemon-parser coverage report format to report all state/lookahead
pairs and indicate on each whether it is hit or missed.

FossilOrigin-Name: 86e30fc284c740b55f75884b67988fe837b28878f586f6ec8850ecf80164e700
2017-12-26 18:32:06 +00:00
drh
4fb5c2dcc1 Merge bug fixes from trunk.
FossilOrigin-Name: d76e12066fa6950f877cbe33b1892e2b0afa948978815d5b9a90cde1fff8ec98
2017-12-26 18:14:53 +00:00
drh
0d9de99c5c Add support for measuring and reporting coverage of the parser state machine
using the SQLITE_TESTCTRL_PARSER_COVERAGE test-control.

FossilOrigin-Name: 1253a872dbf48656d4efd588ab61223a5ac550d9b2b932249d6ba585276ba573
2017-12-26 18:04:23 +00:00
drh
02a43f6def Faster and smaller implementation of sqlite3AtoF() based on a suggestion
from Cezary H. Noweta.

FossilOrigin-Name: fd2e0e7a770c2ce9355068aad1024c3d2861c104fd3be304a91c55ca742155fa
2017-12-26 14:46:20 +00:00
dan
c8f44d245c Fix crashes that could occur if SQL NULL values were passed to the built-in
FTS5 snippet function. Edit: breaks amalgamation builds.

FossilOrigin-Name: 6a790b67a0a5c698526db16ea262b13ecdd1b6ca74e80bdccfcad88ddbdc933a
2017-12-26 14:32:25 +00:00
dan
f6c37dbc8c Add options to speedtest1.c and speed-check.sh for testing performance of
floating-point computatations.

FossilOrigin-Name: ebfea8728fec955b1d74b1d0a3de498fd1a32e8b39572a8fdab606ed87b169b4
2017-12-26 14:30:44 +00:00
drh
5060a67c4d Fix an assertion fault on a syntax error input caused by check-in
[6b2ff26c25bb9da3].  Problem discovered by OSSFuzz.

FossilOrigin-Name: 90d6e4f10d3055a776d24854c442a2a68e726af8fc382cdb6241a834082e4c4c
2017-12-25 13:43:54 +00:00
drh
3a9d6c7156 Enhance LEMON so that it generates the action table in such a way that no
range check is needed on the lookahead table to verify that the next input
token is valid.  This makes the lookahead table slightly larger (about 120
bytes) but helps the parser to run faster.

FossilOrigin-Name: 7eb0198d0102e97e4b7ad9e359d95985e55e09c510ea4b360265ac8feb9ed814
2017-12-25 04:15:38 +00:00
drh
ef53a9f0af In the LEMON-generated parser, avoid unnecessary tests for the acceptance
state.

FossilOrigin-Name: fdbb35c54f2b6cb65d04ac295f207ff3e69360e0558348c77eb5e62691807046
2017-12-25 00:10:05 +00:00
drh
5c8241b875 In the LEMON-generated parser, rearrange the meanings of integer action codes
so that reduce actions occur last.  This means that the most common case
(reduce actions) can be recognized with a single comparison operation, thus
speeding up the main parser loop, slightly.

FossilOrigin-Name: 7bfe7a360261ac7227840db49487c2f0fe338a2f1b868fcaada1e04a8d2b8f7a
2017-12-24 23:38:10 +00:00
drh
512795dfea Fix a NULL pointer dereference after a syntax error that can occur as a
result of check-in [6b2ff26c25bb9da3] yesterday.  This problem was
discovered by the OSSFuzz.

FossilOrigin-Name: d49afb8f9804e96662d1e3cadc4c6643908706d848a53d5ed019919c98f2ccba
2017-12-24 18:56:28 +00:00
drh
e58f74f680 Improved parser tracing output.
FossilOrigin-Name: 25be5750545b7b0ed9e1a1baca31611b354519688f875aa1590b21bb6ff42f1b
2017-12-24 17:06:41 +00:00
drh
d3f5d6110b Grammar changes: the sclp non-terminal should always be followed by a scanpt.
FossilOrigin-Name: 74a0181fc016fb0b7934188cfcc2ec26c689f0d33cc42453875f4392b7240d3a
2017-12-24 17:01:54 +00:00