]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
4 years agoDisable rootpage bounds checking when the SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS rootpage-bounds-check
drh [Wed, 22 Jul 2020 21:05:23 +0000 (21:05 +0000)] 
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

4 years agoImprovements to rootpage bounds checking during schema parse.
drh [Wed, 22 Jul 2020 20:12:10 +0000 (20:12 +0000)] 
Improvements to rootpage bounds checking during schema parse.

FossilOrigin-Name: 75599a9731be19e213a8ae174b038a43381bc6883a6b7f4058c2c1625fdea432

4 years agoWhen parsing the schema, detect out-of-bounds rootpage values and throw an
drh [Wed, 22 Jul 2020 18:03:56 +0000 (18:03 +0000)] 
When parsing the schema, detect out-of-bounds rootpage values and throw an
error.

FossilOrigin-Name: 6c3a2727dc912ed800146e07db5d15d0f3468d13701165ba763c4b114c3e18e8

4 years agoAll TCL tests now passing.
drh [Wed, 22 Jul 2020 17:12:59 +0000 (17:12 +0000)] 
All TCL tests now passing.

FossilOrigin-Name: 4c5f3c6cacf84a36d0347790d98d82d1f584cd1537a13a2736348405c4d20367

4 years agoMost test cases now passing.
drh [Wed, 22 Jul 2020 13:56:14 +0000 (13:56 +0000)] 
Most test cases now passing.

FossilOrigin-Name: 92e2ab38930c76811dbf5abfe6b9ea9e12562a4bb4bb06cdb0cf49ac30da0bc3

4 years agoContinuing work toward supporting unsigned 32-bit page numbers.
drh [Wed, 22 Jul 2020 13:38:04 +0000 (13:38 +0000)] 
Continuing work toward supporting unsigned 32-bit page numbers.

FossilOrigin-Name: 9ce1710aad43cebe5ad50859c7685fb83e40cdd4a60913bd2b7e659bc59942fd

4 years agoEnhance showdb to be 32-bit clean.
drh [Wed, 22 Jul 2020 11:42:50 +0000 (11:42 +0000)] 
Enhance showdb to be 32-bit clean.

FossilOrigin-Name: a8200327d4e8e78abef09c64345e0036f730fbbb20ae88935ef6c9972e6c7d5e

4 years agoMerge fixes from trunk.
drh [Wed, 22 Jul 2020 10:36:49 +0000 (10:36 +0000)] 
Merge fixes from trunk.

FossilOrigin-Name: d2aac001204621062e6cb3230ce2ac1b4545cb83b3ebb6bfebccee4d51162e97

4 years agoWork-around for [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96270|GCC bug 96270].
drh [Tue, 21 Jul 2020 18:36:06 +0000 (18:36 +0000)] 
Work-around for [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96270|GCC bug 96270].

FossilOrigin-Name: 9679c0c61131f0e986551701a64191da0ee0f50880eaa57fe4bf520e3fecf634

4 years agoAdd the sqlite3Int64ToText() routine and use it to convert integers to text,
drh [Tue, 21 Jul 2020 18:25:19 +0000 (18:25 +0000)] 
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

4 years agoFix the ".read" command so that it gives an error when its argument is
drh [Mon, 20 Jul 2020 23:33:11 +0000 (23:33 +0000)] 
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

4 years agoFix a corner-case error in the new UPDATE FROM logic helpfully discovered
drh [Mon, 20 Jul 2020 18:07:35 +0000 (18:07 +0000)] 
Fix a corner-case error in the new UPDATE FROM logic helpfully discovered
by OSSFuzz.

FossilOrigin-Name: 5cc200939d3a33566ddb858fc74c878acc72cfe5cf4c9b1d08e7b13e4d5ff566

4 years agoAdd the "enlargedb" utility program used to construct very large database
drh [Mon, 20 Jul 2020 14:54:36 +0000 (14:54 +0000)] 
Add the "enlargedb" utility program used to construct very large database
files for testing.

FossilOrigin-Name: 66858d87507bfdd17bb76c0afb1108ad5dec752438a79bf57f0f51690232e943

4 years agoFaster column name lookup in the columnIndex() routine using hashing.
drh [Mon, 20 Jul 2020 13:11:19 +0000 (13:11 +0000)] 
Faster column name lookup in the columnIndex() routine using hashing.

