]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
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

3 years agoFurther minor cleanups and docs in the fiddle app and worker. fiddle-local-db
stephan [Wed, 25 May 2022 04:20:08 +0000 (04:20 +0000)] 
Further minor cleanups and docs in the fiddle app and worker.

FossilOrigin-Name: 199e01799dfa48e3fddafb7f2ae5360604150a44186d5c5a977e158ad8e7e657

3 years agofiddle: refactored so that it no longer exposes any global symbols. Doing so with...
stephan [Wed, 25 May 2022 03:08:22 +0000 (03:08 +0000)] 
fiddle: refactored so that it no longer exposes any global symbols. Doing so with the main sqlite3.api module will be much tricker.

FossilOrigin-Name: cd227be805d0cd4b6e3c72ed0992ad3aec3db9c366909d9d82c6d3a29009c6eb

3 years agoAn attempt to get UPDATE FROM working when the FROM clause contains a update-from-right-join
drh [Wed, 25 May 2022 02:32:11 +0000 (02:32 +0000)] 
An attempt to get UPDATE FROM working when the FROM clause contains a
RIGHT or FULL JOIN.

FossilOrigin-Name: a124e4f96f883d8682ba7a253d33a9565ed0fc3580525225b95733bd3782a806

3 years agofiddle: added support for exporting (downloading) the current db file. To do this...
stephan [Tue, 24 May 2022 22:16:12 +0000 (22:16 +0000)] 
fiddle: added support for exporting (downloading) the current db file. To do this we had to fall back to named dbs, instead of defaulting to an in-memory one, but the virtual filesystem is an in-memory FS, so the end effect is the same.

FossilOrigin-Name: 7c7fd34c8a05832a3973aaffe696250cb4d2a0b1646c9bfbe83970daf33cd817

3 years agofiddle: initial work on loading a client-side db file. Works but requires some cleanu...
stephan [Tue, 24 May 2022 19:01:21 +0000 (19:01 +0000)] 
fiddle: initial work on loading a client-side db file. Works but requires some cleanup. Export is not yet implemented.

FossilOrigin-Name: 0fa8378c006fcf2311772d36cf2e3c2cd8e8648f671de89ee9832e2e1a06ef49

3 years agoWhen an ON clause on an INNER JOIN references a table to the right of
drh [Tue, 24 May 2022 16:05:41 +0000 (16:05 +0000)] 
When an ON clause on an INNER JOIN references a table to the right of
of the join, just convert the ON clause to an ordinary WHERE clause term,
in order to be compatible with older versions of SQLite.  See
[forum:/forumpost/687b0bf563a1d4f1|forum thread 687b0bf563a1d4f1] for details.

FossilOrigin-Name: 2b6ebba26d936ae7b9acf7d4bd15e82cbfabda22e1044b3dd838c7b07095100e

3 years agoMoUse re descriptive var names in ext/fiddle/Makefile.
stephan [Tue, 24 May 2022 14:45:16 +0000 (14:45 +0000)] 
MoUse re descriptive var names in ext/fiddle/Makefile.

FossilOrigin-Name: 2f9a42fb141d386f6edd03a37da3b0cef63dcc9fbfd076076b5330a8aa7d45a8

3 years agofiddle: lots of generic refactoring, restructuring, and cleanup in the higher-level...
stephan [Tue, 24 May 2022 14:36:45 +0000 (14:36 +0000)] 
fiddle: lots of generic refactoring, restructuring, and cleanup in the higher-level code. Added push-fiddle ext/fiddle/Makefile target to push the fiddle app to a remote server via rsync.

FossilOrigin-Name: ed19fef3459499abb0a4a010f368b4576d6e068d930c8480446ea677ac87c1c1

3 years agowasm/JS: minor doc updates, corrected bind()ing of the undefined value to behave...
stephan [Tue, 24 May 2022 01:15:21 +0000 (01:15 +0000)] 
wasm/JS: minor doc updates, corrected bind()ing of the undefined value to behave as documented, removed some superfluous code.

FossilOrigin-Name: 526c8c728019b317624a93f6f07840ca524bca84e7c03ce5e86e38953146236f

