Commit Graph

21719 Commits

Author SHA1 Message Date
drh
1cfee74a28 Fix a potential NULL pointer dereference following OOM. Problem discovered
by dbsqlfuzz.  Test case in TH3.

FossilOrigin-Name: 5aeb5a2d295e10d5fc1d456b3acaf8ac13c04cb5bb71a8c4571541d366e95887
2020-02-19 15:39:46 +00:00
drh
4b9e736898 Remove a NEVER() macro and add a test case to cause its argument to be true.
FossilOrigin-Name: ee034fe916448e953ee7824e5c0db99a36a0ad138ebfb25f751bf84cb80a8fa7
2020-02-18 23:58:58 +00:00
drh
4defdddc31 Add the new sqlite3_create_filename() and sqlite3_free_filename() interfaces
for use by Shims.  Use these interfaces inside the multiplexor.

FossilOrigin-Name: 9469f36ac89e4b75d0ab25fefbeff25201992c53141da915dcaa017083cab6db
2020-02-18 19:49:48 +00:00
drh
0184a256e3 Convert invalid surrogates to 0xfffd when translating UTF.
FossilOrigin-Name: 7fab1393c2b22b1f3b159b631e06e7e0d3900850ee249c38e4d3cdd0aacf637e
2020-02-17 23:08:16 +00:00
drh
78d1d225d8 A better (smaller and faster) solution to ticket [4374860b29383380].
FossilOrigin-Name: abc473fb8fb999005dc79a360e34f97b3b25429decf1820dd2afa5c19577753d
2020-02-17 19:25:07 +00:00
drh
bf48ce49f7 Take care when checking the table of a TK_COLUMN expression node to see if the
table is a virtual table to first ensure that the Expr.y.pTab pointer is not
null due to generated column optimizations.  Ticket [4374860b29383380].

FossilOrigin-Name: 9d0d4ab95dc0c56e053c2924ed322a9ea7b25439e6f74599f706905a1994e454
2020-02-17 00:12:04 +00:00
drh
ac9e184e1f Avoid an infinite recursion on an illegal recursive definition of an
fts5vocab table.

FossilOrigin-Name: 109ee07433b274a39954cef62bf67d47bcda960df9bef56127210ebf1c3c104c
2020-02-16 17:40:35 +00:00
drh
fdfd45aef3 Fix problems in the constant propagation optimization that were introduced
by check-in [1c3e5c20a9e6f501].  Fix for ticket [1dcb4d44964846ad]

FossilOrigin-Name: c9a8defcef35a1fee6bcbb88252a2d0076dabe8381b0128b2257b5b5cc494e0f
2020-02-13 22:12:35 +00:00
drh
ab7fdca2ee Disallow the skip-scan optimization in the absence of sqlite_stat1 data.
FossilOrigin-Name: e0c6b8bdb76fcd4f08c89ff20dce6a33ef3c11752e1e919fec5c4e7d423c4b93
2020-02-13 14:51:54 +00:00
drh
0ba3621592 Omit O_NOFOLLOW from the open() call when opening /dev/null, since /dev/null
is a symlink on Solaris, we are told.

FossilOrigin-Name: 0c683c43a62fe25c6cb765e4a31556ec91a7c21af79349b3d7eeb13f73dd1cdc
2020-02-13 13:45:04 +00:00
drh
77c9b3ccb3 Fix an incorrect assert() statement that was added yesterday.
Tickets [41c1456a6e61c0e7] and [fb8c538a8f57ae2a].

FossilOrigin-Name: abfb043ebb0c55fdc2be58255bc852b13865d81fa4c2e0dbe8c375810557aafe
2020-02-13 11:46:47 +00:00
drh
efdba1a8b3 Increase the default upper bound on the number of parameters in a single
SQL statement to 32766 (from 999).

