Commit Graph

24457 Commits

Author SHA1 Message Date
dan
8e658f0a13 Avoid having fts3 read uninitialized values when processing deferred tokens.
FossilOrigin-Name: 98729c5fa6c4c418ca9779c35e6874c930e5cee5a90b5eb32b284a0f3762269e
2022-08-05 17:16:00 +00:00
mistachkin
e2848932a5 Fix harmless compiler warning seen with MSVC.
FossilOrigin-Name: e36217f2536d89f7a15a879fe3ead32307909c71ced42e1ae7b35f43d4744a80
2022-08-05 05:30:07 +00:00
drh
bffd5c1ece Fix a problem with the query optimizer for LIMIT/OFFSET queries when
underlying query is a UNION ALL and both arms of the UNION ALL are
subqueries with an ORDER BY clause.  This bug was reported at
[forum:/forumpost/6b5e9188f0657616|forum post 6b5e9188f0657616].  The
problem was introduced in 2015 (SQLite version 3.9.0) by check-in
[4b631364354068af].  See also ticket [b65cb2c8d91f6685].

FossilOrigin-Name: 6c806f64bbc9e98891bad0868575ee2ec5d0951ceb0c71d3ed417b45d5f27561
2022-08-04 17:15:00 +00:00
drh
e24a6f58ae Fix a typo on a comment used to generate bytecode documentation.
FossilOrigin-Name: 64348d0b665f61c3a89f51341f23ca87f939dd9e306dc58c2004e46ab04e696e
2022-08-04 14:02:35 +00:00
drh
3cf46ee508 Performance optimization to the math opcodes of the bytecode engine.
FossilOrigin-Name: 597347d9c39f6ed068ac942a8c9853b1b745fce1eb5e9dd30f6c1cb312b36f53
2022-08-03 19:53:54 +00:00
drh
403f00219b Small performance increase on the binding interfaces.
FossilOrigin-Name: aab24c37fb444804fb91177b4b522909ef1bb85383444d97d82a758f919047d2
2022-08-03 19:37:25 +00:00
drh
3a17e2e5cf Improvement on the previous check-in.
FossilOrigin-Name: c1ab0ea2959259cbd29f624bfd5e7366035f2dbcaab72c0bf55723c0919b7a79
2022-08-03 17:26:32 +00:00
drh
b5a6f33e50 For an IN operator used with a RIGHT JOIN, use the number of terms in the
vector, not the number of equality terms, to size the column map.
dbsqlfuzz 14cfdad6ca45e607163f54049ddf5065183dc657.

FossilOrigin-Name: b184c8d9222da6b420b5d7c439bbe4b737d92ffa27f5e933f4e1a9c8117b0ee5
2022-08-03 15:58:44 +00:00
drh
f98109e7cb In the xUpdate method of the GeoPoly virtual table, make sure that the
number of updated columns does not exceed the underlying implementation, even
if the virtual table object records an excess number of column in the nAux
field due to table constraints in the table definition.
Fix for the problem reported by
[forum:/forumpost/a096ab7d96bb057a|forum post a096ab7d96bb057a].

FossilOrigin-Name: a04dd475c2c8afdded0afecfd34c6c4c2f48cce520e09b7fa5172ff30f09209e
2022-08-01 13:14:03 +00:00
drh
3b01dd0f5d Restore a VDBE coverage macro that is mistakenly deleted for
check-in [92ac01d41d46ab73].

FossilOrigin-Name: 01de7ec44fb1e8e6f847eaef433216b3163a44a8789451718e1c419ef840ddfb
2022-07-26 19:10:13 +00:00
dan
b4d7f1eb88 Fix another problem related to aggregate query LEFT JOIN flattening.
FossilOrigin-Name: 8e12c6f59bcb67be4ff131feecc5af68f4bb0afbcced2e2f7e73289aaf95d99d
2022-07-26 18:43:45 +00:00
drh
1dd1303600 Omit a unused variable initialization in order to suppress a harmless compiler
warning.