FossilOrigin-Name: de2a90812498e504c9b8eeb83bfc48a948b45e87bdfa242c0aa9f0377d90740f

4 years agoInitial changes to allow database up to 281TB in size.
drh [Mon, 20 Jul 2020 12:47:32 +0000 (12:47 +0000)] 
Initial changes to allow database up to 281TB in size.

FossilOrigin-Name: 9cb7da9bdb666ea40771513b89591dca275f1e92092b39190df747e3797178a3

4 years agoFix test case result on a DELETE with an INDEXED BY clause due to
drh [Sat, 18 Jul 2020 18:59:11 +0000 (18:59 +0000)] 
Fix test case result on a DELETE with an INDEXED BY clause due to
improvements in the query planner at [d901837fea1ed54d]

FossilOrigin-Name: 020dbfa2aef20e5872cc3e785d99f45903843401292114b5092b9c8aa829b9c3

4 years agoMore harmless compiler warning fixes.
drh [Sat, 18 Jul 2020 18:44:59 +0000 (18:44 +0000)] 
More harmless compiler warning fixes.

FossilOrigin-Name: 4c0d208c455abb983217a6dfea7634f677f8360fb57857e1421334fe7a5a23e2

4 years agoFix a harmless compiler warning.
drh [Sat, 18 Jul 2020 18:03:26 +0000 (18:03 +0000)] 
Fix a harmless compiler warning.

FossilOrigin-Name: 5a0b0c6e11146e200c3417903232e6932102b02d7bf128bac4b7cd74c257acd1

4 years agoAdd UPDATE FROM compatible with postgresql.
drh [Sat, 18 Jul 2020 15:52:15 +0000 (15:52 +0000)] 
Add UPDATE FROM compatible with postgresql.

FossilOrigin-Name: 88baf1eb0706503214012520be4d872594ccc5b4c9674c44cc07b67ade2bfcf2

4 years agoAdd ALWAYS() around a conditional that is always true. update-from
drh [Fri, 17 Jul 2020 22:20:23 +0000 (22:20 +0000)] 
Add ALWAYS() around a conditional that is always true.

FossilOrigin-Name: 270e17bba1d35f8c300844e75b2aa15f79a1ab62e40bc5e6bc9694902f8f7dde

4 years agoUse #ifdef to omit code that is only reachable when the
drh [Fri, 17 Jul 2020 18:07:36 +0000 (18:07 +0000)] 
Use #ifdef to omit code that is only reachable when the
SQLITE_ENABLE_UPDATE_DELETE_LIMIT compile-time option is used.

FossilOrigin-Name: 587ded6035a3ce91db81a29fe34ed30d0e59022cba6f107f25b04d034ef37ba9

4 years agoMake it an error to repeat the target object/alias of an UPDATE statement in its...
dan [Fri, 17 Jul 2020 16:31:37 +0000 (16:31 +0000)] 
Make it an error to repeat the target object/alias of an UPDATE statement in its FROM clause.

FossilOrigin-Name: d90a37e930c66afe95165955ae47efde08f52c8ce16c4fb239da0233335db050

4 years agoAdd a couple of "#ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT" blocks missing from new...
dan [Fri, 17 Jul 2020 15:34:54 +0000 (15:34 +0000)] 
Add a couple of "#ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT" blocks missing from new code on this branch.

FossilOrigin-Name: cc471df04aecf344d0aa47138014c07d3f93462ae1f8ff86ec5589cfb62c658d

4 years agoRelax pointless restrictions on allowing tables in the FROM clause from
drh [Thu, 16 Jul 2020 18:55:58 +0000 (18:55 +0000)] 
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

4 years agoModifications to test code so that the sqlite3MemdebugHastype() assert() statements...
dan [Thu, 16 Jul 2020 14:52:24 +0000 (14:52 +0000)] 
Modifications to test code so that the sqlite3MemdebugHastype() assert() statements are enabled for Tcl tests.

FossilOrigin-Name: e3c423cb1407c06a3806ae6304e4713c37cd446f4cc399731884e3d009938e57

