]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
6 years agoFix some harmless compiler warnings. warnings
mistachkin [Fri, 10 May 2019 16:16:19 +0000 (16:16 +0000)] 
Fix some harmless compiler warnings.

FossilOrigin-Name: ca068d82387fc3cda9d2050cedb4f9c61b6d9dc54f89015b4b2ee492243ed5c9

6 years agoEnsure that the BtShared.nPage value is reset correctly on a SAVEPOINT
drh [Fri, 10 May 2019 14:34:18 +0000 (14:34 +0000)] 
Ensure that the BtShared.nPage value is reset correctly on a SAVEPOINT
ROLLBACK.

FossilOrigin-Name: e6d5fee8cdbdce8515957e8288e4d1e7b06f417fd3f9deeeb636fbf5b995af51

6 years agoTreat integer values in window definition ORDER BY clauses as constants, not as refer...
dan [Fri, 10 May 2019 14:26:32 +0000 (14:26 +0000)] 
Treat integer values in window definition ORDER BY clauses as constants, not as references to another expression.

FossilOrigin-Name: 7e4809eadfe99ebfd797a7c63501421021a720bbeed9fba81bebf630c58bb791

6 years agoImproved comments and extra assert() statements on the OP_Savepoint opcode,
drh [Fri, 10 May 2019 14:03:07 +0000 (14:03 +0000)] 
Improved comments and extra assert() statements on the OP_Savepoint opcode,
just to make the code a little easier to read and reason about.

FossilOrigin-Name: e80b2d9fcbc82ae5dc8a1fc13196f9a30bdb504eb5a5c131d136a78bbd5bbe7b

6 years agoFix the previous check-in [db9acef14d492121] so that the amalgamation build
drh [Fri, 10 May 2019 12:14:51 +0000 (12:14 +0000)] 
Fix the previous check-in [db9acef14d492121] so that the amalgamation build
works for systems for which lack HAVE_ISNAN.

FossilOrigin-Name: 3cc55e09e6c1de2059d97bdddf2fdfbdcc62c584b513f56faf9d3a39ef80cddd

6 years agoFix the round() SQL function so that it handles infinities correctly.
drh [Fri, 10 May 2019 12:06:47 +0000 (12:06 +0000)] 
Fix the round() SQL function so that it handles infinities correctly.

FossilOrigin-Name: db9acef14d49212108c8082cc15a9b9b4a56b8afe4fe1104ddf62783739c1fbe

6 years agoFix another small buffer overread in sqlite_dbdata triggered by a corrupt database...
dan [Thu, 9 May 2019 18:37:37 +0000 (18:37 +0000)] 
Fix another small buffer overread in sqlite_dbdata triggered by a corrupt database page.

FossilOrigin-Name: 1dfc95b8673b0e8c9ef5040c2fa0fbe9846e430d104e9b83f3f1f3ad63446380

6 years agoFix a problem in the ".recover" command allowing a circular loop of b-tree pages...
dan [Thu, 9 May 2019 18:33:32 +0000 (18:33 +0000)] 
Fix a problem in the ".recover" command allowing a circular loop of b-tree pages in a database file to cause an infinite loop.

FossilOrigin-Name: 8d2a062eb8a3e6fdc6a61b571c8da0070382bf208c53e797151eac8679c975a1

6 years agoMake the ".schema" command in the CLI resistant to corrupt database files.
drh [Thu, 9 May 2019 18:13:30 +0000 (18:13 +0000)] 
Make the ".schema" command in the CLI resistant to corrupt database files.

FossilOrigin-Name: f22c7e229ea4626c5268d61de3964521cf6a2735290cbd1518d68731ba6cca90

6 years agoFix a crash in the sqlite_dbdata module that could occur if a pointer within an overf...
dan [Thu, 9 May 2019 17:54:27 +0000 (17:54 +0000)] 
Fix a crash in the sqlite_dbdata module that could occur if a pointer within an overflow chain in a corrupt database pointed past the end of the db.

FossilOrigin-Name: 3eae4e301e3e4bcf14e96066f77be1434c5d4b3daadb10153cd36382589ac128

6 years agoDisable the optimization where a REAL value with no fractional part
drh [Thu, 9 May 2019 17:10:30 +0000 (17:10 +0000)] 
Disable the optimization where a REAL value with no fractional part
is stored as an INTEGER when the integer uses as much space as the real
value it proposes to stand in for (8 bytes).  This avoids corner cases
of comparing integers against real values that are beyond the resolution
of an IEEE 754 double.  Fix for ticket [6c1d3febc00b22d457c78c2]

FossilOrigin-Name: 9b0915272f4d4052aa31e9297424a7db9a0234b676e8e2a44c3f2dc54236705a

6 years agoAvoid long delays that can occur when ".recover"ing data from a database with a corru...
dan [Thu, 9 May 2019 16:57:39 +0000 (16:57 +0000)] 
Avoid long delays that can occur when ".recover"ing data from a database with a corrupt freelist.

FossilOrigin-Name: 20f06bf2e659212a68dcf138e444da7bd4220548ec15a97cfd7eb82e028b3630

6 years agoImproved debugging output from the OP_MakeRecord opcode.
drh [Thu, 9 May 2019 16:22:51 +0000 (16:22 +0000)] 
Improved debugging output from the OP_MakeRecord opcode.

