Commit Graph

8297 Commits

Author SHA1 Message Date
dan
a3944bc4fe Add OOM test case associated with the fix in the previous commit.
FossilOrigin-Name: a631c38d22bc00d38b0f112a623fb24c0e03a962f661ffe0931dad32fd31ba31
2021-02-27 15:32:02 +00:00
dan
15de3ce9ab Fix a segfault that could occur when optimizing a NOT NULL constraint against an IPK column of a sub-query.
FossilOrigin-Name: e4d1970ef17b2330f78c750d71d625c2997f79ed1445d0351ec32b482485a954
2021-02-26 21:39:34 +00:00
dan
8ddf686267 Attempt to optimize "x IS NULL" and "x IS NOT NULL" expressions when x is a column with a NOT NULL constraint.
FossilOrigin-Name: 5ecd842555009ce27ee6390325ac5c2504143474b12b730933f0833b3dad788a
2021-02-26 20:14:32 +00:00
dan
b3617e9d2d Fix test case in altercorrupt.test so that it works with SQLITE_ENABLE_OVERSIZE_CELL_CHECK builds.
FossilOrigin-Name: 062b338ff2ea71633b4fb3c75c6a47b5fc4fe9c2a72daacd987d1eca0bda5217
2021-02-25 18:28:11 +00:00
dan
ce5de60ff9 Ensure that tests like "rbu.test" and "notify2.test" that are only run by specific configurations during release testing are run for both release and debug versions of the tests.
FossilOrigin-Name: 911df43f98297bf645688dc51e988106a0297cb60bb97dde699c2848404fcf72
2021-02-25 15:50:19 +00:00
dan
601ec240a9 Allow WHERE terms to be pushed down into sub-queries that contain window functions, provided that the WHERE term is made up of entirely of constants and copies of expressions found in the PARTITION BY clauses of all window functions in the sub-query.
FossilOrigin-Name: 20689468100aed264877111367b42837ca19e63e717fed2ebd4b20b908f13178
2021-02-23 15:53:22 +00:00
dan
34a224a13b Further tests for the push-down optimization with window functions.
FossilOrigin-Name: 4b089f70117bfb440eaefd830c05576be0cc624d9d6018c869270dc68e44513e
2021-02-23 15:36:06 +00:00
dan
903fdd4834 Allow WHERE terms to be pushed down into sub-queries that contain window functions, provided that the WHERE term is made up of entirely of constants and copies of expressions found in the PARTITION BY clauses of all window functions in the sub-query.
FossilOrigin-Name: dac51f303bba1a0aac7768c688b0c134deb7641062cce2071d546f2d8f241dec
2021-02-22 20:56:13 +00:00
drh
dee1cb3006 Add a few simple test cases for MATERIALIZED and NOT MATERIALIZED.
FossilOrigin-Name: 64878124c160f790bc5861fd799ada03bd7db0c4426b8abc3b7ad1f7aa181168
2021-02-22 19:57:58 +00:00
dan
1e0cfd7184 Fix a case where FTS3/4 could pass a NULL pointer to memcpy() when handling a corrupt db.
FossilOrigin-Name: 68bb541a39833d7d4bf41aa91cb6cd9c98757d1fc8236299d09db7e9b14d8ec9
2021-02-20 19:22:32 +00:00
dan
578277c257 Fix another problem handling corrupt database files in the ALTER TABLE DROP COLUMN code.
FossilOrigin-Name: 9edf2ddc4799c8830c4b7b91d7aacee50029a4b9db329fd4c5674fbedea33034
2021-02-19 18:39:32 +00:00
dan
d97471e1ad Add tests for ALTER TABLE DROP COLUMN commands.
FossilOrigin-Name: 05dbea9b26bdcb096194dc531816333f3784eca50b133fe3efede6ab0d233472
2021-02-19 15:34:16 +00:00
dan
f4a72788a4 Fix a crash that could occur in ALTER TABLE DROP COLUMN if the sqlite_schema table was corrupt.
FossilOrigin-Name: 126ee1ec4f3565c0cccca98885fa3665a641ea3df251511de16eed2a1c396124
2021-02-19 14:13:40 +00:00
drh
239c84fc62 Give a better error message on DROP COLUMN when attempting to drop
the last column of a table.

FossilOrigin-Name: 5e1f362bc3e53c60f9e6f771346d10c6e6a6cb3ff1eec5608101f9c5d6d2a5a4
2021-02-19 09:09:07 +00:00
drh
a7da40f377 Merge changes from trunk into the alter-table-drop-column branch.
FossilOrigin-Name: 9ea640073f8809dfe2612ae1ea384a938b433f884c54d9e5aa3712de79397ac1
2021-02-18 22:47:34 +00:00
dan
678f3b33cc Fix DROP COLUMN so that it works even if the user has registered an authorizer callback.
FossilOrigin-Name: e5f144182bbb3ba10c77151cf63c8bddf86374049fb6866387f85e335df298cb
2021-02-18 20:27:46 +00:00
dan
16953469a6 Fix a problem with schema error detection when processing ALTER TABLE DROP COLUMN commands.
FossilOrigin-Name: 565a6fd0c95b438fea7bf84913b38de1718117e16e0d685534a8650e1dc8421b
2021-02-18 19:25:44 +00:00
dan
30cdb992dd Add test cases for ALTER TABLE DROP COLUMN.
FossilOrigin-Name: 204ee5e28210738fb624a9cf85dc6f9b59de0d7eb4fddd46c8babe9beddd4944
2021-02-18 17:48:36 +00:00
dan
a55a839ab3 Avoid invoking the update or pre-update hooks during VACUUM operations.
FossilOrigin-Name: 3c25cb4ab8885a50e2a485fe76f5ffd5dd8ebe1306aca8c0989e0b7fd7dd18d2
2021-02-18 15:59:37 +00:00
dan
fadc0e34be Ensure that the pre-update hook is invoked for INSERT operations on WITHOUT ROWID tables that use the xfer optimization.
FossilOrigin-Name: 66bbad239b4527ac8ae8b487a0c71d88b1861a8dfe1edc25109600dc447c60c4
2021-02-18 12:18:10 +00:00
dan
c2a878ed0a Fix a problem with OOM error handling in the new code on this branch.
FossilOrigin-Name: ea999c9db59e4193b306a2e1b15fc94f8f04cb05e852bb0d068b7d5243a0849b
2021-02-17 20:46:44 +00:00
dan
6a5a13df97 Fix various issues with the changes on this branch. Add test cases for the same.
FossilOrigin-Name: 10538ec6fc1642dfc2ca6cef06ce6cb9e124847b421ccf01f5842064fad379ab
2021-02-17 20:08:22 +00:00
dan
6e6d9833cc Add experimental implementation of ALTER TABLE DROP COLUMN. Only some cases work so far.
FossilOrigin-Name: f0217937d7306fb595727e61e871e8b03d8c881d339a0865bfd0117d90d42e4e
2021-02-16 20:43:36 +00:00
drh
33941691a5 Fix an issue with the LIKE operator when it includes the "ESCAPE '_'" clause.
Ticket [c0aeea67d58ae0fd].