3 years agowasm/JS: documented DB.selectValue() and corrected the fetching of NULL columns via...
stephan [Tue, 24 May 2022 00:35:18 +0000 (00:35 +0000)] 
wasm/JS: documented DB.selectValue() and corrected the fetching of NULL columns via Stmt.get().

FossilOrigin-Name: 70f91fab825d365f505750acdb8d3ae532880c4cdb64d1e61bb21b24a115958b

3 years agowasm/JS: added support for scalar UDFs. Fixed a deallocation problem with bind()ed...
stephan [Tue, 24 May 2022 00:22:10 +0000 (00:22 +0000)] 
wasm/JS: added support for scalar UDFs. Fixed a deallocation problem with bind()ed strings/blobs.

FossilOrigin-Name: 325a9ee31ad7abae563c4da5cd8228e151b00aa9afcac7e9bca5efaa9d48e107

3 years agowasm: minor refactoring and doc updates.
stephan [Mon, 23 May 2022 19:38:57 +0000 (19:38 +0000)] 
wasm: minor refactoring and doc updates.

FossilOrigin-Name: 6044605b2a712da73600cabb967797a03ed1915dc0ab0b10edbd52525e548196

3 years agofiddle: cleaned up and documented the status-loading progress mechanism in prep for...
stephan [Mon, 23 May 2022 16:54:18 +0000 (16:54 +0000)] 
fiddle: cleaned up and documented the status-loading progress mechanism in prep for reusing it in the sqlite3-api worker.

FossilOrigin-Name: 107e3497869d757265f2a4235082bf324ba1220075d1096c2a82021a5d348a6c

3 years agowasm: added missing 'use strict' and fixed an undeclared var use caught by that.
stephan [Mon, 23 May 2022 13:55:39 +0000 (13:55 +0000)] 
wasm: added missing 'use strict' and fixed an undeclared var use caught by that.

FossilOrigin-Name: c16a7f4950d47c2f5177db7dc5d83f0f11eb0cafdce1ec688d6f1bd740d92733

3 years agowasm: corrected isSupportedBindType() to behave as documented.
stephan [Mon, 23 May 2022 13:52:36 +0000 (13:52 +0000)] 
wasm: corrected isSupportedBindType() to behave as documented.

FossilOrigin-Name: 7e2d2e807272e98e9a3c9c9ba492b796a603f36b7cc12b16923cd8a9e6579851

3 years agoNew test cases to further demonstrate the difference in name matching rules
drh [Mon, 23 May 2022 12:37:54 +0000 (12:37 +0000)] 
New test cases to further demonstrate the difference in name matching rules
for LEFT JOIN versus RIGHT JOIN that protect legacy behavior.
[forum:/forumpost/e90a8e6e6fa652ac|Forum thread e90a8e6e6fa652ac].

FossilOrigin-Name: 2c586060a016f5481bad29bfb8f4ac4e1204075afdd0fa1851fbbcf2abda4893

3 years agoAdd an assert() to clear a harmless static-analyzer warning.
drh [Mon, 23 May 2022 11:51:10 +0000 (11:51 +0000)] 
Add an assert() to clear a harmless static-analyzer warning.

FossilOrigin-Name: 919ba2f0472e12c2d1e82364c1481e778b24ea406615b08992964a4eb80abee7

3 years agoDo not run the subroutine that materializes a view or subquery until just
drh [Mon, 23 May 2022 10:57:20 +0000 (10:57 +0000)] 
Do not run the subroutine that materializes a view or subquery until just
before the materialization is actually needed, so that if the materialization
turns out to never been needed, unnecessary work can be avoided.

FossilOrigin-Name: d64ae49a1f2513171d678259928c67741d79b2ae595078299525641a676cc46b

3 years agoWASM: removed the in64-related bindings, as MDN says that calling a wasm function...
stephan [Mon, 23 May 2022 01:11:49 +0000 (01:11 +0000)] 
WASM: removed the in64-related bindings, as MDN says that calling a wasm function which has an int64 type in its signature will currently throw because JS has no 64-bit integer support. Those bindings now use doubles and simply hope that the user doesn't exceed their integer precision (2^53-1, approx 9 quadrillion).

FossilOrigin-Name: 392e84828275ec203bc713d3a5d4790852add57539add6b29b5f6de1da2dc97a