FossilOrigin-Name: ac790729d9c8f8612936bab56dca6061408007bc2150ac8c7089132403d7f885

6 years agoFix another corruption related buffer overread in the sqlite_dbdata module.
dan [Thu, 9 May 2019 15:51:27 +0000 (15:51 +0000)] 
Fix another corruption related buffer overread in the sqlite_dbdata module.

FossilOrigin-Name: 5cd728fb6b3a70f795306d4d6e12151a4de327f801733a8558139e3cd76fe66a

6 years agoFix further buffer overreads triggered by passing corrupt records to the sqlite_dbdat...
dan [Thu, 9 May 2019 15:07:46 +0000 (15:07 +0000)] 
Fix further buffer overreads triggered by passing corrupt records to the sqlite_dbdata module.

FossilOrigin-Name: dbc6a9f7f67256dea96d3245e7bec145ba65d64adf322e18f1f3ac9556b4e0b6

6 years agoHave ".recover" handle cases where the sqlite_master table contains malformed SQL...
dan [Thu, 9 May 2019 14:15:19 +0000 (14:15 +0000)] 
Have ".recover" handle cases where the sqlite_master table contains malformed SQL statements.

FossilOrigin-Name: e736da9c18fad138c5502d354c3553373cba15358b69e44b257f60def59422e2

6 years agoFix a problem with running the ".recover" command on a database that is zero pages...
dan [Thu, 9 May 2019 11:45:21 +0000 (11:45 +0000)] 
Fix a problem with running the ".recover" command on a database that is zero pages in size.

FossilOrigin-Name: 47fa65343e46c7782a173174952c637c5621e16229ece258dc7e7a556683ca0c

6 years agoAvoid reading outside a record buffer when extracting an SQL value in the sqlite_dbda...
dan [Thu, 9 May 2019 11:34:31 +0000 (11:34 +0000)] 
Avoid reading outside a record buffer when extracting an SQL value in the sqlite_dbdata virtual table code.

FossilOrigin-Name: d99bb0c11d62f629bf59da037827af73a9b814e65815006e0cbca1bc41f42e25

6 years agoMerge accidental fork in trunk.
dan [Thu, 9 May 2019 11:21:32 +0000 (11:21 +0000)] 
Merge accidental fork in trunk.

FossilOrigin-Name: ec9373031d76b34163a45d0ed05e43c0c9d585c8d47aa255f670340673bc7875

6 years agoFix a problem in the new code introduced by [658b84d7] causing corruption and other...
dan [Thu, 9 May 2019 11:19:27 +0000 (11:19 +0000)] 
Fix a problem in the new code introduced by [658b84d7] causing corruption and other errors to be ignored.

FossilOrigin-Name: 7ccf2e7d413adb109c61456a5f46e87d38884801dbaab93297a17e3050014b59

6 years agoImproved error handling for the ".open --hexdb" command of the CLI.
drh [Thu, 9 May 2019 11:18:41 +0000 (11:18 +0000)] 
Improved error handling for the ".open --hexdb" command of the CLI.

FossilOrigin-Name: 4fa831d5cd5861f6a0a8f08a738b2d4d371fb2a788178ce86482c5bba761f9de

6 years agoEnsure that the sqlite3BtreeLast() interface initializes the *pRes return
drh [Wed, 8 May 2019 23:55:04 +0000 (23:55 +0000)] 
Ensure that the sqlite3BtreeLast() interface initializes the *pRes return
to zero if the cursor is already sitting on the last entry of the table.

FossilOrigin-Name: ebe4845cd0ffb96b30be3c69eb399d58e93149886bc2fa60a7ebd7b4fbe447a4

6 years agoThis is part of the previous check-in that didn't get committed for some
drh [Wed, 8 May 2019 23:53:50 +0000 (23:53 +0000)] 
This is part of the previous check-in that didn't get committed for some
reason - probably because I failed to press the "Save" button on the text
editor.

FossilOrigin-Name: 51d32173ff1f610b5d75a50f20fa1e0e4e22046299869e3b82e0bb446dba890c

6 years agoAdd another test case to cover a previously uncovered branch in the RBU module.
dan [Wed, 8 May 2019 21:14:48 +0000 (21:14 +0000)] 
Add another test case to cover a previously uncovered branch in the RBU module.

FossilOrigin-Name: 30392985612c51d4583a905f8fe766f08cd31b86d0e30a977adc6a6705649e00

6 years agoFix another pattern for which the LIKE optimization does not work for a
drh [Wed, 8 May 2019 19:55:24 +0000 (19:55 +0000)] 
Fix another pattern for which the LIKE optimization does not work for a
non-TEXT affinity.  Case found by Manuel Rigger.

FossilOrigin-Name: 740201107ae802c12b678e388ea524db01ad0eb70601c78490ad63eae0fe6cf1

6 years agoSimplification to the logic underlying PRAGMA case_sensitive_like.
drh [Wed, 8 May 2019 19:32:33 +0000 (19:32 +0000)] 
Simplification to the logic underlying PRAGMA case_sensitive_like.

