Commit Graph

17098 Commits

Author SHA1 Message Date
drh b701c9a6c3 Improved detection of cells that extend into the reserved space at the end
of the page while adjusting overflow page pointers during autovacuum.

FossilOrigin-Name: 8097712c9c1f4ea16bc5dd462da248ef98896061
2017-01-12 15:11:03 +00:00
drh 24be549329 Remove invalid test case from cursorhints2.test
FossilOrigin-Name: 163cc1b2f7100827d5803b81dcd97a1417744f66
2017-01-12 11:52:47 +00:00
drh ea8f0a155e Make sure Tcl_AppendResult() always has a NULL-pointer argument at the end.
FossilOrigin-Name: c07aef6f909fe35de110f0b180dbf5aa4c226af3
2017-01-12 11:50:08 +00:00
dan ba47020b63 Changes to allow some multi-row UPDATE statements to avoid the two-pass
approach.

FossilOrigin-Name: 7ae6104a3e0d1d2cacfe2be732f0220a53908132
2017-01-11 21:03:53 +00:00
dan e206ea7f48 Fix a problem causing the pre-update hook to be passed an incorrect rowid
value in some single-pass multi-row updates.

FossilOrigin-Name: 62257eb53c13d4c7ed128d5d89f6f10d4aff945c
2017-01-11 20:10:30 +00:00
dan 2c6fec21dc Fix a problem with single-pass multi-row UPDATE statements that invoke REPLACE
conflict handling.

FossilOrigin-Name: 0a2b8e1b9dc600b5a93622e8eea6218649df5e0f
2017-01-11 19:03:08 +00:00
dan 372f942f17 Fix a problem preventing UPDATE statements that use a range-scan on the PK
index of a WITHOUT ROWID table from using a one-pass strategy.

FossilOrigin-Name: cab86c90945126c24c40cf2dedd053a8c46d00d6
2017-01-11 15:42:14 +00:00
drh 785d8ed0d4 In the STAT4 computations, ensure that the aAvgEq values do not go negative.
FossilOrigin-Name: f58f75b5a06f88ba97bd1a02bee621c64691c6f8
2017-01-11 14:15:29 +00:00
dan f91c1318f4 Changes to allow some multi-row UPDATE statements to avoid the two-pass
approach.

FossilOrigin-Name: 46db23ccd116ce5b9d949f9293be8a2818411b46
2017-01-10 20:04:38 +00:00
dan f112f0b3de Add a test case for ticket [25e335f802dd].
FossilOrigin-Name: e500c15a9f55aed1601f7c14169dd56fd76f1fdd
2017-01-10 17:37:49 +00:00
drh 8e36ddd37e Throw an error if the ON clause of a LEFT JOIN references tables to the right
of the ON clause.  Fix for ticket [25e335f802dd].

FossilOrigin-Name: c92ecff2ec5f178433d21f25c653d0fdd9128d7c
2017-01-10 17:33:43 +00:00
drh 1d21bac8aa Avoid unnecessary calls to the xRoundup() method of the memory allocator when
the soft heap limit is not set.

FossilOrigin-Name: 4209b89eab01814228a178963238e0dffffad2a4
2017-01-10 16:09:46 +00:00
drh d9bcb32ebb Fix a potential assertion fault discovered by OSS-Fuzz.
FossilOrigin-Name: 71c03b59b645884ebd6b9e18713cd2eb8c949870
2017-01-10 15:08:06 +00:00
drh e4a8b8769e Remove a redundant assignment statement.
FossilOrigin-Name: a5fa09657bd6c4ea5fe6712b0f8af2170cbe0381
2017-01-09 19:55:19 +00:00
drh 7441df72be Performance optimization and size reduction in the OP_Variable opcode.
FossilOrigin-Name: 237aa97452e20c312f256a8fd62531e3d447f84b
2017-01-09 19:27:04 +00:00
mistachkin ab61cf7d93 Fix typo in a comment. No changes to code.
FossilOrigin-Name: d38fd22935b1572f4481b39c2f9274329b18ea99
2017-01-09 18:22:54 +00:00
drh e7b554d615 Modify the OP_RowData opcode so that when P3!=0 it is allowed to hold an
ephemeral copy of the content.  This avoids unnecessary memcpy() operations
in the xfer-optimization and VACUUM.