4 years agoSmall performance improvement and size reduction in sqlite3DbStrNDup().
drh [Thu, 16 Jul 2020 14:19:57 +0000 (14:19 +0000)] 
Small performance improvement and size reduction in sqlite3DbStrNDup().

FossilOrigin-Name: 35cd87063d1933b87bc2176f957ecd758d7d167e9473fa615e33caec3be14783

4 years agoAdd OOM test for UPDATE...FROM statements inside triggers.
dan [Thu, 16 Jul 2020 10:48:37 +0000 (10:48 +0000)] 
Add OOM test for UPDATE...FROM statements inside triggers.

FossilOrigin-Name: 917a479b0d11fb59abf41d0317ffc541eb4b83928df9382b4782953c0035fa3e

4 years agoFix a double-free of the FROM clause of an UPDATE inside of triggers.
drh [Thu, 16 Jul 2020 02:36:24 +0000 (02:36 +0000)] 
Fix a double-free of the FROM clause of an UPDATE inside of triggers.

FossilOrigin-Name: 706c8da2f6d9299f0ad3b3c93332b38071e8e88b4d1660c1841309919b64fd18

4 years agoSeparate VdbeCoverage() macro for different jumps.
drh [Thu, 16 Jul 2020 00:45:25 +0000 (00:45 +0000)] 
Separate VdbeCoverage() macro for different jumps.

FossilOrigin-Name: da593e57df042527decfea68baacc72d463728544cab81c70fbb25839791f706

4 years agoFix a problem in UPDATE FROM in which it tries to free using sqlite3_free()
drh [Wed, 15 Jul 2020 21:53:53 +0000 (21:53 +0000)] 
Fix a problem in UPDATE FROM in which it tries to free using sqlite3_free()
instead of sqlite3DbFree().

FossilOrigin-Name: 8ca87526523a985674fed5a8770726587b3a2e48d65721916902063ab5dba49c

4 years agoSupport a FROM clause in UPDATE statements, as postgres does.
dan [Wed, 15 Jul 2020 20:01:07 +0000 (20:01 +0000)] 
Support a FROM clause in UPDATE statements, as postgres does.

FossilOrigin-Name: 7d7d5ecbd70cc39ab7a641ae26af0d3b69d5cb02e626b620102a6e19e7d8a577

4 years agoAdd tests for UPDATE...FROM and foreign keys.
dan [Wed, 15 Jul 2020 19:38:49 +0000 (19:38 +0000)] 
Add tests for UPDATE...FROM and foreign keys.

FossilOrigin-Name: 6c3668f9ed898337e664bec95865f15688a6bba43f095358dda5d08abef2bbaa

4 years agoFix problems that could occur if a table with the same name as the table being update...
dan [Wed, 15 Jul 2020 18:30:01 +0000 (18:30 +0000)] 
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

4 years agoFix a problem in SQLITE_ENABLE_HIDDEN_COLUMN builds occuring when an UPDATE...FROM...
dan [Wed, 15 Jul 2020 15:32:59 +0000 (15:32 +0000)] 
Fix a problem in SQLITE_ENABLE_HIDDEN_COLUMN builds occuring when an UPDATE...FROM fired an INSTEAD OF trigger.

FossilOrigin-Name: 5176cb7a6a4e8cfa1973aaae46fcd7d39baedb70ae20bfacc82d62ca39fb0aa3

4 years agoUpdate this branch with changes from trunk.
dan [Wed, 15 Jul 2020 11:00:29 +0000 (11:00 +0000)] 
Update this branch with changes from trunk.

FossilOrigin-Name: 53b8b507a10364f5d580655d89c950a5f14c2a8114625fd8749d77f289413b22

4 years agoNew test cases for decimal and ieee754.
drh [Wed, 15 Jul 2020 02:15:03 +0000 (02:15 +0000)] 
New test cases for decimal and ieee754.

FossilOrigin-Name: 73d62f82f94347c60e026bc9cb859fec2d8b5f0c756df0c4941f11817234bff8

4 years agoImprovements to the min()/max() optimization so that it is able to use
drh [Tue, 14 Jul 2020 23:58:04 +0000 (23:58 +0000)] 
Improvements to the min()/max() optimization so that it is able to use
indexes where terms are constrained by IN operators.

