Commit Graph

26250 Commits

Author SHA1 Message Date
drh
ddf6b27579 When converting an aggregate expression to AGG_COLUMN, be sure to remove
the EP_Unlikely flag if it is present.
[forum:/info/fbfe330a2009d036|Forum post fbfe330a2009d036].

FossilOrigin-Name: 48e65f18b2ebbe786e84e208f2c6c68de6067ba86912fea5a120fd41d0af2184
2023-05-23 15:16:20 +00:00
dan
3195b88b79 Fix a buffer overread in the recovery extension that might occur on 32-bit platforms.
FossilOrigin-Name: ff4a9a2b59657116da99c748ada19dbc64b7d0fd4c920e1c517d8bda3466f06b
2023-05-23 14:05:02 +00:00
dan
9d31508a54 Add test cases for the recovery extension. No changes to code.
FossilOrigin-Name: cec49c7d93362f527f0b4744cd1ae95d44a79671d49d69baa77fda70be29f7e8
2023-05-23 11:47:56 +00:00
larrybr
d294792d1a Avoid duplicate WIN32_LEAN_AND_MEAN #define. Fix a trivial nit likely never observed.
FossilOrigin-Name: 81ffcf41d69ae73ee8c037f675e18e2b46a15bee34062914640456381262d6fc
2023-05-22 20:36:55 +00:00
drh
0503cd6d11 When a floating-point RTREE is presented with large integer constraints -
integers that are too big to be represented exactly by a float - then take
extra steps to ensure that all possibly relevant entries in the RTREE are
returned, even in boundary cases.  Fix for the problem identified by
[forum:/forumpost/da70ee0d0d|forum post da70ee0d0d].

FossilOrigin-Name: bfd8d9100015f3e3fb011698963d670bd89b64ec8a8ab931e0c6c3076b029377
2023-05-22 16:35:21 +00:00
dan
b838a229be Fix a buffer overrun that could occur in fts5 when processing corrupt records.
FossilOrigin-Name: 4891dbd938f4bfd345eaef01f2addea9512eaa98f860844c73abb907b6a8e0e8
2023-05-22 11:02:15 +00:00
stephan
a6ab50bc42 Extend detection of the INSERT...RETURNING locking case to the DB.selectValue(s)/selectArray/selectObject() family of functions. Add tests for INSERT/UPDATE...RETURNING with those functions.
FossilOrigin-Name: 3181c50540df0eff6cb5db79bb477c469bb7b73b0692260ba600db200fcef4ac
2023-05-19 18:23:53 +00:00
stephan
02be13cea6 Minor doc typo fix.
FossilOrigin-Name: 4533be08786306a4fcb4b21458444dffd0fa2764ebb2538313f3a16d9324cacc
2023-05-19 17:59:21 +00:00
stephan
a382d236da oo1.Stmt.finalize() no longer throws, but instead returns the same as the C API. oo1.DB.exec() now triggers the INSERT...RETURNING locking failure as an exception via reset() instead of finalize(). Some code-adjacent internal API renaming for clarity's sake.
FossilOrigin-Name: 4ee6b3aa531b980acea4c4b58ee256e765c5105100468928def3d4c9825fa9bc
2023-05-19 17:50:16 +00:00
drh
fe19414331 Improved documentation for sqlite3_reset(), in response to
[forum:/forumpost/a72bab3dea|forum post a72bab3dea].

