Commit Graph

7925 Commits

Author SHA1 Message Date
drh c37577bb2d When rewriting a query for window functions, if the rewrite changes the
depth of TK_AGG_FUNCTION nodes, be sure to adjust the Expr.op2 field
appropriately.  Fix for ticket [7a5279a25c57adf1]

FossilOrigin-Name: ad7bb70af9bb68d192137188bb2528f1e9e43ad164c925174ca1dafc9e1f5339
2020-05-24 03:38:37 +00:00
drh dd6c33d372 Limit the "precision" of floating-point to text conversions in the printf()
function to 100,000,000.  Fix for ticket [23439ea582241138].

FossilOrigin-Name: d08d3405878d394e08e5d3af281246edfbd81ca74cc8d16458808591512fb93d
2020-05-23 19:58:07 +00:00
drh 4f1315a432 Back out the change from [7fab1393c2b22b1f] that tries to convert invalid
surrogate characters in UTF16 into the replacement character 0xfffd, as we
find that this breaks some software.

FossilOrigin-Name: 4218c7b71fb6b227dbe4b852718584c150164af2d84e067cb810aa602554a609
2020-05-20 15:02:04 +00:00
dan becd68ba0d Fix a use-after-free bug in the fts3 snippet() function.
FossilOrigin-Name: 0d69f76f0865f9626078bee087a22fb826407279e78cf9d5382e1c985c9f64a9
2020-05-16 17:26:58 +00:00
drh bbf6d4328e Adjust some requirement marks. No changes to code.
FossilOrigin-Name: 7285ae2ce8fb1439e1acea2ec321abbc76aab0a2e84b58683fddb0a7bf74fb1b
2020-05-15 15:03:51 +00:00
dan 2629adc7b2 Update test file e_fkey.test to account for the fact that new columns with REFERENCE clauses and non-NULL default values may now be added using ALTER TABLE if the table is empty.
FossilOrigin-Name: 4087fce97252beda2456164afe9508f952fc9fe4be68ad0e9b330569a78e42f2
2020-05-15 13:52:33 +00:00
dan a796de8300 Test script changes to account for the fact that the "p5" column in the EXPLAIN output is now an integer, not a text values containing a 2-digit hex value.
FossilOrigin-Name: 102126d80872fdb7469233611cab28100c8455aab4ce25702b83398394559185
2020-05-15 11:26:31 +00:00
mistachkin a8e41ecaca Enhancements to long-path support in the Win32 VFS.
FossilOrigin-Name: 0119d96decd344ae711388ac8475b92464a6d018ecf73862170f137410036dac
2020-05-15 01:18:07 +00:00
drh 043c8f60a8 Move some new test cases from fts3snippet.test into fts3snippet2.test.
FossilOrigin-Name: fa203999944133941a38e5c858f1f66fc1ef4d2f33222ab81cbf4e3fc1539f1c
2020-05-15 01:13:46 +00:00
drh 856408abf4 Add the SQLITE_ENABLE_FTS3_PARENTHESIS option to fuzzcheck. Add a new
test case that uses that option.

FossilOrigin-Name: c49a33db954f1a3fbc1889bbe9f3f3fdb8fb00e31aafb91cd6f5d1602db5c2b9
2020-05-15 01:02:00 +00:00
drh 219b8e7e75 Fix a null pointer deference that can occur on a strange matchinfo()
query.

FossilOrigin-Name: a4dd148928ea65bd4e1654dfacc3d8057d1f85b8c9939416991d50722e5a720e
2020-05-14 23:59:24 +00:00
drh 3c0e606bba Implement the IIF(x,y,z) SQL function that is short-hand for
"CASE WHEN x THEN y ELSE z END".  For compatibility with SQL Server.