FossilOrigin-Name: b8ba2f17f938c03543a89dd29d6987163f7a4085a51de1aa14ea5504501c4f72

4 years agoNow appears to work. All legacy tests pass. Need to add new tests, however.
drh [Tue, 14 Jul 2020 22:20:26 +0000 (22:20 +0000)] 
Now appears to work.  All legacy tests pass.  Need to add new tests, however.

FossilOrigin-Name: 81e6450980ee745686aee5e2b84672d3c8404a041c82c658aa562013294b8628

4 years agoSupport UPDATE...FROM statements in trigger programs.
dan [Tue, 14 Jul 2020 19:51:01 +0000 (19:51 +0000)] 
Support UPDATE...FROM statements in trigger programs.

FossilOrigin-Name: 4f6d8d0ebf40029218a1d3b05ea657c0c5953b01c6f0b6a628465aa44c67e7f3

4 years agoFix an obsolete header comment on the sqlite3WhereIsOrdered() routine.
drh [Tue, 14 Jul 2020 15:30:35 +0000 (15:30 +0000)] 
Fix an obsolete header comment on the sqlite3WhereIsOrdered() routine.

FossilOrigin-Name: 5041f6a1c439b43c654e72a391517c115e222ef0e9a565907b03149b535e92c8

4 years agoMerge fixes from trunk.
drh [Tue, 14 Jul 2020 13:02:30 +0000 (13:02 +0000)] 
Merge fixes from trunk.

FossilOrigin-Name: 2af372f59ea250ccf9ab7c30fe4bf8376a5da6e35c401edf643b9a193a38d33d

4 years agoEarly detection of freelist size corruption in incremental vacuum.
drh [Tue, 14 Jul 2020 12:40:53 +0000 (12:40 +0000)] 
Early detection of freelist size corruption in incremental vacuum.

FossilOrigin-Name: f25a56c26e28abd44373230c6b5763aed35c9a7648abede8a53409dccc0bee1d

4 years agoFix a crash. Not all tests pass, but tests do at least run to completion now.
drh [Tue, 14 Jul 2020 02:03:35 +0000 (02:03 +0000)] 
Fix a crash.  Not all tests pass, but tests do at least run to completion now.

FossilOrigin-Name: b5d38e28c62dbc4f5f0e1b2590c9d6c2de9a140cc3528cae1968fd741e337fb0

4 years agoFix an obsolete assert().
drh [Tue, 14 Jul 2020 01:51:53 +0000 (01:51 +0000)] 
Fix an obsolete assert().

FossilOrigin-Name: 221e021077e2bbce693a89a16361418ced20f4e8f5a27e8c461648cff663a2c5

4 years agoMerge latest changes from trunk. This branch still does not work.
drh [Tue, 14 Jul 2020 01:03:05 +0000 (01:03 +0000)] 
Merge latest changes from trunk.  This branch still does not work.

FossilOrigin-Name: 6144387238c03b8b33ae98d624f7ffa44a7829d3e0d4a0a01b5528e71ab4f08b

4 years agoAdd test for LEFT JOIN in UPDATE...FROM statement.
dan [Mon, 13 Jul 2020 20:43:13 +0000 (20:43 +0000)] 
Add test for LEFT JOIN in UPDATE...FROM statement.

FossilOrigin-Name: 4f3dff045ab90e80479960fed64cf36f23dd0e13144edbde15043913ad3faac5

4 years agoAdd test cases and fixes for UPDATE...FROM statements that modify primary key columns.
dan [Mon, 13 Jul 2020 20:10:29 +0000 (20:10 +0000)] 
Add test cases and fixes for UPDATE...FROM statements that modify primary key columns.

FossilOrigin-Name: 47c87af3e52bce10fbcc2cbe832d659b0c204bfb3368d9314fa1b01120129254

4 years agoMerge latest trunk changes with this branch.
dan [Mon, 13 Jul 2020 18:04:27 +0000 (18:04 +0000)] 
Merge latest trunk changes with this branch.

FossilOrigin-Name: 5ee3c27e20d12a126fb773b428bb864102b949a5b26a8d5c523753dcedf4be10

4 years agoReadd the ALWAYS() macro that was removed by [f7a74f89dbd58b47] as the
drh [Mon, 13 Jul 2020 15:35:08 +0000 (15:35 +0000)] 
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