FossilOrigin-Name: 6e106acd74da3baa5c308a76443d2f0a7c904e5e
2017-01-09 15:44:25 +00:00
drh f4e994b23a Add the SQLITE_UINT64_TYPE compile-time option.
FossilOrigin-Name: a5fe03bc419d9c7e6068ed38810e3f183de179b5
2017-01-09 13:43:09 +00:00
drh 68116939eb Improvements to the iIdxNoSeek optimization of sqlite3GenerateRowDelete()
so that it is automatically disabled for BEFORE triggers but works in all
other cases.

FossilOrigin-Name: 3178ec4c27efc4ff84bcd17ddb17ec50a6ac96b3
2017-01-07 14:47:03 +00:00
drh 4cef5b1c81 Critical fix to the previous check-in so that it works when there are
BEFORE triggers that move the cursor before the OP_Delete has a chance to
be applied.

FossilOrigin-Name: db2c0960ffb3b396b20e0441d3edb812254c82bc
2017-01-07 14:26:28 +00:00
drh ad1d9a8707 Avoid an unnecessary btree seek while deleting an index entry due to a conflict
on a REPLACE operation.

FossilOrigin-Name: f0495c5133d0dc04d63521136d6b9ca440792cdf
2017-01-07 03:26:50 +00:00
drh a67b5cb6b3 Avoid duplicate b-tree searches in the duplicate row detector used to
implement DISTINCT.

FossilOrigin-Name: d577dda0a7fbfacda57e8cad2bc4651d2a05d813
2017-01-07 00:56:01 +00:00
dan e1ff3f5e11 Ensure that "PRAGMA case_sensitive_like" and "PRAGMA shrink_memory" set the
number of output columns to 0 (as they are statements that return no data).

FossilOrigin-Name: 6696cd1878be4bd44a24841b04163e52d847711e
2017-01-06 13:49:40 +00:00
dan 1439a1e80f Improve handling of corrupt data in fts5.
FossilOrigin-Name: 609ac1c73f7c2b48a571c178a72383996a9538fe
2017-01-06 11:55:03 +00:00
drh 3d775e7586 Clarify the documentation on sqlite3_column_count().
FossilOrigin-Name: 9ea0baddd893e54ec79399ae83033ae139650535
2017-01-06 01:09:43 +00:00
mistachkin 817be73bfc Remove several non-portable tests for the deprecated temp_store_directory PRAGMA.
FossilOrigin-Name: 28d87789141d816e0bce6d3965ce84c79b803218
2017-01-06 00:02:51 +00:00
dan 2b64313b8d Ensure that sqlite3_column_count() returns 0 for the "set" mode of "get/set"
PRAGMA statements that do not return a value in that case (e.g. page_size,
cache_size, auto_vacuum).

FossilOrigin-Name: 2f57939a5583ae420b525c7e0f0dcda8626fe992
2017-01-05 20:00:08 +00:00
dan 9e1ab1a8a4 Ensure that sqlite3_column_count() returns 0 for the "set" mode of "get/set"
PRAGMA statements that do not return a value in that case (e.g. page_size,
cache_size, auto_vacuum).

FossilOrigin-Name: 5c05d8ec5e895661dae2de30c73dfdeaff93511e
2017-01-05 19:32:48 +00:00
dan ac56ab7e48 Fix handling the case where a sub-query in a FROM clause is itself a UNION
ALL, and one side of that UNION ALL is a query on a view that includes an
ORDER BY. Fix for ticket [190c2507].

FossilOrigin-Name: 590ca83b8e8cdd5d24ed7f10f43e540aa0627f22
2017-01-05 17:23:11 +00:00
drh 5f40cebf43 Fix problems in trigger and foreign key handling when doing REPLACE on a
WITHOUT ROWID table that has no secondary indexes.

FossilOrigin-Name: 571f166ea8721e2322965b6f23e758b78d13baca
2017-01-05 13:50:12 +00:00
drh 34d04d64f0 Ensure that the sqlite3_value_text() interface returns a buffer that is long
enough to hold the complete string plus the zero terminator even when the
input is a zeroblob.  Fix for a problem detected by OSS-Fuzz.

FossilOrigin-Name: 2dc7eeb5b4d2eaf1d843eda56f339fd4cc80d78e
2017-01-05 07:58:29 +00:00
dan f9a12a106b Fix some problems with foreign key processing within REPLACE ops on WITHOUT
ROWID tables with no triggers or auxiliary indexes.

FossilOrigin-Name: c1220b1af62629d7fc2178512786d613cd7ea711
2017-01-05 06:57:42 +00:00
drh 801f55d837 Improved the comment on the block of code the provides the performance
optimization originally added by check-in [925840cfdb].  The original
check-in omitted condition 4, which was the cause of bug [30027b613b].