FossilOrigin-Name: fce173cd211b15867369b6a54fad48168352fc83981a722ce98e57299b88608a
2020-05-13 18:03:34 +00:00
drh 2493dcdd07 New test case in test/fuzzdata8.db.
FossilOrigin-Name: fa11230135610f01c56d6f436f30a8b57a50b430fe7397ea3a0b6642986b3a39
2020-05-11 11:11:25 +00:00
dan efa78884a8 Fix a problem handling constant integer expressions with collation sequences in PARTITION BY clauses.
FossilOrigin-Name: 155e6649efe8614718be7ac6c3cccf5b073ae57496dc220db5e4313621f5188e
2020-05-11 10:55:24 +00:00
drh 9e5fdc41c1 Release some restrictions on columns added by ALTER TABLE so that they
only apply if the table contains one or more rows.

FossilOrigin-Name: 3a16c0ce4d8851f79f670d94786032c8007619154ece44647dc9cc5b1f9654ff
2020-05-08 19:02:21 +00:00
drh 98aa1d735e Fix the count-optimization so that it honors the NOT INDEXED clause.
FossilOrigin-Name: 0d23a0b209900f4d7c6c13f75d4364f19afc23db72f9cfdb11e05b81502e8040
2020-05-08 18:22:00 +00:00
drh 91d4c374e2 New test cases added to test/fuzzdata8.db.
FossilOrigin-Name: 3fce9711a47329811cd333ae2f1d1384a96d73b9a5d6f9d08454a57a3fd24fc8
2020-05-08 15:28:07 +00:00
dan 2d3ed22a3f Fix a failing assert() in fts3 triggered by a corrupt database.
FossilOrigin-Name: cb299a090c81cdc5c116c4e15ab38fce112916f8b0fad0c7f2ab127e79238a94
2020-05-07 19:55:40 +00:00
dan 11a8182e5c Fix an error that could occur if the first transaction executed by a connection configured to use blocking locks is a write-transaction for which the WRITER lock cannot be obtained.
FossilOrigin-Name: 49e4dc72f7a4b28e4b49d7b91030bc986aea3ff44dac38cb6e68305800cd1de5
2020-05-07 14:26:40 +00:00
dan a8aae52391 Avoid leaking a file-handle in test file walsetlk.test.
FossilOrigin-Name: 3cfc675e2e917b69108feb3a75728b573abe8e44f0890a7d20d307b0b6784c0e
2020-05-06 21:25:39 +00:00
dan 7bb8b8a4f7 Add error code SQLITE_BUSY_TIMEOUT, used internally by the OS layer to indicate that a call to xShmLock() has failed due to timeout of a blocking lock.
FossilOrigin-Name: f3ef9c7c2b4ba3de1057ad569f068b241d5f23e6629d8e0dacf85e57fd13b8aa
2020-05-06 20:27:18 +00:00
dan fc87ab8c4a Fix compiler warnings in non-SQLITE_ENABLE_SETLK_TIMEOUT builds.
FossilOrigin-Name: 22de99ef410ba2a540871f3e61157d8dc4b969416f14808aeca73971b17fcd51
2020-05-06 19:22:59 +00:00
dan d0e6d13301 Add tests for running recovery when opening a write transaction or performing a checkpoint with blocking locks enabled. Fix some failing assert() statements.
FossilOrigin-Name: d096ea3fe20f8af90f9e3f798fd0a69527b32ac8e208ade58b9d0af0e831f41b
2020-05-06 17:18:57 +00:00
dan 58021b237a Unless upgrading an existing read transaction, have ENABLE_SETLK_TIMEOUT builds attempt to use a blocking lock when opening a write transaction on a wal mode database.
FossilOrigin-Name: d6f819a9e6b35f3fd558bd93255a6a24ad690a0fa15a82b009ca9c641db983c6
2020-05-05 20:30:07 +00:00
drh 51f1c6f3ec Merge recent enhancements from trunk.
FossilOrigin-Name: 96dfc71ea599702ef38b60952d03e95dce5a8c534cd943e076e9c76b00e61e65
2020-05-01 18:58:21 +00:00
dan 07f9e8f4f3 Ensure affinity is not discarded from a view column if the view appears on the rhs of a LEFT JOIN. Fix for [45f4bf4e].
FossilOrigin-Name: ac31edd3eeafcef46164a4506bbc32c711bb7cd78378aeaa4c9bb12524ac5ea1
2020-04-25 15:01:53 +00:00
drh 742efb6749 New test case for ticket [1dcb4d44964846ad].
FossilOrigin-Name: 9e9f1e96c9aac60fcbbcda6923e01e350ca4dd88acefb9d400979419ba4e1e4d
2020-04-24 17:55:52 +00:00
dan fc7f31742d Fix an integer overflow in fts3 causing a usan error.
FossilOrigin-Name: e256f85289a78e629acdf83e5bf1f8df2a0ffb3d559738eb9e49db6c228dc8c0
2020-04-22 11:11:17 +00:00
drh 541ef2c36c Enhance the ".filectrl" command in the CLI to support the --schema option.
FossilOrigin-Name: 698d40db58b76f4094687d46b5c6292702a62168054f9e6a70ee86650a6635f7
2020-04-20 16:21:30 +00:00
dan 7576a68c8c Improve corruption detection in fts3 shadow tables earlier in order to prevent an assert() from failing.
FossilOrigin-Name: a9ec8c8f80a59badabb0afdb4189f0fd2934f936530d4151de395b3a7e7c1f1f
2020-04-16 11:35:27 +00:00
drh 75b5f22c01 Merge recent trunk enhancements into the bytecode-function branch.
FossilOrigin-Name: 7e6576ec00fde277c5c7abac264f7ec7e531de00c4e112bf733a07fe703fadcc
2020-04-09 15:07:22 +00:00
drh 4b3282d8a0 Limit LIKE/GLOB pattern length to 100 bytes (default is 50K) when running
dbsql cases in the fuzzcheck utility.