4 years agoFix a problem causing queries containing window functions to ignore collation sequenc...
dan [Mon, 13 Jul 2020 15:20:27 +0000 (15:20 +0000)] 
Fix a problem causing queries containing window functions to ignore collation sequences under some circumstances.

FossilOrigin-Name: e6c2192ef88e9990c8b91755c8e779f09e23f936a17123d8e42059257b756ed7

4 years agoFix an integer overflow bug in fts5 triggered by a corrupt record.
dan [Mon, 13 Jul 2020 11:06:30 +0000 (11:06 +0000)] 
Fix an integer overflow bug in fts5 triggered by a corrupt record.

FossilOrigin-Name: 49da8bdce17ced910b414d50e8df79800513dcf03a196197dc1ea8e47deeda92

4 years agoAdd second test case for the improvement in [30735432].
dan [Sat, 11 Jul 2020 16:45:20 +0000 (16:45 +0000)] 
Add second test case for the improvement in [30735432].

FossilOrigin-Name: 1bd18ca35bdbf3034591bf8981fd3a985f0920379bc4dc81e0e6a819667998e9

4 years agoImproved detection of a corrupt database schema. Fix for a problem discovered
drh [Sat, 11 Jul 2020 16:42:28 +0000 (16:42 +0000)] 
Improved detection of a corrupt database schema. Fix for a problem discovered
by dbsqlfuzz.

FossilOrigin-Name: 30735432bc33cb953b6d7d2a2de9eb378f9740e0e663f50c727c3f138cd43a2b

4 years agoRemove unnecessary code from the window functions implementation.
drh [Fri, 10 Jul 2020 21:43:53 +0000 (21:43 +0000)] 
Remove unnecessary code from the window functions implementation.

FossilOrigin-Name: 1e87da9c93309d1d69b1e0ab65c615b9ff9c1c6813ad0c7b90d2495be4ba0adc

4 years agoAn attempt to get the Min/Max optimization working with IN constraints.
drh [Fri, 10 Jul 2020 19:09:40 +0000 (19:09 +0000)] 
An attempt to get the Min/Max optimization working with IN constraints.
Not currently working.

FossilOrigin-Name: 4a64c16fb7a07431e534fb9bbcf778646be8a1c718d5d10873fbccb0c867aac7

4 years agoFix a broken assert() in fts3 that could fail when handling corrupt records.
dan [Fri, 10 Jul 2020 11:12:36 +0000 (11:12 +0000)] 
Fix a broken assert() in fts3 that could fail when handling corrupt records.

FossilOrigin-Name: 5124732370fd53c93314c9c79b4251bd46ce81c2e7aa4f59e2c1889cc4263d5a

4 years agoFix handling of another corrupt database case in fts3.
dan [Thu, 9 Jul 2020 21:29:34 +0000 (21:29 +0000)] 
Fix handling of another corrupt database case in fts3.

FossilOrigin-Name: ccff8cb8267d4c5605484f7a35c1836937f20b3d6879fe84cd84dc24bbbffc77

4 years agoFix a comment typo. No changes to code.
drh [Thu, 9 Jul 2020 14:05:47 +0000 (14:05 +0000)] 
Fix a comment typo.  No changes to code.

FossilOrigin-Name: 610ee8d5dc855fd163daa3c93b44db7874463d69df5a01ab4113b725a031b9d4

4 years agoRemove bashism from configure script.
dan [Tue, 7 Jul 2020 19:24:34 +0000 (19:24 +0000)] 
Remove bashism from configure script.

FossilOrigin-Name: 138beebb2aa21ed18525dbe02c80426c6caabf6a5f6532a95b738a39b31ad4d5

5 years agoIncrease the resolution of the vdbe opcode counters to 64 bits, as
drh [Mon, 6 Jul 2020 12:13:05 +0000 (12:13 +0000)] 
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

5 years agoFix the table_info pragma so that it always checks the schema version and
drh [Sat, 4 Jul 2020 20:29:56 +0000 (20:29 +0000)] 
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

5 years agoFix the line-number of error messages coming out of the ".import" command
drh [Fri, 3 Jul 2020 21:24:42 +0000 (21:24 +0000)] 
Fix the line-number of error messages coming out of the ".import" command
when the --skip option is used.

