]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
3 years agoAllow integers and floating point numbers to compare equal. query-invariants
drh [Fri, 17 Jun 2022 16:32:21 +0000 (16:32 +0000)] 
Allow integers and floating point numbers to compare equal.

FossilOrigin-Name: 0fe2e465ba931d4bceaf171693d2ee7af45a5f96840e65e9d4ee4a2e60f155d8

3 years agoImprove query-invariants to the point that it would have discovered the
drh [Fri, 17 Jun 2022 16:09:47 +0000 (16:09 +0000)] 
Improve query-invariants to the point that it would have discovered the
[f23a429d4153518d] bug if that bug had not already been fixed.

FossilOrigin-Name: 2a7251ed9c4c959b6df75172159c6b4445e1c2212e357d2c49ab8fa19cb3ac11

3 years agoOnly run query-invariant checks after the original query has run to completion,
drh [Fri, 17 Jun 2022 15:52:43 +0000 (15:52 +0000)] 
Only run query-invariant checks after the original query has run to completion,
so that we know it does not error-out on a subsequent row.

FossilOrigin-Name: d1fc857bb8dcd5914f5a9bbcc4efe5f4abe19a190e42e2c923b28327a95e4de6

3 years agoFix the virtual table detection mechanism to avoid false-positives that were
drh [Fri, 17 Jun 2022 15:11:31 +0000 (15:11 +0000)] 
Fix the virtual table detection mechanism to avoid false-positives that were
blocking all failures.  Then fix a few of the additional problems that are
revealed by that fix.  More fixes are needed.

FossilOrigin-Name: 42b2e6676fed1508ea0ba17c292e83134825469735700da97817c45d45c54e66

3 years agoFix the new --query-invariants option on fuzzcheck so that it does not
drh [Fri, 17 Jun 2022 12:25:33 +0000 (12:25 +0000)] 
Fix the new --query-invariants option on fuzzcheck so that it does not
use an unprotected sqlite3_value object as an argument to sqlite3_value_int64().

FossilOrigin-Name: d9f820151d74a690b5fa560597a5b3ace20165a112e1b58cb4a7c47b42745643

3 years agoAvoid omitting the rhs of FULL JOINs in cases where it is only correct to omit the...
dan [Fri, 17 Jun 2022 11:39:24 +0000 (11:39 +0000)] 
Avoid omitting the rhs of FULL JOINs in cases where it is only correct to omit the rhs of a LEFT JOIN.

FossilOrigin-Name: f23a429d4153518d37387e121f22a30b22e2b31e126ad168e72049a96be86269

3 years agoMinor fix to the query invariant testing logic of fuzzcheck.
drh [Thu, 16 Jun 2022 20:29:36 +0000 (20:29 +0000)] 
Minor fix to the query invariant testing logic of fuzzcheck.

FossilOrigin-Name: 447e62a0946f5d77b7358adcabaeb23a7012cdfbfa1ef6082734cd9b45b2699d

3 years agoImprovements to query invariants in fuzzcheck.
drh [Wed, 15 Jun 2022 20:18:44 +0000 (20:18 +0000)] 
Improvements to query invariants in fuzzcheck.

FossilOrigin-Name: 3a461f61b47e6ba6d5dcc2b7470ebde512b57bc68086f65050e07b06f42b7351

3 years agoImprovements to query invariant checking in fuzzcheck.
drh [Wed, 15 Jun 2022 16:26:37 +0000 (16:26 +0000)] 
Improvements to query invariant checking in fuzzcheck.

FossilOrigin-Name: 56c60a35ea457f06db58ec3f694a1ae16fd03e6625da1d7879d63d72bbcb1c62

3 years agoWhen running an incremental vacuum, detect growth in the size of the database
drh [Wed, 15 Jun 2022 14:57:04 +0000 (14:57 +0000)] 
When running an incremental vacuum, detect growth in the size of the database
file (which can only occur if the file is corrupt) and fail with SQLITE_CORRUPT.

FossilOrigin-Name: cd7a44124558ea6a43c89b1cba4402d7bf6a6ccb83be0eeb7dd01b56933bca73

3 years agoAdd the --query-invariants option to fuzzcheck. No changes to the SQLite core.
drh [Wed, 15 Jun 2022 12:50:51 +0000 (12:50 +0000)] 
Add the --query-invariants option to fuzzcheck.  No changes to the SQLite core.

FossilOrigin-Name: fef282f9fbb10967102f9676d85b8c6a3b36aff7109f1becdaeaeddef0dff4f1

3 years agoDbsqlfuzz discovered a case where a bytecode branch is in fact taken, so change
drh [Wed, 15 Jun 2022 12:32:27 +0000 (12:32 +0000)] 
Dbsqlfuzz discovered a case where a bytecode branch is in fact taken, so change
the designator from VdbeCoverageNeverTaken() to VdbeCoverage().  Test case
in TH3.

FossilOrigin-Name: 988a2a759f2b9da0e287e65306039b7a3e2b5aac3d31fe15cbb30d30ea6caf71

3 years agoAdd the --query-invariants flag to fuzzcheck. The query invariant checks are query-invariant-tests
drh [Wed, 15 Jun 2022 10:46:52 +0000 (10:46 +0000)] 
Add the --query-invariants flag to fuzzcheck.  The query invariant checks are
only run if that flag is enabled.

FossilOrigin-Name: d13b4621291831ff33cc4a8d53653eaa3f59fecf2fbc5d404db17e33a914495d