FossilOrigin-Name: c6506b82aa6583ccde5f673c79526d5f3920b67a
2017-01-04 22:02:56 +00:00
dan 4e1f0efb4d Possible fix for 30027b61. There may still be problems surrounding foreign key
processing.

FossilOrigin-Name: 71ccb1f4c490fdebc7008e884384e7809b849742
2017-01-04 20:13:51 +00:00
drh 87e1e56b5b Adjust filename creation in test_sqllog.c so that it uses leading zeros on
counters, so that files appear in order when sorted lexicographically.

FossilOrigin-Name: 8d670973595bd01ffc9b2ab53b965e6d6d22c573
2017-01-04 14:53:53 +00:00
drh b005f9e620 Performance enhancements in the printf implementation.
FossilOrigin-Name: 82e4001b8caef7b31967f3edcbc1a545c081bdbc
2017-01-04 13:09:05 +00:00
drh 49c5ab243b Factor constant functions out of the inner loop since they are more expensive
than the extra OP_Copy needed to move the result into place.

FossilOrigin-Name: 80ad317f89c46db0d0d252aefdc036a34a61183d
2017-01-04 04:18:00 +00:00
drh ad879ffdb5 Clean up the implementation of constant function factorization.
FossilOrigin-Name: 2ab997e47998d261bd6190bbce5c09f3fbd4cfd3
2017-01-04 04:10:02 +00:00
drh 1e9b53f9bc Attempt to factor out constant functions from the interior of table scans,
since functions can often be expensive to compute.

FossilOrigin-Name: 62e9270a8057d758621da33adb27fad14225f95d
2017-01-04 01:07:24 +00:00
drh 8236f688e8 Changes to the printf implementation for better performance.
FossilOrigin-Name: acdb8f6f10953ed4290aadc9e026edd57d1dd21a
2017-01-04 00:26:28 +00:00
drh a3a40211bd Use compiler intrinsic functions for signed integer math when overflow
detection is needed.

FossilOrigin-Name: d3ac32a6e7f1823450feb3d1089802542090d164
2017-01-03 21:57:11 +00:00
drh 7433ae5df6 Back out the use of __sync_fetch_and_sub() as it does not appear to work.
FossilOrigin-Name: 4c2efd4239bf07eb4b92d4af54edd68ee6312670
2017-01-03 21:50:49 +00:00
drh 5c6b944d16 Fix a typo in a comment.
FossilOrigin-Name: ae087123db8e7d47b25a8d0a98cfd62e85e42fc6
2017-01-03 21:03:37 +00:00
drh b94f2eccc1 Use the CLANG_VERSION macro to control clang-specific features.
FossilOrigin-Name: f8ebeec211483503e135104ef977b3c384a1d789
2017-01-03 20:01:24 +00:00
drh eea46aeafc Use the GCC built-in __sync_fetch_and_sub() to make the sqlite3StatusDown()
routine atomic, and thereby avoid some mutexing.

FossilOrigin-Name: f69ce75b3d94331fdbfa2f3a27d61db24c285d2b
2017-01-03 18:05:04 +00:00
drh 4a47761e0d Make use of the __buildin_OP_overflow() functions from GCC when doing
64-bit signed integer arithmetic.

FossilOrigin-Name: 82cbebb8ee4484f13e5f48d305e20e73063f273e
2017-01-03 17:33:43 +00:00
drh 5c41d00f42 Add the experimental affinity() SQL function when SQLITE_DEBUG is defined.
FossilOrigin-Name: bed0eaa5f50112e64fc97a2afdc9d56cf8f5026a
2017-01-03 14:45:35 +00:00
drh 5424075137 Put the affinity() function implementation inside of #ifdef SQLITE_DEBUG.
FossilOrigin-Name: f778f58ae4ea3e16f51b94591a2c1e563dcb0cde
2017-01-03 14:39:30 +00:00
drh 01e64a1704 Merge all the latest changes from trunk.
FossilOrigin-Name: c27cd8a8127b81d3176f6a5b9915c9b3c69574fb
2017-01-03 14:30:28 +00:00
drh 2710b14c45 Defer size checking on row-value assignments for when the RHS is a SELECT
until after the "*" wildcards have been expanded.

FossilOrigin-Name: 36944be6be5c42096f5da84187ff203af26b08ae
2017-01-03 13:45:22 +00:00