FossilOrigin-Name: e0a8b11dfd6b3ab89ae5032d60cf3c1bba7198a1a2debe5c691b5d1f2e1befee

5 years agoFix a compiler warning about an unused procedure in the parser.
drh [Fri, 3 Jul 2020 21:18:07 +0000 (21:18 +0000)] 
Fix a compiler warning about an unused procedure in the parser.

FossilOrigin-Name: b27bb4fe389e12472a6144441df2dca6a7393024f2621fd22dd1a2b4033c46ec

5 years agoUpdate the lemon documentation to match recent enhancements.
drh [Fri, 3 Jul 2020 18:07:22 +0000 (18:07 +0000)] 
Update the lemon documentation to match recent enhancements.

FossilOrigin-Name: ca7630a5772ab919482a3629e11627143a1e1ec290a570ce4188189e671f9015

5 years agoIf the amalgamation is built using OPT_FEATURE_FLAGS =
drh [Fri, 3 Jul 2020 17:24:35 +0000 (17:24 +0000)] 
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

5 years agoIn lemon, add "%if" and "%else" and allow boolean expressions as the
drh [Fri, 3 Jul 2020 15:41:08 +0000 (15:41 +0000)] 
In lemon, add "%if" and "%else" and allow boolean expressions as the
argument to "%if", "%ifdef", and "%ifndef".

FossilOrigin-Name: 951d22b72f80de9e23df645abcc3d88ca1a275b46ea23b84152ef48716922b37

5 years agoFix the pragma_foreign_key_check virtual table so that it accepts arguments.
drh [Fri, 3 Jul 2020 12:32:04 +0000 (12:32 +0000)] 
Fix the pragma_foreign_key_check virtual table so that it accepts arguments.

FossilOrigin-Name: 07f849dee3d245ecf80ba3c3ce8dfc630e71ddb1e9c0bcc1f08cee22001fcb07

5 years agoFix a problem with "PRAGMA foreign_key_check" where if a table in one
drh [Fri, 3 Jul 2020 12:15:59 +0000 (12:15 +0000)] 
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

5 years agoMinor simplification to the 32-bit varint decoder.
drh [Thu, 2 Jul 2020 17:05:11 +0000 (17:05 +0000)] 
Minor simplification to the 32-bit varint decoder.

FossilOrigin-Name: 6ffd17b668a8ad561c37e89063afb6e7f8425e557e93025b7527fe3656585d77

5 years agoEnsure that the "PRAGMA schema_version" command causes the schema to be
drh [Wed, 1 Jul 2020 16:19:14 +0000 (16:19 +0000)] 
Ensure that the "PRAGMA schema_version" command causes the schema to be
reparsed and reloaded.

FossilOrigin-Name: 27d4a9a7b530c77a5b2593d1a5232b10746da9906f8d12890de7a8fbd7270256

5 years agoFix a problem with VM code generated for some aggregate SELECT statements that featur...
dan [Wed, 1 Jul 2020 14:07:45 +0000 (14:07 +0000)] 
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

5 years agoAdd a test to ensure that "PRAGMA wal_checkpoint = FULL" invokes the busy-handler...
dan [Tue, 30 Jun 2020 18:21:45 +0000 (18:21 +0000)] 
Add a test to ensure that "PRAGMA wal_checkpoint = FULL" invokes the busy-handler to wait on read-locks.

FossilOrigin-Name: f068fb116286b1dbdee9c168900348cfcab84e6d8413f3456e4e492f650d11b0

5 years agoAvoid a potential buffer overread in fts3 when processing corrupt records.
dan [Tue, 30 Jun 2020 15:32:12 +0000 (15:32 +0000)] 
Avoid a potential buffer overread in fts3 when processing corrupt records.

FossilOrigin-Name: 4d0cfb1236884349168f8e2ec5e18c0232965148af78615e0d5c9b0e13a35422

5 years agoFix generated columns so that they play well with upsert.
drh [Mon, 29 Jun 2020 20:26:50 +0000 (20:26 +0000)] 
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

5 years agoChange the magic number used to identify the "excluded" pseudo-table in
drh [Mon, 29 Jun 2020 20:20:40 +0000 (20:20 +0000)] 
Change the magic number used to identify the "excluded" pseudo-table in
an UPSERT statement into a #define constant.

