Commit Graph

24454 Commits

Author SHA1 Message Date
drh
0286cdbca6 Additional enhancements to the test cases.
FossilOrigin-Name: 55cfad74cace74e541b354228e3ad46e17028213a9f639edf2007c6a8f3ba8fc
2022-06-01 11:58:11 +00:00
drh
47b4969e2d Fix test cases in the previous check-in to make them postgres-compatible.
FossilOrigin-Name: f223ba72b6e02a7ccfd894b4b135f4609b1eb79f547ec279b1c52a6996cd5a73
2022-06-01 11:46:39 +00:00
drh
36c19f7799 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
2022-06-01 11:43:57 +00:00
stephan
ea7a4e4fb3 The Worker-specific variants of the most significant DB-class JS bindings are implemented, most notably various uses of DB.exec().
FossilOrigin-Name: 371d6f7497016ca9bf82c8524b4d701ddf1e614b3fb4e69ff63935da0d51ed05
2022-06-01 11:20:07 +00:00
drh
645682a7c7 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
2022-06-01 11:05:59 +00:00
stephan
6ffa895884 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
2022-06-01 08:09:06 +00:00
stephan
bff17db433 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
2022-06-01 00:00:59 +00:00
drh
c7fc08f69a New FULL JOIN test cases. No changes to code.
FossilOrigin-Name: 13e89ef6649475815d3f4e4aef73a4be1157dd388e55c7f856faeb4b7387774b
2022-05-31 18:18:09 +00:00
drh
aa03c69591 More JOIN test cases inspired by the problem fixed in [3869fd9a2b9483cb].
FossilOrigin-Name: f2d224c5fa06de70f6f22e159a3b7065d4c6b004f9accc13004b9ac1f2fd5549
2022-05-31 17:24:56 +00:00
drh
f51672a945 Fix an assert that is incorrect for a corrupt database.
FossilOrigin-Name: fe0a840805b435efd38a953a8aae60e29a35289f9d9955472a8bab2bce7051c8
2022-05-31 15:18:55 +00:00
drh
d69820c42b Many new PG-confirmed test cases in joinD.test.
FossilOrigin-Name: 481e89c764ad8906cd21c8fbe58df57ae40bb3f261fa4892ea7ce7762786ad26
2022-05-31 14:19:04 +00:00
drh
9f67cc26c1 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
2022-05-31 11:22:30 +00:00
drh
c9dfe2b808 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
2022-05-31 11:13:55 +00:00
drh
b1f08bc690 Add test cases for
[forum:/forumpost/c2554d560bac97c5|forum post c2554d560bac97c5].

FossilOrigin-Name: e66d5ae86c09cbe581b8f4f1bff33376cc680bba3da24f85384dd6c3eb85ddcf
2022-05-31 10:48:02 +00:00
stephan
5fd9f03291 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
2022-05-31 02:03:29 +00:00
drh
404bf6bac6 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
2022-05-30 17:33:22 +00:00
drh
1943005f62 Apply the UPDATE-FROM file from check-in [98b3816bbaf539ea] to
update-delete-limit builds.

FossilOrigin-Name: 7e87892c249f023ee9ed1d5f75a9ad8db10fb38f14dd9e6954b12b9b28400b07
2022-05-28 14:03:23 +00:00
stephan
1a66ff359f 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
2022-05-28 11:59:46 +00:00
stephan
e9ab04a446 fiddle: corrected a piece of far-corner-case error handling and made the various checkbox config options persistent.
FossilOrigin-Name: 2ba429a4f8300b981b23d54c2bdb54bd4863522c1c18bf9a67a82e3dce845b10
2022-05-28 11:29:00 +00:00
drh
5af8a86d62 Mark an always-true conditional as ALWAYS().
FossilOrigin-Name: 3492fe8a212cbe02b9016866e2499b99c3b566a4b0bc91fba267e6e1fe1b8943
2022-05-27 18:06:49 +00:00
drh
abe1ff38dd Minor simplification to ALTER TABLE logic.
FossilOrigin-Name: 01beb0365c529481605f1864b1b6760e2484fad08d56a72e00e34acff37e23f8
2022-05-27 17:36:21 +00:00
stephan
23b34bbc25 Corrected a broken HTML comment (was using a C-style comment closer).
FossilOrigin-Name: db742e3e7d1caeff8d9df1d86abf54fcb2f2263db7a433ffacf3cd3777e533c5
2022-05-27 17:13:56 +00:00
dan
ca29bbce2f Fix another problem with ALTER TABLE and UPDATE...FROM in triggers.
FossilOrigin-Name: 33cf12235e6469ba17cfb72cef0e480dfd0dea81ed412fb1fb24b05dbeb8dc02
2022-05-27 15:33:51 +00:00
dan
4209d553e7 Fix further issues with ALTER TABLE and triggers that contain UPDATE..FROM statements.
FossilOrigin-Name: 53fbc269ddbabc4a97d297e881e5f9cd2bfbcd24af4af1b7cf9db412a3a51813
2022-05-27 15:04:43 +00:00
drh
8d2f661ab8 Omit an unnecessary branch.
FossilOrigin-Name: f56473f9cc1b476b3219fe5b70ba2e4b269b20c880b99ba34c744ed893042081
2022-05-27 14:41:48 +00:00
stephan
cd69784646 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
2022-05-27 03:27:10 +00:00
dan
b8bbe3e2db Fix issues with ALTER TABLE and triggers containing "UPDATE...FROM" statements.
FossilOrigin-Name: 2fba0d41b781d226915fa2bf888a7bc640c046ce22670ceb53f62a09f3975259
2022-05-26 19:10:11 +00:00
drh
26c4df0fb0 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
2022-05-26 17:33:42 +00:00
drh
e91bde4655 Clarification of the meaning of the N parameter in sqlite3_db_name().
Documentation only.  No changes to code.