FossilOrigin-Name: 2d703c5e941cac72efc21d58e1e35c446b338b2927a42f587ab788826fd7f3f1
2022-07-26 15:41:34 +00:00
dan
4784a78d1c Add test cases related to fix [e717e029].
FossilOrigin-Name: 2909f36bfba8f34b818e5d9ecd8c759f05bbe25765089e78bb022de2b77a4f0f
2022-07-26 15:39:32 +00:00
drh
4b1b65ca2e Make sure IF_NULL_ROW expressions receive a separate slot in the sorter used
to implement GROUP BY.

FossilOrigin-Name: 2bda4fca06ab6be5ad02377a7d1fd9fb9586e3181f1052e4b4937958bdd45efe
2022-07-26 15:32:02 +00:00
drh
f4c291275b Improved AggInfo.aCol debugging output, intended to debug a problem with
LEFT JOIN flattening into an aggregate query with GROUP BY.

FossilOrigin-Name: e717e029bde4ee68b6ea77a68721c02ddb6e296f1d310a368137ea3c4164f68c
2022-07-26 14:37:04 +00:00
drh
e6710e83fc Add a OOM term to a single assert() statement.
FossilOrigin-Name: 217fc3ebd423e050508d6af97e0664f301824ef9a997ed2d302c006a41227917
2022-07-26 10:16:25 +00:00
drh
3c8fb6fb84 Performance optimization: avoid unnecessary calls to computeLimitRegisters().
FossilOrigin-Name: f48bd8f85d86fd93329dda7ba57f468854a732b89e4126e9c5beec3495d24b31
2022-07-26 01:20:18 +00:00
drh
fe888bcf11 Fix an assert() that was made out-of-date by [b52393ac28debe98].
FossilOrigin-Name: db8230e80ed894fc2801cdbb53c2cd9de00192d7f4d8328c29cc214e2e0adde9
2022-07-25 23:34:14 +00:00
drh
509a6303d1 Performance optimization by only invoking sqlite3FkCheck() when it is actually
needed.

FossilOrigin-Name: 98b0e830bc7effa3c9cbb77aebe7c128afc3b210af336b7516108d6435705ba0
2022-07-25 23:01:41 +00:00
drh
ef69d2b277 Performance optimization in sqlite3ViewGetColumnNames().
FossilOrigin-Name: 390717e68800af9b71acd635cf6cb123f9a591276df511f11462b42960f9a70c
2022-07-25 22:31:04 +00:00
drh
f89812fe52 Fix a harmless compiler warning.
FossilOrigin-Name: 9aba7417c60b30b44c051580f0f997a4d2fc86bc811b532d175305ad4c181fc6
2022-07-25 22:02:35 +00:00
drh
2d2e528e1f In-line a call to sqlite3ExprCode() in insert.c, for a size reduction and
performance increase.

FossilOrigin-Name: 35066b1446228bf030795e7868509c7b54a5681984ac28bf43123f8fac2e361e
2022-07-25 21:37:13 +00:00
drh
47e2fe3ce7 Performance optimization in computing the Expr.nHeight field.
FossilOrigin-Name: 1798ce97c8763d75315e1716d10f6c5be301042c174f41ee8c1fb8d9db99d52b
2022-07-25 20:21:57 +00:00
drh
058e99502a Small performance increase and size reduction by splitting out the
sqlite3VdbeGetLastOp() from sqlite3VdbeGetOp().

FossilOrigin-Name: 92ac01d41d46ab73e189b1e5596ea63e5edb5b15639c5d7bdb981b95366c069b
2022-07-25 19:05:24 +00:00
drh
6aabb72618 Fix an error in the aggregate query LEFT JOIN flattening optimization from
[2cf373b10c9bc4cb] and further enhance that optimization so that it works
even if there is a GROUP BY clause.

FossilOrigin-Name: b52393ac28debe9867227f901d05cccf54f1b467272474500a549d956a5fb4d7
2022-07-25 16:06:14 +00:00
drh
ee37302095 Allow subqueries on the right-hand side of a LEFT JOIN to be flattened even
if they contain a GROUP BY clause.