FossilOrigin-Name: e96c2ac9ab1a1c51b1498f4b91fb71d2987c30579d072b2f0297da9eb945cb97

5 years agoDocument the dual-use of the P5 operand to the OP_MakeRecord opcode.
drh [Mon, 29 Jun 2020 20:09:04 +0000 (20:09 +0000)] 
Document the dual-use of the P5 operand to the OP_MakeRecord opcode.

FossilOrigin-Name: a73f80f22a585d1a2f55650d5cda4ece6c4ef039ef5eae2c02c3e5c269d4c30a

5 years agoChange the name of IntegrityCk.mallocFailed to IntegrityCk.bOomFault to
drh [Mon, 29 Jun 2020 18:30:49 +0000 (18:30 +0000)] 
Change the name of IntegrityCk.mallocFailed to IntegrityCk.bOomFault to
avoid confusion with the sqlite3 object field with the same name.

FossilOrigin-Name: 87c7d962581f4bb1224086701352850ede9847dc76235b33c7c2a35ef594d382

5 years agoAdd test script to verify busy-timeouts are working for SQLITE_ENABLE_SETLK_TIMEOUT...
dan [Mon, 29 Jun 2020 17:52:53 +0000 (17:52 +0000)] 
Add test script to verify busy-timeouts are working for SQLITE_ENABLE_SETLK_TIMEOUT builds.

FossilOrigin-Name: ada43e7c490bf72a50ee84e1db994e149744b2a943260449076b83d1874813b2

5 years agoDo not run resetAccumulator() after a malloc failure.
drh [Mon, 29 Jun 2020 16:30:10 +0000 (16:30 +0000)] 
Do not run resetAccumulator() after a malloc failure.

FossilOrigin-Name: 1b426603f05033bcee0331c6f664cd5ed2ebf8f5d4cde8c6673c7a699ff53bb1

5 years agoFix another fts3 problem with processing corrupt records.
dan [Mon, 29 Jun 2020 13:33:56 +0000 (13:33 +0000)] 
Fix another fts3 problem with processing corrupt records.

FossilOrigin-Name: 6e0ffa205312416830340ea6e621dfb1a529e5603d569941ed6263930dc28c45

5 years agoSmall performance improvement in the sqlite3_step() interface.
drh [Mon, 29 Jun 2020 13:12:42 +0000 (13:12 +0000)] 
Small performance improvement in the sqlite3_step() interface.

FossilOrigin-Name: 61400ef9f1337c77263b4d3e43a1983b0c4cf7137f066a2691768c98877035ef

5 years agoFix a problem that could cause an infinite loop in the fts3 'merge' command.
dan [Fri, 26 Jun 2020 20:41:18 +0000 (20:41 +0000)] 
Fix a problem that could cause an infinite loop in the fts3 'merge' command.

FossilOrigin-Name: be545f85a6ef09cc6c762f7d2ab7a0b3adf5590c3fbdc9903e6b5b5cec6e823f

5 years agoWhen computing the verification hash in speedtest1, do not include the
drh [Fri, 26 Jun 2020 17:56:43 +0000 (17:56 +0000)] 
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

5 years agoImprovements to speedtest1.c for more consistent verification hashes.
drh [Fri, 26 Jun 2020 16:17:27 +0000 (16:17 +0000)] 
Improvements to speedtest1.c for more consistent verification hashes.

FossilOrigin-Name: d34b8ff5f8d04a75996f6ca9d3a0563c83e8e833c1eb08ac3861431f36f7bfb1

5 years agoImprovements to speedtest1. Added the --memdb and --output options. The
drh [Fri, 26 Jun 2020 15:42:55 +0000 (15:42 +0000)] 
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

5 years agoAdd the ieee754_to_blob() and ieee754_from_blob() functions. Fix the handling
drh [Fri, 26 Jun 2020 15:32:29 +0000 (15:32 +0000)] 
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

5 years agoAdd --verify to speed-check.sh and add --memdb and --output to speedtest1.c. speedtest-hash
drh [Fri, 26 Jun 2020 14:05:58 +0000 (14:05 +0000)] 
Add --verify to speed-check.sh and add --memdb and --output to speedtest1.c.
Other improvements to speedtest1.c.