FossilOrigin-Name: 27d4117980d125975b5e70eeea58a6ab07bcf066e71b5fcb81b822e05afdbab0
2021-02-15 17:02:01 +00:00
dan
f2b32e8915 Add tests for sqlite3_column_count().
FossilOrigin-Name: 7cc65ae57183b3c16f1102fca5603a36acda432e5d45e22a2996e5ebe069fc6a
2021-02-15 14:32:05 +00:00
dan
863fd4905c Fix an error in the test case fix in [ecd71203].
FossilOrigin-Name: 5411bfa41ea9a492ca1f567327d8e0a1b3db047292fec1753bfef8a157cf8c1d
2021-02-15 11:14:53 +00:00
drh
329eaaf0b3 Fix incorrect test name labels in the select1.test script.
FossilOrigin-Name: 179c79ea0deb0f5adaa8d369cfcad06d959a9cc18a8a41e01ef013b2d90acd61
2021-02-13 18:14:15 +00:00
drh
8794c68a35 Avoid manifesting a CTE (or other view) multiple times when it is possible to
reuse the first manifestation.

FossilOrigin-Name: 9692f510803c9b9725abb687d7c10fbc0d5ed784479ec6f3fcc55925a87fe16d
2021-02-13 16:39:24 +00:00
dan
e8f1490f55 Fix a problem in the unreleased union-all flattening code.
FossilOrigin-Name: e4f8a79fd8b3be9bf8add5f5e1c66bc2fe78da4e50ea500ab0b8370d30e31ba5
2021-02-13 14:26:25 +00:00
dan
8b7e93adbc Fix a test case to account for the fact that different versions of OpenBSD behave differently when a program tries to read() from a file-descriptor open on a directory.
FossilOrigin-Name: ecd712032f56a20d7df2bcf89b0d3b8d91dc72c552e27f0a4b23980bd49747b0
2021-02-12 21:22:01 +00:00
dan
23ed8109b6 Ensure RBU tests are run as part of release testing.
FossilOrigin-Name: a18dc08bafefd849e640086b18c41e06361d2e09d7dd2e9af4a394dc543e598b
2021-02-12 11:37:13 +00:00
mistachkin
8c333cfc0d Corrections to the 'filepath_normalize' test suite helper procedure.
FossilOrigin-Name: 32f4d04470bf953b08eea285543f16e03de13d5448c1ebccbba1578ca3b5363e
2021-02-03 19:38:40 +00:00
drh
cd39cda00c Add support for the RETURNING clause following PostgreSQL syntax.
FossilOrigin-Name: 416c898bfb8ff9639ffbaefcfb47fce3782763af1fc67969fa91c5f01a336676
2021-02-03 13:08:09 +00:00
drh
78197e0f8b Fix an assert() that might be off-by-one in the case of a prior
errors in the parse.

FossilOrigin-Name: 06b15b17be38c804dd2641d8616a2a7bd396d2eb9901a0fbf94edd8bd508cf9c
2021-02-03 12:35:51 +00:00
drh
47600083f1 Load enhancements from trunk into the returning branch.
FossilOrigin-Name: b84c7f60c2e1e7debf9f50622087f87d60c6870061d61e14e59cc1ba0775ee92
2021-02-03 00:05:57 +00:00
drh
d33d3a2ba7 Add a few test cases for RETURNING together with UPDATE/DELETE LIMIT.
FossilOrigin-Name: 7611c77d6baa84086ff18cbd045127fd682c6d5c434af5404e34fbe631fedfe1
2021-02-01 21:26:09 +00:00
drh
9e673ace5b Improved corrupt database detection in balance_nonroot().
FossilOrigin-Name: 5d54d9fd406381383afdf10612bfd590afc4142215d9bca09e227e3aa5baa102
2021-02-01 12:39:50 +00:00
drh
ba71a8a01b Test cases added. RETURNING works with UPSERT as does PG.
FossilOrigin-Name: f5698f96e27c9b8669ec6016bb9920ef7580c4146eb61d628a0f62be5135ce94
2021-01-30 01:30:26 +00:00
drh
02d6f9b295 Fix possible division-by-zero in the new log() SQL functions.
Problemm discovered by OSSFuzz.

FossilOrigin-Name: 1ffd321a33b778e87614a26a91a8407ec7b9dec4f0f847b16b1dac4f3b910604
2021-01-29 16:20:16 +00:00
dan
df1b52e727 Ensure a cursor used by the SeekScan operator does not point to a valid row on the first iteration of the loop. Possible fix for [2d6e8400].
FossilOrigin-Name: 390cf60a286b13f454429f4652a133f95a7891a75c1ec6d16cd39990590fd3fb
2021-01-27 17:15:06 +00:00
dan
f380c3f13c Fix a problem caused by using an SQL variable in an OVER clause within a trigger program.
FossilOrigin-Name: 4f676466e60ee2a420b7b2deace76f3a733ce1af278347428285715d9c67f022
2021-01-21 15:40:52 +00:00
mistachkin
f3ebea8114 Update test helper procedure 'get_pwd' to handle the ComSpec environment variable being absent.
FossilOrigin-Name: fe1979552f43e0526f16481457e01981f29707401f77079f9854a8d91b35b5a4
2021-01-18 19:27:56 +00:00
drh
9ffa258a01 Improved handling of vector equalities in the EXISTS-to-IN translator.
FossilOrigin-Name: ef49ee4a3766146963bfb6b013472f9836afb9c5b0d21a8533871cf961139e38
2021-01-16 20:22:11 +00:00
drh
4be8bdccd4 Give the EXISTS-to-IN optimization the ability to handle some cases that
involve vector comparisons, instead of throwing a mysterious error in those
cases.

FossilOrigin-Name: 87e78a19bb3ae1caf57aeeae53a5ab4efdccb57265f25d5c19b62eae53747aff
2021-01-16 18:55:10 +00:00
dan
f7588d4072 Add OOM injection tests for new code on this branch.
FossilOrigin-Name: 9a181dbaedcc2117e670e679ca94ed6d1fabd90c835671dee36424dd0646c4e5
2021-01-15 17:51:56 +00:00
dan
e8f7fcf6f4 Ensure the EXISTS->IN transformation preserves the collation sequence of the comparison operation.
FossilOrigin-Name: a373baae12c914e48fd84de77998e301fdd3da43b06b9d64ac24a14418ed48cd
2021-01-15 15:32:09 +00:00
dan
76cac6ef06 Add simple tests (and a fix) for the change on this branch.
FossilOrigin-Name: 897f3f40267dc922f0fda287484435e1fd8709bade3e87c3829e2f945bb5e4aa
2021-01-15 11:39:46 +00:00
drh
a6e6cf2c8f New CLI command: ".stats vmstep" enables the display of the virtual-machine
step count only, after each command.  Useful for optimization problems.

FossilOrigin-Name: 49dfce469e6a17111b349e53578479daf783064200bf0eec5bf8a91d3553b19f
2021-01-09 19:10:04 +00:00
dan
5cb960b7af Fix problems with some "crashsql" tests.
FossilOrigin-Name: 0c8e2ede5c325aa7fef8e8587057ec8c865fc7cf3e974a2733066fbac640b983
2021-01-07 16:29:34 +00:00
dan
31afee9372 Add extra test for handling of embedded nul characters in the fts4 unicode61 tokenizer.
FossilOrigin-Name: c2c2c7e945f5d5700d91b8e779117e70e388ffc613912a434885ae27f5fe4e22
2021-01-04 18:28:29 +00:00
drh
33e1ec224e Add the "startup" test program designed to measure startup performance,
and in particular schema parsing time.

