Commit Graph

28471 Commits

Author SHA1 Message Date
drh
9904d824b8 Improved comments on byte-code subroutine calls to materialize subqueries.
Should not affect production builds.

FossilOrigin-Name: 6b024c85ef856e26cddac8ad862e16909b5149c3e3efb4e73ba54c97291f1cc4
2024-08-21 17:38:50 +00:00
stephan
5b5625f679 README.md: a markup link fix and use the canonical URL for Fossil.
FossilOrigin-Name: c49bfee6b878bd96adfc852fdc76e98bf81e2fb82be8325672fbc7af04e7dffa
2024-08-21 13:57:30 +00:00
drh
59b171172f Updates and enhancements to the README.md file. No code changes.
FossilOrigin-Name: 3161b8028916bff9a13a04bfb1996bce7e1274a3c403fc58f4d798afd30c528f
2024-08-21 13:44:40 +00:00
drh
4cc86b6e92 Add code comments for a "table-of-contents" and various milestone marks in
the 1300+ line long sqlite3Select() function, to help improve readiability
and maintainability.  Comment changes only - no functional changes.

FossilOrigin-Name: 00cfbb9fa5136e6a7847da4e4ab30d320ca79c22acda9db2030e558d59b8c744
2024-08-21 12:01:46 +00:00
drh
91937a6961 Fix a minor typo in a comment.
FossilOrigin-Name: 92c80af1129051c9eded8df170730ad6366b4f7715dead34c4364c8149d0dce9
2024-08-21 10:37:59 +00:00
drh
01972f55fe Improvements to treetrace output for subqueries. Debug code only.
FossilOrigin-Name: 0a835d18d9063b17a1d506fd989ebcf7f0d76593978a3bd5981be59618335f21
2024-08-21 10:32:00 +00:00
stephan
fb7d0c3c01 De-duplicate some error-output code in shell.c.in as part of tracking down the cause of [forum:5647ca2af1|forum post 5647ca2af1].
FossilOrigin-Name: fd5904495e0c775174f9380bc6877fb9def3d30dec1c9315979ad4503a18d70b
2024-08-21 09:56:45 +00:00
drh
8c58fd78c3 Remove incorrect assert() statements in the SrcItem invariant validator.
dbsqlfuzz 7f908865436ce531b0ace55c97a1c71d05c4e76c.

FossilOrigin-Name: 81a1ede38823b8d50e221ecb6ce52a05d82a856099002a71d9f1ac561a587f05
2024-08-21 07:38:14 +00:00
drh
5648d717b1 Refactor the SrcItem object to move fields associated with subqueries out
into a separate object named Subquery.  This reduces the size of the SrcItem
object by about 1/3rd and provides improved performance.

FossilOrigin-Name: 484bcd75bc95491d8540c791c1c4d40d996cb465839564662e14f98739699bf1
2024-08-20 23:11:28 +00:00
drh
a0651b3707 Fix a name resolution issue with CTEs.
FossilOrigin-Name: 4fa8235dd59cd683d6c6c97bfe181a9637be7c054d435323c903b9dbd74aff02
2024-08-20 22:44:40 +00:00
drh
bb36d55e63 Fix minor comment issues.
FossilOrigin-Name: c1bbed19f4348ec31c3cb4723eaa8f1554bb58ef4de7feb3a0f39612785f13d5
2024-08-20 22:05:01 +00:00
drh
0766cbf511 Remove unreachable code.
FossilOrigin-Name: 17699329aa8e234c6793a38db5ca05def9395b287bcc8bc05493b824327edb59
2024-08-20 20:01:21 +00:00
drh
692c160360 Tighter checking of access constraints on union members in SrcItem.
Improved invariant checking.

FossilOrigin-Name: fd72d3400a8fe5747f494eee81654698acee350bb95b9db269e87d857af03492
2024-08-20 19:09:59 +00:00
drh
ff176231da Fix some stray SrcItem field name fixes.
FossilOrigin-Name: bc5f5ce59e1e4323422bda7d002310923f927a03b4fd42749bf04f6c9853956b
2024-08-20 17:41:44 +00:00
drh
27c680cc69 Fix a memory leak so that now all dev tests (including TH3) are passing.
FossilOrigin-Name: 3995c45fff0e4bd10bcf49cc16eb1050216426723c63ba56d3ae5ba738c34019
2024-08-20 17:24:42 +00:00
drh
ff4ad29d05 Memory issues fixes so that mdevtest now passes.
FossilOrigin-Name: b249516f6a6650808e035ec219e762bf24dcb7c32a6235984b995d08d07d35d8
2024-08-20 16:50:21 +00:00
drh
781163aa9d When the database encoding is UTF-16LE and the GLOB optimization is used,
it is ok to use the range search over an index, but it is not ok to
disable the actual GLOB function call.

FossilOrigin-Name: 3399698376761ab8c422f8ea02bfa2759afb606f08bedbd1cf7eee834229a9aa
2024-08-20 14:12:16 +00:00
drh
6ad4e9fd2a Fix for the UTF-16LE problem reporte by
[forum:/forumpost/dc7e1b7527e84343|forum post dc7e1b7527e84343].  Because of
the unexpected ordering of characters using the default collation (memcmp()
order) in UTF-16LE, the LIKE/GLOB optimization restricts its attention to
the pattern prefix that is all ASCII, which is the common case.