3 years agoImprovements to query invariant testing. Almost working now.
drh [Wed, 15 Jun 2022 10:37:16 +0000 (10:37 +0000)] 
Improvements to query invariant testing.  Almost working now.

FossilOrigin-Name: e039820418d64fb57cb1a8f9f21186284e6c76255a53445c5d7aef6cca89bfc4

3 years agoFix the OP_NullRow opcode so that it works even if it applied to an
drh [Tue, 14 Jun 2022 22:21:23 +0000 (22:21 +0000)] 
Fix the OP_NullRow opcode so that it works even if it applied to an
ephemeral cursor that has not yet been created.

FossilOrigin-Name: 0e925654c24774933c7738c68f704b229c68e18c8baa45f506b8d6f09164d0d8

3 years agoAdd missing SQLITE_FCNTL_SIZE_HINT call to a path taken during transaction rollback.
dan [Tue, 14 Jun 2022 21:34:13 +0000 (21:34 +0000)] 
Add missing SQLITE_FCNTL_SIZE_HINT call to a path taken during transaction rollback.

FossilOrigin-Name: 6c3266c1b4fc446c7c3a40a8816caf4f9fe0cafe4f27cdafecac61425a17927e

3 years agoAttempt to enhance fuzzcheck to do some simple invariant testing on queries.
drh [Tue, 14 Jun 2022 19:12:25 +0000 (19:12 +0000)] 
Attempt to enhance fuzzcheck to do some simple invariant testing on queries.
This is an incremental check-in for a work-in-progress.

FossilOrigin-Name: ce2d780163b3a28486904860a1815acc4169c09b971cfd199bb58d1e9a57b000

3 years agoDo not remove the EP_CanBeNull flag from expressions during a LEFT JOIN
drh [Mon, 13 Jun 2022 12:42:24 +0000 (12:42 +0000)] 
Do not remove the EP_CanBeNull flag from expressions during a LEFT JOIN
strength reduction if the query also contains a RIGHT JOIN. Fix for
the problem identified by
[forum/forumpost/b40696f50145d21c|forum post b40696f50145d21c].

FossilOrigin-Name: b1be2259e2e08ec22a88bc9a18b3ab4d83246ad4c635c05cdf80d3eff84df06a

3 years agoThe same restrictions on the use of WHERE clause terms to drive indexes
drh [Fri, 10 Jun 2022 16:41:54 +0000 (16:41 +0000)] 
The same restrictions on the use of WHERE clause terms to drive indexes
in the presence of RIGHT JOINs also apply to the use of WHERE clause terms
to manufacture automatic indexes.  This fixes a problem identified by
[forum:/forumpost/51e6959f61|forum post 51e6959f61].

FossilOrigin-Name: 342c501f532523347e6c339351e02043dd6ee9e11a291224b65ea72bd6c2ba40

3 years agofiddle: minor style tweaks, including using swapped colors for the input/output field...
stephan [Fri, 10 Jun 2022 15:43:03 +0000 (15:43 +0000)] 
fiddle: minor style tweaks, including using swapped colors for the input/output fields to help (hopefully) reduce the "which field is which?" dissonance.

FossilOrigin-Name: e25dad868f9ef2c7847319c9f6f106999ba8b0a3e09ed9edfbd25e8fc6f3c10e

3 years agoDo not allow constant propagation between WHERE-clause terms and ON-clause terms
drh [Fri, 10 Jun 2022 11:28:52 +0000 (11:28 +0000)] 
Do not allow constant propagation between WHERE-clause terms and ON-clause terms
as this can confuse RIGHT JOIN.  Fix for the problem reported by
[forum:/forumpost/8e4c352937e82929|forum post 8e4c352937e82929].

FossilOrigin-Name: cab9b4cccd13bf0ab2bc38dc9a9c04ddd34e29c65ab6aef07b6bb3c31a43bece

3 years agoFix a faulty assert() statement identified by
drh [Fri, 10 Jun 2022 10:10:31 +0000 (10:10 +0000)] 
Fix a faulty assert() statement identified by
[forum:/forumpost/0b91a75039|forum post 0b91a75039].

FossilOrigin-Name: 1f132bb03a22479ceeca0fd14940e2a1b29ce54b7784d5b0133450056813d877

3 years agofiddle: modernized the UI based on related code in fossil's /pikchrshow. Changed...
stephan [Fri, 10 Jun 2022 09:31:12 +0000 (09:31 +0000)] 
fiddle: modernized the UI based on related code in fossil's /pikchrshow. Changed the color scheme to match sqlite.org.

FossilOrigin-Name: c4523ffcc076e9cddba62c3b832f9a04d4f3c5595a312ac74099927aae085a52

3 years agoDo not allow the subtype of a value to cross a subquery boundary. This
drh [Thu, 9 Jun 2022 20:26:06 +0000 (20:26 +0000)] 
Do not allow the subtype of a value to cross a subquery boundary.  This
fixes the problem identified by
[forum:/forumpost/3d9caa45cbe38c78|forum post 3d9caa45cbe38c78].

FossilOrigin-Name: bbaf1f2eb1e1637b356ed7ab1d1cf5bbc8e1fe3bb2fb46a8f37de091726f38af

3 years agoPrevent subtype values from slipping across a subquery boundry when the subtype-subquery
drh [Thu, 9 Jun 2022 17:17:14 +0000 (17:17 +0000)] 
Prevent subtype values from slipping across a subquery boundry when the
subquery is implemented as a co-routine.