FossilOrigin-Name: ef0015fde4c87e992ffd3d7dea8586951bdd65ff98d30d436b126b85b1cc9c74

6 years agoAvoid an excess register allocation in UPDATE, when possible. This improves
drh [Wed, 8 May 2019 19:06:59 +0000 (19:06 +0000)] 
Avoid an excess register allocation in UPDATE, when possible.  This improves
speed (slightly) and reduces the code footprint.

FossilOrigin-Name: 8658574e3f435f03a87c04f398bd05078ebc53ecb4a477d3b24902d701d935c4

6 years agoAdd tests to improve code coverage of the RBU module.
dan [Wed, 8 May 2019 18:49:51 +0000 (18:49 +0000)] 
Add tests to improve code coverage of the RBU module.

FossilOrigin-Name: ecb56b75a0e66462acdcce285b93f9fc56944c42902d886d6bada419059519a9

6 years agoProvide the SQLITE_OMIT_CASE_SENSITIVE_LIKE_PRAGMA compile-time option to
drh [Wed, 8 May 2019 17:27:18 +0000 (17:27 +0000)] 
Provide the SQLITE_OMIT_CASE_SENSITIVE_LIKE_PRAGMA compile-time option to
omit the case_sensitive_like pragma.  This change, in combination with
documentation changes, is the current solution to ticket
[a340eef47b0cad5].

FossilOrigin-Name: eabe7f2d4ff0e0dd868dcab7ec1d4a9168a25f80d3a52f0eeea2f90bd33782f2

6 years agoFix VDBE opcodes OP_SeekLT and OP_SeekLE so that they work on intkey tables with...
dan [Wed, 8 May 2019 11:52:13 +0000 (11:52 +0000)] 
Fix VDBE opcodes OP_SeekLT and OP_SeekLE so that they work on intkey tables with non-numeric text values.

FossilOrigin-Name: 658b84d7f4a0886591c5aab30ed9e31c4a0f56db303eb863f24833ca37085d14

6 years agoFix VDBE opcodes OP_SeekLT and OP_SeekLE so that they work on intkey tables with... tkt-9cf6c9bb
dan [Wed, 8 May 2019 11:42:49 +0000 (11:42 +0000)] 
Fix VDBE opcodes OP_SeekLT and OP_SeekLE so that they work on intkey tables with non-numeric text values.

FossilOrigin-Name: a870c196d78d8b72c7353fa0015e96b2abd4be154541d76328e3a4f9e5da5d04

6 years agoRemove an ALWAYS() that was previously added by check-in [a0819086] but
drh [Wed, 8 May 2019 04:33:17 +0000 (04:33 +0000)] 
Remove an ALWAYS() that was previously added by check-in [a0819086] but
which turns out can sometimes be false.

FossilOrigin-Name: ad8fc5d8b440c49df95328df0408be699dde5a1dbd195b3f1f32e5f765578032

6 years agoRemove a NEVER() that was added in the previous check-in because it is in fact
drh [Wed, 8 May 2019 03:34:53 +0000 (03:34 +0000)] 
Remove a NEVER() that was added in the previous check-in because it is in fact
reachable.

FossilOrigin-Name: 74eba2558a81f9e790d95a12a0c5379d4f80b43c8698ef9d6a31ff8d160a53d8

6 years agoEarlier detections of errors in the byte-offset-to-cell-content integer at
drh [Wed, 8 May 2019 00:17:45 +0000 (00:17 +0000)] 
Earlier detections of errors in the byte-offset-to-cell-content integer at
offset 5 in the header of a btree page.

FossilOrigin-Name: a0819086a521fb0ca4ffd12f959b168a89ea2e30a2844bbbd39831b2b9ecf29b

6 years agoGenerate all records for INSERT or UPDATE prior to running foreign key
drh [Tue, 7 May 2019 20:06:41 +0000 (20:06 +0000)] 
Generate all records for INSERT or UPDATE prior to running foreign key
constraint checks, since the FK checks might modify the datatype of registers
used to generate the records.  Fix for ticket [e63cbcfd3378afe6980d6].

FossilOrigin-Name: 3c75605b4652ae88659465d832953ac9d467369f9cb417f73b3d8599ec60b18b

6 years agoDo not commit an "OR FAIL" statement that causes foriegn key constraint violations.
dan [Tue, 7 May 2019 19:44:11 +0000 (19:44 +0000)] 
Do not commit an "OR FAIL" statement that causes foriegn key constraint violations.

FossilOrigin-Name: 659c551dcc374a0d349ba9419f692e3363839e11d791a17cc35fa1854a674a51

6 years agoAdd test cases for the fix on this branch. tkt-e63cbcfd
dan [Tue, 7 May 2019 19:21:58 +0000 (19:21 +0000)] 
Add test cases for the fix on this branch.

FossilOrigin-Name: 2e31abe0ae5937a8ce10179e0ae045ee4c5ed8b7e2622ab41243226c6d3f5425

6 years agoOn an INSERT or UPDATE, generate the new table record prior to running
drh [Tue, 7 May 2019 19:13:42 +0000 (19:13 +0000)] 
On an INSERT or UPDATE, generate the new table record prior to running
foreign key checks, in case the foreign key checks changes datatypes on
the registers holding column values.  Proposed fix for ticket
[e63cbcfd3378afe6980d626].