FossilOrigin-Name: 816da9a893ae97a21463562479edb419a8b511ae731d86eccee3fa6e3e7dc96e
2022-07-25 15:54:23 +00:00
drh
6b6d6c6bd2 TK_IF_NULL_ROW expressions must be accumulated in the same way as TK_COLUMN
expressions in an aggregate query.  Proposed fix for the problem identifyed by
dbsqlfuzz 8e17857db2c5a9294c975123ac807156a6559f13.

FossilOrigin-Name: 40d08807209638aad728be2cedbc904e342e76c8e486c364bd571b55dd2e1e87
2022-07-25 14:05:11 +00:00
dan
8bd0b250b7 Reduce a timeout in walsetlk.test from 2000ms to 1100ms so that the test runs a bit faster.
FossilOrigin-Name: 836fa097060dadeb2dc5d4ee2e40621c4af606b1ef7241e2264823e23e4ceb1f
2022-07-25 11:04:13 +00:00
drh
7bace9e9bb Simplifications to sqlite3FinishCoding() for a small size reduction and
performance increase.

FossilOrigin-Name: a995614b9aedf4492e6d7b777293770f268837f8246e1678ef0523738c8a8339
2022-07-23 12:51:48 +00:00
drh
3dedb87bd7 Remove a branch that is no longer reachable due to the previous check-in.
FossilOrigin-Name: 8b4d1b9317624f443fe526858bfe3da5281ba83de1828c62935f48b3e7cf2a88
2022-07-23 00:53:48 +00:00
drh
ee6b80c3b5 Use sqlite3ParserAddCleanup() rather than pParse->pConstExpr to implement
sqlite3ExprDeferredDelete().  This is a better solution than check-in 
[c538d07535092722].

FossilOrigin-Name: 2a6f6971fa010219323b976ff53b2606e39fb43fd36c394837c3a8528bf3c425
2022-07-23 00:44:44 +00:00
drh
825fa17b1f Omit the EP_MemToken flag that was made obsolete by [e1f1cfe7f4387b60], for
a size reduction and performance increase.

FossilOrigin-Name: 28934a9d92d5e5ac862a0dc7169f071f39047f98dc79441db697cf353a4b9433
2022-07-22 19:28:04 +00:00
drh
034d111807 In a TK_BLOB Expr node, the Expr.zToken might not be a well-formed
BLOB literal if there has been a prior OOM.
dbsqlfuzz 23871e5805d6c45b392f9b7aa1e8a2b98f3c27cd.

FossilOrigin-Name: c538d075350927222ab0a6598b844f7b15153c5dc008d71b921a2b73c4f4a7a4
2022-07-22 18:25:04 +00:00
drh
d00505dc97 Update the documentation for SQLITE_OPEN_NOFOLLOW to state more clearly that
nothing in the database path is allowed to be a symbolic link.

FossilOrigin-Name: de9222697b2ca8cae2cc7aa9082cca3910038ebbab1e8ee15270b06711711a0b
2022-07-22 14:52:29 +00:00
mistachkin
e50998859d Fix harmless compiler warning seen with MSVC.
FossilOrigin-Name: 648172de20d70532ed0fb9713b76161dd481e09bbd973c03dffb51fb61b731cc
2022-07-21 18:37:50 +00:00
drh
9553016377 Make use of the sqlite3ExprDeferredDelete() interface in the previous
check-in, and in another place where it might be helpful.

FossilOrigin-Name: 22f90e9683d5cd6619ccdb06a02e9dde9f4b7457391c0dbb4c3216c22fc0db47
2022-07-20 20:36:26 +00:00
drh
3245f3be67 Simplify the logic that converts the "1" expression in "ORDER BY 1" into a
copy of the expression that defines the first output column.