FossilOrigin-Name: 1dfeb3dceee8f30daf5462683f264b9de23e7068e036e70b11ee1b608ac2f7fa
2023-05-19 16:42:49 +00:00
stephan
7fe416fae1 sqlite3.oo1.Stmt.reset() now throws if sqlite3_reset() returns non-zero, analog to [f23eb5c6d365].
FossilOrigin-Name: 487ae12c9a21e5862bd590bbb1030c39734657d52136cf67b98c7545e6ecbe1c
2023-05-19 16:34:56 +00:00
stephan
416aeb16ee Add a basic INSERT RETURNING test for the oo1.DB.exec() API.
FossilOrigin-Name: d29d62cf7658aeb49f3c8a5d0b0809d945ebc9b79379a255eb88f771d2a2c430
2023-05-19 16:12:06 +00:00
stephan
2492b6c0fb sqlite3.oo1.Stmt.finalize() now throws if sqlite3_finalize() returns non-zero. This is intended to address the INSERT RETURNING case covered in [forum:36f7a2e7494897df|forum post 36f7a2e7494897df].
FossilOrigin-Name: f23eb5c6d36546ee1e181a03660e0b2dc8005bba24bee8bae594b0c78bd152cd
2023-05-19 15:54:41 +00:00
stephan
8e2fd6eae3 Correct typo in an 'extern' decl name, reported in [forum:1d4342156439233b|forum post 1d4342156439233b].
FossilOrigin-Name: 6ac18827d8c5be35442dc452af703023c759916c179f165c4e54b3e430a8f7b0
2023-05-19 12:41:14 +00:00
drh
1cb4e2e196 Change the RTREE engine so that equality comparisons of floating point
values are duplicated in the byte-code so that the comparisons are done
using 64-bit floats and consistent results are always obtained.
[forum:/forumpost/da61c4a1b5b4af19|Forum post da61c4a1b5b4af19].

FossilOrigin-Name: 4ec0f0a31b0df93ad15545fe1db117c933e28c75ad3cbc8475b56fecdb084905
2023-05-19 11:48:05 +00:00
drh
2c6c98dbf0 Fix incorrect b-tree root page reports from the enhanced PRAGMA integrity_check
output introduced in version 3.42.0.

FossilOrigin-Name: 9b538f62539bcde7d7d7ad06eccdc558ecbd3f9160db35197568f4d3b4247c76
2023-05-18 23:25:48 +00:00
drh
a03be7987b Fast-path the btree transaction start for the common case where a
transaction is already active.

FossilOrigin-Name: 798c3ff20c606b5f9fde16dc67781f238370a7c450bc239c3a98d0f4ca370399
2023-05-17 19:23:24 +00:00
drh
653882ed8c Simplification, performance improvement, and size reduction in the
codeAllEqualityTerms() function of the code generator.

FossilOrigin-Name: 4fbe02651e877e442d62308d7f607e503695104cd71c5565132fcd1398c120df
2023-05-17 16:13:48 +00:00
drh
60fd5c34ab New assert() statements to verify that Expr.iColumn is never used as an
array index when its value is negative.

FossilOrigin-Name: 6084c5fb6d3fcedf35cd6c597a44ec7bf8b4a2576c7b277e5342d2a7905318e7
2023-05-17 15:46:46 +00:00
drh
9c9b33cbaf Improved assertions on substExpr().
FossilOrigin-Name: 6dbd5b3cc801a75ea23842a43eb7106b62fc1d26dd5a8477a0217325539a7c1a
2023-05-17 13:21:45 +00:00
dan
32a5feb53e Avoid an assert() failure that could occur in SQLITE_ENABLE_UPDATE_DELETE_LIMIT builds when a WITH clause attached to an UPDATE or DELETE statement created a CTE of the same name as the table being modified.
FossilOrigin-Name: 8edf56d1698c3db38250db3b25864f658488414efb3a6b3e1443283b6affd26d
2023-05-17 11:31:51 +00:00
drh
010bd47b98 Fix two assert() statements that failed to take into account
the likely() built-in function.  This does not impact production code.

FossilOrigin-Name: 8504fe812c5b4956c8acad515d537add54cb591bc81747113f9b24526d7685b8
2023-05-17 00:26:50 +00:00
drh
ea1b2fa034 Increase the version number to 3.43.0 in order to begin the next
development cycle.

FossilOrigin-Name: 7874023cd460cbe05401433b8e695a77955e2c055c360a93b92d4ce6937bd136
2023-05-16 14:20:04 +00:00
stephan
73ab708b5c Resolve the JS-side corner case reported in [forum:7774b773937cbe0a | forum post 7774b773937cbe0a] by not caching oo1.Stmt.columnCount.
FossilOrigin-Name: 37d44e8c447626738a8a7f915a9bc3f35fbb95581236dd152fc119b0c3a24c2a
2023-05-16 14:18:48 +00:00
drh
89efa89778 Version 3.42.0
FossilOrigin-Name: 831d0fb2836b71c9bc51067c49fee4b8f18047814f2ff22d817d25195cf350b0
2023-05-16 12:36:15 +00:00
drh
89caab8147 Update the tool/mkmsvcmin.tcl script so that it prints a one-line message
to explain what it has done.