FossilOrigin-Name: 3f1c8051648a341db4dffad66d3b1f9980d8a2b314cb0ce879cb2a10d1779b84

6 years agoStrive to prevent harmless compiler warnings in GCC 4.8.5.
drh [Tue, 7 May 2019 17:47:43 +0000 (17:47 +0000)] 
Strive to prevent harmless compiler warnings in GCC 4.8.5.

FossilOrigin-Name: 8b6691f619ed9a56f6aecbd878ebb447c40984f8767508b248494fd9ec68fbaa

6 years agoOptimize the restarting of an RBU vacuum.
dan [Tue, 7 May 2019 16:37:37 +0000 (16:37 +0000)] 
Optimize the restarting of an RBU vacuum.

FossilOrigin-Name: 82062351a62f4ccc438a2b47a22ee581bd030dec952fecd610f360a25002a5ea

6 years agoRemove some redundant code from sqlite3rbu.c. Add test cases for RBU vacuum. rbu-opt
dan [Tue, 7 May 2019 16:28:50 +0000 (16:28 +0000)] 
Remove some redundant code from sqlite3rbu.c. Add test cases for RBU vacuum.

FossilOrigin-Name: 7b051698d8a763d9db190fd662931266d24a4982f34f100a28641934c222e37b

6 years agoOptimize further cases of restarting an RBU vacuum.
dan [Mon, 6 May 2019 20:40:23 +0000 (20:40 +0000)] 
Optimize further cases of restarting an RBU vacuum.

FossilOrigin-Name: 6b3261bfa1d762aa29a57244a30cf5e35655f1fe9c30ee682c186dec29d7a2c2

6 years agoFix a problem with renaming an INTEGER PRIMARY KEY column of a WITHOUT ROWID table...
dan [Mon, 6 May 2019 16:15:28 +0000 (16:15 +0000)] 
Fix a problem with renaming an INTEGER PRIMARY KEY column of a WITHOUT ROWID table using ALTER TABLE.

FossilOrigin-Name: 91f701d39852ef1ddb29d1527d1520867c5efea110333315c55d8b08084384e7

6 years agoOptimize some cases of restarting an RBU vacuum.
dan [Sat, 4 May 2019 20:04:42 +0000 (20:04 +0000)] 
Optimize some cases of restarting an RBU vacuum.

FossilOrigin-Name: cdc09867ed6522026ae7bfac1f59cd79b60fba6d07d49b99b030a501a7059ee4

6 years agoFix the NOT NULL logic in the theorem prover that determines when a partial
drh [Sat, 4 May 2019 17:32:07 +0000 (17:32 +0000)] 
Fix the NOT NULL logic in the theorem prover that determines when a partial
index can be used.  Ticket [5c6955204c392ae763a95].

FossilOrigin-Name: c2e439bccc40825e211bfa9a88e6a251ff066ca7453d4e7cb5eab56ce7332635

6 years agoFix harmless compiler warning seen with MSVC.
mistachkin [Sat, 4 May 2019 03:56:47 +0000 (03:56 +0000)] 
Fix harmless compiler warning seen with MSVC.

FossilOrigin-Name: 5862b83eb36b93016d37e5b86ebb183d891bb553901facab1e5d83e114a38ec3

6 years agoIn the sqlite3_value or Mem object, make the MEM_IntReal type completely
drh [Sat, 4 May 2019 01:41:18 +0000 (01:41 +0000)] 
In the sqlite3_value or Mem object, make the MEM_IntReal type completely
independent from MEM_Int and MEM_Real. This helps avoid problems when
inserting non-float values into a "REAL" column.

FossilOrigin-Name: 5a8a23ee5f60a31dbd167a0966d1ab3d0f1c07df2251906cb73f23d1f5466b46

6 years agoNew testcase macros to ensure that MEM_IntReal is fully tested. int-real
drh [Sat, 4 May 2019 01:29:13 +0000 (01:29 +0000)] 
New testcase macros to ensure that MEM_IntReal is fully tested.

FossilOrigin-Name: 8b8ef445ccccc148af2cda5975986af0d134352fe16283f65d0f8a91c9ffa932

6 years agoAdd the SQLITE_TESTCTRL_RESULT_INTREAL test-control and use it to create
drh [Fri, 3 May 2019 21:17:28 +0000 (21:17 +0000)] 
Add the SQLITE_TESTCTRL_RESULT_INTREAL test-control and use it to create
the intreal() SQL function in testfixture.  Write a few simple tests to
prove this all works.  TH3 will hold most of the INTREAL tests, probably.

FossilOrigin-Name: c9838731325e0ca73bd8784c10c74ae043fed7861e6de269fd90e29fa4a19955

6 years agoEnsure that UTF16 strings are properly zero-terminated before returning them
drh [Fri, 3 May 2019 19:34:41 +0000 (19:34 +0000)] 
Ensure that UTF16 strings are properly zero-terminated before returning them
in an sqlite3_value_text16() request, even if the string is invalid UTF16
because it was formed from an arbitrary and/or odd-length BLOB.

FossilOrigin-Name: 3a16ddf91f0c9c516a7fc2a9d4a4f69a8326f9b8ea66421e9ef1a2d663687b70