FossilOrigin-Name: 7b3b31efb0047c5a461f487905cffba2b0ddb1518a6e757ca092eb40e1e2cd49
2021-01-01 15:13:17 +00:00
drh
85d31b9f37 New test case for the HAVING fix of check-in [f62f983b56623f0e].
FossilOrigin-Name: 45f46317ab8bd92dcd346bf00ba3a33b0cfd030b790c04e19ef33cff124d8d7f
2020-12-30 13:20:27 +00:00
drh
c4403ca61a New test cases for cursor renumbering in the UNION ALL query flattener.
FossilOrigin-Name: 270babf259750f3d6c490a08df608a101b24b3c06b9e8a938a0e09a854af6a20
2020-12-30 13:10:57 +00:00
dan
f39168e468 Fix a problem handling sub-queries with both a correlated WHERE clause and a "HAVING 0" clause where the parent query is itself an aggregate.
FossilOrigin-Name: f62f983b56623f0ec34f9a54ce1c21b013a20399162f5ee6ee43b23f10c2ecd5
2020-12-22 16:23:29 +00:00
dan
961a72601b Fix problems with joining UNION ALL sub-queries against other sub-queries that contain LEFT JOIN.
FossilOrigin-Name: d554f710a5abbe64022f47a14ef67227c861a8f0991d85d240434e9a709cf8b8
2020-12-21 19:50:10 +00:00
dan
a3d33ebe4a Fix a problem when flattening joins between a UNION ALL sub-query and another sub-query that uses more than one window function.
FossilOrigin-Name: ef9733fe1c6b31849a5da1037d21915f82e0e4ab42d1a23ead8a121012f1bace
2020-12-21 18:39:58 +00:00
drh
237f41ab8d Add the --timer option to fuzzcheck. Get the --timeout option working in
fuzzcheck when running dbsql tests.

FossilOrigin-Name: 3b0c9b41a877c7344ef3b7c5b6981436005716e25b41b1a1ffc145520243abd3
2020-12-21 12:14:59 +00:00
drh
e69ba68363 Allow UNION ALL sub-queriesto be flattened even if the parent query is a join.
FossilOrigin-Name: df1d6482f9e92dafdca1948e96eef52d8646eef9c356394afabe431d6357dd34
2020-12-19 13:58:06 +00:00
dan
d131b51cbd Fix for the previous fix in the case where a UNION ALL sub-query is joined against some other compound query.
FossilOrigin-Name: 63c5cfb9ae8f4598a523bed2a60c0e69172179952961a573113fcf756c06551d
2020-12-18 18:04:44 +00:00
dan
964fa26e0c When flattening UNION ALL subqueries into a join query, ensure that separate cursor numbers are used for each segment of the newly flattened query.
FossilOrigin-Name: c510377b0b052e400f2ee4f20220b61cdf74ee44b9bb9e6490787c88dd4c55aa
2020-12-18 16:13:39 +00:00
dan
8daf5ae2ed Add test cases and minor fixes to this branch.
FossilOrigin-Name: 5d6dc29d5f81738b07e4fee652fb2343fc409c2545f2f4667e8ee82d1a75f721
2020-12-17 16:48:04 +00:00
dan
13dd0228d3 Fix a problem with sqlite3_expanded_sql() that could occur with statements that use both numbered (e.g. "?1") and unnumbered (i.e. "?") parameters.
FossilOrigin-Name: 2a6cd6833e44dd6a2ac388815f43be6508f6fa6db5e451e964276a6c87e6c5ae
2020-12-17 11:24:26 +00:00
drh
0a8b6a9f8f Enhance the sqlite3BtreeTransferRow() routine so that it does more careful
checks for corrupt database pages.

FossilOrigin-Name: 85952e71175dae73c4e587a3b80783825d91fe8567a819e072da651c1ff4131b
2020-12-16 21:09:45 +00:00
dan
de9ed6293d Allow sub-queries that use UNION ALL to be flattened, even if the parent query is a join. Still some problems on this branch.
FossilOrigin-Name: 00e4bf74d3dfb87666a2266905f7d1a2afc6eb088d22cfd4f38f048733d6b936
2020-12-16 20:00:46 +00:00
dan
7f60706691 Fix another integer overflow triggered by a corrupt database in recently modified vacuum code.
FossilOrigin-Name: 4e2dd2a53364f1fed48b995fd5d2642472585f6da5e4735e9da193ba7ff45514
2020-12-15 19:27:20 +00:00
drh
9f023ce539 Enhance UPSERT so that it allows multiple ON CONFLICT clauses and does
not require a conflict target for DO UPDATE.

FossilOrigin-Name: 6b01a24daab1e5bcb0768ebf994368d941b1dfc217bf6b661211d900331e68cf
2020-12-14 15:39:12 +00:00
drh
250af6e0fb More test cases. No new problems discovered.
FossilOrigin-Name: f34dd67e2d0dfc9e3b5d49148fb0162853119c097cbc3fe961878875ba98d8e3
2020-12-12 00:43:52 +00:00
drh
255c1c159b New test cases with corresponding bug fixes.
FossilOrigin-Name: f22c21a94ca4cad0217f91c1a5a275bc348cb6ba0f3a54c927533bc8d8c96a90
2020-12-12 00:28:15 +00:00
drh
58b18a47df Begin adding test cases. Fix one bug found so far. More are pending.
FossilOrigin-Name: aadd67ddf2a191629b5356395f75e4556aac904a6e2f6b83742fa4f26e4253a4
2020-12-11 19:36:19 +00:00
dan
855aed19e2 Fix an assert() broken by recent changes to vacuum.
FossilOrigin-Name: dd058da85ca54ae70e26cb0bdc75ff42998d4a8b29a5e2dcac44ee0e45776a85
2020-12-11 19:01:24 +00:00
dan
d2ffc9721e Fix minor issues with new code on this branch.
FossilOrigin-Name: f7fa76d0963e7b34026dc20c920bfbf7961033fe2b99503f6857157595f86823
2020-12-10 19:20:15 +00:00
dan
ebbf36878c Avoid loading large intkey rows when VACUUMing, even if the page-size is changing.
FossilOrigin-Name: 0d2c3776065dc94119899ae4164995193b82fca7ac31868f3141b729d0b65ab9
2020-12-09 16:32:11 +00:00
drh
63f8f98a63 Many more math functions. Semantics follows PG wherever possible.
FossilOrigin-Name: 6b93627b5d9819abf179a3e4a82e7afe17cbcafdabbd5f058de9ed114c9d477f
2020-12-07 21:13:06 +00:00
drh
f6e904bd92 Begin adding new SQL functions that depend on -lm: ceil(), ceiling(),
floor(), ln(), log(), and log10() so far.  More to follow.

FossilOrigin-Name: 4db5f2f7875f6df78630a7816fc018141a6eee2e295b44fc7627eb66d07881ea
2020-12-07 17:15:32 +00:00
dan
ee8221859b Fix a test script problem in walvfs.test.
FossilOrigin-Name: 4c5076fbe42cc6447c47bfc202501f945f78bd716cbe8e33599c67b7d0956611
2020-12-04 16:26:25 +00:00
drh
c52a1e9f35 Slightly faster tokenization of non-keyword identifiers.
FossilOrigin-Name: 55fa22bd403cc8f0973efea898a7cfa3a32b57c7e2a7a4c30c3f2c72d5396f07
2020-12-02 00:20:00 +00:00
drh
f461bab265 Add the --lookaside SIZE COUNT command-line option to the dbfuzz2 testing tool.
FossilOrigin-Name: 2466960c0ba02ef9c325e9a5f8603db518e7529547f614c225fef430421e1643
2020-12-01 23:18:13 +00:00
drh
68b4034450 Update a requirement mark in the e_expr.test script.
FossilOrigin-Name: bb174a074b5833181900d396edda955254ea1768750a0ab3b6d714530b1fe13f
2020-11-25 18:44:20 +00:00
drh
f82d78e9c2 Fix the shell1.test test script so that it works on windows.
FossilOrigin-Name: 9bd15b07e58b1811c2a368ec76059ac683a2c35b163ef4bba01ccb8b7ca7288d
2020-11-25 14:50:42 +00:00
drh
b7c46aa8c9 Change the -init option to the command-line shell to honor the -bail option.
Also change it to report an error if the filename mentioned cannot be
opened.

