1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00
Commit Graph

14070 Commits

Author SHA1 Message Date
drh
e12ca5abf6 Earlier detection of a database corruption case in balance_nonroot(), to
prevent a possible use of an uninitialized variable.

FossilOrigin-Name: c509d8a8aebe0da4847e95cf737c21313a665de9a540da2db57b8ed22f98a402
2019-05-02 15:56:39 +00:00
drh
cf1747b782 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
2019-05-02 01:41:53 +00:00
drh
01325a3f75 Fix an issue (discovered by OSSFuzz) in the enhanced OP_Concat operator
from check-in [713caa382cf7dd] earlier today.

FossilOrigin-Name: 3e897702f8f789fe5119b9042fb93eca3fbfcc44564fbfa66c65628725b1157d
2019-05-02 00:52:50 +00:00
drh
83a1dafb03 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
2019-05-01 18:59:33 +00:00
drh
8a7e11fb78 Avoid unwelcomed side effects on the input operands in the OP_Concat
operator.  Fix for ticket [3be1295b264be2fac49b681]

FossilOrigin-Name: 713caa382cf7ddef872e510a76a5fca40be1a8d8876ce2f91b632bb0810a6630
2019-05-01 15:32:40 +00:00
drh
6fcc1ecc99 In "PRAGMA vdbe_trace" output, show the results of OP_Affinity opcodes.
FossilOrigin-Name: 56604bb60a8ebac8d2854628d1b052d594d7effe14be8333977995dc07b65114
2019-05-01 14:41:47 +00:00
dan
c589acbc50 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
2019-04-30 15:36:32 +00:00
drh
cf83323936 Small performance increase and size reduction in the implementation of the
LIKE and GLOB operators.

FossilOrigin-Name: f97626f921dafe596b615a168ef31987f4a1c0b52956443e1a5c1148b49cab74
2019-04-30 11:54:36 +00:00
drh
b70b0df8eb Slightly smaller and faster implementation of the OP_MakeRecord opcode.
FossilOrigin-Name: 3bdce7ef1a6bb03affe978243fec603d5a55c071aa6d87c469a3c199d23f3b5e
2019-04-30 01:08:42 +00:00
drh
4baa75b32f 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
2019-04-29 13:48:45 +00:00
drh
c19b63c9a3 Improved header comment and precondition checking for the new isDupColumn()
function.