6 years agoFix a memory-leak/segfault caused by using OP_OpenDup and OP_OpenEphemeral on the...
dan [Fri, 3 May 2019 18:50:24 +0000 (18:50 +0000)] 
Fix a memory-leak/segfault caused by using OP_OpenDup and OP_OpenEphemeral on the same VM cursor.

FossilOrigin-Name: a9b90aa12eecdd9f2a8b2d23da8b7cac43d8b1789f5cefa3f4e939d9f2b59269

6 years agoFix a problem where self-joins on views that are aggregate queries may return the...
dan [Fri, 3 May 2019 17:19:10 +0000 (17:19 +0000)] 
Fix a problem where self-joins on views that are aggregate queries may return the wrong result.

FossilOrigin-Name: 74ef97bf51dd531a277cf22fa4d42043d93799d5a5bd550812648834460fe0b7

6 years agoImproved comments on the elements of the array constant used to implement
drh [Fri, 3 May 2019 17:08:16 +0000 (17:08 +0000)] 
Improved comments on the elements of the array constant used to implement
the sqlite3_value_type() interface.

FossilOrigin-Name: f73a7de7a53f6aa6517221550a9c9882893206edfd7433e80e5fc0f441db9fc4

6 years agoFix the ".open --hexdb" command in the CLI so that it works even with
drh [Fri, 3 May 2019 02:41:36 +0000 (02:41 +0000)] 
Fix the ".open --hexdb" command in the CLI so that it works even with
terminal input.

FossilOrigin-Name: 9b5d943426c9273162ecb4c561eb3b25e843318dd438239c882c9db50f788454

6 years agoMake MEM_IntReal a completely independent type, meaning a floating point
drh [Thu, 2 May 2019 21:36:26 +0000 (21:36 +0000)] 
Make MEM_IntReal a completely independent type, meaning a floating point
value stored as an integer.  This fixes a problem with arithmetic within
arguments to string functions on indexes of expressions.  But it is a big
change and needs lots of new testcase() macros for MC/DC and so it is
initially put on this branch.

FossilOrigin-Name: dba836e31cb29d339b4520acb06188a892a52e45c50aba9742966b01108e251a

6 years agoEnsure that the typeof() function always returns SQLITE_FLOAT for floating
drh [Thu, 2 May 2019 17:45:52 +0000 (17:45 +0000)] 
Ensure that the typeof() function always returns SQLITE_FLOAT for floating
point values even when the value is stored as an integer to save space.

FossilOrigin-Name: 48889530a9de22fee536edfd1627be62396ed18d842d5fd6d91e010b4337be95

6 years agoAdd options to wapptest.tcl similar to those supported by releasetest.tcl. Also add...
dan [Thu, 2 May 2019 17:06:01 +0000 (17:06 +0000)] 
Add options to wapptest.tcl similar to those supported by releasetest.tcl. Also add the -noui switch, for running without wapp altogether.

FossilOrigin-Name: 005a169406ccea6e3cc42271620870d985e8bada1ad49a63656003db4911cb51

6 years agoEarlier detection of a database corruption case in balance_nonroot(), to
drh [Thu, 2 May 2019 15:56:39 +0000 (15:56 +0000)] 
Earlier detection of a database corruption case in balance_nonroot(), to
prevent a possible use of an uninitialized variable.

FossilOrigin-Name: c509d8a8aebe0da4847e95cf737c21313a665de9a540da2db57b8ed22f98a402

6 years agoThe collating sequence of the column must be TEXT if the LIKE or GLOB pattern
drh [Thu, 2 May 2019 01:41:53 +0000 (01:41 +0000)] 
The collating sequence of the column must be TEXT if the LIKE or GLOB pattern
starts with a "+" sign.  This is another case of ticket
[c94369cae9b561b1f996d005] that was discovered by Manuel Rigger.

FossilOrigin-Name: b043a54c3de54b286c4eae564eab6b99118a410d99bdb63480faba3123d2ca11

6 years agoFix an issue (discovered by OSSFuzz) in the enhanced OP_Concat operator
drh [Thu, 2 May 2019 00:52:50 +0000 (00:52 +0000)] 
Fix an issue (discovered by OSSFuzz) in the enhanced OP_Concat operator
from check-in [713caa382cf7dd] earlier today.

FossilOrigin-Name: 3e897702f8f789fe5119b9042fb93eca3fbfcc44564fbfa66c65628725b1157d

6 years agoAdd a test case for ticket [ae0f637bddc5290b44669e066a].
drh [Wed, 1 May 2019 19:01:27 +0000 (19:01 +0000)] 
Add a test case for ticket [ae0f637bddc5290b44669e066a].

FossilOrigin-Name: ece481695fc3c959c3eba0fb485cdda43a10b06d17259b0121e15bfc5e8e8b9f

6 years agoWhen values have real affinity and are converted into strings for CHECK
drh [Wed, 1 May 2019 18:59:33 +0000 (18:59 +0000)] 
When values have real affinity and are converted into strings for CHECK
constraints or index expressions, do the conversions into a real-number format
even if the values are stored as integers for efficiency.
This appears to fix ticket [ae0f637bddc5290b446].