FossilOrigin-Name: 4254f086419892634c80b0b915e14edea365adc6a45bcc75eecba889da274ac3
2023-05-16 12:34:26 +00:00
drh
e680b6dcf7 Fix a C++-style variable declaration in the generate_series() extension.
FossilOrigin-Name: 1d3e008905461ebbd3ea0a862672f740fa72914d4d59fcf800e1ce56f1edfc9d
2023-05-15 19:17:31 +00:00
dan
aeb064c069 Limit the number of nested NOT nodes in an fts5 expression to 256.
FossilOrigin-Name: 01219e69b430c8f5fea5ab6ce511ba8c9b4c9b32b6d2d36623dde99c3d3812c9
2023-05-15 17:24:48 +00:00
drh
ff4e771c0f Increase the stack size available to fuzzcheck to 8MB on Windows.
FossilOrigin-Name: 2290dc6876041bcc982f162f59fdc9fd98b0983e1058c0a33fd46937ecc4bd84
2023-05-15 17:20:21 +00:00
dan
4042d2b424 Limit the number of nested NOT nodes in an fts5 expression to 256.
FossilOrigin-Name: 0e5c1ee40a146ef8b2b3c5f53d0a45e092bc8d8e933f3819805c995819d31bae
2023-05-15 17:14:16 +00:00
drh
307db965c6 Add the --wait command-line option to fuzzcheck.
FossilOrigin-Name: 5a479a2c7637a018d1828d9d37973bf3d36a2fc4cd5b752bca61a41cd0920d39
2023-05-15 10:55:04 +00:00
larrybr
b579db6d5c Make generate_series() correct on ones complement ALUs and acceptable to UBSAN.
FossilOrigin-Name: 4c5cd3e6968c44749b7663beee790969b41d247b9201b771ef90cbb03d09108f
2023-05-15 03:48:48 +00:00
drh
eb4455e4e4 As evidenced by [forum:/forumpost/f3f546025a|forum post f3f546025a], the
new RIGHT JOIN related restriction on the push-down optimization implemented
by [da3fba18742b6e0b] also needs to apply to the automatic index
(a.k.a. hash-join) optimization and to the Bloom filter optimization.
Computation of the restriction is now
moved into the sqlite3ExprIsSingleTableConstraint() routine.