FossilOrigin-Name: 2def75693a8ae002375aff80db0e6c970c75f75e8b6ba64f2c518712badb0ae8
2020-02-12 20:50:20 +00:00
dan
41aa442cf4 When determining whether an == or IS constraint in a WHERE clause makes an ORDER BY term redundant, consider the collation sequence used by the == or IS comparison, not the collation sequence of the comparison expression itself. Possible fix for [fb8c538a8f].
FossilOrigin-Name: 16aed5d0c63dcdc2054dbb8a4b6b992476640433bf81e19301e6db5a3fc82633
2020-02-12 11:57:35 +00:00
drh
df9b5cab93 Mark the sha1() extension function as SQLITE_DETERMINISTIC.
FossilOrigin-Name: 7d8dcfb95cea732e7588e7505bf80a171dd2e371b164c9435c6ac286060df6df
2020-02-10 19:24:49 +00:00
drh
b6664744c0 Fix the build for when SQLITE_VDBE_COVERAGE is used.
FossilOrigin-Name: 084381649edf374ccc5664f136055109a31d4c3a19c4ae2ee5275f630507a2a3
2020-02-10 13:29:10 +00:00
drh
dc4f6fc099 During byte-code generation, strive to avoid jumps that merely jump to the
following instruction.

FossilOrigin-Name: bcf876e67e75f6709f2b25683a3952bbbb87c672bb9d7af456feebc0ab9f6c31
2020-02-07 19:44:13 +00:00
drh
b48c0d59fa Simplify the code by removing the unsupported and undocumented
SQLITE_HAS_CODEC compile-time option

FossilOrigin-Name: 5a877221ce90e7523059353a68650c5fdd28ed032807afc2f10afbfbf864bdfe
2020-02-07 01:12:53 +00:00
drh
c84ad31851 There is no need to keep track of the number of changed rows or of the
last-insert-rowid while running VACUUM.

FossilOrigin-Name: a8a7c05b16f6c73ac55c359fbf62cae4a76eb0d105a3c53e9f47cede9fd85916
2020-02-06 20:46:08 +00:00
drh
0de19cac43 Unroll the comparison loop inside keywordCode() for to avoid unnecessary
comparisions and thus help that routine run faster.

FossilOrigin-Name: cec5f920f5c2a963f88329a08a443fc04be2dd6f7f2d840be63c0ab1de898f0a
2020-02-06 15:38:43 +00:00
drh
c879c4eac0 Separate OP_IdxInsert and OP_SorterInsert into completely separate opcodes,
helping each one to run a little faster.

FossilOrigin-Name: 447d71f0867a11f789eba164ea77470b3ae4953927556304b0861cf690250776
2020-02-06 13:57:08 +00:00
drh
5bdad79f01 Remove dead code from the sqlite3_filename_database() function.
FossilOrigin-Name: 1b6185550f2bcfa11513898984f1fc2029e0356e9acdc786c5c4a8006b1da2ba
2020-02-06 13:09:56 +00:00
dan
fcbc673752 Fix some fts3 problems found by usan.
FossilOrigin-Name: fb7ccf61bed8d862986eda7096bec3df5947f1d1c88f27e7d9c8acf420f40c50
2020-02-06 10:55:10 +00:00
drh
2a74006087 Small size reduction and performance improvement in the
sqlite3VdbeMemFromBtree() interface used to pull content out of the b-tree
and into an sqlite3_value object.

FossilOrigin-Name: ae6dd8d3e921670ee6450453b54245dd71bcfff3fd1bc7fdb7cf4cf9585c3375
2020-02-05 18:28:17 +00:00
dan
3cdc820544 Enable more detailed log messages in SQLITE_ENABLE_CORRUPT_PGNO builds if database corruption is encountered.
FossilOrigin-Name: 57c36a293e16bb4d9652874124ee1447bef278e08664bc8dd0070a0ee2ef1173
2020-02-04 20:01:44 +00:00
drh
92a27f7bf2 Extend the OP_Copy-coalesce optimization fix of check-in [b36126c1889e323c]
so that it is also correctly disabled by the CASE operator.
Ticket [9d3666754ac37d5a].