FossilOrigin-Name: a29f54bd2c032374d7235bb1f9d4c04c094611bbc7d274b7b92722b5b802050c
2020-11-25 13:59:47 +00:00
dan
39acaec16c Fix a test script problem causing crash8.test to fail when run with leak-sanitizer.
FossilOrigin-Name: 2c437f7a2c87129d00c71fa569315b68e0ba9514041d93503350c9ae9f080f17
2020-11-23 15:30:16 +00:00
drh
1335ec7df7 Allow "substring()" as an alias for "substr()" for compatibility with other
SQL engines.

FossilOrigin-Name: aa2ee5754c9f8378c4d490ca756a6415042904477727f0d86e9c0190b5e8b275
2020-11-23 14:50:43 +00:00
drh
6fc74a4454 The xFullPathname method of the unix VFS now normalizes the filenames by
omitting surplus "/", "/./" and "/../" strings.

FossilOrigin-Name: c38dec6f52c01614c1bee8356daf0fcd9f708d029116e9bff51e06719a730dde
2020-11-19 21:12:08 +00:00
drh
e5dc4a2097 More test case changes so that shared-cache mode tests all work
with normalized database names.

FossilOrigin-Name: 6f0d5f0949130a4688319adf05d37c5ccd683ca9ad2dacb7ce433a5fe18ac3c3
2020-11-19 21:01:11 +00:00
drh
f4097026ef Fix the tkt3793 test case so that work even when filenames are normalized.
FossilOrigin-Name: e85d32ac6c82d39f5dc9b28f881d5d72f5e5a7e16df12c19315bfa8edea1b0b4
2020-11-19 20:07:24 +00:00
dan
12c9994659 Fix test file busy2.test so that it works with the "inmemory_journal" permutation.
FossilOrigin-Name: b192fdddb63ac56fd6725032af110a069baac52347c0012c130bf34f3cbe69e4
2020-11-17 18:25:48 +00:00
drh
ea847f1b94 Add a single-argument form to the CARRAY table-valued function, with
content bound using the sqlite3_carray_bind() interface that is included
with the extension.

FossilOrigin-Name: 7b229cb1202be203a87b8f47d284313f357deb1e6dfeb94bba7b46744c33512e
2020-11-17 14:41:37 +00:00
drh
7f42dcd901 Enhance the unix VFS so that it removes extra "/", "/./" and "/../" from
the database filename.

FossilOrigin-Name: 7ba89d3e5c68d970ed26c2ec6e6e34bae535c2cc0b22a022d20ac9ff4527b8ab
2020-11-16 18:45:21 +00:00
drh
4e451aad54 Suppress errors associated with TEMP triggers that reference objects in
non-TEMP databases.  This is a continuation of the fix for ticket #3810
shown in check-in [ba1afc040171810d]
from [/timeline?c=trunk:200908061743|2009-08-06], based on a bug report in
[forum:/forumpost/157dc791df|forum post 157dc791df]

FossilOrigin-Name: 991ca9b26bacd8f6b64498057fe28f2068466a220f372fd365b6685f583f0e92
2020-11-05 19:13:44 +00:00
drh
114cb01796 Remove unused variable from speedtest1.c
FossilOrigin-Name: c0a18565e614021b74646de7efd11d3d46894ef9132fb26787ab0269dc6a647c
2020-11-05 14:50:21 +00:00
drh
6d5ab2a1d6 Fix an another OSS-Fuzz discovered assertion fault due to ALTER TABLE and
strange triggers.

FossilOrigin-Name: 6646d7898ca1d2f71ec906d9613fbfc5c59c6cf05f053529e6e32ab826d1cb78
2020-11-02 00:40:05 +00:00
dan
7a39faecc2 Update the ALTER TABLE command to correctly handle UPDATE ... FROM statements within trigger programs.
FossilOrigin-Name: 3e6af890406b58da1c4aebec4d483be7ab0fdb589ef7a4c4e987d6bde18d6b97
2020-10-31 16:33:01 +00:00
drh
ed7974dee5 Always create a statement journal when using the OP_ParseSchema opcode,
as you never know when it might fail.  See the discussion on
[forum:/forumpost/daa2c728cc|forum post daa2c728cc].

FossilOrigin-Name: aa512f72cf5adfece6299db17bd122aeff0cdee2a25f83f60e2ebb05e99c9591
2020-10-26 18:14:12 +00:00
drh
461ff3594b Test case updates.
FossilOrigin-Name: 27c681c9c6672ad7098d8ff2c41e76d3e9e55866b6327ed85e73f63bd623ceed
2020-10-22 18:16:17 +00:00
drh
403869680b Sometimes it makes sense to do a full table scan rather than try to use
an index when most of the rows will be selected.  This branch is trying to
tune the query planner to make that happen more often.

FossilOrigin-Name: 0f42099ad65855c94af8472f3a6fddac7fc2a82e8fdfcc06a298eb6683a28688
2020-10-22 15:47:48 +00:00
drh
672f07c642 Fix the sqlite3_hard_heap_limit() so that it works with sqlite3_realloc64()
in addition to sqlite3_malloc64().  Improvements to OOM processing and
debugging aids in the fuzzcheck utility.

FossilOrigin-Name: 602d7369166d406a26834aa47d71d565a17d377d32e41f308821a50b41f91896
2020-10-20 14:40:53 +00:00
drh
07d7a8dca9 New test cases for recursive CTEs with multiple recursive terms.
FossilOrigin-Name: cd5182bd6f5969ba0812275f471224908296960358013327cebbe0c52b820f04
2020-10-19 01:44:43 +00:00
drh
340558540e Allow multiple recursive terms in the compound SELECT of a recursive CTE.
This facilitates writing a query to find find the connected components of
an undirected graph.

FossilOrigin-Name: 5481fa8c79c34f434e99ab633ff3d0942a309a74fb0cf38e3d3617b51d5d21dd
2020-10-19 01:23:48 +00:00
drh
71cb422055 Minor fixes to the cksumvfs documentation in the header comment of the source
file.  Enhance speedtest1.c so that it can more easily do performance
comparisons of cksumvfs.