FossilOrigin-Name: 89a11120ab2ce13f8a539cb05a9d0628a1f83b4790910b2023c21d60aabc43ee

5 years agoFix a possible null pointer deref following OOM. Discovered by dbsqlfuzz.
drh [Fri, 26 Jun 2020 04:34:28 +0000 (04:34 +0000)] 
Fix a possible null pointer deref following OOM.  Discovered by dbsqlfuzz.

FossilOrigin-Name: cc888878ea8d5bc754c69de523819d32d6d9853857e31d7287f9dbfd723428db

5 years agoUpdate the showlocks utility program so that it functions on files with
drh [Thu, 25 Jun 2020 23:21:09 +0000 (23:21 +0000)] 
Update the showlocks utility program so that it functions on files with
a huge number of locks without overflowing the stack.

FossilOrigin-Name: adb7484f93329c7a94cd84e30bc4a8dbf2d6e901eba17cc3454afb8ba346cbf4

5 years agoEnhance the --verify option to speedtest1.c so that it computes and displays
drh [Thu, 25 Jun 2020 20:28:13 +0000 (20:28 +0000)] 
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

5 years agoAdd the ieee754_mantissa() and ieee754_exponent() functions to the iee754
drh [Wed, 24 Jun 2020 15:06:29 +0000 (15:06 +0000)] 
Add the ieee754_mantissa() and ieee754_exponent() functions to the iee754
extension.  Build the ieee754 extension into the CLI.

FossilOrigin-Name: db2f0836b64cd2e119684f1cf75fa3b19a84ca6aca1a239f7e2b9298016e2c95

5 years agoFix the decoding of subnormal values in the ieee754 extension.
drh [Wed, 24 Jun 2020 13:52:10 +0000 (13:52 +0000)] 
Fix the decoding of subnormal values in the ieee754 extension.

FossilOrigin-Name: 838817b680f02b3845d6d56f85d5d36fa5ae7453afef7a1a5a24624255f2dc3e

5 years agoIn the one-argument version of the ieee754() extension function, if the
drh [Wed, 24 Jun 2020 13:14:00 +0000 (13:14 +0000)] 
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

5 years agoAdd the decimal extension. It is built into the shell, but is an optional
drh [Wed, 24 Jun 2020 12:29:19 +0000 (12:29 +0000)] 
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

5 years agoFix the ".selecttrace" command in the CLI (only available when compiled
drh [Wed, 24 Jun 2020 11:45:35 +0000 (11:45 +0000)] 
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

5 years agoEnhance the --testset option on speedtest1 so that it can accept a
drh [Tue, 23 Jun 2020 20:03:57 +0000 (20:03 +0000)] 
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

5 years agoTry to remove end-of-line whitespace when building the amalgamation.
drh [Tue, 23 Jun 2020 17:57:08 +0000 (17:57 +0000)] 
Try to remove end-of-line whitespace when building the amalgamation.

FossilOrigin-Name: be3e7814e4cdbc09eaa5112d7d4135b3a2cedbfe66217d9973b1b39a44464e93

5 years agoFix a harmless compiler warning. decimal
drh [Tue, 23 Jun 2020 15:29:22 +0000 (15:29 +0000)] 
Fix a harmless compiler warning.

FossilOrigin-Name: e1416c8b0628afa062d8cff40d0cd3576dc85460e55b21a271f88fcb608b9f59

5 years agoAvoid unnecessary normalization in decimal_sum(). Trim excess trailing
drh [Tue, 23 Jun 2020 14:44:57 +0000 (14:44 +0000)] 
Avoid unnecessary normalization in decimal_sum().  Trim excess trailing
zeros off the result of decimal_mul().

FossilOrigin-Name: 0294ce071c863eb517e97beff31c3d95a4370e979a969415162302a90d3fda0e

5 years agoAdd the decimal_mul() function.
drh [Mon, 22 Jun 2020 21:25:37 +0000 (21:25 +0000)] 
Add the decimal_mul() function.

FossilOrigin-Name: 72eee04b67268ad38fd51ff32849f08c0a54cf1b481d5ecb11d77cc9c729ee03