FossilOrigin-Name: 29a969d6b1709b80d9cb88b60971e4eb021f7f5f8ee9a619be74b833a78a35ef
2020-02-04 01:41:44 +00:00
drh
40d1db8d20 Fix a problem with the byte-code decompiler that was inserted by the
enhancements at [4248980a356f659b]

FossilOrigin-Name: af63e95dcdd6e9741cdddc3698e857e3b8be40048d3036f939f3583e517c4eff
2020-02-04 00:55:27 +00:00
drh
51f37b2bb8 Cosmetic change to the xfer-optimization to put the OP_RowData opcode closer
to the corresponding OP_Insert opcode.  This makes it slightly easier to read
and understand the code.

FossilOrigin-Name: 0ea2dbfc9088561d62c3456803cb08d357e4e60f1d21f6ed37315564be4957d3
2020-02-03 19:56:51 +00:00
drh
081ce2042c Increase the version number to 3.32.0.
FossilOrigin-Name: 8130bbb4217bd4a4db1f6bf97115a60bee8b29943bed0c7bdf54bba5edbed8fc
2020-02-03 12:25:18 +00:00
drh
9dce0ef4ca On an INSERT or UPDATE, perform affinity conversions on new data prior to
running CHECK constraints.  Ticket [86ba67afafded936].

FossilOrigin-Name: 1d4f86201dab9a22df9ef8175a7ebf3640e97cdb23a06fb454b4c69bfda3a9af
2020-02-01 21:03:27 +00:00
drh
d7b10d74e1 Fix the comment display for the OP_Function opcode. And at the same time,
improve the comment generating logic to make use of the newer
sqlite3_str_appendf() interface.

FossilOrigin-Name: 4248980a356f659b10b12c778592996d53c91fae4ea50c8566678da176bdd152
2020-02-01 17:38:24 +00:00
drh
745befd13f Merge the sqlite3CodecQueryParameters() fix into trunk.
FossilOrigin-Name: a812f533693a3605f297199ae0320d663e872208675e86860c5c1803943943aa
2020-02-01 14:20:35 +00:00
drh
1eac966076 Fix a problem in sqlite3CodecQueryParameters() that was introduced by the
query parameter encoding changes for the 3.31.1 release.

FossilOrigin-Name: cc65ca541265bd7061ed8f5ec9a54f3c384c41019c5ea1c68dcaabeff3495839
2020-02-01 13:30:39 +00:00
drh
7aedd5d70b Fix a minor typo in a comment in the btreeinfo extension.
FossilOrigin-Name: b5a66d10f4bbaf10def7b50b9ed98b05b41bb2c2af5ab9a90f6cda61169ab123
2020-01-31 14:52:19 +00:00
dan
d03f77ae46 Fix a problem with the processing of IN(...) constraints handled by virtual table implementations that do not set the "omit" flag when the virtual table column contains at least one NULL value.
FossilOrigin-Name: dcb4838757ca49cf149a6e883b3eb0ac8a075147387a078280dfabe39b1a3e8d
2020-01-29 15:03:01 +00:00
dan
759e9cc064 Add a test case for commit [ffd8bb93].
FossilOrigin-Name: bcd5b37b8ebd67537f60c0061fcbc70b2aebebb88d6fb842ccf321a3e20c122c
2020-01-29 13:56:35 +00:00
drh
48118e4060 Remove a NEVER() that is in fact reachable. Test cases in dbsqlfuzz and TH3.
FossilOrigin-Name: ffd8bb9351fbd8c1285491d4e10734f6816689de6042d640c178a5ecda75a5ef
2020-01-29 13:50:11 +00:00
drh
ffd3fd0c30 Add new memory barriers during initialization.
FossilOrigin-Name: a9b2adc5d61790abd86839d12e7ecb98a85d7e4cde5f94558530e32449d9e483
2020-01-29 13:10:50 +00:00
drh
9ca9a53a42 Modify a couple of FTS test cases so that they work on big-endian platforms.
FossilOrigin-Name: b20503aaf5b6595afafee6aa2bc6276354a62b0f583f6d94e31fedfdfc130347
2020-01-29 12:37:59 +00:00
drh
02a95eb9bb Faster decoding of 32-bit variable-length integers in cases were we do not
need to know the number of bytes in the encoding.