FossilOrigin-Name: 740d5ff6cc9bf7b151dfb8b27409e5923cfb2789b5398fe13d89563aff8ffc07
2019-04-29 13:30:16 +00:00
dan
51f5ffa1a4 Fix a buffer overwrite in shell.c.in (part of the new .recover code).
FossilOrigin-Name: 92facbc73a940d2844ac88fafd2d2dadb10886fb0b7c53e23f346d18fa6d6327
2019-04-29 11:41:46 +00:00
dan
490e6f2506 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
2019-04-29 11:27:58 +00:00
drh
f78d0f426c 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
2019-04-28 19:27:02 +00:00
dan
73c0d272a9 Add the ".recover" command to the shell tool. For recovering as much data as possible from corrupt databases.
FossilOrigin-Name: 50fe48458942fa7a6bcc76316c6321f95b23dc34f2f8e0a483826483b2fb16f6
2019-04-27 20:30:19 +00:00
drh
6c59136498 Fix a minor typo in a comment. No changes to code.
FossilOrigin-Name: 95209072176ff21a91e96d5bd014b35ef100da2b0b93958baf6df4294a8daa85
2019-04-27 20:16:42 +00:00
dan
1b16216f9e Fix building the shell with SQLITE_OMIT_VIRTUAL_TABLE. And without SQLITE_ENABLE_DBPAGE_VTAB.
FossilOrigin-Name: 425d708c3908fe74f69b62e6dd1722a0018088977e12f14b312dad1df0fbb804
2019-04-27 20:15:15 +00:00
dan
0aa01ee42c Add comments and fix formatting issues in new code in shell.c.in.
FossilOrigin-Name: b91d819bd16de43fc99e379da0ba9c915b0c5afc68e804a50c3c1662c1f9a740
2019-04-27 19:36:49 +00:00
dan
42ebb01e9f Add the "--lost-and-found" option to the ".recover" command. For setting the name of the orphaned rows table.
FossilOrigin-Name: 67bb88e24c74d02ae0c4ac6ff2f873f6b0035ccefe5cccfc71c5686cbc76b4c3
2019-04-27 18:47:03 +00:00
dan
f57bea31ba 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
2019-04-27 15:35:45 +00:00
dan
98c5ad309f 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
2019-04-26 21:11:37 +00:00
dan
ca42438261 Fix another problem with database freelist handling in the ".recover" command.
FossilOrigin-Name: bee2652ac26370e612a8c81dd7554befc2d523442a2fbbc77dc73479e6a0d7fd
2019-04-26 15:40:27 +00:00
dan
c0b42437ab Fix a locking-page related problem with the ".recover" command.
FossilOrigin-Name: afdae10424f0f3d0f10a4b73e9732aa55c5ee664814d8ca0edd372cfb17c2445
2019-04-26 15:14:53 +00:00
dan
6aa001527c Merge latest trunk changes into this branch.
FossilOrigin-Name: 1da302d85d7ad4ba54f877117a45d667439fd2ef31dc70ea1d54dc1fba196e68
2019-04-25 20:06:34 +00:00
dan
9c014f8b0c 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
2019-04-25 19:23:15 +00:00
dan
b9b71dbfd4 Fix a bug preventing .recover from working on databases where the final page of the db is corrupt.
FossilOrigin-Name: 959bbd11e92cc789973daf20dfcb8a6d8dc724dd603b286cbdd59e5d1fdb2909
2019-04-25 16:20:40 +00:00
dan
efa363b84c Improve the performance of the .recover command.
FossilOrigin-Name: a50768314d10d743a0cc013b434b516f0763e0a6c5b79655d8fefde7de53e869
2019-04-24 20:48:55 +00:00
mistachkin
8e7e517b68 Correction to the #if in the previous check-in.
FossilOrigin-Name: 30dc05ac12910d318a737f8d7a0e895e5c42ff4c53472aeebc89f052eac05deb
2019-04-24 04:53:01 +00:00
mistachkin
49b0572302 Fix for 8-byte alignment asserts that can trigger in some circumstances with 32-bit MSVC.
FossilOrigin-Name: 4c02832e0c4351ced9d2391f09ee071c65a74b85a0509bf58f045afeb166f48c
2019-04-24 00:37:11 +00:00
drh
29e780068b Make no atttempt to generate VDBE code for VACUUM after a syntax error.
FossilOrigin-Name: 930842470da27d72650033ef2c1df413e70f7c40eb46f91027b35f5ee156af38
2019-04-23 22:00:39 +00:00
dan
b182588c8e Have ".recover" handle "\r" and "\n" in the same way as ".dump".
FossilOrigin-Name: f95f0f02ab6c6cf45f25b613c7ab57f68249689d0a9eddf4c9518ddf0edad365
2019-04-23 20:48:32 +00:00
dan
38f9c7194d Fixes for the ".recover" shell command.
FossilOrigin-Name: 8dcc1d89d955bf58c80a8c30a37960f0cf95719953951a92626cc332cc75ec60
2019-04-23 18:03:02 +00:00
drh
3ea557e0e7 Changes to the --hexdb decoder option in the shell (and also in the TCL
test code) so that it works on systems where sscanf() does not recognize
"%hhx" as wanting to delivery results into a character-size variable.

FossilOrigin-Name: 4258e42d92b0113ba59f407197fc24f21734900e5b02952deed07818be3e3e5d
2019-04-23 15:30:58 +00:00
mistachkin
d5ddecb2f0 Minor simplification of NULL value handling for STAT4.
FossilOrigin-Name: 69bad9257f8db6a2a761bdd298d972eb48d4f845ec11dedc802ba3bafb979915
2019-04-23 15:08:11 +00:00
drh
f4b331535d Improvement on the previous check-in. Parse.rc is less reliable than
Parse.nErr for detecting SQLITE_TOOBIG errors.