FossilOrigin-Name: a5797ebdea423afc3d2d3bd8adaf1575d33a01f594c0c315afcb1499f1718e9b
2024-08-20 12:09:55 +00:00
drh
1c8ed5fa43 Earlier error detection while processing complex aggregate
queries.  dbsqlfuzz 5242c2f07f4aa031aa3c80461f18e9b7619ede9b

FossilOrigin-Name: 70f4973078ffc72f4ff247234e6f8e695b40803c3e7c9ed12050d97195728352
2024-08-19 23:43:08 +00:00
drh
1521ca4c20 Refactor the SrcItem object so that information about subqueries is stored
in a separately allocated Subquery object.  This reduces the memory requirements
for SrcItem and makes the code run faster.  It also provides an expansion path
for subquery processing that does not burden simple queries.  The current
checking mostly works, but there are still issues that need to be tracked
down and fixed.

FossilOrigin-Name: 8ff5dda8448d7e1a533d7f27db2573ce68fa9956b9d9847ced45e83c1f06bab0
2024-08-19 22:48:30 +00:00
dan
127812e645 Update some comments that are processed into the fts5.html webpage.
FossilOrigin-Name: 3e06ab218bbd1ed75a24afb44e8df9ce84e9fc24701428cb8b3459760f44006d
2024-08-19 20:35:30 +00:00
dan
18557fdeb5 Add the fts5_locale() function and related functionality to fts5.
FossilOrigin-Name: b9632900100bdbc913f83bfb03b32585cf07a192b9a7f26b9bebc7d91e63a610
2024-08-19 14:33:39 +00:00
drh
922cf3e2e4 Fix leap-year handling for dates prior to 0400-03-01.
[forum:/forumpost/eaa0a09786c6368b|Forum post eaa0a09786c6368b].

FossilOrigin-Name: 474b7e34b83bc5e85854bc3b386f31ff39b390549d89b94921f33bbc5b658d1d
2024-08-19 14:20:18 +00:00
drh
5a18c1f9cd New date/time test cases to validate ancient dates.
FossilOrigin-Name: 82719074f090d9d0a0b9baea0dee7b1dd40a272e3f3e45043d4a640c07989d5d
2024-08-19 13:53:49 +00:00
drh
aa2258e35b Attempt to fix date/time calculations for days earlier than 0400-03-01.
See [forum:/forumpost/eaa0a09786c6368b|forum thread eaa0a09786c6368b].

FossilOrigin-Name: 00cae11fffaf50e2133915e851d41098d00b6b1458e1438bcb6664e1411d8498
2024-08-19 12:54:12 +00:00
dan
f5b1c3da36 Merge trunk changes into this branch.
FossilOrigin-Name: 6787603bd0d8117e41e6b572c0d7cada0f6d7266a4ff2ad79f9471b9beb28a9e
2024-08-19 10:40:08 +00:00
dan
dd9a7e4540 Fix a problem with detail=none, content='' tables.
FossilOrigin-Name: 4b8070816ada3f269d53c9cee20669f59e19a23c31c8509fc397c21dd097ec9f
2024-08-18 14:46:13 +00:00
drh
901b671455 Automatically disable directory fsync when compiling for AIX.
FossilOrigin-Name: 8d170e07e20c21a5bb97fdc8c2d01d92178f5fe740e60d203e4621747cfce33e
2024-08-18 09:53:37 +00:00
drh
b204b6aa7b Give unique names to fields in the SrcItem object, to facilitate analysis of
how those fields are used using "grep".

FossilOrigin-Name: 9f5aeef3cbc2c95267c8f7bf60d5c66971a76789669fb0e8f853273ff6f616f2
2024-08-17 23:23:23 +00:00
drh
8797bd695f Reduce the size of the SrcItem object by combining fields into a union.
FossilOrigin-Name: a4c59ac3c6ec979c25b544d29e47b8e39f6439c098eed8f84b3bd506c9adf047
2024-08-17 19:46:49 +00:00
dan
6c796631fc Fix a broken assert() in fts5_storage.c.
FossilOrigin-Name: 01116e32797e1b127ba79059d890fbe5075eee2b6e3ce4468e82862b0fc3aa46
2024-08-17 19:40:15 +00:00
dan
408a34925d Merge trunk changes into this branch.
FossilOrigin-Name: 6a8ff9ba5e71d817489093d8dff0a8d77365b4222773b941accbd58558d24379
2024-08-17 19:11:09 +00:00
dan
ef2401f669 Tests to improve coverage of fts5_expr.c.
FossilOrigin-Name: f4b839e5265700b1a89066d1b6e0d0d010852a69c5da3d75d2c41624dbf3c0af
2024-08-17 19:07:13 +00:00
dan
b651084713 Add tests to restore coverage of fts5_tokenizer.c.
FossilOrigin-Name: 8f9257361b05e368bf433e56d0698923b0f97d12e7c0ad7760aaab6746c0e467
2024-08-17 17:22:49 +00:00
drh
21363ac78d Adjust Makefile.in so that it outputs a slightly better error message on an
attempt to build something that requires TCL libraries when HAVE_TCL is false.