FossilOrigin-Name: 9e51a6c0fbfb1899b2b01888430125fba6d4da9bad9eeaa3ad41e29fca54bbe5

3 years agoThe subtype of a value should not propagate across a subquery boundary.
drh [Thu, 9 Jun 2022 16:19:01 +0000 (16:19 +0000)] 
The subtype of a value should not propagate across a subquery boundary.
Proposed fix for the problem reported by
[forum:/forumpost/3d9caa45cbe38c78|forum post 3d9caa45cbe38c78].
Additional works is needed as not all cases are covered.

FossilOrigin-Name: 08af1fe27ebd0edf6e0f1ac477deea033e7f7c813f1016b75196836daf02d2e4

3 years agoMove an #ifdef in shell.c to avoid a harmless "unused function"
drh [Wed, 8 Jun 2022 18:29:23 +0000 (18:29 +0000)] 
Move an #ifdef in shell.c to avoid a harmless "unused function"
compiler warning.

FossilOrigin-Name: 5abb5ef500f52c52dac33e54d824cf89481fec1643c27943f34f0ca4560a7e00

3 years agoAvoid zeroing the value returned by sqlite3_changes() when a DML statement is automat...
dan [Wed, 8 Jun 2022 18:20:36 +0000 (18:20 +0000)] 
Avoid zeroing the value returned by sqlite3_changes() when a DML statement is automatically reprepared in sqlite3_step().

FossilOrigin-Name: 09c8f9f1970cd5b369d98a2b38f0b04d44ed095cb0bda80f7968bb6be4e0263b

3 years agoImproved comments on the new query flattener restriction of the previous
drh [Wed, 8 Jun 2022 17:48:14 +0000 (17:48 +0000)] 
Improved comments on the new query flattener restriction of the previous
check-in.  Also a NEVER() macro on an unreachable branch.

FossilOrigin-Name: 8c9e2d6315fde014bd6e25a7fa58ba054f5328c8a56e9d3d1c2d069c025a1b03

3 years agoFix the query flattener so that it refuses a flattening that might leave both
drh [Wed, 8 Jun 2022 15:38:16 +0000 (15:38 +0000)] 
Fix the query flattener so that it refuses a flattening that might leave both
an inner-join and outer-join ON-clause constraint (or equivalent) on the same
term of the FROM clause.

FossilOrigin-Name: f6c4fb48b65c2e8659aa0a1119c330e8bad5e42b2db2030850bfc9c04afef5c8

3 years agoAdd restriction (29) to the query flattener - do not allow flattening that right-join-query-flattener
drh [Wed, 8 Jun 2022 15:30:39 +0000 (15:30 +0000)] 
Add restriction (29) to the query flattener - do not allow flattening that
would leave both EP_InnerON and EP_OuterON constraints on the same join term.

FossilOrigin-Name: c585d6a4678b04f4cedc08852d01c44cdf52ae2c8ccd1174c3d5a395088bf528

3 years agoNew test cases refute check-in [3f45007d544e5f78].
drh [Wed, 8 Jun 2022 13:13:12 +0000 (13:13 +0000)] 
New test cases refute check-in [3f45007d544e5f78].

FossilOrigin-Name: 12d3c96c39d12f6b01b77456eb874fff445ebfc60f50aada51b06ed37af364ea

3 years agoDo not allow a partial index scan on the left table of a RIGHT JOIN, because
drh [Wed, 8 Jun 2022 12:46:58 +0000 (12:46 +0000)] 
Do not allow a partial index scan on the left table of a RIGHT JOIN, because
since the index is partial, some rows will be omitted from the scan, and
those rows will subsequently be picked up by the no-match logic in the
right-join post-processing loop.
[forum:/forumpost/c4676c4956|forum post c4676c4956].

FossilOrigin-Name: 615c0026119f7870c3b6ef9dcb57ce4ecf5acedea3e2b5cfc25aa450eb8f17a0

3 years agoMinor fix to test/index9.test so that it can be invoked with other
drh [Wed, 8 Jun 2022 12:35:39 +0000 (12:35 +0000)] 
Minor fix to test/index9.test so that it can be invoked with other
index tests using a wildcard.

FossilOrigin-Name: ccbd6e774903f9202f9311954979f6fcc3b13eba1f3402a549a7aee6ed1d55eb

3 years agoUpdate the routine that determines whether or not a partial index can be used
drh [Wed, 8 Jun 2022 12:20:49 +0000 (12:20 +0000)] 
Update the routine that determines whether or not a partial index can be used
so that it is not specific to LEFT JOIN.

FossilOrigin-Name: 5a107fd7fa01554d73fefc0611e5797b8c23e782ce0df3aeba7e2f288675b2ce

3 years agoFix the query flattener to deal with a RIGHT JOIN corner case described
drh [Tue, 7 Jun 2022 13:09:58 +0000 (13:09 +0000)] 
Fix the query flattener to deal with a RIGHT JOIN corner case described
by [forum:/forumpost/323f86cc30|forum post 323f86cc30].

FossilOrigin-Name: 3f45007d544e5f787d5837b4d9f484ba473d69cdba83c229228e9c2f6b972b75