3 years agoWASM: an arg handling fix for DB.exec({multi:true...}).
stephan [Sun, 22 May 2022 22:10:38 +0000 (22:10 +0000)] 
WASM: an arg handling fix for DB.exec({multi:true...}).

FossilOrigin-Name: 0d6332f706ec5c34cc6a9ff79878f4e10a9ad81b24cc7d743b52168586285811

3 years agoWASM: added exec(), execMulti(), and several getters. Various touchups and fixes.
stephan [Sun, 22 May 2022 22:00:39 +0000 (22:00 +0000)] 
WASM: added exec(), execMulti(), and several getters. Various touchups and fixes.

FossilOrigin-Name: b790c91b85e9cf8eecce86ac1717e8ccd2c3b6b98a1ad6a5d64eefc94ee86f9d

3 years agoImplemented Stmt.get() and friends for WASM OO #1 wrapper. Added basic tests for...
stephan [Sun, 22 May 2022 19:09:59 +0000 (19:09 +0000)] 
Implemented Stmt.get() and friends for WASM OO #1 wrapper. Added basic tests for prepare/step/get. Restructured module init output to introduce only 1 global-scope symbol instead of 2.

FossilOrigin-Name: 601dc3fa29c2ce2ede5a8320c79050305f3774b6d7bc759247c5021f3b74aaec

3 years agoWASM: added bindings for sqlite3_compileoption_get/used(), moved OO #1 into sqlite3...
stephan [Sun, 22 May 2022 16:25:43 +0000 (16:25 +0000)] 
WASM: added bindings for sqlite3_compileoption_get/used(), moved OO #1 into sqlite3-api.js since it can only be used from the same thread as that API and separating them complicates client-side use. Started adding test utilities and tests for the OO1 API.

FossilOrigin-Name: f3bc0328c87cac7d50513b0f13576d8fe7b411396f19c08fbe7e7c657b33cfbf

3 years agoWASM OO wrapper #1: prepare() and bind() APIs are in place but are untested, pending...
stephan [Sun, 22 May 2022 14:07:44 +0000 (14:07 +0000)] 
WASM OO wrapper #1: prepare() and bind() APIs are in place but are untested, pending fetch/get APIs.

FossilOrigin-Name: 84c8f63a1c446331a3afe52b0c8bdfa6980f24aa4cf600f576877fef5e650c39

3 years agoBuild refactoring for the fiddle/wasm bits. Set up wasm binding of a chunk of the...
stephan [Sun, 22 May 2022 00:27:19 +0000 (00:27 +0000)] 
Build refactoring for the fiddle/wasm bits. Set up wasm binding of a chunk of the core C API and added some infastructure for creating test pages for it.

FossilOrigin-Name: dea098b64eb95c395b346ebcae687afe42b7d21df48833527808c02226300a66

3 years agoMinor fiddle-related build restructuring to support upcoming development of the C...
stephan [Sat, 21 May 2022 21:13:44 +0000 (21:13 +0000)] 
Minor fiddle-related build restructuring to support upcoming development of the C-style wasm sqlite3 interface, plus some commentary about the plans and goals for that.

FossilOrigin-Name: c7cfdd4c3682659352642461d3307bf8180703b121ec1802ba5881f8e1ef9809

3 years agoDefer materializing a view or subquery until the materialization is actually deferred-materialize
drh [Sat, 21 May 2022 18:03:33 +0000 (18:03 +0000)] 
Defer materializing a view or subquery until the materialization is actually
needed, so that if it is not needed, not useless work is performed.

FossilOrigin-Name: 16bf350683fd6ac906dbd02b21fb8bf1b1014ed05594cacf108645acd383ae65

3 years agoFix a typo in a comment.
drh [Sat, 21 May 2022 15:54:45 +0000 (15:54 +0000)] 
Fix a typo in a comment.

FossilOrigin-Name: 34d7045b2cc8ef16fd4115499888703a376d2c3a289e7fdd117f8341ffa586c3

3 years agoUse the newer OP_BeginSubrtn opcode instead of OP_Integer to start the
drh [Sat, 21 May 2022 15:12:41 +0000 (15:12 +0000)] 
Use the newer OP_BeginSubrtn opcode instead of OP_Integer to start the
subroutine used to matrialize a view.  This does not change execution but
does make the byte code a little easier to read.

