Commit Graph

22195 Commits

Author SHA1 Message Date
drh
e7f3edcd49 Add an sqlite3FaultSim() to make an OOM case more accessible and remove
the ALWAYS() on the conditional that is false when the OOM actually occurs.

FossilOrigin-Name: 2a251af84ff1f5ca281aa69c5410d6ae7aa5a85ef47149909a297525e1651e9d
2020-07-28 17:17:36 +00:00
drh
f31230af12 On recovery, always overwrite the old with the new, even if they are the same.
Add ALWAYS() macros on branches currently thought to be unreachable, pending
additional testing.

FossilOrigin-Name: 7052cf1d533f6404d0f45cf0b3e8a11c1ee27eccb64680a7fd308c8da7cbd544
2020-07-27 20:16:37 +00:00
dan
cddfc3922c Fix a couple of test scripts to match the new wal recovery behaviour on this branch.
FossilOrigin-Name: 3af61e83532f76f0f3252a28663415d37b096ddf05a9c58fa79303933c09abce
2020-07-27 15:05:20 +00:00
drh
8caebb26c5 Improved error reporting if walLockExclusive() fails.
FossilOrigin-Name: cf962d213abe1b55ebbcfecf1de9d5d61709509d1ce3cbd56d8cf4c9ad65e5a9
2020-07-27 15:01:10 +00:00
dan
d3e38b7c0e Allow a wal mode recovery to proceed even if there are readers.
FossilOrigin-Name: 74374aebf9abf3d6b6a3920967a079ceaa4c6276dc6c177682742c2be405b7b7
2020-07-25 20:16:27 +00:00
drh
25a78fdfa2 Merge recent changes from trunk.
FossilOrigin-Name: 22e8e6901a119698de831ede6d8b03c4fd6576eaa8686a97a0b8aeea7593688a
2020-07-24 13:49:38 +00:00
drh
8adc8f1ecb Remove a surplus space from a comment
FossilOrigin-Name: 73fecc688ab5c459245c9bb89432139a083ef378404b4dae3397a7f4e253f72a
2020-07-24 11:01:29 +00:00
drh
0c52f5a2b0 Fix other potentiall pointer aliasing problems associated with subclassing
of the sqlite3_file object for various VFS implementations.