3 years agoTest cases for [forum:/forumpost/323f86cc30|forum post 323f86cc30] added
drh [Tue, 7 Jun 2022 11:02:43 +0000 (11:02 +0000)] 
Test cases for [forum:/forumpost/323f86cc30|forum post 323f86cc30] added
to join8.test, though commented out so that they do not (yet) run.

FossilOrigin-Name: 7f97cb67d01a11f1b7e5b5f05824f9adbc6e4689d1809d60ceda50a595ba6d4a

3 years agoPreserve the database encoding on the CAST operator in the
drh [Tue, 7 Jun 2022 10:14:22 +0000 (10:14 +0000)] 
Preserve the database encoding on the CAST operator in the
sqlite3ValueFromExpr() routine.
[forum:/forumpost/800eecf5e6cdc3f4|Forum thread 800eecf5e6cdc3f4].
Test case in TH3.

FossilOrigin-Name: 3f6a442099b8264cc788e8aa2b12cc583439a5263c4fe433fd22b7af1be2458e

3 years agoMore precise determination of when a WHERE clause can be used to drive an
drh [Mon, 6 Jun 2022 23:22:06 +0000 (23:22 +0000)] 
More precise determination of when a WHERE clause can be used to drive an
index on an outer join.

FossilOrigin-Name: 318543a91108c6fd0764d7ee7beee49838f54d44c54dae3dc9d4cb8336d52fe1

3 years agoMore precise determination of when a WHERE/ON clause term can be used as an outer-join-tests
drh [Mon, 6 Jun 2022 22:33:44 +0000 (22:33 +0000)] 
More precise determination of when a WHERE/ON clause term can be used as an
indexed join constraint.  Testcase macros added to ensure test coverage.

FossilOrigin-Name: f419e98c515e704efa11728192b2594e962cb0e6d2d1837f99a8caf65f4d93cb

3 years agoExtra test cases for outer joins.
dan [Mon, 6 Jun 2022 21:08:27 +0000 (21:08 +0000)] 
Extra test cases for outer joins.

FossilOrigin-Name: c7505765280fb27ec2c8c4da6f87229a4078e3a4a27525226b6bf55864caa04b

3 years agoDo not allow a WHERE clause constraint to be used to drive an index for
drh [Mon, 6 Jun 2022 15:27:42 +0000 (15:27 +0000)] 
Do not allow a WHERE clause constraint to be used to drive an index for
the right operand of a RIGHT JOIN, since this can cause problem if the
constraint implies a not-NULL value for one of the columns for the left
operand of the same join.  See
[forum:/forumpost/206d99a16dd9212f|forum post 206d99a16dd9212f].

FossilOrigin-Name: 4a31b7942a15c9c4363477365784d6d4ac5b1bbe8ff8aeaf2dd3d6532bf8bc96

3 years agoIn CLI, drop .dbinfo command when build options prevent it from working.
larrybr [Mon, 6 Jun 2022 15:22:11 +0000 (15:22 +0000)] 
In CLI, drop .dbinfo command when build options prevent it from working.

FossilOrigin-Name: 4b50a55165f4603674a250df89cfc5ac1fef8aabaf433df8400df14d53bfbbe0

3 years agoSync w/trunk, pickup fts3corrupt6.test change. dbinfo-guard
larrybr [Mon, 6 Jun 2022 14:00:41 +0000 (14:00 +0000)] 
Sync w/trunk, pickup fts3corrupt6.test change.

FossilOrigin-Name: 268072f636b25c24ec47e34f2a8356f466ec200b80487b1041e89e0ae909c8bd

3 years agofiddle: replaced the huge file selection widget with a smaller proxy button.
stephan [Mon, 6 Jun 2022 06:29:09 +0000 (06:29 +0000)] 
fiddle: replaced the huge file selection widget with a smaller proxy button.

FossilOrigin-Name: f7c17449ea0685e322f50abe7a59b7afcde0f7e38e03645ec5b13753a6d0dcf3

3 years agoFix a test case in fts3corrupt6.test. Was failing due to [f1dfbc4f].
dan [Mon, 6 Jun 2022 06:17:54 +0000 (06:17 +0000)] 
Fix a test case in fts3corrupt6.test. Was failing due to [f1dfbc4f].

FossilOrigin-Name: 04b2e47784238008ce9057e2761ded91d895dc16d3bc8a3a3508df98a4769602

3 years agoshell: in WASM mode, permit ATTACH because the filesystem is a virtual sandbox and...
stephan [Mon, 6 Jun 2022 04:09:44 +0000 (04:09 +0000)] 
shell: in WASM mode, permit ATTACH because the filesystem is a virtual sandbox and ATTACH can be used to provide more import/export options. Minor doc updates in sqlite3-api.js.

FossilOrigin-Name: f28de5b726999b913b442fa51355d020ba1f1662d2f7978380623c16438eb238

3 years agoIn CLI, drop .dbinfo command when build options prevent it from working.
larrybr [Sun, 5 Jun 2022 22:58:40 +0000 (22:58 +0000)] 
In CLI, drop .dbinfo command when build options prevent it from working.

FossilOrigin-Name: 2512d2f68dfff4d74c881a4102b63ca528e690ad93ab2b4eb1f03ce1d9ac155c

3 years agoCreate new branch named "dbinfo-guard"
larrybr [Sun, 5 Jun 2022 22:40:49 +0000 (22:40 +0000)] 
Create new branch named "dbinfo-guard"

FossilOrigin-Name: 8d942ba72ea995d0e8d1f8694bb428e5f919fc75afd3e059a69547e27991d580