FossilOrigin-Name: f22f41d2c8a676b9a339e7f00c29c163bbb7079b1a4a76ee1a6a96aaf7de5f9e
2022-05-26 14:46:09 +00:00
stephan
78907bba3e Fixed a minor cut/paste mistake in the previous checkin. Affects only internal docs.
FossilOrigin-Name: 37e3764839b968456f576fad67d3d99007773f5c0689165ecbdc610fcabef1ca
2022-05-26 05:18:33 +00:00
stephan
c121e087f3 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
2022-05-26 05:08:25 +00:00
drh
724e298e9c Slight increase in the accuracy of log10().
FossilOrigin-Name: c48a735bd4a1dbd541aed5937c25fc0c606c4263d8ee94cae30a06b1a7b26d9a
2022-05-25 13:10:29 +00:00
drh
7bfbd2508c 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
2022-05-25 12:49:59 +00:00
drh
361e0ede47 Add in a VdbeCoverage() macro accidentally omitted from [d64ae49a1f251317].
FossilOrigin-Name: 18b5cea0392a28f694b8931a80e93518f8d3d297d787fa44d1544e373f76838e
2022-05-25 11:17:13 +00:00
drh
ddcdf0b0dd Fix the UPDATE-FROM logic so that it works the same as PostgreSQL when the
FROM clause contains an outer join.

FossilOrigin-Name: 98b3816bbaf539ea745456e1c0064e47d2903d33ee0ceb029bdb97d56fcde937
2022-05-25 11:09:07 +00:00
stephan
26542e722b 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
2022-05-25 08:51:07 +00:00
stephan
e599cc427f 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
2022-05-25 04:38:35 +00:00
stephan
085c5c6b43 Add the ability to import/export db files into/from fiddle.
FossilOrigin-Name: e0c30438a4f1372afb93a0488bae17b3f85d535717b215f494a83ae909871d2c
2022-05-25 04:35:22 +00:00
stephan
d0b22b81c8 Further minor cleanups and docs in the fiddle app and worker.
FossilOrigin-Name: 199e01799dfa48e3fddafb7f2ae5360604150a44186d5c5a977e158ad8e7e657
2022-05-25 04:20:08 +00:00
stephan
79669c25c4 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
2022-05-25 03:08:22 +00:00
drh
fb98dac04f An attempt to get UPDATE FROM working when the FROM clause contains a
RIGHT or FULL JOIN.

FossilOrigin-Name: a124e4f96f883d8682ba7a253d33a9565ed0fc3580525225b95733bd3782a806
2022-05-25 02:32:11 +00:00
stephan
80bf86967f 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
2022-05-24 22:16:12 +00:00
stephan
de1e02ee52 fiddle: initial work on loading a client-side db file. Works but requires some cleanup. Export is not yet implemented.
FossilOrigin-Name: 0fa8378c006fcf2311772d36cf2e3c2cd8e8648f671de89ee9832e2e1a06ef49
2022-05-24 19:01:21 +00:00
drh
6af03b469e 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
2022-05-24 16:05:41 +00:00
stephan
73c6ad1920 MoUse re descriptive var names in ext/fiddle/Makefile.
FossilOrigin-Name: 2f9a42fb141d386f6edd03a37da3b0cef63dcc9fbfd076076b5330a8aa7d45a8
2022-05-24 14:45:16 +00:00
stephan
400ee2ecef 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
2022-05-24 14:36:45 +00:00
stephan
2f6a729d55 wasm/JS: minor doc updates, corrected bind()ing of the undefined value to behave as documented, removed some superfluous code.
FossilOrigin-Name: 526c8c728019b317624a93f6f07840ca524bca84e7c03ce5e86e38953146236f
2022-05-24 01:15:21 +00:00
stephan
64f0e9376b wasm/JS: documented DB.selectValue() and corrected the fetching of NULL columns via Stmt.get().
FossilOrigin-Name: 70f91fab825d365f505750acdb8d3ae532880c4cdb64d1e61bb21b24a115958b
2022-05-24 00:35:18 +00:00
stephan
a240a24ad0 wasm/JS: added support for scalar UDFs. Fixed a deallocation problem with bind()ed strings/blobs.
FossilOrigin-Name: 325a9ee31ad7abae563c4da5cd8228e151b00aa9afcac7e9bca5efaa9d48e107
2022-05-24 00:22:10 +00:00
stephan
e145136a4e wasm: minor refactoring and doc updates.
FossilOrigin-Name: 6044605b2a712da73600cabb967797a03ed1915dc0ab0b10edbd52525e548196
2022-05-23 19:38:57 +00:00