FossilOrigin-Name: 270ac1a0f232d75537be40abae559004e950b992cb2c7e94cd6de66e96ae17bd
2020-07-24 09:17:42 +00:00
drh
d9059bdb5b Fix pointer aliasing problem in the in-memory journal code.
Ref: [https://sqlite.org/forum/forumpost/d44eb2fc44|forum post d44eb2fc44]

FossilOrigin-Name: 892e9191dc8f805678a501db1993437ee99a1e1849496a0a24ceec9b84123257
2020-07-24 09:14:44 +00:00
drh
38f0ccc070 Add the OMIT_ZLIB compile-time option to sessionfuzz.c. (Originally
checked into the wrong branch.)

FossilOrigin-Name: 6019bf8a2db548fea4be4f49961937d5b12eba9e42c7c7a58babfaf3288cb0cd
2020-07-23 18:03:14 +00:00
drh
b140347395 Fix a typo in an error message.
FossilOrigin-Name: 849b03d8de62251707ee0d31c9f1cd98cbd296c70c1a2c8d7c1658840a930fe4
2020-07-23 15:23:53 +00:00
drh
a92eae9751 Merge fixes from trunk.
FossilOrigin-Name: dd39418ee47529cc3ffbe01eccf31f1304a266a196bf81a2a2cb2e650c195b97
2020-07-23 14:27:51 +00:00
drh
2add24c0d4 An ORDER BY clause can slip into an SRT_Upfrom query via the query
flattener, even without the SQLITE_ENABLE_UPDATE_DELETE_LIMIT compile-time
option.  So always enable the code to deal with that case.

FossilOrigin-Name: 6a3111cd0693bb51191d55a32ecd436341638d54ecb2df0778de681b4969241b
2020-07-23 14:12:47 +00:00
dan
9d44327a83 Fix another case where a corrupt record could cause an assert() to fail in fts3.
FossilOrigin-Name: 28515bbbae4fbc260457dea7a0f7414be1837d6db27fec5514f8da358bfc1f0c
2020-07-23 13:45:47 +00:00
drh
ed109c06e1 Merge support for partial integrity checks.
FossilOrigin-Name: b5443b47af95f4f0ef527bee90f186ee25faa5df197dbcc3e14d48eee095e4aa
2020-07-23 09:14:25 +00:00
drh
17d2d592fb Add the ability to do a PRAGMA integrity_check (or quick_check) on a single
table by specifying the table name as the argument.

FossilOrigin-Name: 65dd321432e8f80bc1cb11be8ca06656b41ac997a74a5eb271c797cf0fbb764e
2020-07-23 00:45:06 +00:00
drh
134599e557 Detect out-of-bounds rootpage values in the schema.
FossilOrigin-Name: e4a92688fca31335bf15933dec10ecba04cf340ee2f726fd36d46d4c76660eee
2020-07-22 21:11:10 +00:00
drh
ca439a4967 Disable rootpage bounds checking when the SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS
setting is off, to facilitate reaching obscure error states during testing.

FossilOrigin-Name: d7dd4fc464c791915f646b1ad228697d1fa16f530fc7d0e9aa702c8df3068c65
2020-07-22 21:05:23 +00:00
drh
69306bf43a Improvements to rootpage bounds checking during schema parse.
FossilOrigin-Name: 75599a9731be19e213a8ae174b038a43381bc6883a6b7f4058c2c1625fdea432
2020-07-22 20:12:10 +00:00
drh
3b3ddbae36 When parsing the schema, detect out-of-bounds rootpage values and throw an
error.

FossilOrigin-Name: 6c3a2727dc912ed800146e07db5d15d0f3468d13701165ba763c4b114c3e18e8
2020-07-22 18:03:56 +00:00
drh
584e8b7630 All TCL tests now passing.
FossilOrigin-Name: 4c5f3c6cacf84a36d0347790d98d82d1f584cd1537a13a2736348405c4d20367
2020-07-22 17:12:59 +00:00
drh
bb39ac7773 Most test cases now passing.
FossilOrigin-Name: 92e2ab38930c76811dbf5abfe6b9ea9e12562a4bb4bb06cdb0cf49ac30da0bc3
2020-07-22 13:56:14 +00:00
drh
abc3815860 Continuing work toward supporting unsigned 32-bit page numbers.
FossilOrigin-Name: 9ce1710aad43cebe5ad50859c7685fb83e40cdd4a60913bd2b7e659bc59942fd
2020-07-22 13:38:04 +00:00
drh
55550b7602 Enhance showdb to be 32-bit clean.
FossilOrigin-Name: a8200327d4e8e78abef09c64345e0036f730fbbb20ae88935ef6c9972e6c7d5e
2020-07-22 11:42:50 +00:00
drh
a7982eacd5 Merge fixes from trunk.
FossilOrigin-Name: d2aac001204621062e6cb3230ce2ac1b4545cb83b3ebb6bfebccee4d51162e97
2020-07-22 10:36:49 +00:00
drh
2f04583f04 Work-around for [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96270|GCC bug 96270].
FossilOrigin-Name: 9679c0c61131f0e986551701a64191da0ee0f50880eaa57fe4bf520e3fecf634
2020-07-21 18:36:06 +00:00
drh
82b0f106ce Add the sqlite3Int64ToText() routine and use it to convert integers to text,
as it is much faster than the generic text formatter.

FossilOrigin-Name: 14eed318aa9e6e16d1aa13a9f34e3822aa135c39ba06c77df7743509fed6c95e
2020-07-21 18:25:19 +00:00
drh
bbd620e22c Fix the ".read" command so that it gives an error when its argument is
a directory.
See [https://sqlite.org/forum/forumpost/4c53c434ca|forum message 4c53c434ca].

FossilOrigin-Name: 6d258c3c7ecafa1114e4a63739971ff527580868659c2f2c47d2c0adb92c1453
2020-07-20 23:33:11 +00:00
drh
09cf569292 Fix a corner-case error in the new UPDATE FROM logic helpfully discovered
by OSSFuzz.

FossilOrigin-Name: 5cc200939d3a33566ddb858fc74c878acc72cfe5cf4c9b1d08e7b13e4d5ff566
2020-07-20 18:07:35 +00:00
drh
4e6861d23d Add the "enlargedb" utility program used to construct very large database
files for testing.

FossilOrigin-Name: 66858d87507bfdd17bb76c0afb1108ad5dec752438a79bf57f0f51690232e943
2020-07-20 14:54:36 +00:00
drh
a192807c13 Faster column name lookup in the columnIndex() routine using hashing.
FossilOrigin-Name: de2a90812498e504c9b8eeb83bfc48a948b45e87bdfa242c0aa9f0377d90740f
2020-07-20 13:11:19 +00:00
drh
e9261dbd53 Initial changes to allow database up to 281TB in size.
FossilOrigin-Name: 9cb7da9bdb666ea40771513b89591dca275f1e92092b39190df747e3797178a3
2020-07-20 12:47:32 +00:00
drh
51da8daf82 Fix test case result on a DELETE with an INDEXED BY clause due to
improvements in the query planner at [d901837fea1ed54d]

FossilOrigin-Name: 020dbfa2aef20e5872cc3e785d99f45903843401292114b5092b9c8aa829b9c3
2020-07-18 18:59:11 +00:00
drh
a7c74006a0 More harmless compiler warning fixes.
FossilOrigin-Name: 4c0d208c455abb983217a6dfea7634f677f8360fb57857e1421334fe7a5a23e2
2020-07-18 18:44:59 +00:00
drh
aec7dc6563 Fix a harmless compiler warning.
FossilOrigin-Name: 5a0b0c6e11146e200c3417903232e6932102b02d7bf128bac4b7cd74c257acd1
2020-07-18 18:03:26 +00:00
drh
d9674b385c Add UPDATE FROM compatible with postgresql.
FossilOrigin-Name: 88baf1eb0706503214012520be4d872594ccc5b4c9674c44cc07b67ade2bfcf2
2020-07-18 15:52:15 +00:00
drh
387af48ed4 Add ALWAYS() around a conditional that is always true.
FossilOrigin-Name: 270e17bba1d35f8c300844e75b2aa15f79a1ab62e40bc5e6bc9694902f8f7dde
2020-07-17 22:20:23 +00:00
drh
4c0086d7f0 Use #ifdef to omit code that is only reachable when the
SQLITE_ENABLE_UPDATE_DELETE_LIMIT compile-time option is used.

FossilOrigin-Name: 587ded6035a3ce91db81a29fe34ed30d0e59022cba6f107f25b04d034ef37ba9
2020-07-17 18:07:36 +00:00
dan
07ca7d610b Make it an error to repeat the target object/alias of an UPDATE statement in its FROM clause.
FossilOrigin-Name: d90a37e930c66afe95165955ae47efde08f52c8ce16c4fb239da0233335db050
2020-07-17 16:31:37 +00:00
dan
7e1d9512af Add a couple of "#ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT" blocks missing from new code on this branch.
FossilOrigin-Name: cc471df04aecf344d0aa47138014c07d3f93462ae1f8ff86ec5589cfb62c658d
2020-07-17 15:34:54 +00:00
drh
b1c993f681 Relax pointless restrictions on allowing tables in the FROM clause from
crossing over LEFT JOINs, as long as the table being moved is not the
right table of the LEFT JOIN.

FossilOrigin-Name: c1ea064948ba08c4be209ad6efc2126a7367bcb06266ea35eb957bf2d4e2cb9f
2020-07-16 18:55:58 +00:00
dan
9a23d26cba Modifications to test code so that the sqlite3MemdebugHastype() assert() statements are enabled for Tcl tests.
FossilOrigin-Name: e3c423cb1407c06a3806ae6304e4713c37cd446f4cc399731884e3d009938e57
2020-07-16 14:52:24 +00:00
drh
369e758fdc Small performance improvement and size reduction in sqlite3DbStrNDup().
FossilOrigin-Name: 35cd87063d1933b87bc2176f957ecd758d7d167e9473fa615e33caec3be14783
2020-07-16 14:19:57 +00:00
dan
01b2344b3c Add OOM test for UPDATE...FROM statements inside triggers.
FossilOrigin-Name: 917a479b0d11fb59abf41d0317ffc541eb4b83928df9382b4782953c0035fa3e
2020-07-16 10:48:37 +00:00
drh
b866a65d4d Fix a double-free of the FROM clause of an UPDATE inside of triggers.
FossilOrigin-Name: 706c8da2f6d9299f0ad3b3c93332b38071e8e88b4d1660c1841309919b64fd18
2020-07-16 02:36:24 +00:00
drh
6265c47a1a Separate VdbeCoverage() macro for different jumps.
FossilOrigin-Name: da593e57df042527decfea68baacc72d463728544cab81c70fbb25839791f706
2020-07-16 00:45:25 +00:00
drh
525326ef72 Fix a problem in UPDATE FROM in which it tries to free using sqlite3_free()
instead of sqlite3DbFree().

FossilOrigin-Name: 8ca87526523a985674fed5a8770726587b3a2e48d65721916902063ab5dba49c
2020-07-15 21:53:53 +00:00
dan
ac45b7402d Support a FROM clause in UPDATE statements, as postgres does.
FossilOrigin-Name: 7d7d5ecbd70cc39ab7a641ae26af0d3b69d5cb02e626b620102a6e19e7d8a577
2020-07-15 20:01:07 +00:00
dan
e7cf8fdd17 Add tests for UPDATE...FROM and foreign keys.
FossilOrigin-Name: 6c3668f9ed898337e664bec95865f15688a6bba43f095358dda5d08abef2bbaa
2020-07-15 19:38:49 +00:00
dan
576d5a8634 Fix problems that could occur if a table with the same name as the table being updated appeared in the FROM clause of an UPDATE statement.
FossilOrigin-Name: 13224cbd75990615088f3e30ccba05d31b3099fae4300c9ab8f7663bc5f0eb6f
2020-07-15 18:30:01 +00:00
dan
243210b79b Fix a problem in SQLITE_ENABLE_HIDDEN_COLUMN builds occuring when an UPDATE...FROM fired an INSTEAD OF trigger.
FossilOrigin-Name: 5176cb7a6a4e8cfa1973aaae46fcd7d39baedb70ae20bfacc82d62ca39fb0aa3
2020-07-15 15:32:59 +00:00
dan
42d7a77b61 Update this branch with changes from trunk.
FossilOrigin-Name: 53b8b507a10364f5d580655d89c950a5f14c2a8114625fd8749d77f289413b22
2020-07-15 11:00:29 +00:00
drh
d8b3c19991 New test cases for decimal and ieee754.
FossilOrigin-Name: 73d62f82f94347c60e026bc9cb859fec2d8b5f0c756df0c4941f11817234bff8
2020-07-15 02:15:03 +00:00
drh
9951522f0b Improvements to the min()/max() optimization so that it is able to use
indexes where terms are constrained by IN operators.

FossilOrigin-Name: b8ba2f17f938c03543a89dd29d6987163f7a4085a51de1aa14ea5504501c4f72
2020-07-14 23:58:04 +00:00
drh
19543b9b7b Now appears to work. All legacy tests pass. Need to add new tests, however.
FossilOrigin-Name: 81e6450980ee745686aee5e2b84672d3c8404a041c82c658aa562013294b8628
2020-07-14 22:20:26 +00:00
dan
e7877b2d6b Support UPDATE...FROM statements in trigger programs.
FossilOrigin-Name: 4f6d8d0ebf40029218a1d3b05ea657c0c5953b01c6f0b6a628465aa44c67e7f3
2020-07-14 19:51:01 +00:00
drh
c37b7680a4 Fix an obsolete header comment on the sqlite3WhereIsOrdered() routine.
FossilOrigin-Name: 5041f6a1c439b43c654e72a391517c115e222ef0e9a565907b03149b535e92c8
2020-07-14 15:30:35 +00:00
drh
fc5bba7dc1 Merge fixes from trunk.
FossilOrigin-Name: 2af372f59ea250ccf9ab7c30fe4bf8376a5da6e35c401edf643b9a193a38d33d
2020-07-14 13:02:30 +00:00
drh
bc2cf3b295 Early detection of freelist size corruption in incremental vacuum.
FossilOrigin-Name: f25a56c26e28abd44373230c6b5763aed35c9a7648abede8a53409dccc0bee1d
2020-07-14 12:40:53 +00:00
drh
751a44ed24 Fix a crash. Not all tests pass, but tests do at least run to completion now.
FossilOrigin-Name: b5d38e28c62dbc4f5f0e1b2590c9d6c2de9a140cc3528cae1968fd741e337fb0
2020-07-14 02:03:35 +00:00
drh
6e4b140e94 Fix an obsolete assert().
FossilOrigin-Name: 221e021077e2bbce693a89a16361418ced20f4e8f5a27e8c461648cff663a2c5
2020-07-14 01:51:53 +00:00
drh
9d575e46f3 Merge latest changes from trunk. This branch still does not work.
FossilOrigin-Name: 6144387238c03b8b33ae98d624f7ffa44a7829d3e0d4a0a01b5528e71ab4f08b
2020-07-14 01:03:05 +00:00
dan
f067ae8eba Add test for LEFT JOIN in UPDATE...FROM statement.
FossilOrigin-Name: 4f3dff045ab90e80479960fed64cf36f23dd0e13144edbde15043913ad3faac5
2020-07-13 20:43:13 +00:00
dan
be952c11dc Add test cases and fixes for UPDATE...FROM statements that modify primary key columns.
FossilOrigin-Name: 47c87af3e52bce10fbcc2cbe832d659b0c204bfb3368d9314fa1b01120129254
2020-07-13 20:10:29 +00:00
dan
a7f82d9f47 Merge latest trunk changes with this branch.
FossilOrigin-Name: 5ee3c27e20d12a126fb773b428bb864102b949a5b26a8d5c523753dcedf4be10
2020-07-13 18:04:27 +00:00
drh
5b107654e9 Readd the ALWAYS() macro that was removed by [f7a74f89dbd58b47] as the
condition is no longer reachable due to the previous check-in.

FossilOrigin-Name: 9cb03beae42d814a1b1b69f72865fde502d3f443313ec29edd010d1de40225eb
2020-07-13 15:35:08 +00:00
dan
27da907f8e Fix a problem causing queries containing window functions to ignore collation sequences under some circumstances.
FossilOrigin-Name: e6c2192ef88e9990c8b91755c8e779f09e23f936a17123d8e42059257b756ed7
2020-07-13 15:20:27 +00:00
dan
bbc9e1908a Fix an integer overflow bug in fts5 triggered by a corrupt record.
FossilOrigin-Name: 49da8bdce17ced910b414d50e8df79800513dcf03a196197dc1ea8e47deeda92
2020-07-13 11:06:30 +00:00
dan
56215eaff4 Add second test case for the improvement in [30735432].
FossilOrigin-Name: 1bd18ca35bdbf3034591bf8981fd3a985f0920379bc4dc81e0e6a819667998e9
2020-07-11 16:45:20 +00:00
drh
a1085f0640 Improved detection of a corrupt database schema. Fix for a problem discovered
by dbsqlfuzz.

FossilOrigin-Name: 30735432bc33cb953b6d7d2a2de9eb378f9740e0e663f50c727c3f138cd43a2b
2020-07-11 16:42:28 +00:00
drh
6af305de1e Remove unnecessary code from the window functions implementation.
FossilOrigin-Name: 1e87da9c93309d1d69b1e0ab65c615b9ff9c1c6813ad0c7b90d2495be4ba0adc
2020-07-10 21:43:53 +00:00
drh
413b94af89 An attempt to get the Min/Max optimization working with IN constraints.
Not currently working.

FossilOrigin-Name: 4a64c16fb7a07431e534fb9bbcf778646be8a1c718d5d10873fbccb0c867aac7
2020-07-10 19:09:40 +00:00
dan
b16425d05a Fix a broken assert() in fts3 that could fail when handling corrupt records.
FossilOrigin-Name: 5124732370fd53c93314c9c79b4251bd46ce81c2e7aa4f59e2c1889cc4263d5a
2020-07-10 11:12:36 +00:00
dan
7db1ed50b8 Fix handling of another corrupt database case in fts3.
FossilOrigin-Name: ccff8cb8267d4c5605484f7a35c1836937f20b3d6879fe84cd84dc24bbbffc77
2020-07-09 21:29:34 +00:00
drh
9c673a29bd Fix a comment typo. No changes to code.
FossilOrigin-Name: 610ee8d5dc855fd163daa3c93b44db7874463d69df5a01ab4113b725a031b9d4
2020-07-09 14:05:47 +00:00
dan
b13d5c25d6 Remove bashism from configure script.
FossilOrigin-Name: 138beebb2aa21ed18525dbe02c80426c6caabf6a5f6532a95b738a39b31ad4d5
2020-07-07 19:24:34 +00:00
drh
d1d89140c0 Increase the resolution of the vdbe opcode counters to 64 bits, as
apparently some users run single prepared statements that go for
longer than 4 billion instructions.  See forum post 
"[https://sqlite.org/forum/forumpost/d07949dc94|Possible freeze in the progress loop]"

FossilOrigin-Name: 612eb590ea44fd402e630f2d62558beb7ce57d7d0ba113c8b72ea60a895c5a43
2020-07-06 12:13:05 +00:00
drh
a78d2c0528 Fix the table_info pragma so that it always checks the schema version and
reprepares, even if it is a no-op.

FossilOrigin-Name: 6da77973abc325ae8baf64615267a614a0b8bb8dfd0a01a9f7d6c3a8f359564f
2020-07-04 20:29:56 +00:00
drh
a4e42d24df Fix the line-number of error messages coming out of the ".import" command
when the --skip option is used.

FossilOrigin-Name: e0a8b11dfd6b3ab89ae5032d60cf3c1bba7198a1a2debe5c691b5d1f2e1befee
2020-07-03 21:24:42 +00:00
drh
27ee29f68c Fix a compiler warning about an unused procedure in the parser.
FossilOrigin-Name: b27bb4fe389e12472a6144441df2dca6a7393024f2621fd22dd1a2b4033c46ec
2020-07-03 21:18:07 +00:00
drh
5f0d37b57e Update the lemon documentation to match recent enhancements.
FossilOrigin-Name: ca7630a5772ab919482a3629e11627143a1e1ec290a570ce4188189e671f9015
2020-07-03 18:07:22 +00:00
drh
c601f1016c If the amalgamation is built using OPT_FEATURE_FLAGS =
-DSQLITE_UDL_CAPABLE_PARSER then it can be compiled with or without
the -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT option and it works either way.

FossilOrigin-Name: 1f96a29dd8654ee30d36982a8bcd3f17a4b9193d3879fdb38fa3f03eeeff3080
2020-07-03 17:24:35 +00:00
drh
0a34cf551c In lemon, add "%if" and "%else" and allow boolean expressions as the
argument to "%if", "%ifdef", and "%ifndef".

FossilOrigin-Name: 951d22b72f80de9e23df645abcc3d88ca1a275b46ea23b84152ef48716922b37
2020-07-03 15:41:08 +00:00
drh
4b849b0b09 Fix the pragma_foreign_key_check virtual table so that it accepts arguments.
FossilOrigin-Name: 07f849dee3d245ecf80ba3c3ce8dfc630e71ddb1e9c0bcc1f08cee22001fcb07
2020-07-03 12:32:04 +00:00
drh
ec1650a239 Fix a problem with "PRAGMA foreign_key_check" where if a table in one
schema appears to have foreign key constraints against another table in
a different schema, the pragma will try to check the constraints even though
they do not apply because they are in different schemas.

FossilOrigin-Name: 81bc4b65ae2a68128b0be75a7a3d4f47f05cc588ff130ba56366ab9b16289228
2020-07-03 12:15:59 +00:00
drh
15cedda902 Minor simplification to the 32-bit varint decoder.
FossilOrigin-Name: 6ffd17b668a8ad561c37e89063afb6e7f8425e557e93025b7527fe3656585d77
2020-07-02 17:05:11 +00:00
drh
e3863b5176 Ensure that the "PRAGMA schema_version" command causes the schema to be
reparsed and reloaded.

FossilOrigin-Name: 27d4a9a7b530c77a5b2593d1a5232b10746da9906f8d12890de7a8fbd7270256
2020-07-01 16:19:14 +00:00
dan
fa4b0d4453 Fix a problem with VM code generated for some aggregate SELECT statements that feature min()/max() aggregates both with and without FILTER clauses.
FossilOrigin-Name: 2094da753feb847254473b148d11e535c44dbae9b17454f1a4f8f7e90aefba3f
2020-07-01 14:07:45 +00:00
dan
3f1d0f56e4 Add a test to ensure that "PRAGMA wal_checkpoint = FULL" invokes the busy-handler to wait on read-locks.
FossilOrigin-Name: f068fb116286b1dbdee9c168900348cfcab84e6d8413f3456e4e492f650d11b0
2020-06-30 18:21:45 +00:00
dan
f488bc1147 Avoid a potential buffer overread in fts3 when processing corrupt records.
FossilOrigin-Name: 4d0cfb1236884349168f8e2ec5e18c0232965148af78615e0d5c9b0e13a35422
2020-06-30 15:32:12 +00:00
drh
b8fec21983 Fix generated columns so that they play well with upsert.
See the [https://sqlite.org/forum/forumpost/73b9a8ccfb|forum post]
by "iffycan" for details.

FossilOrigin-Name: fa9d93cf32fac4b86044acf5d1b9ea2f36e964ed7142cf1d270986c9ef3fb766
2020-06-29 20:26:50 +00:00
drh
ec43d8040a Change the magic number used to identify the "excluded" pseudo-table in
an UPSERT statement into a #define constant.

FossilOrigin-Name: e96c2ac9ab1a1c51b1498f4b91fb71d2987c30579d072b2f0297da9eb945cb97
2020-06-29 20:20:40 +00:00
drh
da36933eb4 Document the dual-use of the P5 operand to the OP_MakeRecord opcode.
FossilOrigin-Name: a73f80f22a585d1a2f55650d5cda4ece6c4ef039ef5eae2c02c3e5c269d4c30a
2020-06-29 20:09:04 +00:00
drh
8ddf635811 Change the name of IntegrityCk.mallocFailed to IntegrityCk.bOomFault to
avoid confusion with the sqlite3 object field with the same name.

FossilOrigin-Name: 87c7d962581f4bb1224086701352850ede9847dc76235b33c7c2a35ef594d382
2020-06-29 18:30:49 +00:00
dan
2bfd35b8d2 Add test script to verify busy-timeouts are working for SQLITE_ENABLE_SETLK_TIMEOUT builds.
FossilOrigin-Name: ada43e7c490bf72a50ee84e1db994e149744b2a943260449076b83d1874813b2
2020-06-29 17:52:53 +00:00
drh
64185e31fc Do not run resetAccumulator() after a malloc failure.
FossilOrigin-Name: 1b426603f05033bcee0331c6f664cd5ed2ebf8f5d4cde8c6673c7a699ff53bb1
2020-06-29 16:30:10 +00:00
dan
b695bab055 Fix another fts3 problem with processing corrupt records.
FossilOrigin-Name: 6e0ffa205312416830340ea6e621dfb1a529e5603d569941ed6263930dc28c45
2020-06-29 13:33:56 +00:00
drh
5cbb442ea3 Small performance improvement in the sqlite3_step() interface.
FossilOrigin-Name: 61400ef9f1337c77263b4d3e43a1983b0c4cf7137f066a2691768c98877035ef
2020-06-29 13:12:42 +00:00
dan
30b5db1261 Fix a problem that could cause an infinite loop in the fts3 'merge' command.
FossilOrigin-Name: be545f85a6ef09cc6c762f7d2ab7a0b3adf5590c3fbdc9903e6b5b5cec6e823f
2020-06-26 20:41:18 +00:00
drh
22f874168a When computing the verification hash in speedtest1, do not include the
value of floating point results (which can very in trailing bits depending
on platform) but merely hash the fact that a floating point value was
received.

FossilOrigin-Name: e12225d59c63ba392db4fa8dc26700ac26b20c8b98ea5107eef0e0b5138ace87
2020-06-26 17:56:43 +00:00
drh
0581214577 Improvements to speedtest1.c for more consistent verification hashes.
FossilOrigin-Name: d34b8ff5f8d04a75996f6ca9d3a0563c83e8e833c1eb08ac3861431f36f7bfb1
2020-06-26 16:17:27 +00:00
drh
6df54c30fc Improvements to speedtest1. Added the --memdb and --output options. The
--verify option now outputs a hash of SQL outputs.  The speed-check.sh script
disables the hashing feature with --legacy and adds the --verify option.

FossilOrigin-Name: f3455cecf22ea98f9ad48e92d620c8e2ec94877e4581731afff0f2bd32014a1d
2020-06-26 15:42:55 +00:00
drh
85c4754697 Add the ieee754_to_blob() and ieee754_from_blob() functions. Fix the handling
of subnormal forms in the two-argument version of ieee754().

FossilOrigin-Name: c78cbf2e86850cc6882d3f0bd5415f6e731c3c675ffe77bb343682c619cb8cd9
2020-06-26 15:32:29 +00:00
drh
3c99dbb18b Add --verify to speed-check.sh and add --memdb and --output to speedtest1.c.
Other improvements to speedtest1.c.

FossilOrigin-Name: 89a11120ab2ce13f8a539cb05a9d0628a1f83b4790910b2023c21d60aabc43ee
2020-06-26 14:05:58 +00:00
drh
d8d335d737 Fix a possible null pointer deref following OOM. Discovered by dbsqlfuzz.
FossilOrigin-Name: cc888878ea8d5bc754c69de523819d32d6d9853857e31d7287f9dbfd723428db
2020-06-26 04:34:28 +00:00
drh
0f40e8dd41 Update the showlocks utility program so that it functions on files with
a huge number of locks without overflowing the stack.

FossilOrigin-Name: adb7484f93329c7a94cd84e30bc4a8dbf2d6e901eba17cc3454afb8ba346cbf4
2020-06-25 23:21:09 +00:00
drh
99f363b35e Enhance the --verify option to speedtest1.c so that it computes and displays
a hash of the result from all SQL queries, for verification purposes.

FossilOrigin-Name: 60d1e46c8c8a3c853034fd79f204bcb5d50d1c366eb246849c333a2d0abc2648
2020-06-25 20:28:13 +00:00
drh
8cda77d44a Add the ieee754_mantissa() and ieee754_exponent() functions to the iee754
extension.  Build the ieee754 extension into the CLI.

FossilOrigin-Name: db2f0836b64cd2e119684f1cf75fa3b19a84ca6aca1a239f7e2b9298016e2c95
2020-06-24 15:06:29 +00:00
drh
ec18b6e5b9 Fix the decoding of subnormal values in the ieee754 extension.
FossilOrigin-Name: 838817b680f02b3845d6d56f85d5d36fa5ae7453afef7a1a5a24624255f2dc3e
2020-06-24 13:52:10 +00:00
drh
b5b9bf8540 In the one-argument version of the ieee754() extension function, if the
argument is an 8-byte blob, interpret that blob as a binary64 floating point
and decode it.

FossilOrigin-Name: 4199c1e8aa47d77df3ef598cb6f5418f67970dd00f34823463c85eabfc8d2b77
2020-06-24 13:14:00 +00:00
drh
9f683de872 Add the decimal extension. It is built into the shell, but is an optional
add-on for the library.  It is not included in the amalgamation.

FossilOrigin-Name: 5391687bf8563b3fdd157b436b2cbb6a0ee5f676727d41bbddfaa8eacc39729b
2020-06-24 12:29:19 +00:00
drh
e6b430b178 Fix the ".selecttrace" command in the CLI (only available when compiled
with the non-standard -DSQLITE_ENABLE_SELECTTRACE option) so that it does
not segfault if invoked without any arguments.

FossilOrigin-Name: d45c27a3e5edaa2bd9ff0473e18c6536aa5d15f9a4d22dfee894a5ee4347f8d7
2020-06-24 11:45:35 +00:00
drh
9e44f265a7 Enhance the --testset option on speedtest1 so that it can accept a
comma-separated list of test modules to run in order.

FossilOrigin-Name: 780e8aaa231b2b585505c3886d5a13d39dba546fdd8020331ad4de2ae92922b0
2020-06-23 20:03:57 +00:00
drh
24aee8af6e Try to remove end-of-line whitespace when building the amalgamation.
FossilOrigin-Name: be3e7814e4cdbc09eaa5112d7d4135b3a2cedbfe66217d9973b1b39a44464e93
2020-06-23 17:57:08 +00:00
drh
e78c027b64 Fix a harmless compiler warning.
FossilOrigin-Name: e1416c8b0628afa062d8cff40d0cd3576dc85460e55b21a271f88fcb608b9f59
2020-06-23 15:29:22 +00:00
drh
6b64718618 Avoid unnecessary normalization in decimal_sum(). Trim excess trailing
zeros off the result of decimal_mul().

FossilOrigin-Name: 0294ce071c863eb517e97beff31c3d95a4370e979a969415162302a90d3fda0e
2020-06-23 14:44:57 +00:00
drh
427af8dc3d Add the decimal_mul() function.
FossilOrigin-Name: 72eee04b67268ad38fd51ff32849f08c0a54cf1b481d5ecb11d77cc9c729ee03
2020-06-22 21:25:37 +00:00
drh
beb9def059 An extension for doing decimal arithmetic on strings.
FossilOrigin-Name: 4c3b85607feb53462ccc8b89bea699fdb132c402eae597afa33cc40a85c32329
2020-06-22 19:12:23 +00:00
dan
3259295533 Fix problems with handling return value of mmap() in lsm_unix.c (mmap() returns MAP_FAILED on error, not NULL).
FossilOrigin-Name: da06168c09df5c0e8e10d0f9618e69217d4c0173a8199660bad2805f009d7b08
2020-06-22 16:02:06 +00:00
drh
a764709bf3 Work around a bug (an incorrect warning) in Clang-8.
FossilOrigin-Name: 067291143a63db924ead4810defb4bc6f195557412f5d1c22299f30d2d9f2a79
2020-06-20 03:43:46 +00:00
mistachkin
96e3c39bd5 Reverse unintentional spacing change in the previous check-in.
FossilOrigin-Name: c7b2ee1edb108430454578c1623ba6aee1e2a7bc30cb2f9884ea3e21c3b75635
2020-06-19 15:35:07 +00:00
mistachkin
7cff0e34e0 Include 'sqlite3rc.h' in the amalgamation archive targets.
FossilOrigin-Name: 3df579ca32e8250725957d1982897a43281c73e8373af49abd6e7bd674f30e74
2020-06-19 15:33:23 +00:00
drh
067b92ba00 Extend the refactoring into extensions. Clean up stray newlines.
FossilOrigin-Name: 7a876209a678a34c198b54ceef9e3c041f128a14dc73357f6a57cadadaa6cf7b
2020-06-19 15:24:12 +00:00
drh
1e32bed3c1 Further refactoring of the schema table name.
FossilOrigin-Name: 9536fa0ae0c1ae6e2e98d2fa11e5acda7f3c9b8ca5061b6f7f8cae63a11d936b
2020-06-19 13:33:53 +00:00
drh
ccb2113a62 Refactoring various names. No changes in the resulting machine code.
FossilOrigin-Name: 7bb08b1bfcf184e4b59c8c9028926a0052612ff6a6731914ccdb8dee07ea4a98
2020-06-19 11:34:57 +00:00
dan
877859f2d3 Fix an assert() that could fail when operating on a database with a corrupt schema.
FossilOrigin-Name: 4a340c9bc7d939efc947e3b17ca79314482f74368b15567dd089d40e4270890e
2020-06-17 20:29:56 +00:00
dan
0ad1b3284a Fix an assert() in fts3 that could fail when processing a corrupt record.
FossilOrigin-Name: 4adc0a1b0d84c2df6d6bf0d5d9d3fa9f7d048af8d232c4beb77518727890f212
2020-06-17 14:54:06 +00:00
dan
5d237bfab1 Fix a problem with retrying constraint failures within sqlite3changeset_apply() calls with the SQLITE_CHANGESET_INVERT flag is set.
FossilOrigin-Name: d73e857b833dfc29400049ca7f01ca465f980466e3aa67214c3c5e5573181419
2020-06-17 14:14:11 +00:00
dan
74bbd37dae Add new file doc/wal-lock.md, containing notes on wal-mode blocking locks.
FossilOrigin-Name: c6b1d3a385751633d3ac1853e13d5e847185dd6432fb8b960a4080f61357c08c
2020-06-16 19:51:56 +00:00
drh
dd853c382a In the CLI, only interrupt tabular outputs at the end of a line. And print
"Interrupt" on a line after stopping the output.

FossilOrigin-Name: f3bd689336fecaa1e2928b826c6aedb0178d322f4633ac429dd1ae6fbc08e7f1
2020-06-16 17:34:40 +00:00
drh
dc8339eaac Add a test case covering the previous check-in to the test/fuzzdata8.db file.
FossilOrigin-Name: 95379da0e1ad5110648a5b3af24e7caab66a6f1ad6efdf374c83ae4ef1fed515
2020-06-16 14:12:43 +00:00
dan
b65ce39607 Fix an assert() in fts3 that can fail when processing a corrupt record.
FossilOrigin-Name: a58a6d6fb241a50c4c7c9af8a9c65bc4746e905b2ae12290c7182afa944053a2
2020-06-16 14:06:20 +00:00
drh
346a70ca1e Provide "sqlite_schema" as an alternative name to the table that holds the
database schema.

FossilOrigin-Name: 61782a7ae3c25cf59d7a676cb295eb024d17c46e532ae78c6fe871a91d712fa9
2020-06-15 20:27:35 +00:00
drh
999429882e Fix the CLI so that interrupts work in columnar output mode.
FossilOrigin-Name: 9472f1fe58222b738ad10fc93ceb365dc33b65c2bbca571f52bcd5bdb74b347e
2020-06-15 20:05:37 +00:00
drh
b13c3a33fd Fix the --enable-update-limit option to ./configure.
FossilOrigin-Name: d31fd57ea538668238787fde10a6a57bbd8a428c73f2e54b2e95ee9a645bc75b
2020-06-15 14:38:57 +00:00
drh
b7cbf5c1b2 Fix a defect in the query-flattener optimization identified by
ticket [8f157e8010b22af0].

FossilOrigin-Name: 10fa79d00f8091e5748c245f4cae5b5f499a5f8db20da741c130e05a21ede443
2020-06-15 13:51:34 +00:00
drh
86d2de2571 Check-in [1d4f86201dab9a22] changed a testcase() to an assert() because we
didn't know how to reach that condition any more.  But YongHeng's fuzzer
found a way.  So now we change it back.  Ticket [9fb26d37cefaba40].

FossilOrigin-Name: 90b1169d1b200d35a3f9f0ad2ae35a1b336bdd9b1ad0494ba80a382354c8d8b8
2020-06-14 13:40:13 +00:00
dan
cd653a3266 Avoid deleting expression nodes in the flattener code, as they may be referenced by AggInfo objects further up the stack.
FossilOrigin-Name: cc1fffdeddf422404170fa163ab80372ae58b444d7012b2c164021b221709b3e
2020-06-13 21:24:40 +00:00
drh
74e0d96695 Identifiers "TRUE" and "FALSE" cannot take on their boolean constant values if
they are operands of the "." operator.

FossilOrigin-Name: ad738286e2441b5e84d05366db3fcafabe66be766f21fe6c17f43a8fabab16fb
2020-06-13 03:18:21 +00:00
drh
0dc90d43e5 New test case added to test/fuzzdata8.db.
FossilOrigin-Name: 14a5cbddc887e23a684fabab1a213cce261bd6cffa0663d4f138b92d0b65b9c2
2020-06-12 15:45:02 +00:00
dan
56e38185fe Fix a buffer overread in fts3 that could occur when decoding a corrupted record.
FossilOrigin-Name: 9a4a40c45feb2bb89020dc7711b4753479112ceae7ce2a44521d72afeddfac83
2020-06-12 15:17:27 +00:00
drh
6aa7515c46 Remove a NEVER() that turns out to be reachable.
FossilOrigin-Name: 44e573ecd5c2b60107133d60c51f3a04a3f904e9c1cf926e9b8ea977c7acae8d
2020-06-12 00:31:52 +00:00
drh
b5aaee5e31 Add a new assert() to the SELECT processing.
FossilOrigin-Name: 98cea4a32ba558c137d71a5e373a6803d764d34c5640907371dcf6468ffb2e64
2020-06-11 16:04:10 +00:00
dan
46daa99b8d Avoid rewriting compound SELECT statements that use a different collation sequence for ORDER BY and record processing a second time if they contain window functions. Fix for [b706351c].
FossilOrigin-Name: 32a88bdd4be5acdc1b80856bf6e32724dc3a467d5050bec0fe1a3dfedcc06f34
2020-06-11 15:53:54 +00:00
drh
9216de8a23 Provide the ability to use the SELECTTRACE() debugging macro outside of the
select.c source file.  Use this to add a new SELECTTRACE() entry in
window.c for improved tracing of window-function parse-tree rewriting.

FossilOrigin-Name: 30c6d895b573d5f2a53487b3b7a0d20be7e382c7a0bc87336bd43fbd2fa89bf4
2020-06-11 00:57:09 +00:00
drh
ac4f7cf8d3 Make sure the bbox object is fully initialized in geopoly, even if reading
a corrupted database.

FossilOrigin-Name: fd5abb1a7b5a55127d5c0d5ff448020d8bccab44e4f5afe1eb88fc19578af735
2020-06-10 14:30:15 +00:00
dan
f65e379919 Ensure that the "push-down" optimization does not push constraints down into compound queries if any of the component queries uses window functions.
FossilOrigin-Name: 094dcfe779613301521e8bb990432df187b3686add75a3420b4a193f02f3467f
2020-06-10 10:58:15 +00:00
drh
7b4c4d4a67 Disable AggInfo consistency checks when unwinding after an OOM.
FossilOrigin-Name: 65179814aa0ae5927bae97c10ef20f290535399b889d96d5b88931f62635f212
2020-06-10 03:07:26 +00:00
drh
d124549fce Ensure that aggregate functions that (a) are part of SELECT statements with
no FROM clause and (b) have one or more scalar sub-selects as arguments are
assigned to the correct aggregate context.
Fix for ticket [7c6d876f84e6e7e2]

FossilOrigin-Name: c29a9e484e1dd245962afbbf511b183462af5e86c511261ccf018345e773f940
2020-06-09 23:50:13 +00:00
drh
bc050b8f27 Mark an always-true conditional with ALWAYS().
FossilOrigin-Name: 35a236841764a10cdcda63f34e1a8e7ffa43933bc89cb32f675454327834d7bf
2020-06-09 22:11:06 +00:00
dan
ed41a96bc1 Ensure that aggregate functions that (a) are part of SELECT statements with no FROM clause and (b) have one or more scalar sub-selects as arguments are assigned to the correct aggregate context.
FossilOrigin-Name: 16a41fa8c4c74bba4e908a9c19e6cf5a927cac140e2070c9abf303158be7257b
2020-06-09 17:45:48 +00:00
dan
cfb8bf6a50 Modify a test file to avoid causing Tcl to allocate too much memory.
FossilOrigin-Name: 232431f32ef77a9dfc4eeb7765dca24af72051fd5460f648d0c5ba318c8a01fc
2020-06-09 13:53:56 +00:00
drh
81185a5138 Give the expression pointer fields of AggInfo distinctive names in order to
simplify tracking of all their uses.

FossilOrigin-Name: a53bdd311c4154fd5e1131efbb9665362f79db5a35ce9f7b1547f74b8ee2d8ba
2020-06-09 13:38:12 +00:00
drh
e26d428a59 Improved tree-view debugging output for aggregate functions.
FossilOrigin-Name: b5711b4eead10ef4b0b61f2e2c54768d215a4105f6d47d2ea78991b6e53a6831
2020-06-09 11:59:15 +00:00
dan
5c10930fa9 Fix a case where a corrupted fts3 record could cause an assert() failure, or spurious SQLITE_NOMEM error in builds with assert() disabled.
FossilOrigin-Name: d48af4d2cfff3d5f4ccc3db5d658e8b503255b577e6e62b5c2b4a4437875b895
2020-06-08 14:43:41 +00:00
drh
e6463a717a When an Expr object is changed and that Expr is referenced by an AggInfo, then
also update the AggInfo.  Also, persist all AggInfo objects until the Parse
object is destroyed.  This is a new fix for ticket [c8d3b9f0a750a529] that
avoids the follow-on problems identified by tickets
[0899cf62f597d7e7], [1f6f353b684fc708], [e5504e987e419fb0], and
[f7d890858f361402].

FossilOrigin-Name: 6e6b3729e0549de028f6c5bf494b2d69d621c81b61a1dc0a329d3950039342fb
2020-06-08 11:34:40 +00:00
drh
2f82acc036 Fix minor OOM problems.
FossilOrigin-Name: 8b23d80271aab38abe42ee8b3ca4b746572ecef26c2a37b094b01560e6be9d45
2020-06-07 22:44:23 +00:00
drh
bf7909734a AggInfo objects might be referenced even after the sqlite3Select() function
that created them has exited.  So AggInfo cannot be a stack variable.  And it
must not be freed until the Parse object is destroyed.

FossilOrigin-Name: 3c840b4df306e2db1da08673e9ede973b4cb6d2b3f9eeeab5835e39452ee3056
2020-06-07 20:18:07 +00:00
drh
896366282d Alternative fix to ticket [c8d3b9f0a750a529]: Prior to deleting or modifying
an Expr not that is referenced by an AggInfo, modify the AggInfo to get its
own copy of the original Expr.

FossilOrigin-Name: 7682d8a768fbccfe0cc956e9f6481637146e1ab9763b248ff11052761ce32e32
2020-06-07 17:33:18 +00:00
drh
a0365c487c In the debugging treeview output, change the name of "SELECT-expr" expression
nodes to be "subquery-expr", so as to not confuse them with actual SELECT
nodes.

FossilOrigin-Name: c1c8937a30feff6aa4385b0c264fd8e70d54422a0629c2ce38082d85d3334a57
2020-06-05 04:01:50 +00:00
drh
c060508445 Always use ?...? to indicate optional arguments in the output of ".help"
in the CLI.  Change ".mode column" so that it automatically activates
".headers on" if headers have not been previously turned on or off.

FossilOrigin-Name: 2827c0a186596299e43eb3e7378eea462d2b060b2c3388ce5cb2bc8e0b43999e
2020-06-05 00:54:27 +00:00
drh
0908e38536 Add support for "box" mode in the CLI: Like "table" except that it uses
unicode box-drawing characters instead of ascii-art.

FossilOrigin-Name: 6da784c9e174744d6deeb76c553b515b96c1fcb80c55a281e476959ec680fb72
2020-06-04 18:05:39 +00:00
drh
634af38115 Improved display of ".mode table" output for empty result sets.
FossilOrigin-Name: 7efabd683b79743b407ad71dda56db00fb0d668828bdc342145816b4f1c3bf3a
2020-06-04 16:54:10 +00:00
dan
b55389412f Use __has_extension(c_atomic) instead of __has_feature(c_atomic) to detect support for atomic load and store operations with clang.
FossilOrigin-Name: 362255791f8801e0d9869e36239b8b2cb29c38bf0b86894bd2d159ce46d8447e
2020-06-04 16:34:49 +00:00
dan
ec206a7d34 Use AtomicStore() to set values in the wal-index hash table.
FossilOrigin-Name: 1ab30c75f2fe14d1ee77d0eace4e29ba8f805d63e2da0897b111ea1311f409aa
2020-06-04 16:07:51 +00:00
drh
21b473de78 Work around a bug in clang-11.0.0.
FossilOrigin-Name: 3c2bf8042ec46195c67dfd91df084f5bc19162fd26389920e716b310c80deea6
2020-06-04 02:50:47 +00:00
drh
a5f3fb3015 Fix for ticket [810dc8038872e212]. Thank to user "Maxulite" for tracking
down the problem!

FossilOrigin-Name: 89af93d77fa7959a4ee7364bae6c02c40963a3cdf80b0a4a8af9c9764d5c7bb5
2020-06-03 19:28:10 +00:00
drh
56f1873d10 Simplification to the interrupt handling logic in sqlite3VdbeExec() saves
a few bytes of code space.

FossilOrigin-Name: 43e0e59bd4e34c6e88c004ea951c0d76ff1cf0a034389f490495a5d12e239382
2020-06-03 15:59:22 +00:00
drh
094afffaec Improve the query planner so that it is better able to find full
index scan plan when there is an INDEXED BY clause.

FossilOrigin-Name: d901837fea1ed54de43ad59eb47c02cbfd2eb215fc57317b5ea8c22a7df947c4
2020-06-03 03:00:09 +00:00
drh
e566cebb26 Draw the dashes below the headers in "explain" mode in the CLI.
FossilOrigin-Name: c6b7833ac7d9cc75cb45d5e8041367ebd6f197f776766e6143535c227fc72a20
2020-05-30 15:34:49 +00:00
drh
e557b0155b Improved VDBE comments on the ANALYZE code generator. This change
also fixes a harmless use of an uninitialized integer variable as an input
to the %d format on a VDBE comment.

FossilOrigin-Name: 1cb248a3fc4c35c5bc3993b554edcccaa5c5e91570af67ebb99643a15221ae33
2020-05-30 00:30:08 +00:00
mistachkin
375b0b014b Enhancements to the incremental build support for MSVC.
FossilOrigin-Name: 2e25d915bcb8d6f1747f9befdef64d2e0e495cc6c5948a8eff5d0097b6613d06
2020-05-29 21:06:52 +00:00
drh
42c2a04eb7 Remove a stray "&" character in the CLI, detected by a clang warning.
FossilOrigin-Name: 5865d2f2d0333024366ecf1d919535fd4ec05c637feff16d75028ccdc8db4b50
2020-05-29 20:16:19 +00:00
drh
02c17a4da7 Add the "shelltest" target to the MSVC makefile as well.
FossilOrigin-Name: 9924c0456bfcd2058c9620a93dfbfd4c7d960c68910ce6aed7364dff42baba5c
2020-05-29 19:45:03 +00:00
drh
9776784f94 Fix the ".import" command of the CLI to clean up better after errors.
Add the new "shelltest" makefile target on unix platforms.

FossilOrigin-Name: 50d4ddf1330b88551de51439eb535f385dee6b53013802dd62f832d16b3025b6
2020-05-29 19:39:35 +00:00
drh
7da29a3ad3 Improvements to help text for the CLI.
FossilOrigin-Name: 6a01e4c444b072e31a320121a6810d7c986c2c54ce45f9b11683233b1e7af8da
2020-05-29 19:17:20 +00:00
drh
1d29fd85a3 Fix a memory leak in the CLI when an unknown or unrecognized
argument is given to the ".dump" command.

FossilOrigin-Name: 71bfbbcc1a8d0e02073a381a5b31a5ccd5477011b22904b9989b6129d81f02e7
2020-05-29 19:03:03 +00:00
drh
8c748633a9 Improvements to columnar output in the CLI. Columns automatically expand
to contain the largest row.

FossilOrigin-Name: 4e1db8e9a9ee370a398f13fd8546a520111b8cfb84460389535b5bc5bd9f4f82
2020-05-29 16:15:58 +00:00
drh
0285d98de7 Space to hold the ".width" of columns in the CLI is now obtained from
malloc() and hence is not limited in the number of columns supported.

FossilOrigin-Name: 445ed5dab2c26e9f4a7fb5277abdba3359d23cf5318cfd0d8322162d9616ee7a
2020-05-29 14:38:43 +00:00
drh
d6f252490e Incremental improvements to tabular output modes in the CLI. The
"markdown" and "table" modes no have headers turned on by default.

FossilOrigin-Name: af28bff91ad7e2d69db0052323c9c05c75a41d4134974bd1305f1c4f579d3558
2020-05-29 12:31:53 +00:00
dan
d31fcd4751 Expand upon a comment in os_unix.c. No changes to code.
FossilOrigin-Name: 77933dc4dbe0e0af3b13a14293a8bd684edc5056f4ae9291c6f95d4433bf90ce
2020-05-29 11:07:20 +00:00
drh
69c093da98 In the json output mode of the CLI, do correct quoting of escape characters.
Also, show BLOBs as JSON strings, possibly with embedded \u0000 bytes.

FossilOrigin-Name: 0278147a7d2b50bed9f59ed3d3a04ecc6d46f072eb510e463f6707df1d829020
2020-05-29 00:21:43 +00:00
drh
30c54a01db Progress toward adding new output modes to the CLI: json, table, and
markdown.

FossilOrigin-Name: 14f55fafec11491e87e6526c72cf85c689d74ba18418a1ae9646586ec206767a
2020-05-28 23:49:50 +00:00
drh
c683573fd4 Enhance the ".quote" mode in the shell so that it honors .separator.
FossilOrigin-Name: b5e33ed537e7d7dcabc9f6dc91d6838e0d1657f323440e09e2e24ffa2ba6141a
2020-05-28 20:37:17 +00:00
drh
56c65c92cb When the sqlite_stat1 data is missing for some indexes of a table but is
present for the table itself or for other indexes in the same table, then do
not let the estimated number of rows in that table get too small, as
doing so can deceive the query planner into ignoring a perfectly good index.

FossilOrigin-Name: 98d4262018a81a9a36dd8beb4b02ff0e75cdcbb8a121d143157ffb37b228d60d
2020-05-28 00:45:16 +00:00
drh
b639a2094a Small performance improvement and size reduction in the expression
code generator.

FossilOrigin-Name: eeb53e219551d8a05a87f1de9a7cd9af295d08a296f1f435a8509ea1252ccdcc
2020-05-27 12:44:28 +00:00
drh
399062cccb Change a datatype from i16 to int to appease Converity and help eliminate
a false-positive.

FossilOrigin-Name: 5b560ec49041d89c87ea3315d8fc17f7fb0e03a82091934be7373b290183f82e
2020-05-27 00:02:07 +00:00
drh
a3d6b8e5a7 Fix the cksumvfs extension so that it will not register itself more than
once.

FossilOrigin-Name: d5cdd57150db914b61b8b9c61c6caac9690fe7b647ee2c003e75b9b62be62752
2020-05-26 20:33:18 +00:00
drh
ed505ce3e4 Performance optimization in the transfer of error messages from statements
to connections.

FossilOrigin-Name: 0e898f4fed1c851cb90f940175110e632a20668a285d39f5f94f7358c3064882
2020-05-26 20:31:17 +00:00
drh
47937cfd8d Increase the version number to 3.33.0 to begin the next release cycle.
FossilOrigin-Name: 790badb390d59062cd2d8d1dec76cc6104c9425610a67503f6be38076b6a458e
2020-05-26 11:23:48 +00:00
drh
ed1e910448 Changes to sqlite3SelectNew() to work around a false-positive warning
from GCC-10.  The code is very slightly larger and slower as a result.

FossilOrigin-Name: 04e1edd8e5821a377407263829ed0d87968c708c9aeb1282107ea6f39a11c1cc
2020-05-26 11:10:25 +00:00
drh
bdd4f7d91c Innocuous changes to help Coverity avoid false-positives.
FossilOrigin-Name: 4ec8a5a203f10d228d0b3389120638766cc343179dbe38d5dbf69b650765934c
2020-05-26 10:54:46 +00:00
drh
d63c76fb31 Version 3.32.1
FossilOrigin-Name: 0c1fcf4711a2e66c813aed38cf41cd3e2123ee8eb6db98118086764c4ba83350
2020-05-25 16:19:56 +00:00
drh
b6907e2993 Extra assert() statements in the printf() logic.
FossilOrigin-Name: b1b182be2ab34cec1d94c5570bc361331a34f727eb9fa4aadfabb7f1ef79f83e
2020-05-25 15:41:03 +00:00
drh
0934d64045 Defensive code that tries to prevent a recurrence of problems like the
one described in ticket [7a5279a25c57adf1]

FossilOrigin-Name: 572105de1d44bca4f18c99d373458889163611384eebbc9659474874ee1701f4
2020-05-25 15:19:52 +00:00
drh
efc752b131 Fix minor compile issues with optional extensions.
FossilOrigin-Name: 3261ee9ec26bbeaa64190c12556a1d8146270b6660c70004830bd38c1b5b63f4
2020-05-25 12:49:58 +00:00
drh
91960aa53f Make sure variable declarations are at start of scope even when
SQLITE_ENABLE_SNAPSHOT is used.

FossilOrigin-Name: a77ceaf6ba934b1d73c90b8980191a65d02ad6ce1e11e6baf573b3a132685545
2020-05-25 12:02:12 +00:00
drh
d3bf766127 Attempt to work around a false-positive warning in the CGo compiler.
FossilOrigin-Name: d4bf60f464789935dc193ea99bf730c8fade448c7dca13eb3ce297965980f36e
2020-05-25 01:31:09 +00:00
drh
e859e43bb8 Version number to 3.32.1.
FossilOrigin-Name: 56e5063c326ffbfd3e3cb6f2b05718412aca2cb183274bfe11f5666effdd04b9
2020-05-24 12:36:20 +00:00
drh
c37577bb2d When rewriting a query for window functions, if the rewrite changes the
depth of TK_AGG_FUNCTION nodes, be sure to adjust the Expr.op2 field
appropriately.  Fix for ticket [7a5279a25c57adf1]

FossilOrigin-Name: ad7bb70af9bb68d192137188bb2528f1e9e43ad164c925174ca1dafc9e1f5339
2020-05-24 03:38:37 +00:00