3 years agoFix to test case in fts3corrupt.test. No changes to source code.
dan [Fri, 3 Jun 2022 14:08:40 +0000 (14:08 +0000)] 
Fix to test case in fts3corrupt.test. No changes to source code.

FossilOrigin-Name: d18818afc6021a32989499c26ab38fa442e5a55e662e39bb06e5c0daa9c65e25

3 years agoFix a 1-byte overread in fts3 that could occur when processing corrupt records.
dan [Fri, 3 Jun 2022 13:52:53 +0000 (13:52 +0000)] 
Fix a 1-byte overread in fts3 that could occur when processing corrupt records.

FossilOrigin-Name: f1dfbc4f7452154ca5190ac22e17fdabebb92833967b11f7dae21b8d3a5857bd

3 years agoFix a problem with flattening and window functions causing an "IS <column>" to be...
dan [Thu, 2 Jun 2022 16:26:21 +0000 (16:26 +0000)] 
Fix a problem with flattening and window functions causing an "IS <column>" to be transformed to "IS TRUE" or "IS FALSE" when <column> is a view or sub-select expression that is the literal value "TRUE" or "FALSE".

FossilOrigin-Name: 2a952c7738d94e70024e06600fee8c3a49f317f2d02774468019bd7cf9488c8b

3 years agoAvoid a direct use of abort() in debug builds to prevent a compilation issue for...
mistachkin [Thu, 2 Jun 2022 02:45:59 +0000 (02:45 +0000)] 
Avoid a direct use of abort() in debug builds to prevent a compilation issue for Windows CE.

FossilOrigin-Name: 8eb9a7dd07afc0aef0b7c67054d73e7e821138867d115407b71c985e90d44d59

3 years agoNew test cases for row values and RIGHT JOIN.
drh [Wed, 1 Jun 2022 20:08:22 +0000 (20:08 +0000)] 
New test cases for row values and RIGHT JOIN.

FossilOrigin-Name: 5f0582b90fab9111e4a645c692549c35480e62635c596f8c7fa3466bd22f7235

3 years agoEnsure that subqueries associated with row-values are invoked before being
drh [Wed, 1 Jun 2022 16:05:25 +0000 (16:05 +0000)] 
Ensure that subqueries associated with row-values are invoked before being
used when processing a RIGHT JOIN.  Fix for the problem described by
[forum:/forumpost/087de2d9ec87305b|forum post 087de2d9ec87305b].

FossilOrigin-Name: 5a9465dcc0c23fc2c66cd4898bcdfd5086fe4c71ec19a95db7221fdf7c0bbbbd

3 years agofiddle: added another UI element to the list of those which are disabled during long...
stephan [Wed, 1 Jun 2022 16:04:29 +0000 (16:04 +0000)] 
fiddle: added another UI element to the list of those which are disabled during long-running activities. Added DB.close() binding to the Worker-based wasm binding.

FossilOrigin-Name: 5933163ed1a8f996e81023c7c5822655dc6411d30016f37fe8863f760530dc5b

3 years agoEnsure that all necessary row-value subqueries are invoked while running row-value-right-join
drh [Wed, 1 Jun 2022 15:53:11 +0000 (15:53 +0000)] 
Ensure that all necessary row-value subqueries are invoked while running
the right-join post processing.

FossilOrigin-Name: e4e71b4cd4c026fc36f0da1703e6237e6ddd8ff2e08dc3c0011632b9e63098cd

3 years agoMinor tweaks to, and consolidation of, the wasm-related build flags.
stephan [Wed, 1 Jun 2022 14:52:23 +0000 (14:52 +0000)] 
Minor tweaks to, and consolidation of, the wasm-related build flags.

FossilOrigin-Name: f0ad6b1b324f9c0f4340f6cf9584884d1206b56fe1010db43bcbef324e713ea3

3 years agoFix a minor problem in the Tcl "incrblob" command. This does not affect the SQLite...
dan [Wed, 1 Jun 2022 14:32:05 +0000 (14:32 +0000)] 
Fix a minor problem in the Tcl "incrblob" command. This does not affect the SQLite core.

FossilOrigin-Name: e96feccc21d9b858f076960e029b615809243d0cc3f95db75180feb01887451f

3 years agoCandidate fix for the problem with row-value WHERE clause constraints on
drh [Wed, 1 Jun 2022 13:32:47 +0000 (13:32 +0000)] 
Candidate fix for the problem with row-value WHERE clause constraints on
a RIGHT JOIN.

FossilOrigin-Name: fdd782a7bb217e2aceda97a588c0d7874ee19885abfcf0658472d6c3387da6ee

3 years agoOnly include the code for sqlite_offset() if compiled with
drh [Wed, 1 Jun 2022 13:32:05 +0000 (13:32 +0000)] 
Only include the code for sqlite_offset() if compiled with
-DSQLITE_ENABLE_OFFSET_SQL_FUNC.

FossilOrigin-Name: 382cd7e10b2df4216da8f25b55546bc74a963d9834af240f75ec8b8321ba106e

3 years agoFix a typo in a comment in a test case. No changes to code.
drh [Wed, 1 Jun 2022 13:01:57 +0000 (13:01 +0000)] 
Fix a typo in a comment in a test case.  No changes to code.

FossilOrigin-Name: 570efa45dd4c6848dcbd550f78fcaa00b6d84dcffe0a2d12e65ea8ee4468c0e8