FossilOrigin-Name: a4043cbeb8a08fca2fdd2ea703e030d3a5574cc6002292ecc6f0e88c116472a3
2024-08-17 16:17:16 +00:00
drh
f87a54ab41 Adjust the "configure" script so that it just disables the ability to
run tests rather than erroring out if tclsh is unable to recommend a
suitable tclConfig.sh.

FossilOrigin-Name: 793ff83d09bea165c8cedc978afd3fcfb1a4cee894c5914aa1d92416afce963d
2024-08-17 15:52:21 +00:00
dan
52d0310256 Fix a typo in an "ifdef" that broke SQLITE_OMIT_ANALYZE builds.
FossilOrigin-Name: c09da26cb6f772a18c595ff0eb55d8345a377c3ef5ed02a5e539ffdbe9d07f85
2024-08-17 14:59:26 +00:00
dan
342984075b Add tests to restore coverage of fts5_config.c.
FossilOrigin-Name: 9d971b31df7ad4d68eb348f95d8f996071cf87d41c47033bde3fcc4dba732e06
2024-08-16 19:05:47 +00:00
drh
65a46af7ae If a subquery has an ORDER BY clause and that ordering is helpfile in
satisfying the ORDER BY or GROUP BY of the outer query without doing an
extra sort, then omit or reduce the sort in the outer query.  Call
this the "order-by-subquery optimization".

FossilOrigin-Name: 7a0cdc7edb704a88a77b748cd28f6e00c49849cc2c1af838b95b34232ecc21f9
2024-08-16 18:51:46 +00:00
dan
f0f240c0d8 Add tests to restore coverage of fts5_storage.c.
FossilOrigin-Name: 38841881a08f4d75c2dfcbc1b2b45e311d7dda1287780f8ba1c8388f7adc1629
2024-08-16 17:54:00 +00:00
dan
db79dd1f88 Add tests to restore coverage of fts5_main.c.
FossilOrigin-Name: 681edd08ab7024ddcd6447a64d8aad581b47b039481b697d91d26e6c6660f373
2024-08-16 16:20:43 +00:00
drh
b8123415b2 Ensure that memory allocations in ANALYZE are always 8-byte aligned in order
to satisfy a new assert() added by [539e4f661767ef90].

FossilOrigin-Name: a1915cbdeccac2ed49fb8a9733abf2c6239396e3174fed2ff275f66b606c48b6
2024-08-16 15:35:20 +00:00
drh
2ed4f5016a Fix handling of COLLATE. Add test cases for the same. Code cleanup for
improved understandability and maintainability.

FossilOrigin-Name: 41a41c173a9d15d94f23d73a5c04bfb1616cb9223bc81d41808f9b4d00817fbf
2024-08-16 11:26:21 +00:00
drh
42f997d768 Bug fix in the subquery ORDER BY propagator.
FossilOrigin-Name: 5a9a3b8af7ac0aa1c04ad2d735e341c92d67952acb9a1d30217c0471e92cd468
2024-08-16 02:19:17 +00:00
drh
743188642d Improvements to the subquery ORDER BY decision algorithm. Fewer false-negatives.
FossilOrigin-Name: b82421e3f5811946e9d60b845fc882b6ea5c53c648695654c6900754427bf9bf
2024-08-16 00:37:54 +00:00
drh
235b5d0ac5 If a subquery is materialized due to an ORDER BY and that ordering is useful
in helping to satisfy the ORDER BY or GROUP BY in the order query without
doing an extra sort, then omit the extra sort.

FossilOrigin-Name: 2fbb4dc2327ee435cb2b7a4adcddf5a9cee6dff7de96e2ecb761166427b5ddea
2024-08-15 23:38:52 +00:00
dan
41ebf965cd Extra tests.
FossilOrigin-Name: fb257540d32ced4a5fe0759d3ad9c1b36fd2b7d64d93cb0a0ecdb48355a68b7a
2024-08-15 20:33:05 +00:00
dan
189c41221d Further tests and fixes for this branch.
FossilOrigin-Name: d27985245a0e8c0d6b04323c98b26b6a8fb4e489fa8f5f3234252c7c198f23c8
2024-08-15 18:50:13 +00:00
drh
7c5a829025 Improved help message for --disable-tcl on the configure script.
FossilOrigin-Name: 96e6cfb211f7f1aab50f997f4bc61dfb9701beb720c59bc413a4285c1ae5e20d
2024-08-15 15:31:46 +00:00
drh
3f138e1d8f Reinstate the --disable-tcl option on ./configure.
[forum:/forumpost/845d4a57becc7f3c|Forum thread 845d4a57becc7f3c].

FossilOrigin-Name: de927016aadd7ee55d947134e3540907a3ea5ab4015034c5d088e3a84905d98a
2024-08-15 15:23:33 +00:00