FossilOrigin-Name: ed3bb818f58b75c087f2875331ec944397b6c61a5b14d8af4b9ec6f376bd1872
2020-10-15 17:59:38 +00:00
dan
936a30598e Fix ALTER TABLE so that it can run even if the schema contains unknown collation sequences.
FossilOrigin-Name: bc4bb9433fed519386511796cce475d74100b8ed707cdbffd8cbdf683b0faf35
2020-10-12 15:27:50 +00:00
drh
bbb29ecfb4 Add the --nosys option to the .schema command in the CLI.
FossilOrigin-Name: b72ee694532c0c5d2285dd580154546eb592fd6892cad9ad7a49e98737adb974
2020-10-12 14:56:47 +00:00
dan
4d906f1b5a Fix UPDATE FROM statements on virtual tables that are declared WITHOUT ROWID.
FossilOrigin-Name: bcb0bc6a7b7006f07adb7266b1fecca39bf85a0adea6d78a341623a3546f2c2a
2020-10-12 14:29:11 +00:00
dan
a344ad47f3 Do not apply affinities when creating entries for automatic indexes on views. Fix for [95302bdb].
FossilOrigin-Name: df12f097224ebc9473d9e2a8933bd7efed6490d09af2c012c9b59a7892369b7f
2020-10-03 19:16:36 +00:00
drh
9bb612f2c8 Fix a faulty assert() statement. Add new test cases.
FossilOrigin-Name: 80ecdb3da4558bb08ee3ec6edbde906ad5b3b8182e672b5ba0d5dfa8041cee0a
2020-10-02 12:42:51 +00:00
drh
4ad1a1c74c Disable the OP_SeekScan opcode of the in-scan-vs-index optimization when
in PRAGMA reverse_unordered_selects mode, as the OP_SeekScan only works
with forwards scans.  Thanks to OSSFuzz for pointing out the problem to
us.

FossilOrigin-Name: c75c3a3b756635bfdab44e4b56a337e4a88af3a8803cd3e9a67abf3d0d3450dc
2020-10-02 02:02:18 +00:00
drh
395a60dad4 Back out the incorrect optimization of check-in [e51ecadcbdef5ce6] as
ticket [5c4e7aa793943803] reports a case where the optimization does not
work.

FossilOrigin-Name: 7395e96b8cc370c8ac2657fb805915b0992a15d80f8bf256d277b423fec64675
2020-09-30 17:32:22 +00:00
drh
af3711536b In the query flattener when substituting expression Y in place of expression X,
if X is marked has having come from an ON or USING clause of a LEFT JOIN, then
be sure that all subexpressions of Y, not just the root node of Y, are
similarly marked.  Otherwise, if Y is an AND operator, it will be split up
during WHERE clause analysis and the subexpressions will not get the special
treatment needed by LEFT JOIN ON/USING clauses.
Fix for ticket [66e4b0e271c47145].

FossilOrigin-Name: 69f9eb7343a416c5ab426c8e1b9f0ae576544b4ccc5d87f5481c8ff884f696e1
2020-09-30 15:36:03 +00:00
drh
f1ea425560 DISTINCT may not be ignored inside a UNION ALL common table expression.
Fix for ticket [c51489c3b8f919c5]

FossilOrigin-Name: 7d2b590d3abd66a7e6ae9046198eb669e0fd2f223f7691281e9ad795a12b8903
2020-09-17 00:46:09 +00:00
dan
b5a69238b4 Fix a buffer overread found by OSSFuzz that could occur if a WITHOUT ROWID table with many columns was NATURAL JOINed against itself.
FossilOrigin-Name: 3d35fa0be866213274fc09250225b345f6b08a9b4ec373d53d95e627e24512be
2020-09-15 20:48:30 +00:00
dan
78f04753ae Fix a tsan error that could occur when using shared-cache mode.
FossilOrigin-Name: de80bc87300257cc49d98e2d22e914211f213dce912f320c8b37b3883c73923c
2020-09-04 19:10:43 +00:00
dan
2b06b0769e Ensure that the busy-handler count is reset at the end of each sqlite3_file_control() and sqlite3_prepare() (and _v2() and _v3()).
FossilOrigin-Name: 5dd05940617fb05ee2faf212b15afc3a8e9695318eccb76761b37359fea681d1
2020-09-04 17:30:59 +00:00
drh
fa17e134b2 Improvements to the IN-early-out optimization so that it works more
efficiently when there are two or more indexed IN clauses on a single table.

FossilOrigin-Name: 35505c68c1945c35babd2496e02bc4907a15c8e7b8d77f05f230bd0e9d4891d7
2020-09-01 01:52:03 +00:00
drh
92e21ef079 Include the original text of the CHECK constraint in the error message for
anonymous CHECK constraints.

FossilOrigin-Name: 5ce34a955bb36d77edc9951cb7ac2ef9c876d7d3ff5852af682f558e248f428c
2020-08-27 18:36:30 +00:00
drh
359941bd33 Apple the same fix for ticket [9eda2697f5cc1aba] to text-to-integer
conversions that was done for floating point conversions by
check-in [1c76f1d8ec0937a2].

FossilOrigin-Name: aafb7a21041090e529491b0ce30c3902420be0551b1b2c55840a5fbb9105fb7d
2020-08-27 16:28:30 +00:00
dan
ca3ee7e18a Do not attempt to run test script analyze3.test as part of the "prepare" permutation.
FossilOrigin-Name: f7f13cb1bc699c034a3f5f7a2431c8055cb79e2a14d5e70e1fc5dd6dec00fb26
2020-08-27 14:53:47 +00:00
drh
99744fa4ab Add support for the sqlite3_txn_state() interface.
FossilOrigin-Name: ad195e3dd89d0f33b50070c18fb8f43c4eb24162515dfdd7c04d9e7d96b902a2
2020-08-25 19:09:07 +00:00
dan
599456f0ab Correctly handle expressions like "x IS (not) true/false" within the rhs of IN() expressions. Fix for [f3ff1472].
FossilOrigin-Name: 493a25949b9a6d0be82169b597133e491d8be4f4147b6eae135b06c1d810abd3
2020-08-24 10:52:52 +00:00
dan
6c3b4b07d1 Fix a crash that could occur in SQLITE_MAX_EXPR_DEPTH=0 builds when processing SQL containing syntax errors.
FossilOrigin-Name: 5f58dd3a19605b6f49b4364fa29892502eff35f12a7693a8694100e1844711ea
2020-08-20 16:25:26 +00:00
drh
46fe138d98 Do not skip over TK_IF_NULL_ROW operators when bypassing TK_COLLATE operators.
Fix to check-in [ac31edd3eeafcef4] which was itself a fix for ticket
[45f4bf4eb4ffd788].