3 years agoAdditional enhancements to the test cases.
drh [Wed, 1 Jun 2022 11:58:11 +0000 (11:58 +0000)] 
Additional enhancements to the test cases.

FossilOrigin-Name: 55cfad74cace74e541b354228e3ad46e17028213a9f639edf2007c6a8f3ba8fc

3 years agoFix test cases in the previous check-in to make them postgres-compatible.
drh [Wed, 1 Jun 2022 11:46:39 +0000 (11:46 +0000)] 
Fix test cases in the previous check-in to make them postgres-compatible.

FossilOrigin-Name: f223ba72b6e02a7ccfd894b4b135f4609b1eb79f547ec279b1c52a6996cd5a73

3 years agoTest case for [forum:/forumpost/087de2d9ec|forum post 087de2d9ec] showing
drh [Wed, 1 Jun 2022 11:43:57 +0000 (11:43 +0000)] 
Test case for [forum:/forumpost/087de2d9ec|forum post 087de2d9ec] showing
a problem when a row-value constraint is used with RIGHT JOIN.

FossilOrigin-Name: d1e3e0d26e302587a6cfcb7aa4fcdefe2b3891037732a0df0d0fe10a14454e00

3 years agoThe Worker-specific variants of the most significant DB-class JS bindings are impleme...
stephan [Wed, 1 Jun 2022 11:20:07 +0000 (11:20 +0000)] 
The Worker-specific variants of the most significant DB-class JS bindings are implemented, most notably various uses of DB.exec().

FossilOrigin-Name: 371d6f7497016ca9bf82c8524b4d701ddf1e614b3fb4e69ff63935da0d51ed05

3 years agoMove the sqlite_offset() function implementation to be an in-line function,
drh [Wed, 1 Jun 2022 11:05:59 +0000 (11:05 +0000)] 
Move the sqlite_offset() function implementation to be an in-line function,
thereby avoiding special case code and freeing up a bit in the
FuncDef.flags field.

FossilOrigin-Name: 1c9812c458bd229c862efe5df1b64fae333da9871c8756b5ae4605a81bcda4b5

3 years agoInitial proof of concept code for a JavaScript binding which runs in the main window...
stephan [Wed, 1 Jun 2022 08:09:06 +0000 (08:09 +0000)] 
Initial proof of concept code for a JavaScript binding which runs in the main window thread but acts on a db handle running in a Worker thread. Expanded the DB.exec() and DB() constructor to simplify certain use cases.

FossilOrigin-Name: d9efe3e92d1c95aee6f5ae37a8ba28d8cf4891d746744ce4aa2464f766821a0b

3 years agoInitial bits for a JS API variant in which the client operates in the main thread...
stephan [Wed, 1 Jun 2022 00:00:59 +0000 (00:00 +0000)] 
Initial bits for a JS API variant in which the client operates in the main thread and sqlite3 in a Worker. This is far from complete.

FossilOrigin-Name: f6d6f969791f0d2367ae5418623b4794f6df657d9d7d9002fb5aec4206dcfd4c

3 years agoNew FULL JOIN test cases. No changes to code.
drh [Tue, 31 May 2022 18:18:09 +0000 (18:18 +0000)] 
New FULL JOIN test cases.  No changes to code.

FossilOrigin-Name: 13e89ef6649475815d3f4e4aef73a4be1157dd388e55c7f856faeb4b7387774b

3 years agoMore JOIN test cases inspired by the problem fixed in [3869fd9a2b9483cb].
drh [Tue, 31 May 2022 17:24:56 +0000 (17:24 +0000)] 
More JOIN test cases inspired by the problem fixed in [3869fd9a2b9483cb].

FossilOrigin-Name: f2d224c5fa06de70f6f22e159a3b7065d4c6b004f9accc13004b9ac1f2fd5549

3 years agoFix an assert that is incorrect for a corrupt database.
drh [Tue, 31 May 2022 15:18:55 +0000 (15:18 +0000)] 
Fix an assert that is incorrect for a corrupt database.

FossilOrigin-Name: fe0a840805b435efd38a953a8aae60e29a35289f9d9955472a8bab2bce7051c8

3 years agoMany new PG-confirmed test cases in joinD.test.
drh [Tue, 31 May 2022 14:19:04 +0000 (14:19 +0000)] 
Many new PG-confirmed test cases in joinD.test.

FossilOrigin-Name: 481e89c764ad8906cd21c8fbe58df57ae40bb3f261fa4892ea7ce7762786ad26

3 years agoRestore an ON-clause test case (removed by [3869fd9a2b9483cb]) that turns out
drh [Tue, 31 May 2022 11:22:30 +0000 (11:22 +0000)] 
Restore an ON-clause test case (removed by [3869fd9a2b9483cb]) that turns out
to be necessary for correct operation.  Fix for
[forum:/forumpost/c2554d560bac97c5|forum post c2554d560bac97c5].

FossilOrigin-Name: f407ec678f5bf5bfd20b7ba596472c9a85e6f21383a4cde49af1dae542fff582

3 years agoAdd back in a test case for ON-clauses that was removed yesterday by right-join-bug-20220531
drh [Tue, 31 May 2022 11:13:55 +0000 (11:13 +0000)] 
Add back in a test case for ON-clauses that was removed yesterday by
[3869fd9a2b9483cbf] but which turned out to be necessary after all.