FossilOrigin-Name: 10306118e8591e727af477a1a15d136852d21170e645bd0e75f7c88346b037d7
2020-04-07 15:07:11 +00:00
drh aa0696ee9a Add the --spinner option to the fuzzcheck test program.
FossilOrigin-Name: b1eae2686f03a6e20a49ca2b3a654b3019506d4941708ee3919c339cd093a57d
2020-04-07 13:08:56 +00:00
drh 47f8ef32a0 Remove a NEVER() that could be true in sqlite3MatchEName().
FossilOrigin-Name: 921448f0e24a3753374b32be9d7bf36a9ca5d8522eff9f0b51dc243f08652419
2020-04-04 11:58:22 +00:00
drh 2e52a9c611 In the push-down optimization, do not substitute columns that have previously
been identified as being constant by the propagate-constants optimization.
Fix for ticket [51166be0159fd2ce]

FossilOrigin-Name: 70c44811d12f540d4ec1c29dedbe999cf79b82e326a8712ae2fa0725d6bd8a65
2020-04-04 00:15:54 +00:00
dan c59b4acf5d Avoid factoring out constant expressions on the LHS of an IN(...) operator, as the IN(...) operation may affect the affinity of these values.
FossilOrigin-Name: 98d56b4a34fddcbaecd953a045ae0270b4d78c1edf34cc73522fb4e12743af80
2020-04-03 19:37:14 +00:00
drh a96a69b7db Add a test case to fuzzdata8.db for the recent Henry Liu bugs.
FossilOrigin-Name: 42b02454b146ca1b04c0a5321465326435fc5b995f5498d3b1cf69c558a20f95
2020-04-03 16:11:32 +00:00
drh eb110d9687 Merge updates from trunk.
FossilOrigin-Name: 348c40136c8ec20f36ccdd4c8a6d4ec2d8274328b86b25b385813e3aae31ea8b
2020-04-03 15:48:05 +00:00
drh c415d91007 In the event of a semantic error in an aggregate query, early-out the
resetAccumulator() function to prevent problems due to incomplete or
incorrect initialization of the AggInfo object.
Fix for ticket [af4556bb5c285c08].