FossilOrigin-Name: e1f1cfe7f4387b60443bd31742e2f49db1a2d0443200318a898ba0da216619be
2022-07-20 16:42:40 +00:00
larrybr
a5cc692422 Improve accuracy of julian day milliseconds calculation.
FossilOrigin-Name: e5e9311863544ef30dccd3bd0b3a048a864a650e69cdf9aab13dbe32a4777b51
2022-07-19 21:12:54 +00:00
dan
cf2ad7ae36 Remove a few unsuitable scripts from the "veryquick" test suite. Also have every second testrunner.tcl process favour running test scripts that contain text like "testrunner: slow" before any others.
FossilOrigin-Name: 22d280a5cd395abbedcfffbac3d3b3a614c327be25763ca380c1338a2a7bd33a
2022-07-18 19:32:30 +00:00
drh
2a7b27f1c6 Add the "testrunner" makefile target.
FossilOrigin-Name: 954c6593152f8c7372ed1233b32cce153d0ce4804869cf4ec5504d106a4920a2
2022-07-18 18:13:02 +00:00
drh
077e17b59a Increase the size of loop variables in the printf() implementation to avoid
harmless compiler warnings.

FossilOrigin-Name: aab790a16e1bdff78759f9c9ae87a2559ba82dd34ef3dedfb66035a0db7067a7
2022-07-18 15:02:00 +00:00
drh
449b473ee6 Enhance the REGEXP extension so that it will accept the start-of-input
mark ("^") in the middle of parentheses.
[forum:/forumpost/0d6a9160f81ef1a8|Forum post 0d6a9160f81ef1a8].

FossilOrigin-Name: ed8a8ebd62a319b5dabbdf67ee27141153b9899d7c8f08eeb4bdf35271015c71
2022-07-18 13:55:21 +00:00
drh
18934137dd Fix a problem in the REGEXP extension for the {M,N} construct where M is zero.
See [forum:/forumpost/8694e55a2c29963c|forum post 8694e55a2c29963c] for more
information.

FossilOrigin-Name: af15bb75306a4b94593b8431a34768b3de3d6689293e85ca02db16bf3e9f39e2
2022-07-18 13:10:53 +00:00
drh
67a0bf383f Enhance the ext/misc/regexp.c code so that when it is compiled with
SQLITE_DEBUG, a new function named regexp_bytecode() is available that
prints out the compiled NFA as human-readable text, for debugging purposes.

FossilOrigin-Name: cb5c08978fe8f074e6ae16953575213709e98b8bbae4359e0d2e6de67a7ea9e5
2022-07-18 11:44:16 +00:00
dan
b496eef690 Fixes for the generated "mallocs.tcl" and "leaks.tcl" scripts generated by running tcl tests with the --malloctrace=1 option.
FossilOrigin-Name: 449799e2d5902464540e8fda53ab429e0518278dab3b17c86911759114cddea0
2022-07-16 18:08:48 +00:00
drh
02cb3ff004 In the query planner, restore the former aggressiveness in reordering of
FROM clause terms that existed prior to version 3.39.0 for queries that
contain no RIGHT or FULL JOINs.

FossilOrigin-Name: 92d60b64ebfc2d1f0a9cabaa88e7bf0d11737ed01a77b627af10dd1b96a5321c
2022-07-15 20:39:39 +00:00
dan
40e3fa3035 Fix a memory leak in fts3 that could occur when processing a corrupt database.
FossilOrigin-Name: d74f6f6d5136995b8bf900eb671e4b15ca81e03cc1ab5b7a1aa43dc4f3617760
2022-07-15 15:08:48 +00:00
drh
b3623e0af7 Fix the whereKeyStats() routine (part of STAT4 processing only) so that it
is able to cope with row-value comparisons against the primary key index
of a WITHOUT ROWID table.
[forum:/forumpost/3607259d3c|Forum post 3607259d3c].

FossilOrigin-Name: 0620e419a927a3da6ebe921aaa3471686f0fdc2e485f4c2d5c88f32092228724
2022-07-15 12:16:11 +00:00
dan
b1c034b2f1 Update some faulty assert() statements in fts3.
FossilOrigin-Name: b072851be1a5e49441469dbfa4580e132ebb1d8bc2de98fe1aa67bb9c7cf13a3
2022-07-15 11:34:23 +00:00
dan
de353fb5c2 Ensure all testrunner.tcl processes use the same pending-byte value when
accessing testrunner.db. Otherwise locking doesn't work and the db is corrupted.

FossilOrigin-Name: b65225653e4e5c20cc43f4dfdde6c110f6d14b87bff02a65fd61beabe50ec8db
2022-07-14 21:17:22 +00:00