FossilOrigin-Name: aba52a90eef2a5d06e7c499fe84b2efcde7f01e67129058f8223a6a0272aacb9

3 years agoAdd test cases for
drh [Tue, 31 May 2022 10:48:02 +0000 (10:48 +0000)] 
Add test cases for
[forum:/forumpost/c2554d560bac97c5|forum post c2554d560bac97c5].

FossilOrigin-Name: e66d5ae86c09cbe581b8f4f1bff33376cc680bba3da24f85384dd6c3eb85ddcf

3 years agoUpdated the wasm builds to generate gzip'ed copies of relevant files to take advantag...
stephan [Tue, 31 May 2022 02:03:29 +0000 (02:03 +0000)] 
Updated the wasm builds to generate gzip'ed copies of relevant files to take advantage of althttpd's new capability of substituting gzip files in place of requested files. This cuts over-the-wire size of the fiddle app by more than half.

FossilOrigin-Name: 40925585f1dab25babac46a0f4b9d633315110b8d4ccb04cc6df115d167e5ab4

3 years agoFor an outer join, then ON-clause constraints need to be evaluated at just
drh [Mon, 30 May 2022 17:33:22 +0000 (17:33 +0000)] 
For an outer join, then ON-clause constraints need to be evaluated at just
the right moment - not too early and not too late.  Fix for the problem
reported by [forum:/forumpost/3902c7b833|forum post 3902c7b833].

FossilOrigin-Name: 3869fd9a2b9483cbbf83d8f369c1744abc42f12e63abba402be35dd7e136161c

3 years agoApply the UPDATE-FROM file from check-in [98b3816bbaf539ea] to
drh [Sat, 28 May 2022 14:03:23 +0000 (14:03 +0000)] 
Apply the UPDATE-FROM file from check-in [98b3816bbaf539ea] to
update-delete-limit builds.

FossilOrigin-Name: 7e87892c249f023ee9ed1d5f75a9ad8db10fb38f14dd9e6954b12b9b28400b07

3 years agofiddle: changed the internal key of the session/local storage to avoid conflicts...
stephan [Sat, 28 May 2022 11:59:46 +0000 (11:59 +0000)] 
fiddle: changed the internal key of the session/local storage to avoid conflicts with the pikchr fiddle app (which is derived from this one) when running from the same HTTP origin as an instance of that app in a dev environment.

FossilOrigin-Name: fd668da5ccf037c2ad8e61e381dd1eb398a8deab42a00593e551c30bd176890d

3 years agofiddle: corrected a piece of far-corner-case error handling and made the various...
stephan [Sat, 28 May 2022 11:29:00 +0000 (11:29 +0000)] 
fiddle: corrected a piece of far-corner-case error handling and made the various checkbox config options persistent.

FossilOrigin-Name: 2ba429a4f8300b981b23d54c2bdb54bd4863522c1c18bf9a67a82e3dce845b10

3 years agoMark an always-true conditional as ALWAYS().
drh [Fri, 27 May 2022 18:06:49 +0000 (18:06 +0000)] 
Mark an always-true conditional as ALWAYS().

FossilOrigin-Name: 3492fe8a212cbe02b9016866e2499b99c3b566a4b0bc91fba267e6e1fe1b8943

3 years agoMinor simplification to ALTER TABLE logic.
drh [Fri, 27 May 2022 17:36:21 +0000 (17:36 +0000)] 
Minor simplification to ALTER TABLE logic.

FossilOrigin-Name: 01beb0365c529481605f1864b1b6760e2484fad08d56a72e00e34acff37e23f8

3 years agoCorrected a broken HTML comment (was using a C-style comment closer).
stephan [Fri, 27 May 2022 17:13:56 +0000 (17:13 +0000)] 
Corrected a broken HTML comment (was using a C-style comment closer).

FossilOrigin-Name: db742e3e7d1caeff8d9df1d86abf54fcb2f2263db7a433ffacf3cd3777e533c5

3 years agoFix another problem with ALTER TABLE and UPDATE...FROM in triggers.
dan [Fri, 27 May 2022 15:33:51 +0000 (15:33 +0000)] 
Fix another problem with ALTER TABLE and UPDATE...FROM in triggers.

FossilOrigin-Name: 33cf12235e6469ba17cfb72cef0e480dfd0dea81ed412fb1fb24b05dbeb8dc02

3 years agoFix further issues with ALTER TABLE and triggers that contain UPDATE..FROM statements.
dan [Fri, 27 May 2022 15:04:43 +0000 (15:04 +0000)] 
Fix further issues with ALTER TABLE and triggers that contain UPDATE..FROM statements.

FossilOrigin-Name: 53fbc269ddbabc4a97d297e881e5f9cd2bfbcd24af4af1b7cf9db412a3a51813

3 years agoOmit an unnecessary branch.
drh [Fri, 27 May 2022 14:41:48 +0000 (14:41 +0000)] 
Omit an unnecessary branch.

FossilOrigin-Name: f56473f9cc1b476b3219fe5b70ba2e4b269b20c880b99ba34c744ed893042081

3 years agofiddle: added an option to completely wipe/reset the db. The Options area can now...
stephan [Fri, 27 May 2022 03:27:10 +0000 (03:27 +0000)] 
fiddle: added an option to completely wipe/reset the db. The Options area can now be toggled on/off via tapping the label at its top. Running the input SQL is now limited to the selected area if any text is currently selected, per suggestion in the forum.