FossilOrigin-Name: 5997d075665faca6b70fa647e877ebc84c473b32887b96235865d59ce80247f8

6 years agoFix an incompatibility with -DSQLITE_OMIT_LOAD_EXTENSION=1 in dbdata.test.
dan [Wed, 1 May 2019 17:36:56 +0000 (17:36 +0000)] 
Fix an incompatibility with -DSQLITE_OMIT_LOAD_EXTENSION=1 in dbdata.test.

FossilOrigin-Name: a77cd85b1a8b86e71b511f05f8c67faa046d24a48684139d2f64e51249203411

6 years agoFix a case in wapptest.tcl where a failed test might report 0 errors.
dan [Wed, 1 May 2019 17:32:36 +0000 (17:32 +0000)] 
Fix a case in wapptest.tcl where a failed test might report 0 errors.

FossilOrigin-Name: 2be1ed70df605663822d1afdde757f426ccf2ee38add8dc6b6bb4fc4d90a31dc

6 years agoAvoid unwelcomed side effects on the input operands in the OP_Concat
drh [Wed, 1 May 2019 15:32:40 +0000 (15:32 +0000)] 
Avoid unwelcomed side effects on the input operands in the OP_Concat
operator.  Fix for ticket [3be1295b264be2fac49b681]

FossilOrigin-Name: 713caa382cf7ddef872e510a76a5fca40be1a8d8876ce2f91b632bb0810a6630

6 years agoUpdate wapptest.tcl so that it deletes extra files if the "Keep files:" checkbox...
dan [Wed, 1 May 2019 15:25:38 +0000 (15:25 +0000)] 
Update wapptest.tcl so that it deletes extra files if the "Keep files:" checkbox is clear. Set it by default.

FossilOrigin-Name: 09623cc4cc82e3c123d1fd5d88b2f4b50ec5f2cc7e579a7203258bf0c246a74f

6 years agoIn "PRAGMA vdbe_trace" output, show the results of OP_Affinity opcodes.
drh [Wed, 1 May 2019 14:41:47 +0000 (14:41 +0000)] 
In "PRAGMA vdbe_trace" output, show the results of OP_Affinity opcodes.

FossilOrigin-Name: 56604bb60a8ebac8d2854628d1b052d594d7effe14be8333977995dc07b65114

6 years agoFix an incompatibility with auto-vacuum mode in new test script recover.test.
dan [Wed, 1 May 2019 08:48:44 +0000 (08:48 +0000)] 
Fix an incompatibility with auto-vacuum mode in new test script recover.test.

FossilOrigin-Name: 36dd5b0804797a35d0dc596b6ca4f71813a155c5a470237ab6e3d1bcd9ccc6be

6 years agoUpdate wapptest.tcl to use a simpler slave script. And to leave scripts wapptest_conf...
dan [Tue, 30 Apr 2019 20:43:10 +0000 (20:43 +0000)] 
Update wapptest.tcl to use a simpler slave script. And to leave scripts wapptest_configure.sh and wapptest_make.sh in each test directory.

FossilOrigin-Name: 07e527d781838412b2a434e64baaa49cbf7410a51c7393f54adc7b8eaffd5229

6 years agoFix a problem allowing a Table object to be deleted from within a call to the xDestro...
dan [Tue, 30 Apr 2019 15:36:32 +0000 (15:36 +0000)] 
Fix a problem allowing a Table object to be deleted from within a call to the xDestroy method of the associated virtual table, causing a use-after-free error.

FossilOrigin-Name: 1dbbb0101e8213b92b9a4c78c0fd2f9d0240a8ea3b40dff1033d1b8d71fb04ef

6 years agoFix an error message in the Lemon parser generator.
drh [Tue, 30 Apr 2019 14:26:31 +0000 (14:26 +0000)] 
Fix an error message in the Lemon parser generator.

FossilOrigin-Name: b6d7d42b7426622a26b67809cd1f21285fea120aa1897377b9946840463b41f1

6 years agoSmall performance increase and size reduction in the implementation of the
drh [Tue, 30 Apr 2019 11:54:36 +0000 (11:54 +0000)] 
Small performance increase and size reduction in the implementation of the
LIKE and GLOB operators.

FossilOrigin-Name: f97626f921dafe596b615a168ef31987f4a1c0b52956443e1a5c1148b49cab74

6 years agoSlightly smaller and faster implementation of the OP_MakeRecord opcode.
drh [Tue, 30 Apr 2019 01:08:42 +0000 (01:08 +0000)] 
Slightly smaller and faster implementation of the OP_MakeRecord opcode.

FossilOrigin-Name: 3bdce7ef1a6bb03affe978243fec603d5a55c071aa6d87c469a3c199d23f3b5e

6 years agoChanges to oserror.test so that it works even on systems that allow
drh [Mon, 29 Apr 2019 16:44:11 +0000 (16:44 +0000)] 
Changes to oserror.test so that it works even on systems that allow
an unusually large number of file descriptors.

FossilOrigin-Name: a27b0b880d76c6838c0365f66bcd69b1b49b7594470993b608f4e490cbdc4882