FossilOrigin-Name: 8d478cfb92fdeb87591403fe1713b290fee309a38b71abee0002012935d1db98
2019-04-23 12:30:15 +00:00
dan
b40af49d73 Enhance the ".recover" command. Fix a problem with overflow pages in dbdata.c.
FossilOrigin-Name: f193ca587f9e4f925f4f2343b0b07053bd6f93dd87fc6f8f41cf4479e90cf562
2019-04-22 20:52:12 +00:00
drh
2b13cd99d3 Early detection of SQLITE_TOOBIG when processing nested queries.
FossilOrigin-Name: 5d85d80ef8b216639244c6f4e6a2c0050af3cf9c3998f372bae4a19c0430f2fd
2019-04-22 20:05:54 +00:00
dan
a9a5465eb4 Fix an assert() that may be false for corrupt databases.
FossilOrigin-Name: b2ce5ed175cb5029ac07392ae371c86eeec23c74624aad007dee51cf359f3eeb
2019-04-22 11:47:40 +00:00
dan
68cb86ef23 Add the ".recovery" command to the shell tool. For recovering the maximum amount data from corrupt databases. Still needs work.
FossilOrigin-Name: 7461d2e120f2149315ddac2676d51d7445bcdb8e97543effd9c30603517ef9da
2019-04-20 20:57:28 +00:00
drh
1d2d71a02c Mark a single branch as no longer reachable.
FossilOrigin-Name: 4f35b3b78a461b0617a5cd04f60d2ab277bcc7c994dae463851a3cb5d041a723
2019-04-19 23:05:56 +00:00
drh
17180fca9d Improved optimization of the AND and OR operators.
FossilOrigin-Name: 0fbd154eb419b57b9c064c1f47346835d6324388b966b73f8a0122de065f08b1
2019-04-19 17:26:19 +00:00
dan
65455fc682 Fix a problem with renaming a table that starts with "sqlite". Fix for ticket [f00d7b65].
FossilOrigin-Name: a2ead8aa4517b63cda7bf84464326e9cb5e228224caa603568c0e04ea44e6588
2019-04-19 16:34:22 +00:00
drh
ad31727fc6 Use macros to determine if an expression is always true or always false.
FossilOrigin-Name: 6de980a09c3a7adf71f2c9a63a242673b5e1f246e8ee071b26844275f0dad0fc
2019-04-19 16:21:51 +00:00
drh
d5c851c1cb Streamline the processing of the AND operator. Slightly smaller and faster.
FossilOrigin-Name: 7713996aa99ce6dd35b5a2db74dd26658fb8d9817169b2a7531cdef6edb41403
2019-04-19 13:38:34 +00:00
mistachkin
7a3e50dc97 Minor simplification of NULL value handling for STAT4.
FossilOrigin-Name: 5718a9d5fc3fdfc89db869501c81fda39b3ec5c7e11fa0038fc258e316f5d8a1
2019-04-18 19:21:19 +00:00
drh
680f0fe32a Small performance and size optimization in sqlite3WalFindFrame().
FossilOrigin-Name: 03f2e78899fad99b0a0951b3a408268276954d4cd785389ed9a0192c9217f6fe
2019-04-17 21:12:05 +00:00
drh
e551b51472 Fix a typo in the CLI help output for the ".dump" command.
FossilOrigin-Name: 57638248de147efe8d663b3ae1389f590c7b2b7225ecfe295699d68c2893cd09
2019-04-17 13:58:07 +00:00
drh
698c86f40d Small performance improvement on the variable-length integer decoder:
sqlite3GetVarint().

FossilOrigin-Name: 5df2bf62fcd4dfdaa195062dddbd5ce5420bc239b2649ac8f547e0db34e7f0bb
2019-04-17 12:07:08 +00:00
drh
7e427337fe Faster and smaller implementation of sqlite3StrICmp().
FossilOrigin-Name: 7ac500fb5abfe1ad60f2ffdcc8fbe5ccc1c641bbeed53f00940e9ff78788e53d
2019-04-17 11:34:44 +00:00
dan
2eb2ca8391 Avoid a sanitizer error (pointer arithmatic overflow) in vdbesort.c.
FossilOrigin-Name: af61a2fc45a0fa1277d7453779238b77de4c298a9f60714b7dc62ddca5874f80
2019-04-16 11:21:13 +00:00