FossilOrigin-Name: cebd4fd606f967de527cff79df8e80e16d06eec257939322f16d21303868fb4d

3 years agofiddle: refactor into main thread (UI) and worker thread (wasm module). Added bits...
stephan [Sat, 21 May 2022 14:19:05 +0000 (14:19 +0000)] 
fiddle: refactor into main thread (UI) and worker thread (wasm module). Added bits needed to support triggering sqlite3_interrupt() but do not yet have a second SharedWorker to test it with.

FossilOrigin-Name: 5ff3326856bc190cee15a5fca5ded89aacc4bf931a8df98726a872b310e2a4fc

3 years agofiddle: add a selection list of example queries.
stephan [Sat, 21 May 2022 00:45:46 +0000 (00:45 +0000)] 
fiddle: add a selection list of example queries.

FossilOrigin-Name: 74abf03977e1ff8c6043defa38211cdfcfbba1979771b90ed9d3dbc99750fe9f

3 years agoIn the shell WASM build, call open_db() early so that we can get access to the global...
stephan [Sat, 21 May 2022 00:01:45 +0000 (00:01 +0000)] 
In the shell WASM build, call open_db() early so that we can get access to the global db handle from certain experimentation-only function without having to first run some SQL code.

FossilOrigin-Name: 31706ef851f7d55e2fe865933ec03f42dfa8b49e6d1f12b6c016b5c1d3460504

3 years agoAdded the standard sqlite license header to the the fiddle JS files. Minor internal...
stephan [Fri, 20 May 2022 13:50:04 +0000 (13:50 +0000)] 
Added the standard sqlite license header to the the fiddle JS files. Minor internal renamings in those same files.

FossilOrigin-Name: 67e40d99ff84a6cb23c68bf0722a4f9dee29b8ad18d9e7aac7d1665e99901ba1

3 years ago#if'd out the '.nonce' and '.check' commends in WASM builds.
stephan [Thu, 19 May 2022 22:04:23 +0000 (22:04 +0000)] 
#if'd out the '.nonce' and '.check' commends in WASM builds.

FossilOrigin-Name: 326f79ea54566a9302be99d920856f13b48f2c2ed265fa87d78ced367d4b1946

3 years ago#if'd out the the '.cd' and '.clone' commands for WASM builds.
stephan [Thu, 19 May 2022 21:56:50 +0000 (21:56 +0000)] 
#if'd out the the '.cd' and '.clone' commands for WASM builds.

FossilOrigin-Name: fa391868dd626ffdb220bed6834d0a10c7336f0fc4ca56055147784de1a4f99d

3 years agofiddle: consolidated two duplicate CSS rules. Internal doc typo fix.
stephan [Thu, 19 May 2022 18:14:34 +0000 (18:14 +0000)] 
fiddle: consolidated two duplicate CSS rules. Internal doc typo fix.

FossilOrigin-Name: d3175a793fb2d1ac9ecfd7a7c3b1627fe583effcd37740206a11b115f099d521

3 years agoAdded a disclaimer about fiddle's experimental and subject-to-change/removal nature.
stephan [Thu, 19 May 2022 17:47:17 +0000 (17:47 +0000)] 
Added a disclaimer about fiddle's experimental and subject-to-change/removal nature.

FossilOrigin-Name: 75b4f574089c4969d2f2c3615a52029e98515e36390c530cdf63f15f4f687a1d

3 years agoMerge the changes to support the "fiddle" extension.
drh [Thu, 19 May 2022 16:59:46 +0000 (16:59 +0000)] 
Merge the changes to support the "fiddle" extension.

FossilOrigin-Name: 58585f01aa4747d3a09771fb462066bd037914f435ff04fa16ed9b0571e7912a

3 years agoWhen building fiddle from its own directory (e.g. from emacs instead of the normal... fiddle
stephan [Thu, 19 May 2022 16:49:15 +0000 (16:49 +0000)] 
When building fiddle from its own directory (e.g. from emacs instead of the normal build process), force -O0 the sake of compilation speed. The top-level build now defaults to -Oz, which is more appropriate for that case.

FossilOrigin-Name: 56b82ae806c61b95e62042ca70ed952ce01832b02da55c2b315f9201989514ab