FossilOrigin-Name: 871f2ddcfbb9196dbd851a350e3471ee6d242d86bbd755201f7e2406fce3ac55
2020-08-19 23:32:06 +00:00
dan
1d42e619ac Update releasetest_data.tcl so that the "Fast-One" configuration runs bigmmap.test as part of release testing.
FossilOrigin-Name: a0aa35aaa5694a96638a7c7b1cd69c7523750cbe95831a13c1ee5a6d48256b76
2020-08-19 15:24:19 +00:00
dan
fce445b8fa Fix a problem in test file bigmmap.test.
FossilOrigin-Name: d8e47382160e98be646ce3ba568578493088d1bb11d513ded3e00b576fb07f06
2020-08-19 15:21:52 +00:00
dan
e0404386f2 Fix an inconsequential memory leak in sqldiff. Update the "Sanitize" case in wapptest.tcl to use -fsanitize=address,undefined, and to run more tests.
FossilOrigin-Name: 613fb5c2525be77e48bad0a74e8b7bf53489365060fb9c7713a0caddb1820c71
2020-08-14 16:14:40 +00:00
dan
96e337df6b Fix "make test" handling of environment variable QUICKTEST_OMIT so that it can be used to exclude test files in other than the main test directory.
FossilOrigin-Name: b050976079ba4a22d4dfeadb81f40cf71da6588c95bf2b634d88b416de5accd7
2020-08-13 17:27:57 +00:00
drh
c08716a317 Fix harmless USAN warnings from gcc9.
FossilOrigin-Name: 72c4c69fea13f5e24df25645e6941ce3ff896f0a3c73cd63329f819cc907ab40
2020-08-11 21:53:42 +00:00
drh
4dfdb86c8d New test cases for the use of the ieee754 and decimal extensions in the CLI.
FossilOrigin-Name: bc1590f32fc4e2696b4126bd0302cb6405031dd4f55b86f3f1611f7f39299f85
2020-08-11 18:17:04 +00:00
dan
91faeec8d0 Modify a test for corruption within the wal checkpoint code to account for the pending-byte page. And for the fact that test configurations might move the pending-byte page.
FossilOrigin-Name: 7dfb74c37e678dde347d9d85846672f82ad282e300e32676330b764be2e4d580
2020-08-11 18:00:10 +00:00
dan
9f567eb9f5 Fix a problem causing test failures in corruptL.test for some permutations.
FossilOrigin-Name: 680bdc6524ad6af0e74401e96e3a576145042fb865c1582bfaffc11d4ff76a4f
2020-08-10 19:35:01 +00:00
dan
ed0af52cb1 Fix another test script problem in walvfs.test.
FossilOrigin-Name: 1b89d3931e368a66be5075bdf49eedd3839591ee268e3ac293040b5bf7639746
2020-08-10 11:21:48 +00:00
dan
80aff0847e Fix minor test script problems.
FossilOrigin-Name: 5d54cd44d076cfede60bd404a59bd700a950420b961ae9fdec4365a3e4ed18ed
2020-08-10 10:43:43 +00:00
dan
07066d90f6 Fix test script busy2.test so that it works with the inmemory-journal permutation.
FossilOrigin-Name: b412d1d175fde9c6402b6fda7c73ac2db2471f2c9416d5c5073549732dea6d98
2020-08-08 20:11:22 +00:00
dan
47d38e2444 Changes to busy2.test, corruptL.test and fkey5.test so that new test cases pass with all test permutations.
FossilOrigin-Name: d62d1711e2b0f18bb4dfb8899299c8e5b4c8205989b719699da60bcfe1884cf3
2020-08-08 20:03:12 +00:00
dan
35a37c2a47 Fix a test script problem causing an error for SQLITE_ENABLE_OVERSIZE_CELL_CHECK builds in corruptL.test.
FossilOrigin-Name: a85520e0074d574cb4ac5239bb225f8f0b0b3ea1d782cd1cbc79797b4c583fb0
2020-08-08 19:52:53 +00:00
drh
d43c0cbed2 Update requirement marks due to wording improvements in the documentation.
FossilOrigin-Name: bf875a1c7fcb2b41a4d3bd741bb358a635b869d0b6fc9d24385cd5779686d78c
2020-08-08 15:40:42 +00:00
dan
26b9540fc2 Fix a file-descriptor leak in test script corruptL.test.
FossilOrigin-Name: ec2c340c39bc78e4bce0eb01ea408c95ba121103cc77f300f29f3001fc345c20
2020-08-07 18:52:03 +00:00
dan
88819d5870 Return an SQLITE_CORRUPT error if the final expected size of the database when checkpointing is not reasonable - where reasonable is defined (basically) as the sum of the sizes of the database and wal files.
FossilOrigin-Name: e2799563c8a97f617c6d932719b312e3d5bff051a9a397492df8d88e8bb4260a
2020-08-07 16:28:02 +00:00
drh
b19493434f Add the --checkpoint option to speedtest1.
FossilOrigin-Name: 4cffa9bb44d6f0bdb23cae913adfb224f0814e65a2abb9120179f0b288e70f77
2020-08-07 14:47:55 +00:00
drh
53218e2e2c Back out a NEVER() that turns out to be reachable.
FossilOrigin-Name: 8cf342d4e5eb67b17aee595d9d75f7798eccaebc1ec88e646d344d8d4ab64977
2020-07-31 23:34:53 +00:00
drh
6528bcdc80 Merge enhancements from trunk.
FossilOrigin-Name: 969c25bb14fbd99ca8523abf0ae78a75a3dde539e3323d105690aef4940041eb
2020-07-28 17:51:48 +00:00
dan
cddfc3922c Fix a couple of test scripts to match the new wal recovery behaviour on this branch.
FossilOrigin-Name: 3af61e83532f76f0f3252a28663415d37b096ddf05a9c58fa79303933c09abce
2020-07-27 15:05:20 +00:00
drh
25a78fdfa2 Merge recent changes from trunk.
FossilOrigin-Name: 22e8e6901a119698de831ede6d8b03c4fd6576eaa8686a97a0b8aeea7593688a
2020-07-24 13:49:38 +00:00
drh
38f0ccc070 Add the OMIT_ZLIB compile-time option to sessionfuzz.c. (Originally
checked into the wrong branch.)

FossilOrigin-Name: 6019bf8a2db548fea4be4f49961937d5b12eba9e42c7c7a58babfaf3288cb0cd
2020-07-23 18:03:14 +00:00
drh
a92eae9751 Merge fixes from trunk.
FossilOrigin-Name: dd39418ee47529cc3ffbe01eccf31f1304a266a196bf81a2a2cb2e650c195b97
2020-07-23 14:27:51 +00:00
dan
9d44327a83 Fix another case where a corrupt record could cause an assert() to fail in fts3.
FossilOrigin-Name: 28515bbbae4fbc260457dea7a0f7414be1837d6db27fec5514f8da358bfc1f0c
2020-07-23 13:45:47 +00:00
drh
ed109c06e1 Merge support for partial integrity checks.
FossilOrigin-Name: b5443b47af95f4f0ef527bee90f186ee25faa5df197dbcc3e14d48eee095e4aa
2020-07-23 09:14:25 +00:00
drh
17d2d592fb Add the ability to do a PRAGMA integrity_check (or quick_check) on a single
table by specifying the table name as the argument.

FossilOrigin-Name: 65dd321432e8f80bc1cb11be8ca06656b41ac997a74a5eb271c797cf0fbb764e
2020-07-23 00:45:06 +00:00
drh
ca439a4967 Disable rootpage bounds checking when the SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS
setting is off, to facilitate reaching obscure error states during testing.

FossilOrigin-Name: d7dd4fc464c791915f646b1ad228697d1fa16f530fc7d0e9aa702c8df3068c65
2020-07-22 21:05:23 +00:00
drh
584e8b7630 All TCL tests now passing.
FossilOrigin-Name: 4c5f3c6cacf84a36d0347790d98d82d1f584cd1537a13a2736348405c4d20367
2020-07-22 17:12:59 +00:00
drh
09cf569292 Fix a corner-case error in the new UPDATE FROM logic helpfully discovered
by OSSFuzz.

FossilOrigin-Name: 5cc200939d3a33566ddb858fc74c878acc72cfe5cf4c9b1d08e7b13e4d5ff566
2020-07-20 18:07:35 +00:00
drh
51da8daf82 Fix test case result on a DELETE with an INDEXED BY clause due to
improvements in the query planner at [d901837fea1ed54d]