6 years agoDo not de-duplicate columns index columns associated with a WITHOUT ROWID table
drh [Mon, 29 Apr 2019 13:48:45 +0000 (13:48 +0000)] 
Do not de-duplicate columns index columns associated with a WITHOUT ROWID table
if the columns have different collating sequences.  This is the fix for
ticket [3182d3879020ef3b2].  There is one test case added, but most of the
tests are done in TH3.

FossilOrigin-Name: 1b1dd4d48cd79a585e1fa7ee79128e9f2a9ee9846339dc56bbd67b75112dcad5

6 years agoImproved header comment and precondition checking for the new isDupColumn() tkt-3182d38790
drh [Mon, 29 Apr 2019 13:30:16 +0000 (13:30 +0000)] 
Improved header comment and precondition checking for the new isDupColumn()
function.

FossilOrigin-Name: 740d5ff6cc9bf7b151dfb8b27409e5923cfb2789b5398fe13d89563aff8ffc07

6 years agoFix a buffer overwrite in shell.c.in (part of the new .recover code).
dan [Mon, 29 Apr 2019 11:41:46 +0000 (11:41 +0000)] 
Fix a buffer overwrite in shell.c.in (part of the new .recover code).

FossilOrigin-Name: 92facbc73a940d2844ac88fafd2d2dadb10886fb0b7c53e23f346d18fa6d6327

6 years agoFix a stack overflow that could occur when renaming a table that has a trigger contai...
dan [Mon, 29 Apr 2019 11:27:58 +0000 (11:27 +0000)] 
Fix a stack overflow that could occur when renaming a table that has a trigger containing a window function invocation that itself contains a specific syntax error.

FossilOrigin-Name: c621fc668c6538f9f5bdac204f012c64998679a61aa8e224d212503820224c09

6 years agoTake collating sequence into account when removing redundant columns from
drh [Sun, 28 Apr 2019 19:27:02 +0000 (19:27 +0000)] 
Take collating sequence into account when removing redundant columns from
indexes on WITHOUT ROWID tables.  This is the first proof-of-concept fix
for ticket [3182d3879020ef3]. More testing needed.

FossilOrigin-Name: b34fa5bff40d3d364bd8c80e7de55c606ef3caac47b14b5265ebcb38857eb85e

6 years agoAdd the ".recover" command to the shell tool. For recovering as much data as possible...
dan [Sat, 27 Apr 2019 20:30:19 +0000 (20:30 +0000)] 
Add the ".recover" command to the shell tool. For recovering as much data as possible from corrupt databases.

FossilOrigin-Name: 50fe48458942fa7a6bcc76316c6321f95b23dc34f2f8e0a483826483b2fb16f6

6 years agoFix a minor typo in a comment. No changes to code.
drh [Sat, 27 Apr 2019 20:16:42 +0000 (20:16 +0000)] 
Fix a minor typo in a comment.  No changes to code.

FossilOrigin-Name: 95209072176ff21a91e96d5bd014b35ef100da2b0b93958baf6df4294a8daa85

6 years agoFix building the shell with SQLITE_OMIT_VIRTUAL_TABLE. And without SQLITE_ENABLE_DBPA... dbdata
dan [Sat, 27 Apr 2019 20:15:15 +0000 (20:15 +0000)] 
Fix building the shell with SQLITE_OMIT_VIRTUAL_TABLE. And without SQLITE_ENABLE_DBPAGE_VTAB.

FossilOrigin-Name: 425d708c3908fe74f69b62e6dd1722a0018088977e12f14b312dad1df0fbb804

6 years agoAdd comments and fix formatting issues in new code in shell.c.in.
dan [Sat, 27 Apr 2019 19:36:49 +0000 (19:36 +0000)] 
Add comments and fix formatting issues in new code in shell.c.in.

FossilOrigin-Name: b91d819bd16de43fc99e379da0ba9c915b0c5afc68e804a50c3c1662c1f9a740

6 years agoAdd the "--lost-and-found" option to the ".recover" command. For setting the name...
dan [Sat, 27 Apr 2019 18:47:03 +0000 (18:47 +0000)] 
Add the "--lost-and-found" option to the ".recover" command. For setting the name of the orphaned rows table.

FossilOrigin-Name: 67bb88e24c74d02ae0c4ac6ff2f873f6b0035ccefe5cccfc71c5686cbc76b4c3

6 years agoFix a problem in the .recover command with recovering WITHOUT ROWID tables where...
dan [Sat, 27 Apr 2019 15:35:45 +0000 (15:35 +0000)] 
Fix a problem in the .recover command with recovering WITHOUT ROWID tables where the PK columns are not the leftmost in the CREATE TABLE statement.

FossilOrigin-Name: 91df4b8e0386105d01614921e8410994b621404a3d46ec4af8687b8743c52d52

6 years agoHave .recover store all orphaned rows in a single table, with extra columns to indica...
dan [Fri, 26 Apr 2019 21:11:37 +0000 (21:11 +0000)] 
Have .recover store all orphaned rows in a single table, with extra columns to indicate the orphaned page and sub-tree they were discovered within.

FossilOrigin-Name: 7221f6e33ed6a5a96ec61e25f2a1f70b84aae66e503d897eb7b7ff1aec42355d