FossilOrigin-Name: d100283e378f2d8e353399848184a4ab8ccf6316218fffc28b90a656cf81c279

3 years agoFix issues with ALTER TABLE and triggers containing "UPDATE...FROM" statements.
dan [Thu, 26 May 2022 19:10:11 +0000 (19:10 +0000)] 
Fix issues with ALTER TABLE and triggers containing "UPDATE...FROM" statements.

FossilOrigin-Name: 2fba0d41b781d226915fa2bf888a7bc640c046ce22670ceb53f62a09f3975259

3 years agoCorrect handling of outer joins in the FROM clause of an UPDATE statement
drh [Thu, 26 May 2022 17:33:42 +0000 (17:33 +0000)] 
Correct handling of outer joins in the FROM clause of an UPDATE statement
that occurs inside of a trigger.  Follow-on to [98b3816bbaf539ea].

FossilOrigin-Name: 664a49fa813144b6fa5a7ae3f65af5412f150dd5def261c4d581d706b39f7846

3 years agoClarification of the meaning of the N parameter in sqlite3_db_name().
drh [Thu, 26 May 2022 14:46:09 +0000 (14:46 +0000)] 
Clarification of the meaning of the N parameter in sqlite3_db_name().
Documentation only.  No changes to code.

FossilOrigin-Name: f22f41d2c8a676b9a339e7f00c29c163bbb7079b1a4a76ee1a6a96aaf7de5f9e

3 years agoFixed a minor cut/paste mistake in the previous checkin. Affects only internal docs.
stephan [Thu, 26 May 2022 05:18:33 +0000 (05:18 +0000)] 
Fixed a minor cut/paste mistake in the previous checkin. Affects only internal docs.

FossilOrigin-Name: 37e3764839b968456f576fad67d3d99007773f5c0689165ecbdc610fcabef1ca

3 years agoMakefile.in: added explanations, intended for maintainers and hackers, of the various...
stephan [Thu, 26 May 2022 05:08:25 +0000 (05:08 +0000)] 
Makefile.in: added explanations, intended for maintainers and hackers, of the various emcc flags used for building the wasm files. No code or build rule changes.

FossilOrigin-Name: 1a159159094d6357b3cadbb8e5499cec4de35ef382c03fcc45c11daee906c3d6

3 years agoSlight increase in the accuracy of log10().
drh [Wed, 25 May 2022 13:10:29 +0000 (13:10 +0000)] 
Slight increase in the accuracy of log10().

FossilOrigin-Name: c48a735bd4a1dbd541aed5937c25fc0c606c4263d8ee94cae30a06b1a7b26d9a

3 years agoDo not allow the right operand of a RIGHT JOIN to be reordered with other
drh [Wed, 25 May 2022 12:49:59 +0000 (12:49 +0000)] 
Do not allow the right operand of a RIGHT JOIN to be reordered with other
FROM clause terms that are even further to the right.  Fix for the issue
identified by [forum:/forumpost/5cfe08eed6|forum post 5cfe08eed6].

FossilOrigin-Name: 4be0c60e38edc5d5bfd72bb35a3c91c55240b4e6313a40614beb60f1ab9d9f4c

3 years agoAdd in a VdbeCoverage() macro accidentally omitted from [d64ae49a1f251317].
drh [Wed, 25 May 2022 11:17:13 +0000 (11:17 +0000)] 
Add in a VdbeCoverage() macro accidentally omitted from [d64ae49a1f251317].

FossilOrigin-Name: 18b5cea0392a28f694b8931a80e93518f8d3d297d787fa44d1544e373f76838e

3 years agoFix the UPDATE-FROM logic so that it works the same as PostgreSQL when the
drh [Wed, 25 May 2022 11:09:07 +0000 (11:09 +0000)] 
Fix the UPDATE-FROM logic so that it works the same as PostgreSQL when the
FROM clause contains an outer join.

FossilOrigin-Name: 98b3816bbaf539ea745456e1c0064e47d2903d33ee0ceb029bdb97d56fcde937

3 years agoGot the sqlite3-api JS bits wrapped up in deferred-load module. Whether that's going...
stephan [Wed, 25 May 2022 08:51:07 +0000 (08:51 +0000)] 
Got the sqlite3-api JS bits wrapped up in deferred-load module. Whether that's going to be easier to use, in practice, remains to be seen. Consolidated two of the test-related JS files.

FossilOrigin-Name: dd83cc05f2522d221641807dd66b33df48ac9264f27e5b6f63f312084f109801

3 years agoRenamed EXPORTED_FUNCTIONS.sqlite3 to EXPORTED_FUNCTIONS.sqlite3-api to avoid any...
stephan [Wed, 25 May 2022 04:38:35 +0000 (04:38 +0000)] 
Renamed EXPORTED_FUNCTIONS.sqlite3 to EXPORTED_FUNCTIONS.sqlite3-api to avoid any potential confusion about that file (not) being an sqlite3 database.

FossilOrigin-Name: 3d6245c6f9f2ef4ca6746639d300cc5795598b119034439dfed671de3da638fb

3 years agoAdd the ability to import/export db files into/from fiddle.
stephan [Wed, 25 May 2022 04:35:22 +0000 (04:35 +0000)] 
Add the ability to import/export db files into/from fiddle.

FossilOrigin-Name: e0c30438a4f1372afb93a0488bae17b3f85d535717b215f494a83ae909871d2c