FossilOrigin-Name: 59a31b16b54a0068c81ee65bc2fa905c2c826e98da3a7ffd8c3ea860a2827b4a
2020-01-28 20:27:42 +00:00
drh
925ab5c17e Small performance improvement to the key-comparision routine for strings.
FossilOrigin-Name: 41454499a2b63c5fe6fae2d2085773a5f7d869250dcbe669929d20c961211f70
2020-01-28 20:09:39 +00:00
drh
fbfd113365 Reinstate the optimization of converting "a IN (C)" into "a=C" but only
if C is a constant.  If the RHS is a table column, the complications of
managing affinity and collations become too involved to mess with.

FossilOrigin-Name: 8ac26a23d7f0ef29c5eb007c7467181f8b96102c8600ea8a5b15cc7584af27bd
2020-01-28 18:09:53 +00:00
dan
4b2f45be34 Fix a 4 byte OOB read in test_multiplex.c.
FossilOrigin-Name: 912148913c11d98e48119a2c1fa7a0e52f318af36e7e2491d968ffde286c949f
2020-01-28 16:55:32 +00:00
drh
b9f2e5f777 Minor change for compatibility with the s390 architecture.
FossilOrigin-Name: 04885763c4cd00cbca26d048f2b19316bfc93e8edebeceaa171ebfc6c563d53e
2020-01-28 15:02:23 +00:00
drh
562fd18b9d Version 3.31.1
FossilOrigin-Name: 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837bb4d6
2020-01-27 19:55:54 +00:00
drh
f54f105446 Update the version number to 3.31.1.
FossilOrigin-Name: 6fb9a8fb85486a8fccc462856316ef523450c23a7a7a81c8dfb323fbe809f8f5
2020-01-27 17:09:02 +00:00
drh
532b0d23fd Revise the layout of filenames in the Pager object so that it is unchanged
from prior versions.  It turns out that some important 3rd-party software
does questionable pointer manipulations on those filenames that depend on
that legacy layout.  Technical this is a misuse of SQLite by the 3rd-party
software, but we want to avoid unnecessary breakage.

FossilOrigin-Name: 34ab760689fd493eda482e856047708d74e769a01cc90b69da456d79ffe39aea
2020-01-27 14:40:44 +00:00
drh
9a3bdeba3e Fix typos in the sqlite3ext.h header file that prevent some newer APIs from
being accessed from loadable extensions.

FossilOrigin-Name: 14331989fcaf6591336290ed1548e9c90f0f153e27f456f4c30c966f9c23aa6e
2020-01-23 15:00:18 +00:00
mistachkin
8122c6e9be Fix variable declaration issue seen with MSVC.
FossilOrigin-Name: 8a6fe3066cf0599fcf2960e8fb3ae39e4e7a61ec81e8ec71d0b5910aee2c16f6
2020-01-23 00:08:25 +00:00
drh
78b5220328 Fix a NEVER() macro that can be true if compiled with
SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION.
Ticket [b985f0bd1636d9bc]

FossilOrigin-Name: 9f0f5d593a383ec2bebb6513ad566813f5b3dc6f052c61bcd76e8ac557bbb062
2020-01-22 23:08:19 +00:00
drh
1a3220ace6 Version 3.31.0
FossilOrigin-Name: f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86d824
2020-01-22 18:38:59 +00:00