6 years agoOmit tests of the LIKE optimization in like3.test when SQLITE_ENABLE_ICU is defined.
dan [Fri, 26 Apr 2019 17:08:50 +0000 (17:08 +0000)] 
Omit tests of the LIKE optimization in like3.test when SQLITE_ENABLE_ICU is defined.

FossilOrigin-Name: af53c41a127c314c0608f3fd016d3a26896783745e46cd180976a188400cdb75

6 years agoFix another problem with database freelist handling in the ".recover" command.
dan [Fri, 26 Apr 2019 15:40:27 +0000 (15:40 +0000)] 
Fix another problem with database freelist handling in the ".recover" command.

FossilOrigin-Name: bee2652ac26370e612a8c81dd7554befc2d523442a2fbbc77dc73479e6a0d7fd

6 years agoFix a locking-page related problem with the ".recover" command.
dan [Fri, 26 Apr 2019 15:14:53 +0000 (15:14 +0000)] 
Fix a locking-page related problem with the ".recover" command.

FossilOrigin-Name: afdae10424f0f3d0f10a4b73e9732aa55c5ee664814d8ca0edd372cfb17c2445

6 years agoMerge latest trunk changes into this branch.
dan [Thu, 25 Apr 2019 20:06:34 +0000 (20:06 +0000)] 
Merge latest trunk changes into this branch.

FossilOrigin-Name: 1da302d85d7ad4ba54f877117a45d667439fd2ef31dc70ea1d54dc1fba196e68

6 years agoUnless the "--freelist-corrupt" option is specified, do not have the .recover command...
dan [Thu, 25 Apr 2019 19:23:15 +0000 (19:23 +0000)] 
Unless the "--freelist-corrupt" option is specified, do not have the .recover command attempt to recover data from pages that are on the database free-list.

FossilOrigin-Name: 8d2f52bb640d6d0f84b18d746043e56f45a73ace93239be1d036701f7f4018fd

6 years agoFix a bug preventing .recover from working on databases where the final page of the...
dan [Thu, 25 Apr 2019 16:20:40 +0000 (16:20 +0000)] 
Fix a bug preventing .recover from working on databases where the final page of the db is corrupt.

FossilOrigin-Name: 959bbd11e92cc789973daf20dfcb8a6d8dc724dd603b286cbdd59e5d1fdb2909

6 years agoImprove the performance of the .recover command.
dan [Wed, 24 Apr 2019 20:48:55 +0000 (20:48 +0000)] 
Improve the performance of the .recover command.

FossilOrigin-Name: a50768314d10d743a0cc013b434b516f0763e0a6c5b79655d8fefde7de53e869

6 years agoNew test cases in test/fuzzdata8.db.
drh [Wed, 24 Apr 2019 17:04:02 +0000 (17:04 +0000)] 
New test cases in test/fuzzdata8.db.

FossilOrigin-Name: 7be6222c9ec44596e4eddd906c831eb1272b90fbdf68641d791f216264feb7cf

6 years agoFix another instance in fts3 where a corrupt record can cause a buffer overflow.
dan [Wed, 24 Apr 2019 16:13:52 +0000 (16:13 +0000)] 
Fix another instance in fts3 where a corrupt record can cause a buffer overflow.

FossilOrigin-Name: e1724f1d618cfbcfd1e495d8965a395656cfc1114e1bffd4bc3be0bd5cdb6550

6 years agoFix a problem in fts5 where a corrupt position list could lead to a buffer overwrite.
dan [Wed, 24 Apr 2019 15:57:25 +0000 (15:57 +0000)] 
Fix a problem in fts5 where a corrupt position list could lead to a buffer overwrite.

FossilOrigin-Name: 516ca8945150bdc1363603e234be5f3f4a3861f581d7cc9455da3e87b9974309

6 years agoFix an error in fts3_write.c allowing a corrupt database to cause a crash.
dan [Wed, 24 Apr 2019 15:13:02 +0000 (15:13 +0000)] 
Fix an error in fts3_write.c allowing a corrupt database to cause a crash.

FossilOrigin-Name: 6e4a5f22811bcd1485e27073ec96821d448b91b6d1ff1659cc3772449d19a762

6 years agoCorrection to the #if in the previous check-in.
mistachkin [Wed, 24 Apr 2019 04:53:01 +0000 (04:53 +0000)] 
Correction to the #if in the previous check-in.

FossilOrigin-Name: 30dc05ac12910d318a737f8d7a0e895e5c42ff4c53472aeebc89f052eac05deb

6 years agoFix for 8-byte alignment asserts that can trigger in some circumstances with 32-bit...
mistachkin [Wed, 24 Apr 2019 00:37:11 +0000 (00:37 +0000)] 
Fix for 8-byte alignment asserts that can trigger in some circumstances with 32-bit MSVC.

FossilOrigin-Name: 4c02832e0c4351ced9d2391f09ee071c65a74b85a0509bf58f045afeb166f48c

6 years agoMake no atttempt to generate VDBE code for VACUUM after a syntax error.
drh [Tue, 23 Apr 2019 22:00:39 +0000 (22:00 +0000)] 
Make no atttempt to generate VDBE code for VACUUM after a syntax error.

FossilOrigin-Name: 930842470da27d72650033ef2c1df413e70f7c40eb46f91027b35f5ee156af38