FossilOrigin-Name: 4902015dcf3869f08d9986e422faa231d9218a5e0fc59ba8df0f407e4eb3d605
2023-05-15 02:06:35 +00:00
drh
fa746af4a3 Simplify the interface to constructAutomaticIndex().
FossilOrigin-Name: c5da16551619718bf649c517515261706843e11e131f0b99e1fd6927d0f7e238
2023-05-15 01:02:50 +00:00
dan
b8d689b666 Fix windows-specific problems in test scripts sessionnoop2.test and sessionrowid.test.
FossilOrigin-Name: e4989c111ddffe6818cbb88a72bd027b30124d1e8de0cce4109c72a214ffb5b8
2023-05-13 20:01:27 +00:00
dan
5e65cd1caa Remove unnecessary call to sqlite3_dbdata_init() from shell.c.
FossilOrigin-Name: 84ca2000007d217f911a3b1586143fc9261c0697a9e9fadda6bd3dd6afdfb099
2023-05-13 19:38:30 +00:00
dan
fd0791587b Add an "#ifndef SQLITE_HAVE_SQLITE3R" directive to shell.c.in, to avoid including the recovery code a second time if the shell is being compiled with sqlite3r.c.
FossilOrigin-Name: 6f1a60fb7b3ef463b4131dfecbc72b7c778c794a9aa13ce4617ab6dd895508b2
2023-05-13 19:13:40 +00:00
larrybr
ea51c09a8b Mention that sqlite3_mutex_free() accepts NULL as a no-op.
FossilOrigin-Name: 603d9ad5012ca8996783996d7b8cd6a1aabf12b21604a2ccc137f4c2d99427b9
2023-05-13 15:34:15 +00:00
mistachkin
273c2a9425 Fix compilation issue seen with MSVC.
FossilOrigin-Name: 67001887044da71ab50c07d8345bd950a0a1f9688cf9cd6966312ea163cf6e17
2023-05-13 05:13:29 +00:00
drh
59b6a2bcbe Fix harmless compiler warning caused by [0772ddf56713d013].
FossilOrigin-Name: f06c16a8b0e7a15ce4f7d99af3376a1bf1bfbfc0fdc048b079418ae74c619d6b
2023-05-12 19:06:00 +00:00
dan
83be5586a0 Add multi-threaded test for "INSERT ... RETURNING ..." and SQLITE_BUSY errors.
FossilOrigin-Name: 559cb1c6de384fd14160db005acaf1858b8b018d3d40d7f786a56a49d3cdbd59
2023-05-12 19:02:50 +00:00
drh
4f3dc93978 Make the regexp extension more robust against OOM errors during compilation
of the recognizer engine.
[forum:/forumpost/f50aecd5e8|Forum post f50aecd5e8].

FossilOrigin-Name: 0772ddf56713d013cd1bd44f9c75977ca14f852e3a8f038b0a6b9814f6519d79
2023-05-12 15:45:34 +00:00
larrybr
fb74019a14 Fix unlikely strange result of CLI edit().
FossilOrigin-Name: ab3797e844c97fed344b36f30cfb788aca9e0d68c574fb833712219eb712db44
2023-05-12 14:51:00 +00:00
drh
69bc8c70f9 Ensure the _O_U16TEXT is defined for Windows builds of the CLI.
[forum:/forumpost/c80aa942dc6bf2|Forum post c80aa942dc6bf2].

FossilOrigin-Name: 504effa89b48c0dc6cd12b3eaf6017be3f32017c601af17759a3cc185346d868
2023-05-12 13:20:57 +00:00
drh
26a3e56649 Remove a stray CR from end of line in a source file.
FossilOrigin-Name: 48139fb904de4b7b383e7f8c29bed83ad878eb22b1dd773c366a0aee74613d23
2023-05-12 12:57:44 +00:00
drh
61791c6f4c Fix harmless typos in comments.
FossilOrigin-Name: 607c3efbe0293d7c11a955a9f21e24fb9f7f1bb758e13e60f4ba0cc0ac8b900c
2023-05-12 12:45:56 +00:00
drh
6b429dc11b Ensure that all prepared statements are expired and forced to reprepare
whenever the database text encoding changes.
[forum:/forumpost/43cbfc4d23|Forum post 43cbfc4d23].

FossilOrigin-Name: 469718f106e1cfa7f8f4714a9e743108c361af81e0258061c2b76880a7c352ae
2023-05-12 10:52:12 +00:00
drh
78b404d976 Add [/info/cec6a06508239c09e363?ln=5525-5531|restriction (5)] to the
omit-noop-join optimization.  Fix for the issue reported by
[forum/forumpost/49f2c7f690|forum post 49f2c7f690].

FossilOrigin-Name: 3e9c9bbdb59b9d500ff218db538c047c83da7ac18ebb95c3ee7629ab15e0b43a
2023-05-11 21:15:55 +00:00
drh
5ca40d84ad Fix a minor typo in a comment. No code changes.
FossilOrigin-Name: 607cfb5bc5c0fb8b789944c2326cfdebf0629e45fbf0a61dd5f667ed685a1bbe
2023-05-11 18:03:11 +00:00
dan
418d212308 Fix the rbu_exclusive_checkpoint=1 option so that it works with a zipvfs database in pass-through mode.
FossilOrigin-Name: caca67d30670913914335aa3edff784e1c3d26aed70ae32efb5607ccf31ad142
2023-05-11 17:25:14 +00:00