FossilOrigin-Name: 020dbfa2aef20e5872cc3e785d99f45903843401292114b5092b9c8aa829b9c3
2020-07-18 18:59:11 +00:00
dan
07ca7d610b Make it an error to repeat the target object/alias of an UPDATE statement in its FROM clause.
FossilOrigin-Name: d90a37e930c66afe95165955ae47efde08f52c8ce16c4fb239da0233335db050
2020-07-17 16:31:37 +00:00
dan
9a23d26cba Modifications to test code so that the sqlite3MemdebugHastype() assert() statements are enabled for Tcl tests.
FossilOrigin-Name: e3c423cb1407c06a3806ae6304e4713c37cd446f4cc399731884e3d009938e57
2020-07-16 14:52:24 +00:00
dan
01b2344b3c Add OOM test for UPDATE...FROM statements inside triggers.
FossilOrigin-Name: 917a479b0d11fb59abf41d0317ffc541eb4b83928df9382b4782953c0035fa3e
2020-07-16 10:48:37 +00:00
dan
e7cf8fdd17 Add tests for UPDATE...FROM and foreign keys.
FossilOrigin-Name: 6c3668f9ed898337e664bec95865f15688a6bba43f095358dda5d08abef2bbaa
2020-07-15 19:38:49 +00:00
dan
576d5a8634 Fix problems that could occur if a table with the same name as the table being updated appeared in the FROM clause of an UPDATE statement.
FossilOrigin-Name: 13224cbd75990615088f3e30ccba05d31b3099fae4300c9ab8f7663bc5f0eb6f
2020-07-15 18:30:01 +00:00
dan
243210b79b Fix a problem in SQLITE_ENABLE_HIDDEN_COLUMN builds occuring when an UPDATE...FROM fired an INSTEAD OF trigger.
FossilOrigin-Name: 5176cb7a6a4e8cfa1973aaae46fcd7d39baedb70ae20bfacc82d62ca39fb0aa3
2020-07-15 15:32:59 +00:00
dan
42d7a77b61 Update this branch with changes from trunk.
FossilOrigin-Name: 53b8b507a10364f5d580655d89c950a5f14c2a8114625fd8749d77f289413b22
2020-07-15 11:00:29 +00:00
drh
d8b3c19991 New test cases for decimal and ieee754.
FossilOrigin-Name: 73d62f82f94347c60e026bc9cb859fec2d8b5f0c756df0c4941f11817234bff8
2020-07-15 02:15:03 +00:00
dan
e7877b2d6b Support UPDATE...FROM statements in trigger programs.
FossilOrigin-Name: 4f6d8d0ebf40029218a1d3b05ea657c0c5953b01c6f0b6a628465aa44c67e7f3
2020-07-14 19:51:01 +00:00
drh
bc2cf3b295 Early detection of freelist size corruption in incremental vacuum.
FossilOrigin-Name: f25a56c26e28abd44373230c6b5763aed35c9a7648abede8a53409dccc0bee1d
2020-07-14 12:40:53 +00:00
dan
f067ae8eba Add test for LEFT JOIN in UPDATE...FROM statement.
FossilOrigin-Name: 4f3dff045ab90e80479960fed64cf36f23dd0e13144edbde15043913ad3faac5
2020-07-13 20:43:13 +00:00
dan
be952c11dc Add test cases and fixes for UPDATE...FROM statements that modify primary key columns.
FossilOrigin-Name: 47c87af3e52bce10fbcc2cbe832d659b0c204bfb3368d9314fa1b01120129254
2020-07-13 20:10:29 +00:00
dan
a7f82d9f47 Merge latest trunk changes with this branch.
FossilOrigin-Name: 5ee3c27e20d12a126fb773b428bb864102b949a5b26a8d5c523753dcedf4be10
2020-07-13 18:04:27 +00:00
dan
27da907f8e Fix a problem causing queries containing window functions to ignore collation sequences under some circumstances.
FossilOrigin-Name: e6c2192ef88e9990c8b91755c8e779f09e23f936a17123d8e42059257b756ed7
2020-07-13 15:20:27 +00:00
dan
56215eaff4 Add second test case for the improvement in [30735432].
FossilOrigin-Name: 1bd18ca35bdbf3034591bf8981fd3a985f0920379bc4dc81e0e6a819667998e9
2020-07-11 16:45:20 +00:00
drh
a1085f0640 Improved detection of a corrupt database schema. Fix for a problem discovered
by dbsqlfuzz.

FossilOrigin-Name: 30735432bc33cb953b6d7d2a2de9eb378f9740e0e663f50c727c3f138cd43a2b
2020-07-11 16:42:28 +00:00
dan
b16425d05a Fix a broken assert() in fts3 that could fail when handling corrupt records.
FossilOrigin-Name: 5124732370fd53c93314c9c79b4251bd46ce81c2e7aa4f59e2c1889cc4263d5a
2020-07-10 11:12:36 +00:00
dan
7db1ed50b8 Fix handling of another corrupt database case in fts3.
FossilOrigin-Name: ccff8cb8267d4c5605484f7a35c1836937f20b3d6879fe84cd84dc24bbbffc77
2020-07-09 21:29:34 +00:00
drh
4b849b0b09 Fix the pragma_foreign_key_check virtual table so that it accepts arguments.
FossilOrigin-Name: 07f849dee3d245ecf80ba3c3ce8dfc630e71ddb1e9c0bcc1f08cee22001fcb07
2020-07-03 12:32:04 +00:00
drh
ec1650a239 Fix a problem with "PRAGMA foreign_key_check" where if a table in one
schema appears to have foreign key constraints against another table in
a different schema, the pragma will try to check the constraints even though
they do not apply because they are in different schemas.

FossilOrigin-Name: 81bc4b65ae2a68128b0be75a7a3d4f47f05cc588ff130ba56366ab9b16289228
2020-07-03 12:15:59 +00:00
drh
e3863b5176 Ensure that the "PRAGMA schema_version" command causes the schema to be
reparsed and reloaded.