FossilOrigin-Name: 4a302b42c7bf5e11ddb5522ca999f74aba397d3a7eb91b1844bb02852f772441
2020-04-03 13:19:03 +00:00
dan 4db7ab53f9 Do not suppress errors when resolving references in an ORDER BY clause belonging to a compound SELECT within a view or trigger within ALTER TABLE. Fix for ticket [a10a14e9b4ba2].
FossilOrigin-Name: 684293882c302600e112cf52553c19d84fdb31663d96e5dd7f8ac17dda00a026
2020-04-03 11:52:59 +00:00
dan fb99e388ec Fix a case when a pointer might be used after being freed in the ALTER TABLE code. Fix for [4722bdab08cb1].
FossilOrigin-Name: d09f8c3621d5f7f8c6d99d7d82bcaa8421855b3f470bea2b26c858106382b906
2020-04-03 11:20:40 +00:00
drh c5eeacd58b Merge updates from trunk.
FossilOrigin-Name: d7db09101878102e192ee7a81437e8f6f2e317ddf110852673a2e81d1f80ae0e
2020-03-26 15:28:46 +00:00
drh 8e9297fb79 Enhance the ".dump" command in the CLI so that it accepts multiple LIKE
pattern arguments and shows the union of all matching tables.

FossilOrigin-Name: 45fba3d7055f90f67005ca740687f060a2311db40c8f6a161bfea0424e6ebf6d
2020-03-25 12:50:13 +00:00
drh cb49f5468e Further simplification and modularization of the EXPLAIN logic.
FossilOrigin-Name: aee1c12f4227cea9e8c6295cee3ec11797422c31b48c9468f176eb52f8261fe8
2020-03-23 19:14:11 +00:00
dan 00bd55e1ae Allow "main" to be used to refer to the main database even after SQLITE_DBCONFIG_MAINDBNAME has been used to assign another alias.
FossilOrigin-Name: 75c85ca32f9ae4a28fd8f8ff2f7639599413d22af706e9799a0e76cc560d14eb
2020-03-20 20:54:28 +00:00
dan ec8e689a20 Avoid an undefined integer overflow in fts3 by detecting data structure corruption earlier.
FossilOrigin-Name: 86e98ddc19470410ccc6d2cf4ad56ef0bc5a23b7fbe6331b8cae374689f54529
2020-03-20 20:18:49 +00:00
drh 589c787620 Chagnes the ESCAPE clause on the LIKE operator to overwrite wildcard
characters, in order ot match the behavior of PosgreSQL.

FossilOrigin-Name: 11e0844f71e8f2d27ce9363fb505e02fd7795c61dae0b3886cf0d8df4484dd97
2020-03-19 18:13:28 +00:00
drh f0a2172d1d Fix an integer overflow problem with the dbstat virtual table that comes up
when trying to analyze a corrupt database.

FossilOrigin-Name: 1d64f4a8af81fe1235fffa54884d8f842a48ff6a33d6172f0cd65bf42fe8b2a1
2020-03-19 17:27:52 +00:00
dan 553948e514 Fix handling of window functions in aggregate queries that have no GROUP BY clause. Also remove a faulty assert causing the error reported in [618156e3].
FossilOrigin-Name: 38e3dd389d142e520c71139ec84aa3c7722992af28a5f93a7f16e0ea176b74bb
2020-03-16 18:52:53 +00:00
drh 14c98a4f40 At the end of the right-hand table loop of a LEFT JOIN that uses an IN
operator in the ON clause, put the OP_IfNoHope operator after the
OP_IfNotOpen operator, not before, to avoid a (harmless) uninitialized
register reference.  Ticket [82b588d342d515d1]

FossilOrigin-Name: 8b437b47266ec2d80d85eafcfdd6949556d6c28d9d67d5f43d89799f0f5b7bd0
2020-03-16 03:07:53 +00:00