FossilOrigin-Name: 27d4a9a7b530c77a5b2593d1a5232b10746da9906f8d12890de7a8fbd7270256
2020-07-01 16:19:14 +00:00
dan
fa4b0d4453 Fix a problem with VM code generated for some aggregate SELECT statements that feature min()/max() aggregates both with and without FILTER clauses.
FossilOrigin-Name: 2094da753feb847254473b148d11e535c44dbae9b17454f1a4f8f7e90aefba3f
2020-07-01 14:07:45 +00:00
dan
3f1d0f56e4 Add a test to ensure that "PRAGMA wal_checkpoint = FULL" invokes the busy-handler to wait on read-locks.
FossilOrigin-Name: f068fb116286b1dbdee9c168900348cfcab84e6d8413f3456e4e492f650d11b0
2020-06-30 18:21:45 +00:00
dan
f488bc1147 Avoid a potential buffer overread in fts3 when processing corrupt records.
FossilOrigin-Name: 4d0cfb1236884349168f8e2ec5e18c0232965148af78615e0d5c9b0e13a35422
2020-06-30 15:32:12 +00:00
drh
b8fec21983 Fix generated columns so that they play well with upsert.
See the [https://sqlite.org/forum/forumpost/73b9a8ccfb|forum post]
by "iffycan" for details.

FossilOrigin-Name: fa9d93cf32fac4b86044acf5d1b9ea2f36e964ed7142cf1d270986c9ef3fb766
2020-06-29 20:26:50 +00:00
dan
2bfd35b8d2 Add test script to verify busy-timeouts are working for SQLITE_ENABLE_SETLK_TIMEOUT builds.
FossilOrigin-Name: ada43e7c490bf72a50ee84e1db994e149744b2a943260449076b83d1874813b2
2020-06-29 17:52:53 +00:00
dan
b695bab055 Fix another fts3 problem with processing corrupt records.
FossilOrigin-Name: 6e0ffa205312416830340ea6e621dfb1a529e5603d569941ed6263930dc28c45
2020-06-29 13:33:56 +00:00
dan
30b5db1261 Fix a problem that could cause an infinite loop in the fts3 'merge' command.
FossilOrigin-Name: be545f85a6ef09cc6c762f7d2ab7a0b3adf5590c3fbdc9903e6b5b5cec6e823f
2020-06-26 20:41:18 +00:00
drh
22f874168a When computing the verification hash in speedtest1, do not include the
value of floating point results (which can very in trailing bits depending
on platform) but merely hash the fact that a floating point value was
received.

FossilOrigin-Name: e12225d59c63ba392db4fa8dc26700ac26b20c8b98ea5107eef0e0b5138ace87
2020-06-26 17:56:43 +00:00
drh
0581214577 Improvements to speedtest1.c for more consistent verification hashes.
FossilOrigin-Name: d34b8ff5f8d04a75996f6ca9d3a0563c83e8e833c1eb08ac3861431f36f7bfb1
2020-06-26 16:17:27 +00:00
drh
6df54c30fc Improvements to speedtest1. Added the --memdb and --output options. The
--verify option now outputs a hash of SQL outputs.  The speed-check.sh script
disables the hashing feature with --legacy and adds the --verify option.

FossilOrigin-Name: f3455cecf22ea98f9ad48e92d620c8e2ec94877e4581731afff0f2bd32014a1d
2020-06-26 15:42:55 +00:00
drh
85c4754697 Add the ieee754_to_blob() and ieee754_from_blob() functions. Fix the handling
of subnormal forms in the two-argument version of ieee754().

FossilOrigin-Name: c78cbf2e86850cc6882d3f0bd5415f6e731c3c675ffe77bb343682c619cb8cd9
2020-06-26 15:32:29 +00:00
drh
3c99dbb18b Add --verify to speed-check.sh and add --memdb and --output to speedtest1.c.
Other improvements to speedtest1.c.

FossilOrigin-Name: 89a11120ab2ce13f8a539cb05a9d0628a1f83b4790910b2023c21d60aabc43ee
2020-06-26 14:05:58 +00:00
drh
d8d335d737 Fix a possible null pointer deref following OOM. Discovered by dbsqlfuzz.
FossilOrigin-Name: cc888878ea8d5bc754c69de523819d32d6d9853857e31d7287f9dbfd723428db
2020-06-26 04:34:28 +00:00
drh
99f363b35e Enhance the --verify option to speedtest1.c so that it computes and displays
a hash of the result from all SQL queries, for verification purposes.

FossilOrigin-Name: 60d1e46c8c8a3c853034fd79f204bcb5d50d1c366eb246849c333a2d0abc2648
2020-06-25 20:28:13 +00:00
drh
9f683de872 Add the decimal extension. It is built into the shell, but is an optional
add-on for the library.  It is not included in the amalgamation.

FossilOrigin-Name: 5391687bf8563b3fdd157b436b2cbb6a0ee5f676727d41bbddfaa8eacc39729b
2020-06-24 12:29:19 +00:00
drh
9e44f265a7 Enhance the --testset option on speedtest1 so that it can accept a
comma-separated list of test modules to run in order.

FossilOrigin-Name: 780e8aaa231b2b585505c3886d5a13d39dba546fdd8020331ad4de2ae92922b0
2020-06-23 20:03:57 +00:00
drh
6b64718618 Avoid unnecessary normalization in decimal_sum(). Trim excess trailing
zeros off the result of decimal_mul().

FossilOrigin-Name: 0294ce071c863eb517e97beff31c3d95a4370e979a969415162302a90d3fda0e
2020-06-23 14:44:57 +00:00
drh
427af8dc3d Add the decimal_mul() function.
FossilOrigin-Name: 72eee04b67268ad38fd51ff32849f08c0a54cf1b481d5ecb11d77cc9c729ee03
2020-06-22 21:25:37 +00:00
drh
beb9def059 An extension for doing decimal arithmetic on strings.
FossilOrigin-Name: 4c3b85607feb53462ccc8b89bea699fdb132c402eae597afa33cc40a85c32329
2020-06-22 19:12:23 +00:00
drh
067b92ba00 Extend the refactoring into extensions. Clean up stray newlines.
FossilOrigin-Name: 7a876209a678a34c198b54ceef9e3c041f128a14dc73357f6a57cadadaa6cf7b
2020-06-19 15:24:12 +00:00
drh
1e32bed3c1 Further refactoring of the schema table name.
FossilOrigin-Name: 9536fa0ae0c1ae6e2e98d2fa11e5acda7f3c9b8ca5061b6f7f8cae63a11d936b
2020-06-19 13:33:53 +00:00
dan
877859f2d3 Fix an assert() that could fail when operating on a database with a corrupt schema.
FossilOrigin-Name: 4a340c9bc7d939efc947e3b17ca79314482f74368b15567dd089d40e4270890e
2020-06-17 20:29:56 +00:00
dan
0ad1b3284a Fix an assert() in fts3 that could fail when processing a corrupt record.
FossilOrigin-Name: 4adc0a1b0d84c2df6d6bf0d5d9d3fa9f7d048af8d232c4beb77518727890f212
2020-06-17 14:54:06 +00:00
drh
dc8339eaac Add a test case covering the previous check-in to the test/fuzzdata8.db file.
FossilOrigin-Name: 95379da0e1ad5110648a5b3af24e7caab66a6f1ad6efdf374c83ae4ef1fed515
2020-06-16 14:12:43 +00:00
dan
b65ce39607 Fix an assert() in fts3 that can fail when processing a corrupt record.
FossilOrigin-Name: a58a6d6fb241a50c4c7c9af8a9c65bc4746e905b2ae12290c7182afa944053a2
2020-06-16 14:06:20 +00:00
drh
346a70ca1e Provide "sqlite_schema" as an alternative name to the table that holds the
database schema.

FossilOrigin-Name: 61782a7ae3c25cf59d7a676cb295eb024d17c46e532ae78c6fe871a91d712fa9
2020-06-15 20:27:35 +00:00
drh
b7cbf5c1b2 Fix a defect in the query-flattener optimization identified by
ticket [8f157e8010b22af0].

FossilOrigin-Name: 10fa79d00f8091e5748c245f4cae5b5f499a5f8db20da741c130e05a21ede443
2020-06-15 13:51:34 +00:00
drh
86d2de2571 Check-in [1d4f86201dab9a22] changed a testcase() to an assert() because we
didn't know how to reach that condition any more.  But YongHeng's fuzzer
found a way.  So now we change it back.  Ticket [9fb26d37cefaba40].

FossilOrigin-Name: 90b1169d1b200d35a3f9f0ad2ae35a1b336bdd9b1ad0494ba80a382354c8d8b8
2020-06-14 13:40:13 +00:00
dan
cd653a3266 Avoid deleting expression nodes in the flattener code, as they may be referenced by AggInfo objects further up the stack.
FossilOrigin-Name: cc1fffdeddf422404170fa163ab80372ae58b444d7012b2c164021b221709b3e
2020-06-13 21:24:40 +00:00
drh
74e0d96695 Identifiers "TRUE" and "FALSE" cannot take on their boolean constant values if
they are operands of the "." operator.

FossilOrigin-Name: ad738286e2441b5e84d05366db3fcafabe66be766f21fe6c17f43a8fabab16fb
2020-06-13 03:18:21 +00:00