Compare commits

..

211 Commits

Author SHA1 Message Date
drh b7b060401e Work around compilers that do not understand flexible arrays, in the
recovery extension and in the fuzzcheck test module.

FossilOrigin-Name: f101c46cf83e532fd33034abccba496bf395ef10c161af003211614d6581d5eb
2025-03-15 19:00:46 +00:00
drh 7bd72d4abf Fix alignment problems on Linux with -m32 and on Mac PPC.
FossilOrigin-Name: 8a91aeca60548d5cd19add128cf65b9c3815c9103b1ef8ff6bc02711b6d709de
2025-03-15 18:26:27 +00:00
stephan 8c0e922721 -fsanitize is a CFLAG, not LDFLAG, so rename some vars accordingly and simplify the feature check to not run the linker.
FossilOrigin-Name: 44f2c64ec16f4720dc538be30410863c4138ea4ce41c94521bd7980535261735
2025-03-15 13:50:07 +00:00
stephan f792cda1a1 For fuzzcheck-asan, dynamically determine the list of -fsanitize flags to use based on configure-time feature tests.
FossilOrigin-Name: b70f9cc81516e57e73960bed4b4d2abdcf3dab0ad4a400ca1aed49365c25231e
2025-03-15 13:36:01 +00:00
drh d389fd3699 Omit the -fsanitize=bounds-strict for now, as that is still not widely
implemented.  In particular, it does not work on Macs.

FossilOrigin-Name: 3e1c2ac7817e73ea736a39bb0c0ec8212ceedbc89b265b4caf1b53871d27d7c0
2025-03-15 13:11:24 +00:00
drh 0a4f10e6e2 Use flexible arrays in the recovery extension and in the fuzzcheck test program.
Adjust the unix makefile to use -fsanitize=bounds-strict when building
fuzzcheck-asan.

FossilOrigin-Name: 6ea6a6b211fed1a14d7bec1ab1790dec09e2a00423860498a60b760c4a4561fa
2025-03-15 13:04:16 +00:00
drh bd0e3ed522 Use flexible arrays whereever appropriate in FTS5.
FossilOrigin-Name: 16dfc415b6e98a2acae79a24bb0afd401e60efc27cbdd1603a426fd33e17d427
2025-03-15 12:22:39 +00:00
drh 17abe9e251 Convert the Fts5Sorter.aIdx field to a flexible array.
FossilOrigin-Name: 28ac776a23da2753265a7fe2ee2ebb09964815fc9058e69c08275fc217842edc
2025-03-15 00:11:22 +00:00
drh 502b7a236e Turn Fts5Colset.aiCol into a flexible array.
FossilOrigin-Name: 0c4d9c74741794468adc444908f6024f016738aa2852d3a646f2c28d079d9446
2025-03-14 23:57:53 +00:00
drh 126541f8ac In FTS3, rename the MatchinfoBuffer.aMatchinfo field to aMI, to avoid confusing
it with MatchInfo.aMatchinfo.  Make aMI a flexiable array.

FossilOrigin-Name: bb00b973980d259ca85af84c054501cae78b3a9d33ccffa54d7034235dd8d50d
2025-03-14 23:20:12 +00:00
drh dbd455a0fd Fix one of two flexible arrays in FTS3.
FossilOrigin-Name: ddfa87c17906ecf7fd5639a87bbfa9a87d17ab688159acd2fd80cc5b6f25f09b
2025-03-14 21:15:11 +00:00
drh 01ef1dfc1f Use flexible arrays for RTREE.
FossilOrigin-Name: 2b41776179c726586e3ff836edcf235938cf02f7c5e33c1d6954b84d4061b8d5
2025-03-14 20:19:49 +00:00
drh b6e8f65ffe KeyInfo is now an indeterminate size, so we cannot declare a variable of that
type, only a pointer to an instance of that type.

FossilOrigin-Name: 37b687dc2d3b9dc82ed09a9c5b2c00e576b1eebe358a20d18a3da190347b644e
2025-03-14 19:07:11 +00:00
drh cebf06c798 Make use of the flexible-array feature of C99, when available, to try to
pacify -fsanitize=strict-bounds.  This check-in fixes the core. There is
more yet to do in FTS3, RTREE, and in FTS5.

FossilOrigin-Name: 6fd6b32d06bd6a705e5140cd613af823b8183a6f6a9ceeeedfcf5e8b50821d68
2025-03-14 18:10:02 +00:00
stephan dae87df198 Fix an internal doc typo reported in [forum:e25e581f917|forum post e25e581f917].
FossilOrigin-Name: fa6f6ccdffc50024624306900efd2538c7415d8bdd0f02835b2e9c05adab3cf1
2025-03-14 12:37:36 +00:00
stephan 1560045c32 Cherrypick the [2b582c0097e33] doc addition, which was initially committed to the wrong branch.
FossilOrigin-Name: f786de8d1873cd27b1bf83273a1e100e9d481144674888ccf65974e003a3caad
2025-03-14 09:34:09 +00:00
drh 99e8490705 Fix the generate_series extension for the case where the termination value
is not an even multiple of the step from the start value and there is also
a value=NNN constraint in the WHERE clause.
[forum:/info/bf2dc8e909983511|Forum post bf2dc8e9]

FossilOrigin-Name: 75e72e3b0d0d689d39e00a01dc361dd6ce2649e68d200bf501ddcf04063041b2
2025-03-13 18:51:18 +00:00
drh 62d9d70edd The --echo flag on the CLI also echos dot-commands provided on the command-line.
FossilOrigin-Name: 6ec0c03b954cf705da076d035a1cc2e784233ae28857385379e44a59af6c5ec4
2025-03-12 15:17:13 +00:00
drh a7829ecbdd The substitute "puts" command used by the Windows implementation of
sqlite3_analyzer must invoke fflush() after each line of output.  Otherwise
the output can be truncated when redirected into a file.

FossilOrigin-Name: ba058ce90a2ba9ebc4d8fb289108c04f80fa85da01c0b8bd58855681836ba83d
2025-03-11 12:19:27 +00:00
drh 642479d1cd Ensure that the TEMP database has been initialized at the beginning of
a call to sqlite3_open_blob() for the TEMP database.  Fix for the issue
reported by [forum:/forumpost/0a556d619b|forum post 0a556d619b].

FossilOrigin-Name: 2cfccdbe08b7b14a6b255f7157ac20d0807327adefcb33fcffeeed14c7603fe1
2025-03-10 22:31:55 +00:00
stephan 09eba154b2 Add an explicit db close to test/walsetlk.test to work around an unjustified test failure on Windows when the walsetlk tests are run in the same invocation of testfixture.exe in Windows.
FossilOrigin-Name: f418de109335cd7cb29d2b587540c163bbaaa7129c662c2908ef67492139b2d7
2025-03-10 17:28:43 +00:00
drh eed4e1d2df Disable the [d1ba200234f40b84|count-of-view optimization] if any subquery
is DISTINCT, as the optimization does not work in that case.
Bug reported by [forum/forumpost/a860f5fb2e|forum post a860f5fb2e].

FossilOrigin-Name: d7013b63932b2f5750572ae6bdd259a2b6e6548c20fb9a5559edd22d2f2fc6cb
2025-03-10 10:32:31 +00:00
stephan d75acb8312 Back out the most significant part of [5c28a17253e2f], as Cygwin is a hybrid. With SQLITE_OS_UNIX it will use POSIX locking, which will misinteract with apps using Windows-style locking.
FossilOrigin-Name: 44adf8f38761a0d756c047f93fc76fc1d0aba8cc209970e3ba13e7040dd14b13
2025-03-06 09:29:15 +00:00
stephan 47991d973a Various typo fixes reported by Daniel Dumitriu. No functional changes.
FossilOrigin-Name: 37e6ec777445d8ef81acecbb66f86ae78f2ae67ef0bfd3fbd089da51fff35cc9
2025-03-06 09:08:38 +00:00
stephan ba6510a399 Additional 'array index is signed char' warning cleanups for the shell and its embedded extensions, analog to [44bd44532d].
FossilOrigin-Name: f31042595b8f8a378db9778c9a8223b07ec02cf2f528581ba43bf72b5b03c964
2025-03-06 07:48:45 +00:00
stephan 894cda4db7 Fix a tcl typo in the previous checkin which triggers an error on one machine but not another.
FossilOrigin-Name: 646c2821ad434058db7760e699d21a47c7feb5976199cbe4b58d54c902720cbf
2025-03-06 07:09:50 +00:00
stephan 2d960e943b Have the configure script report cygwin as SQLITE_OS_UNIX instead of SQLITE_OS_WIN, per off-list discussion with Jan Nijtmans.
FossilOrigin-Name: 5c28a17253e2fe56d7fd97cc43345b3fd8bd59fccea3fb1547ed87f7902f76f5
2025-03-06 06:25:45 +00:00
dan fc9b5d2a95 Have the recover module add "PRAGMA foreign_keys = off" to SQL output. Have the shell tool add ".dbconfig defensive off".
FossilOrigin-Name: dcfe3d3292851aa48a085a2c68623b049e2786c8dc7154ccc78508443973b5a1
2025-03-05 19:39:02 +00:00
drh bee4fb401e Always ignore comments in the schema of a database, even if
SQLITE_DBCONFIG_ENABLE_COMMENTS is turned off.

FossilOrigin-Name: 373ae3f4de526c636c35db03d6b5c84526d6f144c1c3bebcbb257e52f563a203
2025-03-05 18:18:17 +00:00
dan c27c61586f Update the recovery extension so that it works with encrypted databases.
FossilOrigin-Name: b0b66f21159b47e1950ca63a01f92fe4f621efb9a2962b310d65fa7ebdbb43b3
2025-03-05 17:26:56 +00:00
drh 427e0076a9 Use AtomicRead() and AtomicWrite() to access the pcache1_g.bUnderPressure
global, to forestall unnecessary angst from thread analyzers.

FossilOrigin-Name: 41ec85637a7fac710a3986ee78ed25a96d331a03653069bae4d9f826cc6f944a
2025-03-05 17:12:42 +00:00
drh 9f19ea83e7 Improvement output for ".schema --indent" in the CLI when the schema contains
partial indexes with long and complicated WHERE clauses.

FossilOrigin-Name: defd7187ff8c4388f8b5467ed168462ec48215a1f4263bc4128b8e4d89a0bb2a
2025-03-05 16:35:51 +00:00
stephan bf09cbe2ca Minor configure script cleanups which started out as cygwin-specific fixes but ended up just being minor platform-agnostic cleanups.
FossilOrigin-Name: 2cda90410ac62843fa3cf5a9592b2b25564cf9d829e107c85854e8167d4fe46d
2025-03-04 21:37:40 +00:00
stephan 4b60c1b49c Roll back part of [6d87a8efe]: the check for tclsh90.exe (as opposed to tclsh9.0.exe) is incorrect on these platforms (it's an msvc build). Also remove an unused function added in that checkin.
FossilOrigin-Name: dc84976a7c0d0028b7c576d54e18d1b8e1fc2376bc7b0504f1c86e82c1f7c814
2025-03-04 21:31:18 +00:00
stephan e34ad2b0b3 tclsqlite3 patch from Christian Werner: replace FILE handles with TCL channels for the db copy command.
FossilOrigin-Name: ea1f7f8de4abb80fe41a115c9f601ff27cd728493640c6d47d868913feec28dc
2025-03-04 21:25:18 +00:00
stephan 0ca5b1e39d Teach autosetup how to find tclsh v9.0 on cygwin.
FossilOrigin-Name: 6d87a8efe5611102eac150e5dc1e9d9602318ab8b96046b29c66602e7c3d12fa
2025-03-04 19:38:38 +00:00
stephan f5965e9d51 Makefile doc updates. Remove a couple extraneous targets. No functional changes.
FossilOrigin-Name: 5a3e22999f8da075f7ca3e039f10386fb85295a2457c9495d2c48b7137a84296
2025-03-04 07:29:28 +00:00
stephan 3ce81095f9 Minor doc typo fixes via [forum:65bd941da8|forum post 65bd941da8].
FossilOrigin-Name: 6f6a03e93cf58eaee79603de0b28ad34c872fb4b4b7d9c4e7fe35c698b27618a
2025-03-04 06:29:03 +00:00
stephan 5b27bfac44 Document the EXTRA_SRC makefile var and add --amalgamation-extra-src=list to the canonical-build configure script as the formal way to pass that at configure-time.
FossilOrigin-Name: 44de0ec29a86f91a227132f7af8898108d555463b754b299eace0ee8475bad57
2025-03-04 05:16:10 +00:00
stephan 272344d206 Internal configure script cleanups. Resolve an as-yet-hypothetical corner case involving the --dev flag mixed with custom CFLAGS containing SQLITE_ENABLE... or SQLITE_OMIT... flags. Fix an unrelated API doc typo reported in [forum:606ea661df|forum post 606ea661df].
FossilOrigin-Name: 0554c00f32b7cc81d35340080df10ea6d66c9ff07fe749ea76cc523a4149b5c8
2025-03-03 14:15:13 +00:00
stephan 31b72ff521 Minor configure script doc tweaks. This is also a note that the basic elements of the build run as-is on Haiku OS Beta 5 but the tcl bits do not (for lack of tclConfig.sh).
FossilOrigin-Name: acf9babf0efc346b26c8ac02c0bd973498bf1604b47fe320de14027f9b21ed33
2025-03-03 11:48:09 +00:00
drh c171cf1ef7 Ensure that detection of control characters by comparison against 0x1f
uses unsigned characters. [forum:/forumpost/4c344ca61f|Forum post 4c344ca61f].

FossilOrigin-Name: b7c5ce84216cc7f5a3ba07404572edb94fd628b3a7421111cd5f5333f3e56ea8
2025-03-02 20:29:49 +00:00
stephan c9cc6a5474 Use SQLITE_EXTRA_INIT_MUTEXED instead of SQLITE_EXTRA_INIT for the SQLITE_WASM_EXTRA_INIT feature, as suggested in [forum:14183b98fc0b1dea|forum post 14183b98fc0b1dea]. This doesn't make a functional difference now - this is in the name of future-proofing against eventual threading support in wasm.
FossilOrigin-Name: 46479c2e30b9676e0fa8da117ba67f673671fb340c9bea38ece19a1b2371a57b
2025-03-01 23:44:11 +00:00
drh 8346ceef5a Add an assert() in vdbesort.c to help both humans and static analyzer AIs
understand why a particular array cannot overflow.

FossilOrigin-Name: a14d4afd5020af327629e5c72b0699ddab0ef4e3f23938a1b72669aa29fc2e87
2025-03-01 11:47:01 +00:00
drh 557974e126 In the CLI, ensure that all calls to ctype.h macros are cast to unsigned char.
Apparently cygwin needs this.

FossilOrigin-Name: 44bd44532d4a63b2f600427dc425bde618bcc21e4abffaa2ec19f27350e54732
2025-02-28 15:54:28 +00:00
stephan cf794e17cc Latest upstream autosetup. Fixes two minor corner-case issues which we haven't yet seen in practice.
FossilOrigin-Name: 5c2438a719de6787c2f7c9f38d14d5ccdb8d36a120657661ec28051c83a93270
2025-02-28 04:58:43 +00:00
stephan da5f813878 Approximately 100 typo corrections spanning the whole tree, submitted via [forum:0db9827f0464bc33|forum post 0db9827f0464bc33] and individually audited and verified. Affects only code comments, innocuous test strings, error message text in tool (not library) code, and configure-level help text.
FossilOrigin-Name: f50c21484d3cac73589da0376c423de39ae8b842218105786c5aa3726e4dcaed
2025-02-27 21:17:55 +00:00
stephan 3398441bfc Reimplement testrunner_data.tcl::trd_get_bin_name() to assume a .exe extension on all platforms not matching "unix", to avoid having to do file-exists checks.
FossilOrigin-Name: ce5519102a1b4df5d513835974799cdcda3478ec53ae99bbb631951095291919
2025-02-27 19:40:02 +00:00
drh 1d54203394 Strive to make sorts stable in the mkpragmatab.tcl build script, so that
we get consistent amalgamations regardless of platform.
[forum:/forumpost/c9914addebf3da51|Forum thread c9914addebf3da51].

FossilOrigin-Name: 3f57584710d611748eb0af797c58c72e4ac099db09f5286cafdbd9a8ce354c90
2025-02-27 16:07:49 +00:00
drh 157d9276a0 Merge back a sequence of three changes that were branched due to a build break.
FossilOrigin-Name: 67809715977a5bad0ec7830e27746aba2080852eb725d471c0fd62d4f464a884
2025-02-27 15:55:01 +00:00
drh 29820d39d8 Fix build break in [e2bd23f251359e7a].
FossilOrigin-Name: 6ed84211033ee0ff00c8fd088979fe06d3a264e4f935162f36a62c00af135c63
2025-02-27 15:52:15 +00:00
dan fd3938fbca Add support for SQLITE_EXTRA_INIT_MUTEXED - like SQLITE_EXTRA_INIT, but is called from within sqlite3_initialize() when the SQLITE_MUTEX_STATIC_MAIN mutex is still held.
FossilOrigin-Name: 3cf88d429f6e7c10b8f19c283151541924c4bb84bbd0d2e05cabdd4f9f0e88c9
2025-02-27 11:03:54 +00:00
stephan 129203bce3 Internal doc typo fixes reported in [forum:01d15f21b6|forum post 01d15f21b6].
FossilOrigin-Name: d6514c20ff583ccc4fb3a526fb8f86a563224f513ee10bb39a978046bd952726
2025-02-27 03:23:33 +00:00
stephan e1e822ca23 Teach testrunner how to run local binaries which have a .exe extension. Also teach it to recognized mingw environments (but actually building the test programs there currently doesn't work).
FossilOrigin-Name: e2bd23f251359e7a818c4cfacf114aa9fd8c0a9a1cb802654e96fad67b505508
2025-02-26 19:22:52 +00:00
stephan 94c42564f3 Test testrunner.tcl to identify an msys environment.
FossilOrigin-Name: e9f777ceda9fca51c37caca0afeadfc3f99b86e945496f52c71adcc520dcee98
2025-02-26 18:31:42 +00:00
stephan 666bbd4641 Undo part of [69e83ab859c], as that order of operations breaks the --prefix=... configure flag. Found a workaround for the library version and OS/environment info being emitted when --help.
FossilOrigin-Name: cd2a84a72c922c330441d6b75df0c8b2f6df2c25bc7c37ac37046fffd702624a
2025-02-26 17:11:25 +00:00
stephan 68d88cfec5 configure: extend the readline detection a bit so that it can find readline on termux environments without having to be told where it is. Fix a typo in a libedit-related message.
FossilOrigin-Name: 52f528c4be4ee4ae4ee4c05009c33bb97269d27380ce2cdd717a514616f39be7
2025-02-26 16:15:34 +00:00
stephan a37aec123a Shift some bootstrapping configure bits to avoid emitting extra output if --help is specified.
FossilOrigin-Name: 69e83ab859ca37c047defdaba84e80d028b30045631e773bd8dfa286c41a57e8
2025-02-26 09:14:26 +00:00
stephan d804893762 Fix a bug in mkwasmbuilds.c which caused sqlite3.wasm to get deleted directly after it was built.
FossilOrigin-Name: 1a72d1d13e42f69f02861f8ac3058e69b78d4fd2050ca8c53a1ce016b7e0863d
2025-02-26 03:20:26 +00:00
drh b5f74ee637 Disable some misuse tests that sometimes cause segfaults during
"make releasetest".

FossilOrigin-Name: 5856251a7e8a69aa181f89533bc2a78812d8b450a407b4b2f73f0c146cd78072
2025-02-25 21:16:13 +00:00
stephan 5d60f47001 Approximately 50 typo fixes, spanning the whole tree, contributed via [forum:006c8fa165083ac3|forum post 006c8fa165083ac3] and individually checked for correctness. Affects only code comments, docs, and a single line of debug output in a test app.
FossilOrigin-Name: af928818a030924060ee0762431dae0f16d53a62f4e1132754d052eb9c621ac2
2025-02-25 20:55:14 +00:00
drh b8ec04ee02 Fix a test case that was broken when the default --escape type was changed
by the previous check-in.

FossilOrigin-Name: 5f2531e068b4856db2270518c370b65cbd0c0ab5443d76f1fb1116fe9ad80296
2025-02-25 20:36:46 +00:00
drh 846643ebad Change the default control-character escape algorithm from "symbol" to
"ascii", since the "ascii" algorithm works even on terminals that do
not support unicode.

FossilOrigin-Name: d35320495eb282601ab4f3b9efc53c7c1d58e890f025317e34c7046a43c8cb53
2025-02-25 20:10:46 +00:00
drh 1c03a34400 Fix harmless "unused parameter" compiler warnings.
FossilOrigin-Name: 7a68a3ead8e6c75203641542256bcfa05067bed4bf9035452fbd134534801a08
2025-02-25 20:02:58 +00:00
drh 82769e7d04 Improved help messages for the --escape option in the CLI.
FossilOrigin-Name: e6784af6d50f715338ae3218fc8ba1b894883c27d797f0b7fd2625cac17d9cd7
2025-02-25 18:10:47 +00:00
stephan 90454d8924 Configure script cosmetics: emit the host/build system info before the directory info.
FossilOrigin-Name: 6f0b6d95db17e69ac7e46a39f52770291ac4cfe43eea09add224946a6e11f04e
2025-02-25 16:39:51 +00:00
stephan c3d2ec2289 Restructure [826bad10e9ccd6f71e] as that structure mysteriously breaks the --prefix=... configure flag.
FossilOrigin-Name: d284230f68616b78a527d34df777b0220376ba6a00e9e927d4ffb4cbddab900c
2025-02-25 16:11:25 +00:00
drh 87ad172c50 Enhancements to help avoid problems in the CLI when trying display content
that contains ANSI escape codes:  (1) Add the --escape MODE option to the CLI
where MODE is one of "symbol", "ascii", "off" where the default is "symbol".
(2) Add the unistr() SQL function.  (3) Add the unistr_quote() SQL function.
(4) Add the %#Q and %#q conversions in the built-in printf.

FossilOrigin-Name: e3e509ae145ee2623ac68ededa59991a97fcd28313e03f67a3890b560c5381b0
2025-02-25 15:57:49 +00:00
stephan 228e51d8cd Diverse configure tweaks to better support package maintainers on the unix-on-windows environments like msys2, cygwin, and mingw, based largely on feedback in forum posts [forum:e6cf2bbb70da2922|e6cf2bbb70da2922] and [forum:828fdfe9041fd725|828fdfe9041fd725].
FossilOrigin-Name: 85b56fb0cce4b628f80b26a67b43236ef1557282775739bdbe7cc4d65948d66f
2025-02-25 15:54:07 +00:00
dan 58bc525e32 Reinstate the assert() removed by [0f6223b8]. Avoid holding a wal-mode write lock after the transaction has been rolled back if an IO error occurs while restarting the wal file.
FossilOrigin-Name: 277e150d6ab75de2407f6761aa2359df80a4e1dbce30788df06621dee05b2ef1
2025-02-25 15:27:55 +00:00
dan 18d9b12e90 Fix a test script problem causing errors with Tcl 9.
FossilOrigin-Name: dbec2c47d09027f2458036f675c8af3f8f152c0530799582eeac231649eba501
2025-02-25 13:33:43 +00:00
drh d4c686ed8f Small performance improvement for the new %#Q conversion in printf.
FossilOrigin-Name: 17e440781e68d7d3ea68c5144e1e08e183f0caef595a6c7ac4ce56489c60f476
2025-02-25 12:18:27 +00:00
drh 17b620eb60 Update the autoconf Makefile for nmake to support SETLK_TIMEOUT.
FossilOrigin-Name: 46909fe3348976448d6a0d9e9aacaeaccdf0978c9e9d10742a96842418ab3a08
2025-02-25 12:11:57 +00:00
dan fb8c46510e Avoid running certain tests in walsetlk2.test if SQLITE_ENABLE_SETLK_TIMEOUT is set to 2, not 1.
FossilOrigin-Name: 86788c08fa09019f224d5dbd76f06c1d113b04ca5eca5d773719194a8b02da22
2025-02-25 11:48:57 +00:00
drh a357a90f12 Consolidate two different UTF8 encoders into a single subroutine.
FossilOrigin-Name: 6208e494858b9d362efc7db4e8aac6f8e93fe51d2e038c94dfa97c55a74688a0
2025-02-25 11:47:34 +00:00
dan a4cf066d64 Remove an assert() added by [e88212b1] that is sometimes false.
FossilOrigin-Name: 0f6223b8f6c044db687f78e19f6373d0dda9155445c511a297efa05bac3b16e5
2025-02-25 11:29:04 +00:00
drh c46fbec350 Fix the new shellA.test test script so that it works with Valgrind.
FossilOrigin-Name: c3949852cee320c2e02123b99c33155c459b10b2ac8e4fe80b1b7624c9ce0817
2025-02-24 23:34:50 +00:00
dan f037440bfe Support SQLITE_ENABLE_SETLK_TIMEOUT on windows.
FossilOrigin-Name: e88212b10a7829ff42ef51a02863d788c929e54161faf492f9ef2ad90fd7074e
2025-02-24 21:27:16 +00:00
stephan 51770439ff Slightly simplify auto.def and autoconf/auto.def.
FossilOrigin-Name: d84f591b962ea44efb902043444e4e54bc55e5bb32e5108f04df824407c412dd
2025-02-24 20:53:50 +00:00
drh 81d44c7e3e Use an assert() to fix a harmless (false-positive) scan-build warning
in the CLI.

FossilOrigin-Name: 4c56cd7392f114e27b43d8fcc79444c3078cd65285ba7dd3338a414e2a9f5392
2025-02-24 20:13:29 +00:00
stephan 31d54ad041 autoconf/auto.def: remove a define which made superfluous by [b8bf966628c0]. Add a check/status message for whether to statically link the library into the CLI shell.
FossilOrigin-Name: df95e908cacc7e8e749701ff49d2ce02a927c58a474dd9a362d5f84cb3d7413f
2025-02-24 18:45:30 +00:00
stephan b16c76408a configure: in autoconf build if both --disable-shared and --disable-static-shell are used together, ignore the former and emit a notice to that effect.
FossilOrigin-Name: b8bf966628c0cbbb6f0bc09a70800ac0b6b7f8c2d2f70c91f4b6e65daae0b192
2025-02-24 18:14:27 +00:00
drh e4f7af1908 Only use unistr() in columnar formats when strictly needed.
Do not use unistr() in insert mode when --escape is off.
More test cases.

FossilOrigin-Name: e029828de91b10b4c7f4a19bc70c35e4f36fae4ebf32b40553a6ba9f2b3af295
2025-02-24 17:50:49 +00:00
drh b6205d4bc3 Add the unistr_quote() function that works like quote(), but also escape
control characters using unistr() if necessary.

FossilOrigin-Name: e99e37b54baf7283588ead4983e613a1e14c58a0b92be5f7b25b4d9d287b5324
2025-02-24 13:51:24 +00:00
drh 7db5e50b8d Bug fix and initial test-case infrastructure for control-character escaping
in the CLI.

FossilOrigin-Name: c809997792602a7299b8ab84d018a03d291695e308ce750fc8b9d7a824edfd6e
2025-02-24 13:27:16 +00:00
drh 21b431e685 Ongoing work to get all the quoting and escaping variations in the CLI
working correctly.

FossilOrigin-Name: b77aea93e7eff0af408f598727caedcfc4428361b8440fbc1cc54c18f93abb69
2025-02-24 12:41:30 +00:00
stephan d2060072f3 Configure doc tweaks. Move the package version/build dir output so that it does not appear at the start of --help text, but otherwise still appears before the first output from low-level config initialization.
FossilOrigin-Name: 826bad10e9ccd6f71e6dad90d41fb7d4a941e459d2e080901345ed8877ad5e38
2025-02-24 12:19:06 +00:00
stephan ffe65da569 Further consolidation of auto.def and autoconf/auto.def. Note in configure --help that --disable-largefile is a legacy option which has no effect on the library but may influence the generated sqlite_cfg.h.
FossilOrigin-Name: 17fd6836f362c646d6dadb40adc0a8a31e2bfc9416651dde2c156400b3aa06dd
2025-02-24 11:21:32 +00:00
dan b081a391ce Merge latest changes from trunk into this branch.
FossilOrigin-Name: 55324d1c862c42b95251a398c40930d9fa94debb1aec7d3d0ae734d6b17b4a59
2025-02-24 10:52:34 +00:00
stephan ed36fb77e9 Move the configure output about the SQLite version and build dirs up, so that they appear before any tests for the C compiler and such.
FossilOrigin-Name: 83e0f3d138abf33751f735169aee752ba1677c5df37c3947f2c8be3ea3629822
2025-02-24 10:30:59 +00:00
stephan 3111c4687f Further consolidation of the main auto.def and the autoconf auto.def content into sqlite-config.tcl.
FossilOrigin-Name: 76a4efa9668791f23de8d4db1788708891f5efa01ba73bced6abfc54391c3b28
2025-02-24 08:42:40 +00:00
stephan 644b99641f Configure-internal doc tweaks. Fix the distclean rules for libsqlite3.dll.a on msys/cygwin/mingw, broken when the DLL basename was changed for those platforms.
FossilOrigin-Name: 8641e2c7c868be67ebb367fe7c8ceeee0e0d96574c164191ce9e340e7a527f49
2025-02-24 07:06:36 +00:00
stephan a63dee09a6 Add some internal notes about potential changes for the rpath flag handling.
FossilOrigin-Name: 6f904f0695c7e3396522c061170d6201b256af0294afeefcf8b6672e3ba15987
2025-02-24 05:10:09 +00:00
stephan 09591b78ae Update jimsh0.c from upstream autosetup to address [https://github.com/msteveb/autosetup/issues/75|autosetup ticket #75], triggered by this build in the Gentoo project.
FossilOrigin-Name: ffd05de8a3b7cab1b8e91b99da74b43ec5a7b91c78dcfd7cf338b66126e30a56
2025-02-24 04:47:34 +00:00
drh 6a9c3b407e Make column output modes in the CLI responsive to the --escape setting.
FossilOrigin-Name: 14ff5557d450475ad959f8c753c0cecb85dfca7346fcacd91da16e4d36e30508
2025-02-24 00:40:36 +00:00
drh 96a65cc474 Three different --escape modes: symbol, ascii, off.
FossilOrigin-Name: b5adb52fc0dc1838cb9c66cff422f2b8ec147e546cf909dd3c48731fa1edfe50
2025-02-24 00:18:12 +00:00
drh 9ba963f035 Further improvements to control-character escapes in the CLI.
FossilOrigin-Name: 9c2f974c17e3dfac78f3808fdfe916f7617cfdaa64430af38eae21bd6592e6f5
2025-02-23 20:50:37 +00:00
drh 8d15d7ed68 Work toward VT100-safe output from the CLI by default.
FossilOrigin-Name: 44c44620e8648a4265053f194e32b3a5c65d25b4f1fff61ef9b944e7cb0ed624
2025-02-23 20:20:56 +00:00
stephan 8f2e95fa6c Add (disabled) infrastructure for disabling use of the rpath linker flag. This is a proactive precautionary measure because how the rpath is used does not match up with what the unix-on-windows environments do with their DLLs.
FossilOrigin-Name: 38ba8e837c2679f12a4019612f7188cb4afffd43cef7af4a4aa02e62c20885ac
2025-02-23 17:55:41 +00:00
stephan 7b90beebd5 Internal cleanups to how certain linker flags are tested.
FossilOrigin-Name: 6743e3e5b87f1d2308ec8cebef3c7ecccddafdace107630e0d8feee2b089d105
2025-02-23 17:24:55 +00:00
stephan 43aeed3fec Internal configure doc cleanups. Apply the [5ecbe7ddc4] unix-on-windows DLL install dir fix to the canonical build.
FossilOrigin-Name: 51b9812df9087ec0aa7656178a069ddf2d60dcffa5ab0de57a84bd412b2f71c7
2025-02-23 15:34:05 +00:00
drh a3283ec135 The %#Q conversion now adds unistr('...') around the converted string if
escape characters were inserted.  %#w now works just like %w as escape
sequences inside of identifiers are not recognized.

FossilOrigin-Name: 997391d42079783e294836f714ccd9526ecc442c8dbf8212d72cd17c67e7158a
2025-02-23 11:48:07 +00:00
drh 07ce1820a0 Enhance the %Q, %q, and %w printf conversions so that if the alternate-form
flag # is present, they transform backslash and control characters into
unistr()-style backslash escape codes.

FossilOrigin-Name: ffbfcc2bbb57f02aa5ee813e7a25a2a014e3353a10f6bccb609075a5b63545d7
2025-02-23 00:09:24 +00:00
drh 4d70dbad57 Prototype implementation of the unistr() SQL function.
FossilOrigin-Name: 7cc302de05ed2a973372c05f55b048bf99af3d2590dd29f6fd0f379fb451aa0e
2025-02-22 23:18:38 +00:00
stephan fdb2bdc2a3 Update the help text to account for [35b1c32f80b9].
FossilOrigin-Name: f2e7355d87450f9a4d98390cf9d830e9902105048f9308e02c597190ecf2a594
2025-02-22 17:33:18 +00:00
stephan cbdbf534a3 Replace --dll-basename=none with --dll-basename=default.
FossilOrigin-Name: 35b1c32f80b9aed04776508683a1828fd5777ee8bb0e42e593557ae3cca558e4
2025-02-22 17:30:08 +00:00
drh c071c47b51 Tamp down various harmless compiler warnings. Use "int" in places instead
of "u16" or "i16" since the compiler complains less and generates faster
code.

FossilOrigin-Name: 742827f049768c4f69ccdfaadfad339aaad3bc126d3a68b90cfea01d825bf7ce
2025-02-22 16:44:14 +00:00
stephan 524b8a6df2 On unix-on-windows platforms, if either of --out-implib or --dll-basename are not provided, auto-enable them. Add the 'none' special value to those flags to specifically disable the environment-specific handling of those flags.
FossilOrigin-Name: 486400801a4540392c04d805a47df5249c4010b1a5fbac91900db6149374c274
2025-02-22 16:31:16 +00:00
stephan 1ad8df3c6b Ensure that [08c9e56f60] uses an absolute path when appending .exe to mksourceid.
FossilOrigin-Name: 906d27f7a645833595f02ddf05892703783d89116b1009f04e0b71679ff34a8b
2025-02-22 14:58:20 +00:00
stephan df5d5faebe Random non-functional configure script cleanups.
FossilOrigin-Name: 2ee73109809e7d4a9d203cfa42f29c62837c06dc414f9dbf17ce00d9bbb5a883
2025-02-22 14:53:31 +00:00
stephan 8b0240ea72 tool/mksqlite3h.tcl: when invoking the mksourceid binary, add a .exe to it, if needed, to appease msys2.
FossilOrigin-Name: 08c9e56f6082bb609a42f0e34c83542fe8b682757bc45616810d91491950fd0f
2025-02-22 14:53:00 +00:00
drh 447f1c2312 Fix an incorrect assert added by [d7729dbbf231d57c].
FossilOrigin-Name: eeea11278bdebe336f0c30fbad79e30e3456ab67dae46abdd5f9951ea1b61bed
2025-02-22 11:40:29 +00:00
stephan c3d72a5587 Fix installation rules for import lib in the autoconf bundle, broken by recent refactoring in this branch.
FossilOrigin-Name: 95b71fc7e9887833f03f84c37b94385012a6ae76b86cd079372f1752833e0f5d
2025-02-22 00:01:30 +00:00
stephan 449c552b7c Rename configure-defined ENABLE_SHARED/STATIC makefile vars to ENABLE_LIB_... so that they're consistent between the canonical and autoconf builds (baby steps towards further configure code consolidation).
FossilOrigin-Name: a7647fd07792ef32697c7ba8ab6348593c2a5c4cedf673b155206da6aae799f8
2025-02-21 23:43:10 +00:00
stephan a8d6fcf40d Configure docs/help text tweaks. No functional changes.
FossilOrigin-Name: 701cc1aff423b87996134801abbbcd06d529bbf522c725837844b6aea406fb1c
2025-02-21 23:27:03 +00:00
stephan f8c2382d70 Only use the platform-specific --dll-basename if that option is explicitly provided, else use libsqlite3.
FossilOrigin-Name: 69bacfdce5d99ba532feb30d19ccea9ef49ed3bbf33e44d41bb8740811f5b0cf
2025-02-21 22:46:18 +00:00
stephan 2a9812ce49 Fix another deps problem for msys installs.
FossilOrigin-Name: b0b9e92599dd4fbe2aafacf41eef5fecfce3295b025dad799a292e78f5e370c2
2025-02-21 22:39:48 +00:00
stephan c580663329 Ensure that the prefix/bin dir exists on msys/cygwin installations before installing the DLL there.
FossilOrigin-Name: 5ecbe7ddc48f688b1a511a86f81e7fb8ad3a559c2d513738c839f4d37c63db1c
2025-02-21 22:35:10 +00:00
stephan 4d58d3938a Add --dll-basename flag to give clients control over the DLL's base name. Split the DLL installation makefile rules into digestible, platform-specific chunks. On Windows-side Unix-like environments, install the DLL into the bin dir. Requires testing and feedback from those platforms' package maintainers to confirm it follows the expectated conventions.
FossilOrigin-Name: 8d5fed807b7151dcb79b97cfc2da0e8ac3586a0bf8b4c28967ad4cffafa53c08
2025-02-21 21:58:32 +00:00
drh cc803b209f The number of declared columns in an index is limited to SQLITE_LIMIT_COLUMN.
But the actual number of columns in the implementation might need to be
twice as much to account for the primary key at the end.  Ensure that the
code is able to deal with this.  This is a correction to
check-in [d7729dbbf231d57c].

FossilOrigin-Name: 5822feec43be9352fd87bf9968c39c0218e01ab5fe3ba50431ae21cba79e6c89
2025-02-21 20:35:37 +00:00
stephan 72b119d5e4 Extend --out-implib to optionally specify the import lib's name. Add as-yet-unused internals for specifying the DLL's base name (which differs across the Windows-side Unix-esque environments).
FossilOrigin-Name: 12a55d343f9663acb68cd0f75fbb6c9ab67f4f88ad296e3e266f12d91522dd19
2025-02-21 20:28:44 +00:00
stephan d9959bf48b Makefile-internal var renaming in prep for pending portability-related changes in the handling of DLLs. No functional/build interface changes.
FossilOrigin-Name: ebf41fc90aa9fb1bb96239145c0cdd06eced391499975c71734610996d088641
2025-02-21 20:22:56 +00:00
drh ce25007db8 Detect when a UNIQUE or PRIMARY KEY on a WITHOUT ROWID table would need
to use more than SQLITE_LIMIT_COLUMN columns and raise an error.
Also include some unrelated compiler warning fixes.

FossilOrigin-Name: d7729dbbf231d57cbcaaa5004d0a9c4957f112dd6520052995b232aa521c0ca3
2025-02-21 17:03:22 +00:00
stephan 220260b896 configure: in several places where support for -Wl,... linker flags are checked, ensure that the check invokes the linker (not just the compiler) to avoid false positives. This allows us to remove the AIX-specific handling and --disable-rpath bits added in [a15e0f680], as well as make several similar checks more robust.
FossilOrigin-Name: 4e81e2c707a954dcda6219dc94e2b96dd0c9907bd4beab28adad51d488b7d739
2025-02-21 03:19:21 +00:00
stephan a80089c516 configure: automatically fail the check for rpath on AIX systems and provide a --disable-rpath flag as a fallback for use on platforms which pass the configure-time rpath check but then fail at link-time. Based on discussion in [forum:ae5bd8a84b|forum thread ae5bd8a84b].
FossilOrigin-Name: a15e0f6802a5ba7bc5a7a70d6a162ea4548b49b132a5ac31263e64c388bbafcb
2025-02-20 17:14:40 +00:00
stephan 2a300a2853 Fix autoconf bundle to honor the --disable-static and --disable-shared flags, as reported in [forum:ae5bd8a84b|forum post ae5bd8a84b]. Problem introduced in 3.49.0.
FossilOrigin-Name: 56027220cc15b69cb98ba5360ffd3718c997e10d51e30eebeff14f0dc358d103
2025-02-20 16:45:45 +00:00
stephan 9e632f5512 wasm: do not build the (untested/unsupported) node-for-node build by default, to cut build time by about 15%. Adjacent cleanups in mkwasmbuilds.c.
FossilOrigin-Name: e4539ebebd89840b76f5a0626393299100685a38f45546a0bf7a62e4df56f863
2025-02-20 05:39:18 +00:00
stephan b42310a6b9 wasm makefile docs: make explicit that the node.js-for-node.js builds (as opposed to the node.js-for-browser builds) are both untested and unsupported.
FossilOrigin-Name: e1f184889fef4603d61d306c8c0dc86df616290ccf73dbd871fa27bd99e5e5c9
2025-02-20 04:45:02 +00:00
stephan a32ea731a0 Add the pause/unpause capability to the opfs-sahpool VFS, as discussed in [forum:fe8cdb8431c|forum thread fe8cdb8431c]. Summary: this gives clients a way to eke some degree of multi-page/tab/Worker concurrency out of this VFS but requires that coordination to be implemented client-side, e.g. via a SharedWorker or WebLocks.
FossilOrigin-Name: b5dbd521951e129b4dec69f191a872500dbf387b34a8479ad58b053ffcccbab9
2025-02-20 04:14:26 +00:00
stephan f8a9f45595 configure: when running proj-check-function-in-lib, strip -Werror from CFLAGS for the duration of the test. This enables CFLAGS='-Wall -Werror' and the like to be passed to configure without breaking these configure-time checks.
FossilOrigin-Name: 4ae9d6c642295e3a0c1732dacf7c18ecacd39d3e74e38381ac5531c8396f5f1c
2025-02-20 03:27:47 +00:00
stephan eb0d2e7bc6 Increase default CLI shell .prompt buffer length to 128 bytes, based on discussion in [forum:362f185a6aa|forum post 362f185a6aa].
FossilOrigin-Name: 628407f03d4bfb7499f0e6e2197089edf859380a3c4e6fecc517390327718141
2025-02-19 13:05:33 +00:00
stephan 2e132a4c04 Slight tweak to the CLI shell help output to help convey that it can accept multiple SQL arguments, as suggested in [forum:20e617feee|forum post 20e617feee].
FossilOrigin-Name: 82fc67070f9aff0065c07cbeed40f4321e03617bdc3e517adc58a2d96e6e3e49
2025-02-19 13:02:23 +00:00
dan eb3a069fc8 Have SQLITE_FTS5_ENABLE_TEST_MI builds avoid reading the database schema from
within sqlite3_open().

FossilOrigin-Name: 15dc524fd4113026cc542140c39c1c8f9e052d36946f0c599f282d9ac27efdab
2025-02-18 15:11:30 +00:00
stephan 9ef8399055 Update path on the web server for test/snapshot instances of fiddle.
FossilOrigin-Name: 57caa3136d1bfca06e4f2285734a4977b8d3fa1f75bf87453b975867e9de38fc
2025-02-18 01:16:26 +00:00
drh 21212923f2 Add an ORDER BY to a test case for skip-scan to make the output consistent.
FossilOrigin-Name: 9c9c19414ac243ce48a34bf13a08bff54a465e54a0c09ded50508b8d4bdba227
2025-02-17 20:13:20 +00:00
dan c274e6dda4 Fix problems in test script fkey6.test.
FossilOrigin-Name: 088e476519c2c759ba9387cb18eaad7c042cc37e45e96237d3125ba33ee3633a
2025-02-17 19:44:45 +00:00
drh 7bfa4452a3 Additional changes making it easier to prove that integer overflow does not
occur.  No problems found.

FossilOrigin-Name: e846743a875430a5c51d41f00ac9532214f97d9925e6261113b63580f92369fc
2025-02-17 18:09:24 +00:00
drh ef86b942b9 Code changes that make it easier to prove that no 32-bit integer overflows
happen during memory allocation.  No problems fixed; this change is just
to make future maintenance easier.

FossilOrigin-Name: 215650a5a1d55bdbca9c92524804a1a54456a17f42a17e53747b21a6507506f5
2025-02-17 17:33:14 +00:00
stephan ad5dcff53b Add two generated files to the distclean rules of the autoconf bundle.
FossilOrigin-Name: b59d0ebb22e4ca2f3a7a73dd49a0c142dbca538cb1b4eafd35a78bac87c6c456
2025-02-17 16:14:15 +00:00
stephan f6757b305a Replace TEXE (legacy name) with T.exe (3.48+ name) in two places in makefiles. This fixes distclean of jimsh.exe in the canonical build in non-native Windows environments.
FossilOrigin-Name: edb8a78c0238f085eefbf86aa7777528f36f3400d4ef096ffd6855cf3321a97b
2025-02-17 16:04:21 +00:00
drh 56d2fd008b Harden the SQLITE_DBCONFIG_LOOKASIDE interface against misuse, such as
described in [forum:/forumpost/48f365daec|forum post 48f365daec].  Enhancements
to the SQLITE_DBCONFIG_LOOKASIDE documentation.  Test cases in TH3.

FossilOrigin-Name: 1ec4c308c76c69fba031184254fc3340f07607cfbf8342b13713ab445563d377
2025-02-17 14:16:49 +00:00
drh 59c64e086a Fix a typo (a missing ")") in a comment that is used to generate
documentation.  No changes to code.

FossilOrigin-Name: ea21685658df8246551650666ff59945ac27271b10a675104cbadaf57d48595f
2025-02-17 10:58:23 +00:00
stephan 3cc3898e13 Internal reordering/re-grouping of some configure flags. No functional changes.
FossilOrigin-Name: 0c085a5ab51d6ac793a147a865bd086b1a6a572932c251b38d3854e4ea802f8d
2025-02-16 19:16:09 +00:00
stephan c2d56ea4ea Re-add the --disable-static-shell configure feature to the autoconf bundle. It got lost in the autoconf-to-autosetup port, as reported in [forum:cc219ee7044|forum post cc219ee7044].
FossilOrigin-Name: 47e817f663468ce08dae4965b7ecacefb921a77398ec958b35bf5cedee767e24
2025-02-16 18:14:05 +00:00
stephan 4b1c8362e7 Update autoconf/Makefile.msc from tool/mkmsvcmin.tcl.
FossilOrigin-Name: 9ffe94d2ea0b3679c3d2657e2c3b67f84c09e9bcbbe0a13c76d58858df367d1b
2025-02-16 13:49:18 +00:00
stephan 18780193d5 API naming typo reported in [forum:416f2d8dec|forum post 416f2d8dec]. No functional changes.
FossilOrigin-Name: 0cfb9e234e116741d01b65d0abf18210e495276319fb08ec6e40d3f2e698956d
2025-02-16 13:13:19 +00:00
drh f4fc2ee203 Add a typecast to avoid 32-bit integer overflow in the concat_ws()
function with an enormous separator values and many arguments.

FossilOrigin-Name: 498e3f1cf57f164fbd8380e92bf91b9f26d6aa05d092fcd135d754abf1e5b1b5
2025-02-16 10:57:25 +00:00
stephan ac729894be Remove tea version check from tool/srctree-check.tcl, as it's obsoleted by [be265559].
FossilOrigin-Name: 1860ea060bd373f49d0b5d41367409a4607e9a0a0cb606af99927af15de1e21e
2025-02-15 17:29:56 +00:00
stephan 4a1c44eea7 Automate update of the library version number in autoconf/tea/configure.ac as part of the tool/mkautoconfamal.sh process, per /chat discussion.
FossilOrigin-Name: be265559a334eda127862ae54edb58c46051f74445642daa84a9f61a81df1bac
2025-02-15 16:24:05 +00:00
stephan 984f699ccb DLL installation rules no longer create versioned symlinks on platforms where the DLL extension is '.dll' (cygwin, msys2, etc.), as suggested in [forum:28bb79638844c328|forum post 28bb79638844c328].
FossilOrigin-Name: d743410665df8ba962db6e1f245d929b005d0add77be95af3c3c7f87a1c758fb
2025-02-15 16:12:28 +00:00
stephan 4e87ddc105 A cleaner workaround for [6a21d6a2], provided by autosetup's creator.
FossilOrigin-Name: 334ed723d0fc0b202f79a9746459181f637ca99c54864a4aa11629eecb4b8d0c
2025-02-15 14:12:24 +00:00
stephan 6b5599726b More informative output for the pthread feature test.
FossilOrigin-Name: 01b9ed73ca6e72411dcf5a81f445c15c5bc42fa068fc7eca485ac72635b9d2fc
2025-02-14 18:17:31 +00:00
stephan d04782206b Make failure to find pthreads support non-fatal unless --enable-threadsafe is specifically passed in. Build regression reported in [8e0fdb8c0d].
FossilOrigin-Name: 806ad1ac173d7c0d6d94bfccd3b961fc5c9541b32773c063a8c4082380d7a90d
2025-02-14 18:06:28 +00:00
stephan b0c987967f Simplify the --help workaround introduced in [6a21d6a2ed].
FossilOrigin-Name: b0928f2043ed2a5d445c65f0d7271431e182f5a6fcd24ddcd57ea1cdcf4bbaa2
2025-02-14 17:52:57 +00:00
stephan a09fd7b913 Work around a autosetup --help bug which only(?) triggers on tcl 8.6, introduced by [9978c87139b7b042] and reported upstream as [https://github.com/msteveb/autosetup/issues/73|ticket #73]. Summary: calling 'options' from a proc, instead of the global scope, triggers an error about an invalid use of 'break'.
FossilOrigin-Name: 6a21d6a2ed627ba0a864bef85369ed17553b808ae5c19891fa1f70505dfcbe39
2025-02-14 17:21:05 +00:00
stephan e3157582bf ICU config support: add more details to error messages and correct a typo which would cause a configure crash if --with-icu-config=X refered to a non-executable X.
FossilOrigin-Name: ff508926651d632d86081ccde89d3367c89538dde469e9e925540d634ac8a416
2025-02-14 16:42:37 +00:00
drh f338ab20ef Fix test cases added for [d7b90d92ffbfc61f] so that they also work when
compiling with ICU support.
[forum:/forumpost/2ca8a09a7e|Forum post 2ca8a09a7e]

FossilOrigin-Name: 5964616dc9de9323fddfede0ded29ee135498c8760017ce1158461f596fe6914
2025-02-14 10:28:28 +00:00
stephan e89f31f19a When using the --out-implib build option, install the generated .dll.a file to PREFIX/lib.
FossilOrigin-Name: 0dadea0ec86b6ac74281915433e41ae66cc20547d9882c4be2933a24c8287927
2025-02-13 16:20:05 +00:00
dan 5087eacb18 Ensure the counts of "deferred FK violations" and "deferred immediate FK violations" are kept separate when "PRAGMA defer_foreign_keys" is used.
FossilOrigin-Name: c5190b0fd9bd76653fb7bb08e931699e42c88cef8a00352360d091948cda93a2
2025-02-13 14:47:25 +00:00
dan 25367c1eb0 Fix a few 32-bit overflow problems in showdb.c.
FossilOrigin-Name: 9377766647eeaa575d646cf5f66c3163ef7074930aa5c3b11073e6b1e90ce799
2025-02-12 20:19:57 +00:00
dan 8bbce21ed7 Have the win32 VFS take a temporary shared lock (instead of the current exclusive) on the pending-byte when taking a SHARED lock on a db. Do not lock the pending-byte at all when taking an EXCLUSIVE lock if RESERVED is not already held.
FossilOrigin-Name: 5127509abb10cb1da35b9874ea63e0c2f882b10567606e2bdd636a50811a693c
2025-02-12 17:21:24 +00:00
stephan 1be96b44c1 configure --help cleanups and eliminate the use of a JS-esque inner function in sqlite-config.tcl. No functional changes.
FossilOrigin-Name: 6df859cd18ded3ca64a184e45709503dd9b6a3f65e7611d3352f0bad288400f4
2025-02-12 16:59:07 +00:00
dan f3e24d0875 Remove old function declaration accidentally left in sqlite3session.h.
FossilOrigin-Name: 0cfbe349d4b740f3d2be8c714cf679901fc2465db4c64e4c3742da700d82f4e7
2025-02-12 15:31:26 +00:00
stephan 56ff8df023 Tiny tcl comment tweaks. No functional changes.
FossilOrigin-Name: da94e551c0ed354ae782c89fd9495d607b77ad7572d90c41ceac12bd6ec4c31b
2025-02-12 14:51:02 +00:00
dan 41f29806a1 Fix test script errors in walsetlk3.test. Tests still don't all pass.
FossilOrigin-Name: 56eb4114f8bf9971960998ae0b79352767657ee19b5bdfec5149906e72ba170f
2025-02-12 08:07:10 +00:00
drh cd56ad4ccb Omit the src/pragma.h file. It is generated by the tool/mkpragmatab.tcl script.
The makefiles now know how to build this file for themselves.

FossilOrigin-Name: 9709ed1cdfa17f690ffd4ec8cfc54efefec8352143c1d8b701f09299bd7eef6e
2025-02-11 19:54:13 +00:00
drh 374c6a451e Omit the src/ctime.c source file, since it is automatically generated by a TCL
script.  Instead, add rules to the various makefiles to generate ctime.c on
demand.

FossilOrigin-Name: 958bb5de7c484cc503c38d38d51a30f679244fd364df5cbfc1992e36995b2ff9
2025-02-11 19:40:19 +00:00
dan e5769f6525 Update tool/mkctimec.tcl so that sqlite3_compileoption_xxx() APIs report on the SQLITE_ENABLE_SETLK_TIMEOUT option.
FossilOrigin-Name: 303e8009ab59aad32030407baf3eff9443f7f9bed7947218b78293b06bba1737
2025-02-11 18:32:22 +00:00
dan 833dd3daff Fix "unused variable" warnings in os_unix.c and os_win.c.
FossilOrigin-Name: 8e809632ba3bb20b7ec23ce9e6ca659c57cf1338b1fe8c33502c5f3161061dd2
2025-02-11 18:29:35 +00:00
stephan db253d0862 Rename a configure-internal function and fix handling of --dump-defines for the autoconf bundle.
FossilOrigin-Name: 6aa54cc180e034a10d8fc8f8b0c13d7bc0c94509b4240ac855121d501853768f
2025-02-11 17:20:12 +00:00
dan 138951dc2e Merge latest changes from trunk into this branch.
FossilOrigin-Name: e5ec5bb9f4dc3e02db7ab0e49686f47617af75d3f7d4ab23288a1aea4a693e59
2025-02-11 17:10:46 +00:00
stephan ba8e3ca139 Move the configure flags definition and handling into autosetup/sqlite-config.tcl to avoid duplication between auto.def and autoconf/auto.def while still giving us a way to filter the canonical-tree-only flags out of the autoconf build.
FossilOrigin-Name: 9978c87139b7b04208fd1f62121fc4e1e2080723fde69a2bbdca88769f4baf22
2025-02-11 17:10:10 +00:00
stephan 62e1d44846 Make the --out-implib support ([6092b0b86bf93a3d]) specifically opt-in because the feature check for it passes on some platforms where it is not recognized at link-time.
FossilOrigin-Name: 75535f2355b3b2e83dd57f4c30340af98c8dbcfe6ff1e9be17d23bd30d7d766c
2025-02-11 13:13:46 +00:00
stephan df9b89932f Adapt [https://fossil-scm.org/home/info/3bff7b92d6d|Fossil SCM patch 3bff7b92d6d], applying -lrt for platforms which need it for one of {fdatasync, nanosleep}.
FossilOrigin-Name: 1768de6e9e2c6ff3a9ee29fa6f488fb3d23a3599195ac7d1b09e61c02b7d18b3
2025-02-11 13:00:40 +00:00
dan 2d87894700 Experimental change to allow clients to block when taking a SHARED lock to connect to a wal mode database.
FossilOrigin-Name: d2d6a000fb9bf8097e0ce9979685408d183be3ab785ceeb11ec1f97a81a83e41
2025-02-10 20:46:14 +00:00
stephan cee7609074 Minor cleanups in the opfs-sahpool pause/unpause API demo.
FossilOrigin-Name: e205cdc468e02eefdeb8d391d921aa2d4d28a8b7b87036d6d937a9928261a413
2025-01-31 17:47:47 +00:00
stephan a75321d735 Add the conventional license header to sahpool-worker.js and correct the date on the header in sahpool-pausing.js.
FossilOrigin-Name: f7c3026b0d2e33cc4e3b906810d860b155b1ff714bbe4e1eb9ee392122217efa
2025-01-31 16:34:52 +00:00
stephan cb0da053ed Add a small test app demonstrating cooperative semi-concurrency of the opfs-sahpool VFS using its un/pauseVfs() APIs.
FossilOrigin-Name: 09570c55a23e5af76dd2153a5b28a493f498d7d4a08b0089f3074d0a2c5d3d29
2025-01-31 16:25:18 +00:00
stephan 654c94d683 Cleanups in the opfs-sahpool VFS pause/unpause feature and its tests.
FossilOrigin-Name: 184ba37702f63196deca91d273e798ca895fbb301938e6264bc82815a4e33149
2025-01-31 14:25:38 +00:00
stephan d4bfa3465e Merge trunk into opfs-sahpool-pause branch.
FossilOrigin-Name: 775a547eca2b0b3dbb6c03990236128a095cc34d28caec44b9a5072510c75b63
2025-01-31 12:39:07 +00:00
dan df54ecb1bf Fix a problem causing the write-lock to be held when it should not be in some circumstances following a SEH exception.
FossilOrigin-Name: 7eb5accb7cf937fc967dcd86da0af813fb18a2697348bd231fbefd3c09b930ab
2025-01-30 17:04:28 +00:00
dan 462888819e Have sqlite3_enable_setlk(-1) configure indefinite blocking locks where they are supported.
FossilOrigin-Name: 62009565d2f2a2c4d347e1da0d5b4ad43056742df47fd6ddb92e62f53a2b57f1
2025-01-30 15:26:16 +00:00
stephan cb46f1bb95 Simplify how OpfsSAHPoolUtil.unpauseVfs()'s returned promise is handled.
FossilOrigin-Name: d651b8da5a84cd54d71f15bd34e4db685674ef73f26f5cc26b7af5321a2ec05e
2025-01-29 11:28:18 +00:00
stephan 8883deb30e Add experimental support to pause/unpause an SAHPool OPFS VFS, as discussed in [forum:fe8cdb8431c32455|forum post fe8cdb8431c32455], the intent being enable a page to relinquish, perhaps temporarily, the VFS such that the VFS's storage can be accessed by another page/tab.
FossilOrigin-Name: 1d2683fe9e4be01c3137e750900f54d287e7d96185e66924d24b50f4647e7ef1
2025-01-29 11:08:11 +00:00
dan 43aad25b1b Add the sqlite3_setlk_timeout() API. For setting the timeout used by SQLITE_ENABLE_SETLK_TIMEOUT blocking locks without also setting the regular retry-based busy-timeout.
FossilOrigin-Name: 4a7eb492797abb47b18b7dfc557aeae43a0dea5b861efc203398d5059b10d131
2025-01-27 11:50:03 +00:00
dan 2539fb2bc5 Fix a race condition causing SQLite to use a busy-handler for an operation that should not.
FossilOrigin-Name: 6ab9ed8eef77781898375038ab05fc6e5f46b745e4906691393b8b1d90570eb6
2025-01-24 15:49:47 +00:00
dan ff6bff4059 Have windows SQLITE_ENABLE_SETLK_TIMEOUT builds block indefinitely if the busy-timeout is set to 0x7FFFFFFF.
FossilOrigin-Name: daefcafe799ad7613cbdff1fb1e9d40659892906875b28fbc112abd7679e48ea
2025-01-15 12:45:38 +00:00
dan 362d51a159 Omit code to link all winShm objects open on a single node into a list. This is no longer required.
FossilOrigin-Name: b400ab4ba99d3ed7e90c93257d729563c630ef451017a702d42f322a4e57b663
2024-12-26 16:10:15 +00:00
dan 4e3b6a14fd Merge trunk changes into this branch.
FossilOrigin-Name: 3e2893097c59820def88bb4739189c9c9a4f70a98a0a72b81959658f069715f6
2024-12-26 14:40:11 +00:00
dan ce50282c3b Properly wait for asynchronous results for calls to LockFileEx() on FILE_FLAG_OVERLAPPED files even if LOCKFILE_FAIL_IMMEDIATELY, which usually causes LockFileEx() to return synchronously, is specified.
FossilOrigin-Name: 35b3e73c5a9efa12f9bb0dad1721fce128cd1e3bcbc87027ee4ea685a12a70d5
2024-12-24 14:44:38 +00:00
dan c978e390e6 Fix release test errors on winrt.
FossilOrigin-Name: 39bebd50b80ceee321b1da837c72a20cdb26f06e4b726f23e3ddac877d9400a7
2024-12-16 19:31:30 +00:00
dan 800bf8fd93 Fix a problem on this branch causing a file-handle to be leaked following an OOM condition.
FossilOrigin-Name: 5ca12dc964b2d8c3d11a2be5be7eac0dc994cec3a8b5fdfeac4ff8dde19a5a93
2024-12-16 15:13:34 +00:00
dan d26bb375be Fix a buffer overread in test code. Add test configurations for ENABLE_SETLK=1 and FOR_WINRT=1 builds to release testing.
FossilOrigin-Name: b558db5db7e7c9aced1d24d74dc5ee2fab7cd04ec6570247c9c45723eb6f8fc0
2024-12-12 20:59:32 +00:00
dan b1ad83a342 Ensure that all win32 API functions invocations in os_win.c are made via the function table. Fix asan error in test code.
FossilOrigin-Name: 2ffdc799c63ff8858f2aa9177ca9c74be2df5d7594cb10fb0a233537d83fd563
2024-12-11 15:30:58 +00:00
dan 7d32ec0a5c Fix a problem with walsetlk.test on windows.
FossilOrigin-Name: 704e6567c14a4a07a1a4d1fc2bd8a7f288b55b27508d23ba7f5c755c830c14ec
2024-12-10 21:24:28 +00:00
dan d50eb9c999 Ensure windows may block on a SHARED (but not EXCLUSIVE) DMS lock.
FossilOrigin-Name: 55e4e7bb0074859e8c3e736e7eceb69af8408ce75135f5baa09e98aaf4e2a321
2024-12-10 19:00:07 +00:00
dan e5418e9dd3 Fix walsetlk.test to work on unix.
FossilOrigin-Name: 798dff041be46d2d5014779c0855f60e6b2a142e9946bfb79061d7dff0bc3d27
2024-12-10 18:12:59 +00:00
dan 50ebf16dd6 Merge latest trunk changes into this branch.
FossilOrigin-Name: d67a42d62555cf9294e11a04d3c7cfdf11ca7978d60fc085f5a73e36aff8313e
2024-12-10 17:36:20 +00:00
dan 9c750fe3a3 Test the case where a db connection blocks for a while and then successfully obtains the lock.
FossilOrigin-Name: 9cbc97ff8411a672b572000e4509ac02b3d29911be5ce1bcf334ed8e2a91db77
2024-12-09 17:30:20 +00:00
dan 4ab343cb7c Enhance tests to ensure that blocking locks, and not calls to xSleep(), are being used by SQLITE_ENABLE_SETLK_TIMEOUT builds when they should be.
FossilOrigin-Name: c892242bb642f7a6a961e310ed8b4f1e140f8ee32c00f50021c6011c6e7e1476
2024-12-09 16:01:28 +00:00
dan b9be2f6396 Fix filectrl.test so that it works with winrt builds.
FossilOrigin-Name: 70b0cfb0493e3fe56645648b462cb035d0d791f95b2913b7622f08c1090338c0
2024-12-04 19:32:24 +00:00
dan 093c21342c Assume an NT-based OS when running tests if sqlite_os_type is not set.
FossilOrigin-Name: 22e4aeded0a6a691fc7026f3cd90836a289dfc994269f8576d01e28fa478902b
2024-12-04 18:27:13 +00:00
dan 23498de7be Back out minor changes not required by this branch.
FossilOrigin-Name: 68c34ffd2332d89cb6400bce5dad350a6e48c395924b8380cbeb0dbe64141808
2024-12-03 19:41:41 +00:00
dan c99caf5de5 Merge latest trunk into this branch.
FossilOrigin-Name: eb13b8b3ef67ca8a252f7a4fd5a83ed31fefe68aa5ad8693d9d1f17218f4d176
2024-12-03 19:30:14 +00:00
dan 2d5ce92aae Further test file tweaks to run with SQLITE_OS_WINRT builds.
FossilOrigin-Name: 54853421ba012c192ee2a41873e6ba10e187a6ec2e23182ccbec56864604166f
2024-12-03 19:09:54 +00:00
dan d4545bca73 Fix the lock_win32_file test command so that it works with winrt builds.
FossilOrigin-Name: 5994656074b2db2c172f4c690c3b40cadd12e91d737fb91a03268148f8b49421
2024-12-03 15:19:02 +00:00
dan 9d592359fe Fix a problem with SQLITE_OS_WINRT builds.
FossilOrigin-Name: baf43e8c7da6aacce874ec30d0c9e1dcb44c5ed9de2214099d42fbbd335d2e93
2024-12-02 20:48:17 +00:00
dan a180131454 On windows, use a separate handle for each connection for xShmLock() locks.
FossilOrigin-Name: 272d552f126357d7bc16d84f13a4bea823abc6ef7faf90e3cffcedb68210f52a
2024-11-30 20:00:54 +00:00
dan f6d267491c Ensure that file-handle winShmNode.hFile.h is used in a thread-safe manner.
FossilOrigin-Name: 7a32b497ab16774021924a8536e1025a0a01740a6484f0de17623a69713511d8
2024-11-25 18:47:12 +00:00
dan 1743c5f836 Fixes for code on this branch. Now appears to work, but is not tested well.
FossilOrigin-Name: 0568fc6dde41dd29e85e697cd1865feb4db6aaae09d5e5100b3f97cab93590eb
2024-11-25 16:54:10 +00:00
dan 6bd3faa092 Supports SQLITE_ENABLE_SETLK_TIMEOUT on windows. Does not work properly yet.
FossilOrigin-Name: 737ca8a9fb9dc74b28f2186d93c5101463497445d0fabba3def61fee29abf2c8
2024-11-22 21:24:08 +00:00
216 changed files with 5279 additions and 3661 deletions
+15 -11
View File
@@ -79,7 +79,7 @@ libdir = @libdir@
INSTALL = @BIN_INSTALL@
AR = @AR@
AR.flags = cr # TODO? Add a configure test to determine this?
AR.flags = cr
CC = @CC@
B.cc = @CC_FOR_BUILD@ @BUILD_CFLAGS@
T.cc = $(CC)
@@ -118,6 +118,7 @@ LDFLAGS.dlopen = @LDFLAGS_DLOPEN@
LDFLAGS.readline = @LDFLAGS_READLINE@
CFLAGS.readline = @CFLAGS_READLINE@
LDFLAGS.icu = @LDFLAGS_ICU@
LDFLAGS.rt = @LDFLAGS_RT@
CFLAGS.icu = @CFLAGS_ICU@
LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@
# soname: see https://sqlite.org/src/forumpost/5a3b44f510df8ded
@@ -125,9 +126,17 @@ LDFLAGS.libsqlite3.os-specific = @LDFLAGS_MAC_CVERSION@ @LDFLAGS_OUT_IMPLIB@
# os-specific: see
# - https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7
# - https://sqlite.org/forum/forumpost/0c7fc097b2
ENABLE_SHARED = @ENABLE_SHARED@
ENABLE_STATIC = @ENABLE_STATIC@
libsqlite3.DLL.basename = @SQLITE_DLL_BASENAME@
# DLL.basename: see https://sqlite.org/forum/forumpost/828fdfe904
libsqlite3.out.implib = @SQLITE_OUT_IMPLIB@
# libsqlite3.out.implib => the output filename part of LDFLAGS_OUT_IMPLIB.
ENABLE_LIB_SHARED = @ENABLE_LIB_SHARED@
ENABLE_LIB_STATIC = @ENABLE_LIB_STATIC@
HAVE_WASI_SDK = @HAVE_WASI_SDK@
libsqlite3.DLL.install-rules = @SQLITE_DLL_INSTALL_RULES@
# -fsanitize flags for the fuzzcheck-asap app
CFLAGS.fuzzcheck.fsanitize = @CFLAGS_FUZZCHECK_FSANITIZE@
T.cc.sqlite = $(T.cc) @TARGET_DEBUG@
@@ -146,7 +155,7 @@ T.cc.sqlite += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite
# shell command.
#
CFLAGS.jimsh = @CFLAGS_JIMSH@
JIMSH = ./jimsh$(TEXE)
JIMSH = ./jimsh$(T.exe)
#
# $(B.tclsh) is documented in main.mk.
@@ -255,6 +264,7 @@ AS_AUTORECONFIG = @SQLITE_AUTORECONFIG@
USE_AMALGAMATION ?= @USE_AMALGAMATION@
LINK_TOOLS_DYNAMICALLY ?= @LINK_TOOLS_DYNAMICALLY@
AMALGAMATION_GEN_FLAGS ?= --linemacros=@AMALGAMATION_LINE_MACROS@
EXTRA_SRC ?= @AMALGAMATION_EXTRA_SRC@
#
# CFLAGS for sqlite3$(T.exe)
@@ -316,13 +326,7 @@ misspell: ./custom.rws has_tclsh84
# perform cleanup known to be relevant to (only) the autosetup-driven
# build.
#
#clean-autosetup:
# -if [ -f ext/wasm/GNUmakefile ]; then \
# gmake --no-print-directory --ignore-errors -C ext/wasm clean; \
# fi >/dev/null 2>&1; true
#clean: clean-autosetup
distclean-autosetup: clean
distclean-autosetup:
rm -f sqlite_cfg.h config.log config.status config.defines.* Makefile sqlite3.pc
rm -f $(TOP)/tool/emcc.sh
rm -f libsqlite3*$(T.dll)
+22 -6
View File
@@ -294,6 +294,12 @@ SESSION = 0
RBU = 0
!ENDIF
# Set this to non-0 to enable support for blocking locks.
#
!IFNDEF SETLK_TIMEOUT
SETLK_TIMEOUT = 0
!ENDIF
# Set the source code file to be used by executables and libraries when
# they need the amalgamation.
#
@@ -450,6 +456,10 @@ EXT_FEATURE_FLAGS =
!ENDIF
!ENDIF
!IF $(SETLK_TIMEOUT)!=0
OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SETLK_TIMEOUT
!ENDIF
###############################################################################
############################### END OF OPTIONS ################################
###############################################################################
@@ -1396,7 +1406,7 @@ SRC00 = \
$(TOP)\src\build.c \
$(TOP)\src\callback.c \
$(TOP)\src\complete.c \
$(TOP)\src\ctime.c \
ctime.c \
$(TOP)\src\date.c \
$(TOP)\src\dbpage.c \
$(TOP)\src\dbstat.c \
@@ -1495,7 +1505,7 @@ SRC04 = \
SRC05 = \
$(TOP)\src\pager.h \
$(TOP)\src\pcache.h \
$(TOP)\src\pragma.h \
pragma.h \
$(TOP)\src\sqlite.h.in \
$(TOP)\src\sqlite3ext.h \
$(TOP)\src\sqliteInt.h \
@@ -1698,7 +1708,7 @@ HDR = \
$(TOP)\src\pager.h \
$(TOP)\src\pcache.h \
parse.h \
$(TOP)\src\pragma.h \
pragma.h \
$(SQLITE3H) \
sqlite3ext.h \
$(TOP)\src\sqliteInt.h \
@@ -2099,8 +2109,11 @@ callback.lo: $(TOP)\src\callback.c $(HDR)
complete.lo: $(TOP)\src\complete.c $(HDR)
$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c
ctime.lo: $(TOP)\src\ctime.c $(HDR)
$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c
ctime.c: $(TOP)\tool\mkctimec.tcl $(JIM_TCLSH)
$(JIM_TCLSH) $(TOP)\tool\mkctimec.tcl
ctime.lo: ctime.c $(HDR)
$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c ctime.c
date.lo: $(TOP)\src\date.c $(HDR)
$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\date.c
@@ -2333,6 +2346,9 @@ parse.c: $(TOP)\src\parse.y lemon.exe
copy /B parse.y +,,
.\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) -S parse.y
pragma.h: $(TOP)\tool\mkpragmatab.tcl $(JIM_TCLSH)
$(JIM_TCLSH) $(TOP)\tool\mkpragmatab.tcl
$(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest mksourceid.exe $(TOP)\VERSION $(JIM_TCLSH)
$(JIM_TCLSH) $(TOP)\tool\mksqlite3h.tcl "$(TOP:\=/)" -o $(SQLITE3H) $(MKSQLITE3H_ARGS)
@@ -2812,7 +2828,7 @@ moreclean: clean
clean:
del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
del /Q *.bsc *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
del /Q sqlite3.def tclsqlite3.def 2>NUL
del /Q sqlite3.def tclsqlite3.def ctime.c pragma.h 2>NUL
del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL
# <<mark>>
del /Q $(SQLITE3TCLDLL) pkgIndex.tcl 2>NUL
+1 -1
View File
@@ -134,7 +134,7 @@ later. The "tclextension-install" target and the test targets that follow
all require TCL development libraries too. ("apt install tcl-dev"). It is
helpful, but is not required, to install the SQLite TCL extension (the
"tclextension-install" target) prior to running tests. The "releasetest"
target has additional requiremenst, such as "valgrind".
target has additional requirements, such as "valgrind".
On "make" command-lines, one can add "OPTIONS=..." to specify additional
compile-time options over and above those set by ./configure. For example,
+43 -268
View File
@@ -1,279 +1,54 @@
#/do/not/tclsh
#!/do/not/tclsh
# ^^^ help out editors which guess this file's content type.
#
# This is the main autosetup-compatible configure script for the
# SQLite project.
#
# This script should be kept compatible with JimTCL, a copy of which
# is included in this source tree as ./autosetup/jimsh0.c. The number
# of incompatibilities between canonical TCL and JimTCL is very low
# and alternative formulations of incompatible constructs have, so
# far, been easy to find.
# This script and all of its dependencies must be kept compatible with
# JimTCL, a copy of which is included in this source tree as
# ./autosetup/jimsh0.c. The number of incompatibilities between
# canonical TCL and JimTCL is very low and alternative formulations of
# incompatible constructs have, so far, been easy to find.
#
# JimTCL: https://jim.tcl.tk
#
use sqlite-config
sqlite-configure canonical {
proj-if-opt-truthy dev {
# --enable-dev needs to come early so that the downstream tests
# which check for the following flags use their updated state.
proj-opt-set all 1
proj-opt-set debug 1
proj-opt-set amalgamation 0
define CFLAGS [get-env CFLAGS {-O0 -g}]
# -------------^^^^^^^ intentionally using [get-env] instead of
# [proj-get-env] here because [sqlite-setup-default-cflags] uses
# [proj-get-env] and we want this to supercede that.
sqlite-munge-cflags
}
sqlite-check-common-bins ;# must come before [sqlite-handle-wasi-sdk]
sqlite-handle-wasi-sdk ;# must run relatively early, as it changes the environment
sqlite-check-common-system-deps
proj-define-for-opt amalgamation USE_AMALGAMATION "Use amalgamation for builds?"
proj-define-for-opt gcov USE_GCOV "Use gcov?"
proj-define-for-opt test-status TSTRNNR_OPTS \
"test-runner flags:" {--status} {}
proj-define-for-opt linemacros AMALGAMATION_LINE_MACROS \
"Use #line macros in the amalgamation:"
define AMALGAMATION_EXTRA_SRC \
[join [opt-val amalgamation-extra-src ""] " "]
define LINK_TOOLS_DYNAMICALLY [proj-opt-was-provided dynlink-tools]
define CFLAGS_FUZZCHECK_FSANITIZE [proj-check-fsanitize {address bounds-strict}]
sqlite-handle-tcl
sqlite-handle-emsdk
if {[string first " " $autosetup(srcdir)] != -1} {
user-error "The pathname of the source tree\
may not contain space characters"
}
if {[string first " " $autosetup(builddir)] != -1} {
user-error "The pathname of the build directory\
may not contain space characters"
}
########################################################################
# Regarding flag compatibility with the historical autotool configure
# script:
#
# A very long story made short, autosetup's --flag handling has
# some behaviors which make it impossible to implement 100% identical
# flags compared to the historical autotools build. The differences
# are documented here:
#
# 1) --debug is used by autosetup itself, but we patch it because
# decades of muscle memory expect --debug to apply to this code,
# not the configure script (details are in autosetup/README.md).
#
# 2) In autosetup, all flags starting with (--enable, --disable) are
# forced to be booleans and receive special handling in how they're
# resolved. Because of that we have to rename:
#
# 2.1) --enable-tempstore[=no] to --with-tempstore[=no], noting that
# it has four legal values, not two.
#
########################################################################
# A gentle introduction to flags handling in autosetup
#
# Reference: https://msteveb.github.io/autosetup/developer/
#
# All configure flags must be described in an 'options' call, which
# must appear very early on in this script. The general syntax is:
#
# FLAG => {Help text}
#
# Where FLAG can have any of the following formats:
#
# boolopt => "a boolean option which defaults to disabled"
# boolopt2=1 => "a boolean option which defaults to enabled"
# stringopt: => "an option which takes an argument, e.g. --stringopt=value"
# stringopt2:=value => "an option where the argument is optional and defaults to 'value'"
# optalias booltopt3 => "a boolean with a hidden alias. --optalias is not shown in --help"
#
# Autosetup does no small amount of specialized handling for flags,
# especially booleans. Each bool-type --FLAG implicitly gets
# --enable-FLAG and --disable-FLAG forms. e.g. we define a flag
# "readline", which will be interpreted in one of two ways, depending
# on how it's invoked and how its default is defined:
#
# --enable-readline ==> boolean true
# --disable-readline ==> boolean false
#
# Passing --readline or --readline=1 is equivalent to passing
# --enable-readline, and --readline=0 is equivalent to
# --disable-readline.
#
# The behavior described above can lead lead to some confusion when
# writing help text. For example:
#
# options { json=1 {Disable JSON functions} }
#
# The reason the help text says "disable" is because a boolean option
# which defaults to true is, in the --help text, rendered as:
#
# --disable-json Disable JSON functions
#
# Whereas a bool flag which defaults to false will instead render as:
#
# --enable-FLAG
#
# Non-boolean flags, in contrast, use the names specifically given to
# them in the [options] invocation. e.g. "with-tcl" is the --with-tcl
# flag.
#
# Fetching values for flags:
#
# booleans: use one of:
# - [opt-bool FLAG] is autosetup's built-in command for this, but we
# have some convenience variants:
# - [proj-opt-truthy FLAG]
# - [proj-opt-if-truthy FLAG {THEN} {ELSE}]
#
# Non-boolean (i.e. string) flags:
# - [opt-val FLAG ?default?]
# - [opt-str ...] - see the docs in ./autosetup/autosetup
#
########################################################################
set flags {
# When writing {help text blocks}, be aware that autosetup formats
# them differently (left-aligned, directly under the --flag) if the
# block starts with a newline. It does NOT expand vars and commands,
# but we use a [subst] call below which will replace (only) var
# refs.
# <build-modes>
shared=1 => {Disable build of shared libary}
static=1 => {Disable build of static library (mostly)}
amalgamation=1 => {Disable the amalgamation and instead build all files separately.}
# </build-modes>
# <lib-feature>
threadsafe=1 => {Disable mutexing}
with-tempstore:=no => {Use an in-RAM database for temporary tables: never,no,yes,always}
largefile=1 => {Disable large file support}
load-extension=1 => {Disable loading of external extensions}
math=1 => {Disable math functions}
json=1 => {Disable JSON functions}
memsys5 => {Enable MEMSYS5}
memsys3 => {Enable MEMSYS3}
fts3 => {Enable the FTS3 extension}
fts4 => {Enable the FTS4 extension}
fts5 => {Enable the FTS5 extension}
update-limit => {Enable the UPDATE/DELETE LIMIT clause}
geopoly => {Enable the GEOPOLY extension}
rtree => {Enable the RTREE extension}
session => {Enable the SESSION extension}
all => {Enable FTS4, FTS5, Geopoly, RTree, Sessions}
# </lib-feature>
# <tcl>
with-tcl:DIR =>
{Directory containing tclConfig.sh or a directory one level up from
that, from which we can derive a directory containing tclConfig.sh.
A dir name of "prefix" is equivalent to the directory specified by
the --prefix flag.}
with-tclsh:PATH =>
{Full pathname of tclsh to use. It is used for (A) trying to find
tclConfig.sh and (B) all TCL-based code generation. Warning: if
its containing dir has multiple tclsh versions, it may select the
wrong tclConfig.sh!}
tcl=1 =>
{Disable components which require TCL, including all tests.
This tree requires TCL for code generation but can use the in-tree
copy of autosetup/jimsh0.c for that. The SQLite TCL extension and the
test code require a canonical tclsh.}
# <tcl>
# <line-editing>
readline=1 => {Disable readline support}
# --with-readline-lib is a backwards-compatible alias for
# --with-readline-ldflags
with-readline-lib:
with-readline-ldflags:=auto
=> {Readline LDFLAGS, e.g. -lreadline -lncurses}
# --with-readline-inc is a backwards-compatible alias for
# --with-readline-cflags.
with-readline-inc:
with-readline-cflags:=auto
=> {Readline CFLAGS, e.g. -I/path/to/includes}
with-readline-header:PATH
=> {Full path to readline.h, from which --with-readline-cflags will be derived}
with-linenoise:DIR => {Source directory for linenoise.c and linenoise.h}
editline=0 => {Enable BSD editline support}
# </line-editing>
# <icu>
with-icu-ldflags:LDFLAGS
=> {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries}
with-icu-cflags:CFLAGS
=> {Apply extra CFLAGS/CPPFLAGS necessary for building with ICU. e.g. -I/usr/local/include}
with-icu-config:=auto => {Enable SQLITE_ENABLE_ICU. Value must be one of: auto, pkg-config, /path/to/icu-config}
icu-collations=0 => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=... or --with-icu-config}
# </icu>
# <alternative-builds>
with-wasi-sdk:=/opt/wasi-sdk
=> {Top-most dir of the wasi-sdk for a WASI build}
with-emsdk:=auto => {Top-most dir of the Emscripten SDK installation. Default = EMSDK env var.}
# </alternative-builds>
# <developer>
# Note that using the --debug/--enable-debug flag here requires patching
# autosetup/autosetup to rename the --debug to --autosetup-debug.
with-debug=0
debug=0 =>
{Enable debug build flags. This option will impact performance by
as much as 4x, as it includes large numbers of assert()s in
performance-critical loops. Never use --debug for production
builds.}
scanstatus => {Enable the SQLITE_ENABLE_STMT_SCANSTATUS feature flag}
dev => {Enable dev-mode build: automatically enables certain other flags}
test-status => {Enable status of tests}
gcov=0 => {Enable coverage testing using gcov}
linemacros => {Enable #line macros in the amalgamation}
dynlink-tools => {Dynamically link libsqlite3 to certain tools which normally statically embed it.}
soname:=legacy =>
# --soname has a long story behind it: https://sqlite.org/src/forumpost/5a3b44f510df8ded
{SONAME for libsqlite3.so. "none", or not using this flag, sets no
soname. "legacy" sets it to its historical value of
libsqlite3.so.0. A value matching the glob "libsqlite3.*" sets
it to that literal value. Any other value is assumed to be a
suffix which gets applied to "libsqlite3.so.",
e.g. --soname=9.10 equates to "libsqlite3.so.9.10".
}
dump-defines=0 => {Dump autosetup defines to $::sqliteConfig(dump-defines-txt) (for build debugging)}
# </developer>
}
if {"" ne $::sqliteConfig(dump-defines-json)} {
lappend flags \
defines-json-include-lowercase=0 \
=> {Include lower-case defines (primarily system paths) in $::sqliteConfig(dump-defines-json)}
}
options [subst -nobackslashes -nocommands $flags]
unset flags
sqlite-post-options-init
sqlite-setup-default-cflags
proj-if-opt-truthy dev {
# --enable-dev needs to come early so that the downstream tests
# which check for the following flags use their updated state.
proj-opt-set all 1
proj-opt-set debug 1
proj-opt-set amalgamation 0
define CFLAGS [get-env CFLAGS {-O0 -g}]
# -------------^^^^^^^ intentionally using [get-env] instead of
# [proj-get-env] here because [sqlite-setup-default-cflags] uses
# [proj-get-env] and we want this to supercede that.
}
sqlite-check-common-bins ;# must come before [sqlite-handle-wasi-sdk]
sqlite-handle-wasi-sdk ;# must run relatively early, as it changes the environment
sqlite-check-common-system-deps
#
# Enable large file support (if special flags are necessary)
#
define HAVE_LFS 0
if {[opt-bool largefile]} {
cc-check-lfs
}
proj-define-for-opt shared ENABLE_SHARED "Build shared library?"
if {![proj-define-for-opt static ENABLE_STATIC \
"Build static library?"]} {
proj-warn "Static lib build may be implicitly re-activated by other components, e.g. some test apps."
}
proj-define-for-opt amalgamation USE_AMALGAMATION "Use amalgamation for builds?"
proj-define-for-opt gcov USE_GCOV "Use gcov?"
proj-define-for-opt test-status TSTRNNR_OPTS \
"test-runner flags:" {--status} {}
proj-define-for-opt linemacros AMALGAMATION_LINE_MACROS \
"Use #line macros in the amalgamation:"
define LINK_TOOLS_DYNAMICALLY [proj-opt-was-provided dynlink-tools]
proj-check-rpath
sqlite-handle-soname
sqlite-handle-debug
sqlite-handle-tcl
sqlite-handle-threadsafe
sqlite-handle-tempstore
sqlite-handle-line-editing
sqlite-handle-load-extension
sqlite-handle-math
sqlite-handle-icu
sqlite-handle-emsdk
sqlite-common-late-stage-config
sqlite-dump-defines
+81 -43
View File
@@ -67,6 +67,7 @@ LDFLAGS.pthread = @LDFLAGS_PTHREAD@
LDFLAGS.dlopen = @LDFLAGS_DLOPEN@
LDFLAGS.readline = @LDFLAGS_READLINE@
CFLAGS.readline = @CFLAGS_READLINE@
LDFLAGS.rt = @LDFLAGS_RT@
LDFLAGS.icu = @LDFLAGS_ICU@
CFLAGS.icu = @CFLAGS_ICU@
@@ -86,7 +87,7 @@ install-dir.all = $(install-dir.bin) $(install-dir.include) \
$(install-dir.lib) $(install-dir.man1) \
$(install-dir.pkgconfig)
$(install-dir.all):
if [ ! -d "$@" ]; then $(INSTALL) -d "$@"; fi
@if [ ! -d "$@" ]; then set -x; $(INSTALL) -d "$@"; fi
# ^^^^ on some platforms, install -d fails if the target already exists.
@@ -135,58 +136,83 @@ LDFLAGS.libsqlite3 = \
$(LDFLAGS.rpath) $(LDFLAGS.pthread) \
$(LDFLAGS.math) $(LDFLAGS.dlopen) \
$(LDFLAGS.zlib) $(LDFLAGS.icu) \
$(LDFLAGS.configure)
$(LDFLAGS.rt) $(LDFLAGS.configure)
CFLAGS.libsqlite3 = -I. $(CFLAGS.core) $(CFLAGS.icu) $(OPT_FEATURE_FLAGS)
sqlite3.o: $(TOP)/sqlite3.h $(TOP)/sqlite3.c
$(CC) -c $(TOP)/sqlite3.c -o $@ $(CFLAGS) $(CFLAGS.libsqlite3)
libsqlite3.LIB = libsqlite3$(T.lib)
libsqlite3.SO = libsqlite3$(T.dll)
libsqlite3.DLL.basename = @SQLITE_DLL_BASENAME@
libsqlite3.out.implib = @SQLITE_OUT_IMPLIB@
libsqlite3.DLL = $(libsqlite3.DLL.basename)$(T.dll)
libsqlite3.DLL.install-rules = @SQLITE_DLL_INSTALL_RULES@
$(libsqlite3.SO): sqlite3.o
$(libsqlite3.DLL): sqlite3.o
$(CC) -o $@ sqlite3.o $(LDFLAGS.shlib) \
$(LDFLAGS) $(LDFLAGS.libsqlite3) \
$(LDFLAGS.libsqlite3.os-specific) $(LDFLAGS.libsqlite3.soname)
all: $(libsqlite3.SO)
$(libsqlite3.DLL)-1: $(libsqlite3.DLL)
$(libsqlite3.DLL)-0:
all: $(libsqlite3.DLL)-$(ENABLE_LIB_SHARED)
$(libsqlite3.LIB): sqlite3.o
$(AR) $(AR.flags) $@ sqlite3.o
all: $(libsqlite3.LIB)
$(libsqlite3.LIB)-1: $(libsqlite3.LIB)
$(libsqlite3.LIB)-0:
all: $(libsqlite3.LIB)-$(ENABLE_LIB_STATIC)
install-so-1: $(install-dir.lib) $(libsqlite3.SO)
$(INSTALL) $(libsqlite3.SO) "$(install-dir.lib)"
@echo "Setting up $(libsqlite3.SO) version symlinks..."; \
cd "$(install-dir.lib)" || exit $$?; \
if [ x.dylib = x$(T.dll) ]; then \
rm -f libsqlite3.0$(T.dll) libsqlite3.$(PACKAGE_VERSION)$(T.dll) || exit $$?; \
dllname=libsqlite3.$(PACKAGE_VERSION)$(T.dll); \
mv $(libsqlite3.SO) $$dllname || exit $$?; \
ln -s $$dllname $(libsqlite3.SO) || exit $$?; \
ln -s $$dllname libsqlite3.0$(T.dll) || exit $$?; \
ls -la $$dllname $(libsqlite3.SO) libsqlite3.0$(T.dll); \
else \
rm -f $(libsqlite3.SO).0 $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \
mv $(libsqlite3.SO) $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO) || exit $$?; \
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0 || exit $$?; \
ls -la $(libsqlite3.SO) $(libsqlite3.SO).[03]*; \
if [ -e $(libsqlite3.SO).0.8.6 ]; then \
echo "ACHTUNG: legacy libtool-compatible install found. Re-linking it..."; \
rm -f libsqlite3.la $(libsqlite3.SO).0.8.6 || exit $$?; \
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0.8.6 || exit $$?; \
ls -la $(libsqlite3.SO).0.8.6; \
elif [ x1 = "x$(INSTALL_SO_086_LINK)" ]; then \
echo "ACHTUNG: installing legacy libtool-style links because INSTALL_SO_086_LINK=1"; \
rm -f libsqlite3.la $(libsqlite3.SO).0.8.6 || exit $$?; \
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0.8.6 || exit $$?; \
ls -la $(libsqlite3.SO).0.8.6; \
fi; \
#
# Maintenance reminder: the install-dll-... rules must be kept in sync
# with the main copies rom /main.mk.
#
install-dll-out-implib: $(install-dir.lib) $(libsqlite3.DLL)
if [ x != "x$(libsqlite3.out.implib)" ] && [ -f "$(libsqlite3.out.implib)" ]; then \
$(INSTALL) $(libsqlite3.out.implib) "$(install-dir.lib)"; \
fi
install-so-0 install-so-:
install-so: install-so-$(ENABLE_LIB_SHARED)
install: install-so
install-dll-unix-generic: install-dll-out-implib
$(INSTALL) $(libsqlite3.DLL) "$(install-dir.lib)"
@echo "Setting up $(libsqlite3.DLL) version symlinks..."; \
cd "$(install-dir.lib)" || exit $$?; \
rm -f $(libsqlite3.DLL).0 $(libsqlite3.DLL).$(PACKAGE_VERSION) || exit $$?; \
mv $(libsqlite3.DLL) $(libsqlite3.DLL).$(PACKAGE_VERSION) || exit $$?; \
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL) || exit $$?; \
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0 || exit $$?; \
ls -la $(libsqlite3.DLL) $(libsqlite3.DLL).[a03]*; \
if [ -e $(libsqlite3.DLL).0.8.6 ]; then \
echo "ACHTUNG: legacy libtool-compatible install found. Re-linking it..."; \
rm -f libsqlite3.la $(libsqlite3.DLL).0.8.6 || exit $$?; \
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0.8.6 || exit $$?; \
ls -la $(libsqlite3.DLL).0.8.6; \
elif [ x1 = "x$(INSTALL_SO_086_LINK)" ]; then \
echo "ACHTUNG: installing legacy libtool-style links because INSTALL_SO_086_LINK=1"; \
rm -f libsqlite3.la $(libsqlite3.DLL).0.8.6 || exit $$?; \
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0.8.6 || exit $$?; \
ls -la $(libsqlite3.DLL).0.8.6; \
fi
install-dll-msys: install-dll-out-implib $(install-dir.bin)
$(INSTALL) $(libsqlite3.DLL) "$(install-dir.bin)"
# ----------------------------------------------^^^ yes, bin
install-dll-mingw: install-dll-msys
install-dll-cygwin: install-dll-msys
install-dll-darwin: $(install-dir.lib) $(libsqlite3.DLL)
$(INSTALL) $(libsqlite3.DLL) "$(install-dir.lib)"
@echo "Setting up $(libsqlite3.DLL) version symlinks..."; \
cd "$(install-dir.lib)" || exit $$?; \
rm -f libsqlite3.0$(T.dll) libsqlite3.$(PACKAGE_VERSION)$(T.dll) || exit $$?; \
dllname=libsqlite3.$(PACKAGE_VERSION)$(T.dll); \
mv $(libsqlite3.DLL) $$dllname || exit $$?; \
ln -s $$dllname $(libsqlite3.DLL) || exit $$?; \
ln -s $$dllname libsqlite3.0$(T.dll) || exit $$?; \
ls -la $$dllname $(libsqlite3.DLL) libsqlite3.0$(T.dll)
install-dll-1: install-dll-$(libsqlite3.DLL.install-rules)
install-dll-0 install-dll-:
install-dll: install-dll-$(ENABLE_LIB_SHARED)
install: install-dll
install-lib-1: $(install-dir.lib) $(libsqlite3.LIB)
$(INSTALL.noexec) $(libsqlite3.LIB) "$(install-dir.lib)"
@@ -194,13 +220,22 @@ install-lib-0 install-lib-:
install-lib: install-lib-$(ENABLE_LIB_STATIC)
install: install-lib
sqlite3$(T.exe): $(TOP)/shell.c $(TOP)/sqlite3.c
#
# Flags to link the shell app either directly against sqlite3.c
# (ENABLE_STATIC_SHELL==1) or libsqlite3.so (ENABLE_STATIC_SHELL==0).
#
ENABLE_STATIC_SHELL = @ENABLE_STATIC_SHELL@
sqlite3-shell-link-flags.1 = $(TOP)/sqlite3.c $(LDFLAGS.libsqlite3)
sqlite3-shell-link-flags.0 = -L. -lsqlite3 $(LDFLAGS.zlib)
sqlite3-shell-deps.1 = $(TOP)/sqlite3.c
sqlite3-shell-deps.0 = $(libsqlite3.DLL)
sqlite3$(T.exe): $(TOP)/shell.c $(sqlite3-shell-deps.$(ENABLE_STATIC_SHELL))
$(CC) -o $@ \
$(TOP)/shell.c $(TOP)/sqlite3.c \
$(TOP)/shell.c $(sqlite3-shell-link-flags.$(ENABLE_STATIC_SHELL)) \
-I. $(OPT_FEATURE_FLAGS) $(SHELL_OPT) \
$(CFLAGS) $(CFLAGS.readline) $(CFLAGS.icu) \
$(LDFLAGS) $(LDFLAGS.libsqlite3) $(LDFLAGS.readline)
$(LDFLAGS) $(LDFLAGS.readline)
all: sqlite3$(T.exe)
install-shell: sqlite3$(T.exe) $(install-dir.bin)
@@ -221,10 +256,10 @@ install: install-man1
clean:
rm -f *.o sqlite3$(T.exe)
rm -f $(libsqlite3.LIB) $(libsqlite3.SO) $(libsqlite3.SO).a
rm -f $(libsqlite3.LIB) $(libsqlite3.DLL) libsqlite3$(T.dll).a
distclean: clean
rm -f jimsh0$(T.exe) config.* sqlite3.pc
rm -f jimsh0$(T.exe) config.* sqlite3.pc sqlite_cfg.h Makefile
DIST_FILES := \
README.txt VERSION \
@@ -234,14 +269,17 @@ DIST_FILES := \
sqlite3.rc sqlite3rc.h Replace.cs \
sqlite3.pc.in sqlite3.1
#
# Maintenance note: dist_name must be sqlite-$(PACKAGE_VERSION) so
# that tool/mkautoconfamal.sh knows how to find it.
#
dist_name = sqlite-$(PACKAGE_VERSION)
dist_tarball = $(dist_name).tar.gz
dist:
rm -fr $(dist_name)
mkdir -p $(dist_name)
cp -rp $(DIST_FILES) $(dist_name)/.
rm -f $(dist_name)/tea/configure.ac.in
tar czf $(dist_tarball) $(dist_name)
rm -fr $(dist_name)
ls -l $(dist_tarball)
+11 -1
View File
@@ -247,6 +247,12 @@ SESSION = 0
RBU = 0
!ENDIF
# Set this to non-0 to enable support for blocking locks.
#
!IFNDEF SETLK_TIMEOUT
SETLK_TIMEOUT = 0
!ENDIF
# Set the source code file to be used by executables and libraries when
# they need the amalgamation.
#
@@ -372,6 +378,10 @@ EXT_FEATURE_FLAGS =
!ENDIF
!ENDIF
!IF $(SETLK_TIMEOUT)!=0
OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SETLK_TIMEOUT
!ENDIF
###############################################################################
############################### END OF OPTIONS ################################
###############################################################################
@@ -1088,5 +1098,5 @@ $(LIBRESOBJS): $(TOP)\sqlite3.rc rcver.vc $(SQLITE3H)
clean:
del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
del /Q *.bsc *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
del /Q sqlite3.def tclsqlite3.def 2>NUL
del /Q sqlite3.def tclsqlite3.def ctime.c pragma.h 2>NUL
del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL
+1 -1
View File
@@ -27,7 +27,7 @@ the embedded copy of JimTCL).
REASONS TO USE THE CANONICAL BUILD SYSTEM RATHER THAN THIS PACKAGE
==================================================================
* the cononical build system allows you to run tests to verify that
* the canonical build system allows you to run tests to verify that
the build worked
* the canonical build system supports more compile-time options
* the canonical build system works for any arbitrary check-in to
+4 -91
View File
@@ -1,97 +1,10 @@
#/do/not/tclsh
#!/do/not/tclsh
# ^^^ help out editors which guess this file's content type.
#
# This is the main autosetup-compatible configure script for the
# "autoconf" bundle of the SQLite project.
#
# This script must be kept compatible with JimTCL, a copy of which is
# included in this source tree as ./autosetup/jimsh0.c.
#
use sqlite-config
options {
# <build-modes>
static=1 => {Disable build of static library}
shared=1 => {Disable build of shared library}
# </build-modes>
# <lib-feature>
threadsafe=1 => {Disable mutexing}
with-tempstore:=no => {Use an in-RAM database for temporary tables: never,no,yes,always}
load-extension=1 => {Disable loading of external extensions}
math=1 => {Disable math functions}
json=1 => {Disable JSON functions}
memsys5 => {Enable MEMSYS5}
memsys3 => {Enable MEMSYS3}
fts3 => {Enable the FTS3 extension}
fts4 => {Enable the FTS4 extension}
fts5 => {Enable the FTS5 extension}
update-limit => {Enable the UPDATE/DELETE LIMIT clause}
geopoly => {Enable the GEOPOLY extension}
rtree => {Enable the RTREE extension}
session => {Enable the SESSION extension}
all => {Enable FTS4, FTS5, Geopoly, RTree, Sessions}
# </lib-feature>
# <line-editing>
readline=1 => {Disable readline support}
# --with-readline-lib is a backwards-compatible alias for
# --with-readline-ldflags
with-readline-lib:
with-readline-ldflags:=auto
=> {Readline LDFLAGS, e.g. -lreadline -lncurses}
# --with-readline-inc is a backwards-compatible alias for
# --with-readline-cflags.
with-readline-inc:
with-readline-cflags:=auto
=> {Readline CFLAGS, e.g. -I/path/to/includes}
with-readline-header:PATH
=> {Full path to readline.h, from which --with-readline-cflags will be derived}
with-linenoise:DIR => {Source directory for linenoise.c and linenoise.h}
editline=0 => {Enable BSD editline support}
# </line-editing>
# <icu>
with-icu-ldflags:LDFLAGS
=> {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries}
with-icu-cflags:CFLAGS
=> {Apply extra CFLAGS/CPPFLAGS necessary for building with ICU. e.g. -I/usr/local/include}
with-icu-config:=auto => {Enable SQLITE_ENABLE_ICU. Value must be one of: auto, pkg-config, /path/to/icu-config}
icu-collations=0 => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=... or --with-icu-config}
# </icu>
# <developer>
# Note that using the --debug/--enable-debug flag here requires patching
# autosetup/autosetup to rename the --debug to --autosetup-debug.
with-debug=0
debug=0 =>
{Enable debug build flags. This option will impact performance by
as much as 4x, as it includes large numbers of assert()s in
performance-critical loops. Never use --debug for production
builds.}
# </developer>
soname:=legacy =>
# --soname has a long story behind it: https://sqlite.org/src/forumpost/5a3b44f510df8ded
{SONAME for libsqlite3.so. "none", or not using this flag, sets no
soname. "legacy" sets it to its historical value of
libsqlite3.so.0. A value matching the glob "libsqlite3.*" sets
it to that literal value. Any other value is assumed to be a
suffix which gets applied to "libsqlite3.so.",
e.g. --soname=9.10 equates to "libsqlite3.so.9.10".
}
sqlite-configure autoconf {
sqlite-check-common-bins
sqlite-check-common-system-deps
}
sqlite-post-options-init
sqlite-check-common-bins
sqlite-check-common-system-deps
proj-check-rpath
sqlite-handle-soname
sqlite-setup-default-cflags
sqlite-handle-debug
sqlite-handle-threadsafe
sqlite-handle-tempstore
sqlite-handle-line-editing
sqlite-handle-load-extension
sqlite-handle-math
sqlite-handle-icu
define ENABLE_LIB_SHARED [opt-bool shared]
define ENABLE_LIB_STATIC [opt-bool static]
sqlite-common-late-stage-config
+1 -1
View File
@@ -26,7 +26,7 @@ SQLite that does not require first installing TCL and/or "tclsh".
The canonical Makefile in the SQLite source tree provides more
capabilities (such as the the ability to run test cases to ensure
that the build worked) and is better maintained. The only
downside of the canonical Makfile is that it requires a TCL
downside of the canonical Makefile is that it requires a TCL
installation. But if you are wanting to build the TCL extension for
SQLite, then presumably you already have a TCL installation. So why
not just use the more-capable and better-maintained canoncal Makefile?
@@ -19,7 +19,7 @@ dnl to configure the system for the local environment.
# so that we create the export library with the dll.
#-----------------------------------------------------------------------
AC_INIT([sqlite],[3.50.0])
AC_INIT([sqlite],[@VERSION@])
#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
@@ -93,7 +93,7 @@ TEA_ADD_TCL_SOURCES([])
# The --with-system-sqlite causes the TCL bindings to SQLite to use
# the system shared library for SQLite rather than statically linking
# against its own private copy. This is dangerous and leads to
# undersirable dependences and is not recommended.
# undesirable dependences and is not recommended.
# Patchs from rmax.
#--------------------------------------------------------------------
AC_ARG_WITH([system-sqlite],
+8 -4
View File
@@ -1634,8 +1634,8 @@ proc automf_command_reference {} {
if {[regexp {^#.*@section (.*)$} $line -> section]} {
lappend doc($current) [list section $section]
continue
}
continue
}
# Find embedded module names
if {[regexp {^#.*@module ([^ ]*)} $line -> modulename]} {
@@ -1651,7 +1651,7 @@ proc automf_command_reference {} {
if {$cmd eq "synopsis:"} {
set current $modulename
lappend doc($current) [list section "Module: $modulename"]
} else {
} else {
lappend doc($current) [list subsection $cmd]
}
@@ -2088,8 +2088,12 @@ if {$autosetup(iswin)} {
proc split-path {} {
split [getenv PATH .] :
}
# Check for an executable file
proc file-isexec {exec} {
file executable $exec
if {[file executable $exec] && [file isfile $exec]} {
return 1
}
return 0
}
}
+1 -1
View File
@@ -9,7 +9,7 @@ for tclsh in ./jimsh0 $autosetup_tclsh jimsh tclsh tclsh8.5 tclsh8.6 tclsh8.7; d
done
echo 1>&2 "No installed jimsh or tclsh, building local bootstrap jimsh0"
for cc in ${CC_FOR_BUILD:-cc} gcc; do
{ $cc -o jimsh0 "$d/jimsh0.c"; } >/dev/null 2>&1 || continue
{ $cc -o jimsh0 "$d/jimsh0.c"; } 2>/dev/null >/dev/null || continue
./jimsh0 "$d/${1-autosetup-test-tclsh}" && exit 0
done
echo 1>&2 "No working C compiler found. Tried ${CC_FOR_BUILD:-cc} and gcc."
+8 -12
View File
@@ -1252,6 +1252,14 @@ int Jim_OpenForRead(const char *filename);
#endif
# ifndef MAXPATHLEN
# ifdef PATH_MAX
# define MAXPATHLEN PATH_MAX
# else
# define MAXPATHLEN JIM_PATH_LEN
# endif
# endif
int Jim_FileStoreStatData(Jim_Interp *interp, Jim_Obj *varName, const jim_stat_t *sb);
@@ -2088,10 +2096,6 @@ enum wbuftype {
#define UNIX_SOCKETS 0
#endif
#ifndef MAXPATHLEN
#define MAXPATHLEN JIM_PATH_LEN
#endif
@@ -4173,14 +4177,6 @@ int Jim_regexpInit(Jim_Interp *interp)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
# ifndef MAXPATHLEN
# ifdef PATH_MAX
# define MAXPATHLEN PATH_MAX
# else
# define MAXPATHLEN JIM_PATH_LEN
# endif
# endif
#if defined(__MINGW32__) || defined(__MSYS__) || defined(_MSC_VER)
#define ISWINDOWS 1
+107 -29
View File
@@ -197,16 +197,42 @@ proc proj-strip-hash-comments {val} {
return $x
}
########################################################################
# @proj-cflags-without-werror
#
# Fetches [define $var], strips out any -Werror entries, and returns
# the new value. This is intended for temporarily stripping -Werror
# from CFLAGS or CPPFLAGS within the scope of a [define-push] block.
proc proj-cflags-without-werror {{var CFLAGS}} {
set rv {}
foreach f [get-define $var ""] {
switch -exact -- $f {
-Werror {}
default { lappend rv $f }
}
}
return [join $rv " "]
}
########################################################################
# @proj-check-function-in-lib
#
# A proxy for cc-check-function-in-lib which does not make any global
# changes to the LIBS define. Returns the result of
# cc-check-function-in-lib (i.e. true or false). The resulting linker
# flags are stored in the [define] named lib_${function}.
# A proxy for cc-check-function-in-lib with the following differences:
#
# - Does not make any global changes to the LIBS define.
#
# - Strips out -W... warning flags from CFLAGS before running the
# test, as these feature tests will often fail if -Werror is used.
#
# Returns the result of cc-check-function-in-lib (i.e. true or false).
# The resulting linker flags are stored in the [define] named
# lib_${function}.
proc proj-check-function-in-lib {function libs {otherlibs {}}} {
set found 0
define-push {LIBS} {
define-push {LIBS CFLAGS} {
#puts "CFLAGS before=[get-define CFLAGS]"
define CFLAGS [proj-cflags-without-werror]
#puts "CFLAGS after =[get-define CFLAGS]"
set found [cc-check-function-in-lib $function $libs $otherlibs]
}
return $found
@@ -353,7 +379,6 @@ proc proj-opt-was-provided {key} {
#
# Returns $val.
proc proj-opt-set {flag {val 1}} {
global autosetup
if {$flag ni $::autosetup(options)} {
# We have to add this to autosetup(options) or else future calls
# to [opt-bool $flag] will fail validation of $flag.
@@ -363,6 +388,15 @@ proc proj-opt-set {flag {val 1}} {
return $val
}
########################################################################
# @proj-opt-exists flag
#
# Returns 1 if the given flag has been defined as a legal configure
# option, else returns 0.
proc proj-opt-exists {flag} {
expr {$flag in $::autosetup(options)};
}
########################################################################
# @proj-val-truthy val
#
@@ -907,6 +941,35 @@ proc proj-check-emsdk {} {
return $rc
}
########################################################################
# @proj-cc-check-Wl-flag ?flag ?args??
#
# Checks whether the given linker flag (and optional arguments) can be
# passed from the compiler to the linker using one of these formats:
#
# - -Wl,flag[,arg1[,...argN]]
# - -Wl,flag -Wl,arg1 ...-Wl,argN
#
# If so, that flag string is returned, else an empty string is
# returned.
proc proj-cc-check-Wl-flag {args} {
cc-with {-link 1} {
# Try -Wl,flag,...args
set fli "-Wl"
foreach f $args { append fli ",$f" }
if {[cc-check-flags $fli]} {
return $fli
}
# Try -Wl,flag -Wl,arg1 ...-Wl,argN
set fli ""
foreach f $args { append fli "-Wl,$f " }
if {[cc-check-flags $fli]} {
return [string trim $fli]
}
return ""
}
}
########################################################################
# @proj-check-rpath
#
@@ -918,12 +981,7 @@ proc proj-check-emsdk {} {
# --exec-prefix=... or --libdir=... are explicitly passed to
# configure then [get-define libdir] is used (noting that it derives
# from exec-prefix by default).
#
# Achtung: we have seen platforms which report that a given option
# checked here will work but then fails at build-time, and the current
# order of checks reflects that.
proc proj-check-rpath {} {
set rc 1
if {[proj-opt-was-provided libdir]
|| [proj-opt-was-provided exec-prefix]} {
set lp "[get-define libdir]"
@@ -934,21 +992,18 @@ proc proj-check-rpath {} {
# CFLAGS or LIBS or whatever it is that cc-check-flags updates) then
# downstream tests may fail because the resulting rpath gets
# implicitly injected into them.
cc-with {} {
cc-with {-link 1} {
if {[cc-check-flags "-rpath $lp"]} {
define LDFLAGS_RPATH "-rpath $lp"
} elseif {[cc-check-flags "-Wl,-rpath,$lp"]} {
define LDFLAGS_RPATH "-Wl,-rpath,$lp"
} elseif {[cc-check-flags "-Wl,-rpath -Wl,$lp"]} {
define LDFLAGS_RPATH "-Wl,-rpath -Wl,$lp"
} elseif {[cc-check-flags -Wl,-R$lp]} {
define LDFLAGS_RPATH "-Wl,-R$lp"
} else {
define LDFLAGS_RPATH ""
set rc 0
set wl [proj-cc-check-Wl-flag -rpath $lp]
if {"" eq $wl} {
set wl [proj-cc-check-Wl-flag -R$lp]
}
define LDFLAGS_RPATH $wl
}
}
return $rc
expr {"" ne [get-define LDFLAGS_RPATH]}
}
########################################################################
@@ -965,7 +1020,7 @@ proc proj-check-rpath {} {
# potentially avoid some end-user confusion by using their own lib's
# name here (which shows up in the "checking..." output).
proc proj-check-soname {{libname "libfoo.so.0"}} {
cc-with {} {
cc-with {-link 1} {
if {[cc-check-flags "-Wl,-soname,${libname}"]} {
define LDFLAGS_SONAME_PREFIX "-Wl,-soname,"
return 1
@@ -976,6 +1031,29 @@ proc proj-check-soname {{libname "libfoo.so.0"}} {
}
}
########################################################################
# @proj-check-fsanitize ?list-of-opts?
#
# Checks whether CC supports -fsanitize=X, where X is each entry of
# the given list of flags. If any of those flags are supported, it
# returns the string "-fsanitize=X..." where X... is a comma-separated
# list of all supported flags. If none of the given options are
# supported then it returns an empty string.
proc proj-check-fsanitize {{opts {address bounds-strict}}} {
set sup {}
foreach opt $opts {
cc-with {} {
if {[cc-check-flags "-fsanitize=$opt"]} {
lappend sup $opt
}
}
}
if {[llength $sup] > 0} {
return "-fsanitize=[join $sup ,]"
}
return ""
}
########################################################################
# Internal helper for proj-dump-defs-json. Expects to be passed a
# [define] name and the variadic $args which are passed to
@@ -1138,7 +1216,7 @@ proc proj-xfer-options-aliases {mapping} {
########################################################################
# Arguable/debatable...
#
# When _not_ cross-compiling and CC_FOR_BUILD is _not_ explcitely
# When _not_ cross-compiling and CC_FOR_BUILD is _not_ explicitly
# specified, force CC_FOR_BUILD to be the same as CC, so that:
#
# ./configure CC=clang
@@ -1146,7 +1224,7 @@ proc proj-xfer-options-aliases {mapping} {
# will use CC_FOR_BUILD=clang, instead of cc, for building in-tree
# tools. This is based off of an email discussion and is thought to
# be likely to cause less confusion than seeing 'cc' invocations
# will when the user passes CC=clang.
# when when the user passes CC=clang.
#
# Sidebar: if we do this before the cc package is installed, it gets
# reverted by that package. Ergo, the cc package init will tell the
@@ -1191,11 +1269,11 @@ proc proj-which-linenoise {dotH} {
#
# In that make invocation, $(libdir) would, at make-time, normally be
# hard-coded to /foo/lib, rather than /blah/lib. That happens because
# the autosetup exports conventional $prefix-based values for the
# numerous autoconfig-compatible XYZdir vars at configure-time. What
# we would normally want, however, is that --libdir derives from the
# make-time $(prefix). The distinction between configure-time and
# make-time is the significant factor there.
# autosetup exports conventional $prefix-based values for the numerous
# autoconfig-compatible XYZdir vars at configure-time. What we would
# normally want, however, is that --libdir derives from the make-time
# $(prefix). The distinction between configure-time and make-time is
# the significant factor there.
#
# This function attempts to reconcile those vars in such a way that
# they will derive, at make-time, from $(prefix) in a conventional
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -567,7 +567,7 @@ proc sqlitecon::Cut w {
}
}
# Do a paste opeation.
# Do a paste operation.
#
proc sqlitecon::Paste w {
if {[sqlitecon::canCut $w]==1} {
+1 -1
View File
@@ -281,7 +281,7 @@ happen if and when they are actually needed.
A valid JSONB BLOB consists of a single JSON element. The element must
exactly fill the BLOB. This one element is often a JSON object or array
and those usually contain additional elements as its payload, but the
element can be a primite value such a string, number, boolean, or null.
element can be a primitive value such a string, number, boolean, or null.
When the built-in JSON functions are attempting to determine if a BLOB
argument is a JSONB or just a random BLOB, they look at the header of
+1 -1
View File
@@ -881,7 +881,7 @@ is allowed between the "%" and the directive name.</p>
<p>Grammar text in between "<tt>%ifdef MACRO</tt>" and the next nested
"<tt>%endif</tt>" is
ignored unless the "-DMACRO" command-line option is used. Grammar text
betwen "<tt>%ifndef MACRO</tt>" and the next nested "<tt>%endif</tt>" is
between "<tt>%ifndef MACRO</tt>" and the next nested "<tt>%endif</tt>" is
included except when the "-DMACRO" command-line option is used.<p>
<p>The text in between "<tt>%if</tt> <i>CONDITIONAL</i>" and its
+1 -1
View File
@@ -45,7 +45,7 @@
*** Definition: Two databases (or the same database at two points it time)
are said to be "logically equivalent" if they give the same answer to
all queries. Note in particular the content of freelist leaf
pages can be changed arbitarily without effecting the logical equivalence
pages can be changed arbitrarily without effecting the logical equivalence
of the database.
(7) At any time, if any subset, including the empty set and the total set,
+2 -2
View File
@@ -1,6 +1,6 @@
The 5 states of an historical rollback lock as implemented by the
xLock, xUnlock, and xCheckReservedLock methods of the sqlite3_io_methods
objec are:
object are:
UNLOCKED
SHARED
@@ -58,7 +58,7 @@ The meanings of the various wal-index locking states is as follows:
A particular lock manager implementation may coalesce one or more of
the wal-index locking states, though with a reduction in concurrency.
For example, an implemention might implement only exclusive locking,
For example, an implementation might implement only exclusive locking,
in which case all states would be equivalent to CHECKPOINT, meaning that
only one reader or one writer or one checkpointer could be active at a
time. Or, an implementation might combine READ and READ_FULL into
+1 -1
View File
@@ -12,7 +12,7 @@ facilitates transfer of OS priority between processes when a high priority
process is blocked by a lower priority one.
Only read/write clients use blocking locks. Clients that have read-only access
to the \*-shm file nevery use blocking locks.
to the \*-shm file never use blocking locks.
Threads or processes that access a single database at a time never deadlock as
a result of blocking database locks. But it is of course possible for threads
+1 -1
View File
@@ -2052,7 +2052,7 @@ sqlite3expert *sqlite3_expert_new(sqlite3 *db, char **pzErrmsg){
sqlite3_set_authorizer(pNew->dbv, idxAuthCallback, (void*)pNew);
}
/* If an error has occurred, free the new object and reutrn NULL. Otherwise,
/* If an error has occurred, free the new object and return NULL. Otherwise,
** return the new sqlite3expert handle. */
if( rc!=SQLITE_OK ){
sqlite3_expert_destroy(pNew);
+5 -5
View File
@@ -62,20 +62,20 @@
matches rows that contain both the "engineering" and "consultancy" tokens
in the same column with not more than 10 other words between them. It does
not matter which of the two terms occurs first in the document, only that
they be seperated by only 10 tokens or less. The user may also specify
they be separated by only 10 tokens or less. The user may also specify
a different required proximity by adding "/N" immediately after the NEAR
operator, where N is an integer. For example:
<col> MATCH 'engineering NEAR/5 consultancy'
searches for a row containing an instance of each specified token seperated
searches for a row containing an instance of each specified token separated
by not more than 5 other tokens. More than one NEAR operator can be used
in as sequence. For example this query:
<col> MATCH 'reliable NEAR/2 engineering NEAR/5 consultancy'
searches for a row that contains an instance of the token "reliable"
seperated by not more than two tokens from an instance of "engineering",
separated by not more than two tokens from an instance of "engineering",
which is in turn separated by not more than 5 other tokens from an
instance of the term "consultancy". Phrases enclosed in quotes may
also be used as arguments to the NEAR operator.
@@ -146,7 +146,7 @@
<col> MATCH '(hello world) OR (simple example)'
matches documents that contain both "hello" and "world", and documents
that contain both "simple" and "example". It is not possible to forumlate
that contain both "simple" and "example". It is not possible to formulate
such a query using the standard syntax.
2) Instead of separating tokens and phrases by whitespace, an AND operator
@@ -174,7 +174,7 @@
4) Unlike in the standard syntax, where the OR operator has a higher
precedence than the implicit AND operator, when using the enhanced
syntax implicit and explict AND operators have a higher precedence
syntax implicit and explicit AND operators have a higher precedence
than OR operators. Using the enhanced syntax, the following two
queries are equivalent:
+5 -5
View File
@@ -87,7 +87,7 @@
** Here, array { X } means zero or more occurrences of X, adjacent in
** memory. A "position" is an index of a token in the token stream
** generated by the tokenizer. Note that POS_END and POS_COLUMN occur
** in the same logical place as the position element, and act as sentinals
** in the same logical place as the position element, and act as sentinels
** ending a position list array. POS_END is 0. POS_COLUMN is 1.
** The positions numbers are not stored literally but rather as two more
** than the difference from the prior position, or the just the position plus
@@ -2639,7 +2639,7 @@ static int fts3DoclistOrMerge(
** sizes of the two inputs, plus enough space for exactly one of the input
** docids to grow.
**
** A symetric argument may be made if the doclists are in descending
** A symmetric argument may be made if the doclists are in descending
** order.
*/
aOut = sqlite3_malloc64((i64)n1+n2+FTS3_VARINT_MAX-1+FTS3_BUFFER_PADDING);
@@ -4438,7 +4438,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){
nDistance = iPrev - nMaxUndeferred;
}
aOut = (char *)sqlite3Fts3MallocZero(nPoslist+FTS3_BUFFER_PADDING);
aOut = (char *)sqlite3Fts3MallocZero(((i64)nPoslist)+FTS3_BUFFER_PADDING);
if( !aOut ){
sqlite3_free(aPoslist);
return SQLITE_NOMEM;
@@ -4737,7 +4737,7 @@ static int incrPhraseTokenNext(
**
** * does not contain any deferred tokens.
**
** Advance it to the next matching documnent in the database and populate
** Advance it to the next matching document in the database and populate
** the Fts3Doclist.pList and nList fields.
**
** If there is no "next" entry and no error occurs, then *pbEof is set to
@@ -5744,7 +5744,7 @@ static int fts3EvalNext(Fts3Cursor *pCsr){
}
/*
** Restart interation for expression pExpr so that the next call to
** Restart iteration for expression pExpr so that the next call to
** fts3EvalNext() visits the first row. Do not allow incremental
** loading or merging of phrase doclists for this iteration.
**
+20 -3
View File
@@ -202,6 +202,19 @@ typedef sqlite3_int64 i64; /* 8-byte signed integer */
#define deliberate_fall_through
/*
** Macros needed to provide flexible arrays in a portable way
*/
#ifndef offsetof
# define offsetof(STRUCTURE,FIELD) ((size_t)((char*)&((STRUCTURE*)0)->FIELD))
#endif
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
# define FLEXARRAY
#else
# define FLEXARRAY 1
#endif
#endif /* SQLITE_AMALGAMATION */
#ifdef SQLITE_DEBUG
@@ -306,7 +319,7 @@ struct Fts3Table {
#endif
#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
/* True to disable the incremental doclist optimization. This is controled
/* True to disable the incremental doclist optimization. This is controlled
** by special insert command 'test-no-incr-doclist'. */
int bNoIncrDoclist;
@@ -358,7 +371,7 @@ struct Fts3Cursor {
/*
** The Fts3Cursor.eSearch member is always set to one of the following.
** Actualy, Fts3Cursor.eSearch can be greater than or equal to
** Actually, Fts3Cursor.eSearch can be greater than or equal to
** FTS3_FULLTEXT_SEARCH. If so, then Fts3Cursor.eSearch - 2 is the index
** of the column to be searched. For example, in
**
@@ -431,9 +444,13 @@ struct Fts3Phrase {
*/
int nToken; /* Number of tokens in the phrase */
int iColumn; /* Index of column this phrase must match */
Fts3PhraseToken aToken[1]; /* One entry for each token in the phrase */
Fts3PhraseToken aToken[FLEXARRAY]; /* One for each token in the phrase */
};
/* Size (in bytes) of an Fts3Phrase object large enough to hold N tokens */
#define SZ_FTS3PHRASE(N) \
(offsetof(Fts3Phrase,aToken)+(N)*sizeof(Fts3PhraseToken))
/*
** A tree of these objects forms the RHS of a MATCH operator.
**
+5 -5
View File
@@ -202,7 +202,7 @@ static int getNextToken(
rc = pModule->xNext(pCursor, &zToken, &nToken, &iStart, &iEnd, &iPosition);
if( rc==SQLITE_OK ){
nByte = sizeof(Fts3Expr) + sizeof(Fts3Phrase) + nToken;
nByte = sizeof(Fts3Expr) + SZ_FTS3PHRASE(1) + nToken;
pRet = (Fts3Expr *)sqlite3Fts3MallocZero(nByte);
if( !pRet ){
rc = SQLITE_NOMEM;
@@ -212,7 +212,7 @@ static int getNextToken(
pRet->pPhrase->nToken = 1;
pRet->pPhrase->iColumn = iCol;
pRet->pPhrase->aToken[0].n = nToken;
pRet->pPhrase->aToken[0].z = (char *)&pRet->pPhrase[1];
pRet->pPhrase->aToken[0].z = (char*)&pRet->pPhrase->aToken[1];
memcpy(pRet->pPhrase->aToken[0].z, zToken, nToken);
if( iEnd<n && z[iEnd]=='*' ){
@@ -283,9 +283,9 @@ static int getNextString(
Fts3Expr *p = 0;
sqlite3_tokenizer_cursor *pCursor = 0;
char *zTemp = 0;
int nTemp = 0;
i64 nTemp = 0;
const int nSpace = sizeof(Fts3Expr) + sizeof(Fts3Phrase);
const int nSpace = sizeof(Fts3Expr) + SZ_FTS3PHRASE(1);
int nToken = 0;
/* The final Fts3Expr data structure, including the Fts3Phrase,
@@ -657,7 +657,7 @@ static int fts3ExprParse(
/* The isRequirePhrase variable is set to true if a phrase or
** an expression contained in parenthesis is required. If a
** binary operator (AND, OR, NOT or NEAR) is encounted when
** binary operator (AND, OR, NOT or NEAR) is encountered when
** isRequirePhrase is set, this is a syntax error.
*/
if( !isPhrase && isRequirePhrase ){
+1 -1
View File
@@ -187,7 +187,7 @@ static void fts3HashInsertElement(
}
/* Resize the hash table so that it cantains "new_size" buckets.
/* Resize the hash table so that it contains "new_size" buckets.
** "new_size" must be a power of 2. The hash table might fail
** to resize if sqliteMalloc() fails.
**
+1 -1
View File
@@ -256,7 +256,7 @@ static int star_oh(const char *z){
/*
** If the word ends with zFrom and xCond() is true for the stem
** of the word that preceeds the zFrom ending, then change the
** of the word that precedes the zFrom ending, then change the
** ending to zTo.
**
** The input word *pz and zFrom are both in reverse order. zTo
+16 -12
View File
@@ -108,9 +108,13 @@ struct MatchinfoBuffer {
int nElem;
int bGlobal; /* Set if global data is loaded */
char *zMatchinfo;
u32 aMatchinfo[1];
u32 aMI[FLEXARRAY];
};
/* Size (in bytes) of a MatchinfoBuffer sufficient for N elements */
#define SZ_MATCHINFOBUFFER(N) \
(offsetof(MatchinfoBuffer,aMI)+(((N)+1)/2)*sizeof(u64))
/*
** The snippet() and offsets() functions both return text values. An instance
@@ -135,13 +139,13 @@ struct StrBuffer {
static MatchinfoBuffer *fts3MIBufferNew(size_t nElem, const char *zMatchinfo){
MatchinfoBuffer *pRet;
sqlite3_int64 nByte = sizeof(u32) * (2*(sqlite3_int64)nElem + 1)
+ sizeof(MatchinfoBuffer);
+ SZ_MATCHINFOBUFFER(1);
sqlite3_int64 nStr = strlen(zMatchinfo);
pRet = sqlite3Fts3MallocZero(nByte + nStr+1);
if( pRet ){
pRet->aMatchinfo[0] = (u8*)(&pRet->aMatchinfo[1]) - (u8*)pRet;
pRet->aMatchinfo[1+nElem] = pRet->aMatchinfo[0]
pRet->aMI[0] = (u8*)(&pRet->aMI[1]) - (u8*)pRet;
pRet->aMI[1+nElem] = pRet->aMI[0]
+ sizeof(u32)*((int)nElem+1);
pRet->nElem = (int)nElem;
pRet->zMatchinfo = ((char*)pRet) + nByte;
@@ -155,10 +159,10 @@ static MatchinfoBuffer *fts3MIBufferNew(size_t nElem, const char *zMatchinfo){
static void fts3MIBufferFree(void *p){
MatchinfoBuffer *pBuf = (MatchinfoBuffer*)((u8*)p - ((u32*)p)[-1]);
assert( (u32*)p==&pBuf->aMatchinfo[1]
|| (u32*)p==&pBuf->aMatchinfo[pBuf->nElem+2]
assert( (u32*)p==&pBuf->aMI[1]
|| (u32*)p==&pBuf->aMI[pBuf->nElem+2]
);
if( (u32*)p==&pBuf->aMatchinfo[1] ){
if( (u32*)p==&pBuf->aMI[1] ){
pBuf->aRef[1] = 0;
}else{
pBuf->aRef[2] = 0;
@@ -175,18 +179,18 @@ static void (*fts3MIBufferAlloc(MatchinfoBuffer *p, u32 **paOut))(void*){
if( p->aRef[1]==0 ){
p->aRef[1] = 1;
aOut = &p->aMatchinfo[1];
aOut = &p->aMI[1];
xRet = fts3MIBufferFree;
}
else if( p->aRef[2]==0 ){
p->aRef[2] = 1;
aOut = &p->aMatchinfo[p->nElem+2];
aOut = &p->aMI[p->nElem+2];
xRet = fts3MIBufferFree;
}else{
aOut = (u32*)sqlite3_malloc64(p->nElem * sizeof(u32));
if( aOut ){
xRet = sqlite3_free;
if( p->bGlobal ) memcpy(aOut, &p->aMatchinfo[1], p->nElem*sizeof(u32));
if( p->bGlobal ) memcpy(aOut, &p->aMI[1], p->nElem*sizeof(u32));
}
}
@@ -196,7 +200,7 @@ static void (*fts3MIBufferAlloc(MatchinfoBuffer *p, u32 **paOut))(void*){
static void fts3MIBufferSetGlobal(MatchinfoBuffer *p){
p->bGlobal = 1;
memcpy(&p->aMatchinfo[2+p->nElem], &p->aMatchinfo[1], p->nElem*sizeof(u32));
memcpy(&p->aMI[2+p->nElem], &p->aMI[1], p->nElem*sizeof(u32));
}
/*
@@ -611,7 +615,7 @@ static int fts3StringAppend(
}
/* If there is insufficient space allocated at StrBuffer.z, use realloc()
** to grow the buffer until so that it is big enough to accomadate the
** to grow the buffer until so that it is big enough to accommodate the
** appended data.
*/
if( pStr->n+nAppend+1>=pStr->nAlloc ){
+2 -2
View File
@@ -3956,7 +3956,7 @@ static int fts3IncrmergePush(
**
** It is assumed that the buffer associated with pNode is already large
** enough to accommodate the new entry. The buffer associated with pPrev
** is extended by this function if requrired.
** is extended by this function if required.
**
** If an error (i.e. OOM condition) occurs, an SQLite error code is
** returned. Otherwise, SQLITE_OK.
@@ -5619,7 +5619,7 @@ int sqlite3Fts3DeferToken(
/*
** SQLite value pRowid contains the rowid of a row that may or may not be
** present in the FTS3 table. If it is, delete it and adjust the contents
** of subsiduary data structures accordingly.
** of subsidiary data structures accordingly.
*/
static int fts3DeleteByRowid(
Fts3Table *p,
+1 -1
View File
@@ -893,7 +893,7 @@ proc print_test_main {} {
puts "\}"
}
# Proces the command line arguments. Exit early if they are not to
# Process the command line arguments. Exit early if they are not to
# our liking.
#
proc usage {} {
+15 -2
View File
@@ -75,6 +75,18 @@ typedef sqlite3_uint64 u64;
# define EIGHT_BYTE_ALIGNMENT(X) ((((uptr)(X) - (uptr)0)&7)==0)
#endif
/*
** Macros needed to provide flexible arrays in a portable way
*/
#ifndef offsetof
# define offsetof(STRUCTURE,FIELD) ((size_t)((char*)&((STRUCTURE*)0)->FIELD))
#endif
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
# define FLEXARRAY
#else
# define FLEXARRAY 1
#endif
#endif
/* Truncate very long tokens to this many bytes. Hard limit is
@@ -147,10 +159,11 @@ typedef struct Fts5Colset Fts5Colset;
*/
struct Fts5Colset {
int nCol;
int aiCol[1];
int aiCol[FLEXARRAY];
};
/* Size (int bytes) of a complete Fts5Colset object with N columns. */
#define SZ_FTS5COLSET(N) (sizeof(i64)*((N+2)/2))
/**************************************************************************
** Interface to code in fts5_config.c. fts5_config.c contains contains code
+1 -1
View File
@@ -667,7 +667,7 @@ static int fts5Bm25GetData(
** under consideration.
**
** The problem with this is that if (N < 2*nHit), the IDF is
** negative. Which is undesirable. So the mimimum allowable IDF is
** negative. Which is undesirable. So the minimum allowable IDF is
** (1e-6) - roughly the same as a term that appears in just over
** half of set of 5,000,000 documents. */
double idf = log( (nRow - nHit + 0.5) / (nHit + 0.5) );
+1 -1
View File
@@ -308,7 +308,7 @@ char *sqlite3Fts5Strndup(int *pRc, const char *pIn, int nIn){
** * The 52 upper and lower case ASCII characters, and
** * The 10 integer ASCII characters.
** * The underscore character "_" (0x5F).
** * The unicode "subsitute" character (0x1A).
** * The unicode "substitute" character (0x1A).
*/
int sqlite3Fts5IsBareword(char t){
u8 aBareword[128] = {
+32 -22
View File
@@ -86,9 +86,13 @@ struct Fts5ExprNode {
/* Child nodes. For a NOT node, this array always contains 2 entries. For
** AND or OR nodes, it contains 2 or more entries. */
int nChild; /* Number of child nodes */
Fts5ExprNode *apChild[1]; /* Array of child nodes */
Fts5ExprNode *apChild[FLEXARRAY]; /* Array of child nodes */
};
/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */
#define SZ_FTS5EXPRNODE(N) \
(offsetof(Fts5ExprNode,apChild) + (N)*sizeof(Fts5ExprNode*))
#define Fts5NodeIsString(p) ((p)->eType==FTS5_TERM || (p)->eType==FTS5_STRING)
/*
@@ -119,9 +123,13 @@ struct Fts5ExprPhrase {
Fts5ExprNode *pNode; /* FTS5_STRING node this phrase is part of */
Fts5Buffer poslist; /* Current position list */
int nTerm; /* Number of entries in aTerm[] */
Fts5ExprTerm aTerm[1]; /* Terms that make up this phrase */
Fts5ExprTerm aTerm[FLEXARRAY]; /* Terms that make up this phrase */
};
/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */
#define SZ_FTS5EXPRPHRASE(N) \
(offsetof(Fts5ExprPhrase,aTerm) + (N)*sizeof(Fts5ExprTerm))
/*
** One or more phrases that must appear within a certain token distance of
** each other within each matching document.
@@ -130,9 +138,12 @@ struct Fts5ExprNearset {
int nNear; /* NEAR parameter */
Fts5Colset *pColset; /* Columns to search (NULL -> all columns) */
int nPhrase; /* Number of entries in aPhrase[] array */
Fts5ExprPhrase *apPhrase[1]; /* Array of phrase pointers */
Fts5ExprPhrase *apPhrase[FLEXARRAY]; /* Array of phrase pointers */
};
/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */
#define SZ_FTS5EXPRNEARSET(N) \
(offsetof(Fts5ExprNearset,apPhrase)+(N)*sizeof(Fts5ExprPhrase*))
/*
** Parse context.
@@ -292,7 +303,7 @@ int sqlite3Fts5ExprNew(
/* If the LHS of the MATCH expression was a user column, apply the
** implicit column-filter. */
if( sParse.rc==SQLITE_OK && iCol<pConfig->nCol ){
int n = sizeof(Fts5Colset);
int n = SZ_FTS5COLSET(1);
Fts5Colset *pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&sParse.rc, n);
if( pColset ){
pColset->nCol = 1;
@@ -1650,7 +1661,7 @@ Fts5ExprNearset *sqlite3Fts5ParseNearset(
if( pParse->rc==SQLITE_OK ){
if( pNear==0 ){
sqlite3_int64 nByte;
nByte = sizeof(Fts5ExprNearset) + SZALLOC * sizeof(Fts5ExprPhrase*);
nByte = SZ_FTS5EXPRNEARSET(SZALLOC+1);
pRet = sqlite3_malloc64(nByte);
if( pRet==0 ){
pParse->rc = SQLITE_NOMEM;
@@ -1661,7 +1672,7 @@ Fts5ExprNearset *sqlite3Fts5ParseNearset(
int nNew = pNear->nPhrase + SZALLOC;
sqlite3_int64 nByte;
nByte = sizeof(Fts5ExprNearset) + nNew * sizeof(Fts5ExprPhrase*);
nByte = SZ_FTS5EXPRNEARSET(nNew+1);
pRet = (Fts5ExprNearset*)sqlite3_realloc64(pNear, nByte);
if( pRet==0 ){
pParse->rc = SQLITE_NOMEM;
@@ -1752,12 +1763,12 @@ static int fts5ParseTokenize(
int nNew = SZALLOC + (pPhrase ? pPhrase->nTerm : 0);
pNew = (Fts5ExprPhrase*)sqlite3_realloc64(pPhrase,
sizeof(Fts5ExprPhrase) + sizeof(Fts5ExprTerm) * nNew
SZ_FTS5EXPRPHRASE(nNew+1)
);
if( pNew==0 ){
rc = SQLITE_NOMEM;
}else{
if( pPhrase==0 ) memset(pNew, 0, sizeof(Fts5ExprPhrase));
if( pPhrase==0 ) memset(pNew, 0, SZ_FTS5EXPRPHRASE(1));
pCtx->pPhrase = pPhrase = pNew;
pNew->nTerm = nNew - SZALLOC;
}
@@ -1865,7 +1876,7 @@ Fts5ExprPhrase *sqlite3Fts5ParseTerm(
if( sCtx.pPhrase==0 ){
/* This happens when parsing a token or quoted phrase that contains
** no token characters at all. (e.g ... MATCH '""'). */
sCtx.pPhrase = sqlite3Fts5MallocZero(&pParse->rc, sizeof(Fts5ExprPhrase));
sCtx.pPhrase = sqlite3Fts5MallocZero(&pParse->rc, SZ_FTS5EXPRPHRASE(1));
}else if( sCtx.pPhrase->nTerm ){
sCtx.pPhrase->aTerm[sCtx.pPhrase->nTerm-1].bPrefix = (u8)bPrefix;
}
@@ -1900,19 +1911,18 @@ int sqlite3Fts5ExprClonePhrase(
sizeof(Fts5ExprPhrase*));
}
if( rc==SQLITE_OK ){
pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&rc,
sizeof(Fts5ExprNode));
pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&rc, SZ_FTS5EXPRNODE(1));
}
if( rc==SQLITE_OK ){
pNew->pRoot->pNear = (Fts5ExprNearset*)sqlite3Fts5MallocZero(&rc,
sizeof(Fts5ExprNearset) + sizeof(Fts5ExprPhrase*));
pNew->pRoot->pNear = (Fts5ExprNearset*)sqlite3Fts5MallocZero(&rc,
SZ_FTS5EXPRNEARSET(2));
}
if( rc==SQLITE_OK && ALWAYS(pOrig!=0) ){
Fts5Colset *pColsetOrig = pOrig->pNode->pNear->pColset;
if( pColsetOrig ){
sqlite3_int64 nByte;
Fts5Colset *pColset;
nByte = sizeof(Fts5Colset) + (pColsetOrig->nCol-1) * sizeof(int);
nByte = SZ_FTS5COLSET(pColsetOrig->nCol);
pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&rc, nByte);
if( pColset ){
memcpy(pColset, pColsetOrig, (size_t)nByte);
@@ -1940,7 +1950,7 @@ int sqlite3Fts5ExprClonePhrase(
}else{
/* This happens when parsing a token or quoted phrase that contains
** no token characters at all. (e.g ... MATCH '""'). */
sCtx.pPhrase = sqlite3Fts5MallocZero(&rc, sizeof(Fts5ExprPhrase));
sCtx.pPhrase = sqlite3Fts5MallocZero(&rc, SZ_FTS5EXPRPHRASE(1));
}
}
@@ -2034,7 +2044,7 @@ static Fts5Colset *fts5ParseColset(
assert( pParse->rc==SQLITE_OK );
assert( iCol>=0 && iCol<pParse->pConfig->nCol );
pNew = sqlite3_realloc64(p, sizeof(Fts5Colset) + sizeof(int)*nCol);
pNew = sqlite3_realloc64(p, SZ_FTS5COLSET(nCol+1));
if( pNew==0 ){
pParse->rc = SQLITE_NOMEM;
}else{
@@ -2069,7 +2079,7 @@ Fts5Colset *sqlite3Fts5ParseColsetInvert(Fts5Parse *pParse, Fts5Colset *p){
int nCol = pParse->pConfig->nCol;
pRet = (Fts5Colset*)sqlite3Fts5MallocZero(&pParse->rc,
sizeof(Fts5Colset) + sizeof(int)*nCol
SZ_FTS5COLSET(nCol+1)
);
if( pRet ){
int i;
@@ -2130,7 +2140,7 @@ Fts5Colset *sqlite3Fts5ParseColset(
static Fts5Colset *fts5CloneColset(int *pRc, Fts5Colset *pOrig){
Fts5Colset *pRet;
if( pOrig ){
sqlite3_int64 nByte = sizeof(Fts5Colset) + (pOrig->nCol-1) * sizeof(int);
sqlite3_int64 nByte = SZ_FTS5COLSET(pOrig->nCol);
pRet = (Fts5Colset*)sqlite3Fts5MallocZero(pRc, nByte);
if( pRet ){
memcpy(pRet, pOrig, (size_t)nByte);
@@ -2298,7 +2308,7 @@ static Fts5ExprNode *fts5ParsePhraseToAnd(
assert( pNear->nPhrase==1 );
assert( pParse->bPhraseToAnd );
nByte = sizeof(Fts5ExprNode) + nTerm*sizeof(Fts5ExprNode*);
nByte = SZ_FTS5EXPRNODE(nTerm+1);
pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte);
if( pRet ){
pRet->eType = FTS5_AND;
@@ -2308,7 +2318,7 @@ static Fts5ExprNode *fts5ParsePhraseToAnd(
pParse->nPhrase--;
for(ii=0; ii<nTerm; ii++){
Fts5ExprPhrase *pPhrase = (Fts5ExprPhrase*)sqlite3Fts5MallocZero(
&pParse->rc, sizeof(Fts5ExprPhrase)
&pParse->rc, SZ_FTS5EXPRPHRASE(1)
);
if( pPhrase ){
if( parseGrowPhraseArray(pParse) ){
@@ -2377,7 +2387,7 @@ Fts5ExprNode *sqlite3Fts5ParseNode(
if( pRight->eType==eType ) nChild += pRight->nChild-1;
}
nByte = sizeof(Fts5ExprNode) + sizeof(Fts5ExprNode*)*(nChild-1);
nByte = SZ_FTS5EXPRNODE(nChild);
pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte);
if( pRet ){
@@ -3252,7 +3262,7 @@ int sqlite3Fts5ExprInstToken(
}
/*
** Clear the token mappings for all Fts5IndexIter objects mannaged by
** Clear the token mappings for all Fts5IndexIter objects managed by
** the expression passed as the only argument.
*/
void sqlite3Fts5ExprClearTokens(Fts5Expr *pExpr){
+2 -2
View File
@@ -20,7 +20,7 @@ typedef struct Fts5HashEntry Fts5HashEntry;
/*
** This file contains the implementation of an in-memory hash table used
** to accumuluate "term -> doclist" content before it is flused to a level-0
** to accumulate "term -> doclist" content before it is flushed to a level-0
** segment.
*/
@@ -77,7 +77,7 @@ struct Fts5HashEntry {
};
/*
** Eqivalent to:
** Equivalent to:
**
** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; }
*/
+52 -34
View File
@@ -422,9 +422,13 @@ struct Fts5Structure {
u64 nOriginCntr; /* Origin value for next top-level segment */
int nSegment; /* Total segments in this structure */
int nLevel; /* Number of levels in this index */
Fts5StructureLevel aLevel[1]; /* Array of nLevel level objects */
Fts5StructureLevel aLevel[FLEXARRAY]; /* Array of nLevel level objects */
};
/* Size (in bytes) of an Fts5Structure object holding up to N levels */
#define SZ_FTS5STRUCTURE(N) \
(offsetof(Fts5Structure,aLevel) + (N)*sizeof(Fts5StructureLevel))
/*
** An object of type Fts5SegWriter is used to write to segments.
*/
@@ -554,11 +558,15 @@ struct Fts5SegIter {
** Array of tombstone pages. Reference counted.
*/
struct Fts5TombstoneArray {
int nRef; /* Number of pointers to this object */
int nRef; /* Number of pointers to this object */
int nTombstone;
Fts5Data *apTombstone[1]; /* Array of tombstone pages */
Fts5Data *apTombstone[FLEXARRAY]; /* Array of tombstone pages */
};
/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */
#define SZ_FTS5TOMBSTONEARRAY(N) \
(offsetof(Fts5TombstoneArray,apTombstone)+(N)*sizeof(Fts5Data*))
/*
** Argument is a pointer to an Fts5Data structure that contains a
** leaf page.
@@ -627,9 +635,12 @@ struct Fts5Iter {
i64 iSwitchRowid; /* Firstest rowid of other than aFirst[1] */
Fts5CResult *aFirst; /* Current merge state (see above) */
Fts5SegIter aSeg[1]; /* Array of segment iterators */
Fts5SegIter aSeg[FLEXARRAY]; /* Array of segment iterators */
};
/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */
#define SZ_FTS5ITER(N) (offsetof(Fts5Iter,aSeg)+(N)*sizeof(Fts5SegIter))
/*
** An instance of the following type is used to iterate through the contents
** of a doclist-index record.
@@ -656,9 +667,13 @@ struct Fts5DlidxLvl {
struct Fts5DlidxIter {
int nLvl;
int iSegid;
Fts5DlidxLvl aLvl[1];
Fts5DlidxLvl aLvl[FLEXARRAY];
};
/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */
#define SZ_FTS5DLIDXITER(N) \
(offsetof(Fts5DlidxIter,aLvl)+(N)*sizeof(Fts5DlidxLvl))
static void fts5PutU16(u8 *aOut, u16 iVal){
aOut[0] = (iVal>>8);
aOut[1] = (iVal&0xFF);
@@ -1026,7 +1041,7 @@ int sqlite3Fts5StructureTest(Fts5Index *p, void *pStruct){
static void fts5StructureMakeWritable(int *pRc, Fts5Structure **pp){
Fts5Structure *p = *pp;
if( *pRc==SQLITE_OK && p->nRef>1 ){
i64 nByte = sizeof(Fts5Structure)+(p->nLevel-1)*sizeof(Fts5StructureLevel);
i64 nByte = SZ_FTS5STRUCTURE(p->nLevel);
Fts5Structure *pNew;
pNew = (Fts5Structure*)sqlite3Fts5MallocZero(pRc, nByte);
if( pNew ){
@@ -1100,10 +1115,7 @@ static int fts5StructureDecode(
){
return FTS5_CORRUPT;
}
nByte = (
sizeof(Fts5Structure) + /* Main structure */
sizeof(Fts5StructureLevel) * (nLevel-1) /* aLevel[] array */
);
nByte = SZ_FTS5STRUCTURE(nLevel);
pRet = (Fts5Structure*)sqlite3Fts5MallocZero(&rc, nByte);
if( pRet ){
@@ -1183,10 +1195,7 @@ static void fts5StructureAddLevel(int *pRc, Fts5Structure **ppStruct){
if( *pRc==SQLITE_OK ){
Fts5Structure *pStruct = *ppStruct;
int nLevel = pStruct->nLevel;
sqlite3_int64 nByte = (
sizeof(Fts5Structure) + /* Main structure */
sizeof(Fts5StructureLevel) * (nLevel+1) /* aLevel[] array */
);
sqlite3_int64 nByte = SZ_FTS5STRUCTURE(nLevel+2);
pStruct = sqlite3_realloc64(pStruct, nByte);
if( pStruct ){
@@ -1725,7 +1734,7 @@ static Fts5DlidxIter *fts5DlidxIterInit(
int bDone = 0;
for(i=0; p->rc==SQLITE_OK && bDone==0; i++){
sqlite3_int64 nByte = sizeof(Fts5DlidxIter) + i * sizeof(Fts5DlidxLvl);
sqlite3_int64 nByte = SZ_FTS5DLIDXITER(i+1);
Fts5DlidxIter *pNew;
pNew = (Fts5DlidxIter*)sqlite3_realloc64(pIter, nByte);
@@ -1943,7 +1952,7 @@ static void fts5SegIterSetNext(Fts5Index *p, Fts5SegIter *pIter){
static void fts5SegIterAllocTombstone(Fts5Index *p, Fts5SegIter *pIter){
const int nTomb = pIter->pSeg->nPgTombstone;
if( nTomb>0 ){
int nByte = nTomb * sizeof(Fts5Data*) + sizeof(Fts5TombstoneArray);
int nByte = SZ_FTS5TOMBSTONEARRAY(nTomb+1);
Fts5TombstoneArray *pNew;
pNew = (Fts5TombstoneArray*)sqlite3Fts5MallocZero(&p->rc, nByte);
if( pNew ){
@@ -3404,8 +3413,7 @@ static Fts5Iter *fts5MultiIterAlloc(
for(nSlot=2; nSlot<nSeg; nSlot=nSlot*2);
pNew = fts5IdxMalloc(p,
sizeof(Fts5Iter) + /* pNew */
sizeof(Fts5SegIter) * (nSlot-1) + /* pNew->aSeg[] */
SZ_FTS5ITER(nSlot) + /* pNew + pNew->aSeg[] */
sizeof(Fts5CResult) * nSlot /* pNew->aFirst[] */
);
if( pNew ){
@@ -5206,7 +5214,7 @@ static void fts5DoSecureDelete(
int iDelKeyOff = 0; /* Offset of deleted key, if any */
nIdx = nPg-iPgIdx;
aIdx = sqlite3Fts5MallocZero(&p->rc, nIdx+16);
aIdx = sqlite3Fts5MallocZero(&p->rc, ((i64)nIdx)+16);
if( p->rc ) return;
memcpy(aIdx, &aPg[iPgIdx], nIdx);
@@ -5771,7 +5779,7 @@ static Fts5Structure *fts5IndexOptimizeStruct(
Fts5Structure *pStruct
){
Fts5Structure *pNew = 0;
sqlite3_int64 nByte = sizeof(Fts5Structure);
sqlite3_int64 nByte = SZ_FTS5STRUCTURE(1);
int nSeg = pStruct->nSegment;
int i;
@@ -5800,7 +5808,8 @@ static Fts5Structure *fts5IndexOptimizeStruct(
assert( pStruct->aLevel[i].nMerge<=nThis );
}
nByte += (pStruct->nLevel+1) * sizeof(Fts5StructureLevel);
nByte += (((i64)pStruct->nLevel)+1) * sizeof(Fts5StructureLevel);
assert( nByte==SZ_FTS5STRUCTURE(pStruct->nLevel+2) );
pNew = (Fts5Structure*)sqlite3Fts5MallocZero(&p->rc, nByte);
if( pNew ){
@@ -6377,9 +6386,13 @@ struct Fts5TokenDataIter {
int nIterAlloc;
Fts5PoslistReader *aPoslistReader;
int *aPoslistToIter;
Fts5Iter *apIter[1];
Fts5Iter *apIter[FLEXARRAY];
};
/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */
#define SZ_FTS5TOKENDATAITER(N) \
(offsetof(Fts5TokenDataIter,apIter) + (N)*sizeof(Fts5Iter))
/*
** The two input arrays - a1[] and a2[] - are in sorted order. This function
** merges the two arrays together and writes the result to output array
@@ -6451,7 +6464,7 @@ static void fts5TokendataIterAppendMap(
/*
** Sort the contents of the pT->aMap[] array.
**
** The sorting algorithm requries a malloc(). If this fails, an error code
** The sorting algorithm requires a malloc(). If this fails, an error code
** is left in Fts5Index.rc before returning.
*/
static void fts5TokendataIterSortMap(Fts5Index *p, Fts5TokenDataIter *pT){
@@ -6642,7 +6655,7 @@ static void fts5SetupPrefixIter(
&& p->pConfig->bPrefixInsttoken
){
s.pTokendata = &s2;
s2.pT = (Fts5TokenDataIter*)fts5IdxMalloc(p, sizeof(*s2.pT));
s2.pT = (Fts5TokenDataIter*)fts5IdxMalloc(p, SZ_FTS5TOKENDATAITER(1));
}
if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){
@@ -6688,7 +6701,8 @@ static void fts5SetupPrefixIter(
}
}
pData = fts5IdxMalloc(p, sizeof(*pData)+s.doclist.n+FTS5_DATA_ZERO_PADDING);
pData = fts5IdxMalloc(p, sizeof(*pData)
+ ((i64)s.doclist.n)+FTS5_DATA_ZERO_PADDING);
assert( pData!=0 || p->rc!=SQLITE_OK );
if( pData ){
pData->p = (u8*)&pData[1];
@@ -6769,15 +6783,17 @@ int sqlite3Fts5IndexRollback(Fts5Index *p){
** and the initial version of the "averages" record (a zero-byte blob).
*/
int sqlite3Fts5IndexReinit(Fts5Index *p){
Fts5Structure s;
Fts5Structure *pTmp;
u8 tmpSpace[SZ_FTS5STRUCTURE(1)];
fts5StructureInvalidate(p);
fts5IndexDiscardData(p);
memset(&s, 0, sizeof(Fts5Structure));
pTmp = (Fts5Structure*)tmpSpace;
memset(pTmp, 0, SZ_FTS5STRUCTURE(1));
if( p->pConfig->bContentlessDelete ){
s.nOriginCntr = 1;
pTmp->nOriginCntr = 1;
}
fts5DataWrite(p, FTS5_AVERAGES_ROWID, (const u8*)"", 0);
fts5StructureWrite(p, &s);
fts5StructureWrite(p, pTmp);
return fts5IndexReturn(p);
}
@@ -6985,7 +7001,7 @@ static Fts5TokenDataIter *fts5AppendTokendataIter(
if( p->rc==SQLITE_OK ){
if( pIn==0 || pIn->nIter==pIn->nIterAlloc ){
int nAlloc = pIn ? pIn->nIterAlloc*2 : 16;
int nByte = nAlloc * sizeof(Fts5Iter*) + sizeof(Fts5TokenDataIter);
int nByte = SZ_FTS5TOKENDATAITER(nAlloc+1);
Fts5TokenDataIter *pNew = (Fts5TokenDataIter*)sqlite3_realloc(pIn, nByte);
if( pNew==0 ){
@@ -7501,7 +7517,8 @@ static int fts5SetupPrefixIterTokendata(
fts5BufferGrow(&p->rc, &token, nToken+1);
assert( token.p!=0 || p->rc!=SQLITE_OK );
ctx.pT = (Fts5TokenDataIter*)sqlite3Fts5MallocZero(&p->rc, sizeof(*ctx.pT));
ctx.pT = (Fts5TokenDataIter*)sqlite3Fts5MallocZero(&p->rc,
SZ_FTS5TOKENDATAITER(1));
if( p->rc==SQLITE_OK ){
@@ -7632,7 +7649,8 @@ int sqlite3Fts5IndexIterWriteTokendata(
if( pIter->nSeg>0 ){
/* This is a prefix term iterator. */
if( pT==0 ){
pT = (Fts5TokenDataIter*)sqlite3Fts5MallocZero(&p->rc, sizeof(*pT));
pT = (Fts5TokenDataIter*)sqlite3Fts5MallocZero(&p->rc,
SZ_FTS5TOKENDATAITER(1));
pIter->pTokenDataIter = pT;
}
if( pT ){
@@ -8666,7 +8684,7 @@ static void fts5DecodeRowid(
#if defined(SQLITE_TEST) || defined(SQLITE_FTS5_DEBUG)
static void fts5DebugRowid(int *pRc, Fts5Buffer *pBuf, i64 iKey){
int iSegid, iHeight, iPgno, bDlidx, bTomb; /* Rowid compenents */
int iSegid, iHeight, iPgno, bDlidx, bTomb; /* Rowid components */
fts5DecodeRowid(iKey, &bTomb, &iSegid, &bDlidx, &iHeight, &iPgno);
if( iSegid==0 ){
@@ -8912,7 +8930,7 @@ static void fts5DecodeFunction(
** buffer overreads even if the record is corrupt. */
n = sqlite3_value_bytes(apVal[1]);
aBlob = sqlite3_value_blob(apVal[1]);
nSpace = n + FTS5_DATA_ZERO_PADDING;
nSpace = ((i64)n) + FTS5_DATA_ZERO_PADDING;
a = (u8*)sqlite3Fts5MallocZero(&rc, nSpace);
if( a==0 ) goto decode_out;
if( n>0 ) memcpy(a, aBlob, n);
+6 -4
View File
@@ -170,9 +170,11 @@ struct Fts5Sorter {
i64 iRowid; /* Current rowid */
const u8 *aPoslist; /* Position lists for current row */
int nIdx; /* Number of entries in aIdx[] */
int aIdx[1]; /* Offsets into aPoslist for current row */
int aIdx[FLEXARRAY]; /* Offsets into aPoslist for current row */
};
/* Size (int bytes) of an Fts5Sorter object with N indexes */
#define SZ_FTS5SORTER(N) (offsetof(Fts5Sorter,nIdx)+((N+2)/2)*sizeof(i64))
/*
** Virtual-table cursor object.
@@ -1050,7 +1052,7 @@ static int fts5CursorFirstSorted(
const char *zRankArgs = pCsr->zRankArgs;
nPhrase = sqlite3Fts5ExprPhraseCount(pCsr->pExpr);
nByte = sizeof(Fts5Sorter) + sizeof(int) * (nPhrase-1);
nByte = SZ_FTS5SORTER(nPhrase);
pSorter = (Fts5Sorter*)sqlite3_malloc64(nByte);
if( pSorter==0 ) return SQLITE_NOMEM;
memset(pSorter, 0, (size_t)nByte);
@@ -3801,8 +3803,8 @@ static int fts5Init(sqlite3 *db){
** its entry point to enable the matchinfo() demo. */
#ifdef SQLITE_FTS5_ENABLE_TEST_MI
if( rc==SQLITE_OK ){
extern int sqlite3Fts5TestRegisterMatchinfo(sqlite3*);
rc = sqlite3Fts5TestRegisterMatchinfo(db);
extern int sqlite3Fts5TestRegisterMatchinfoAPI(fts5_api*);
rc = sqlite3Fts5TestRegisterMatchinfoAPI(&pGlobal->api);
}
#endif
+22 -10
View File
@@ -393,17 +393,13 @@ static void fts5MatchinfoFunc(
}
}
int sqlite3Fts5TestRegisterMatchinfo(sqlite3 *db){
int rc; /* Return code */
fts5_api *pApi; /* FTS5 API functions */
/*
** Register "matchinfo" with global API object pApi.
*/
int sqlite3Fts5TestRegisterMatchinfoAPI(fts5_api *pApi){
int rc;
/* Extract the FTS5 API pointer from the database handle. The
** fts5_api_from_db() function above is copied verbatim from the
** FTS5 documentation. Refer there for details. */
rc = fts5_api_from_db(db, &pApi);
if( rc!=SQLITE_OK ) return rc;
/* If fts5_api_from_db() returns NULL, then either FTS5 is not registered
/* If fts5_api_from_db() returned NULL, then either FTS5 is not registered
** with this database handle, or an error (OOM perhaps?) has occurred.
**
** Also check that the fts5_api object is version 2 or newer.
@@ -418,4 +414,20 @@ int sqlite3Fts5TestRegisterMatchinfo(sqlite3 *db){
return rc;
}
/*
** Register "matchinfo" with database handle db.
*/
int sqlite3Fts5TestRegisterMatchinfo(sqlite3 *db){
int rc; /* Return code */
fts5_api *pApi; /* FTS5 API functions */
/* Extract the FTS5 API pointer from the database handle. The
** fts5_api_from_db() function above is copied verbatim from the
** FTS5 documentation. Refer there for details. */
rc = fts5_api_from_db(db, &pApi);
if( rc!=SQLITE_OK ) return rc;
return sqlite3Fts5TestRegisterMatchinfoAPI(pApi);
}
#endif /* SQLITE_ENABLE_FTS5 */
+3 -3
View File
@@ -193,12 +193,12 @@ static int fts5VocabInitVtab(
*pzErr = sqlite3_mprintf("wrong number of vtable arguments");
rc = SQLITE_ERROR;
}else{
int nByte; /* Bytes of space to allocate */
i64 nByte; /* Bytes of space to allocate */
const char *zDb = bDb ? argv[3] : argv[1];
const char *zTab = bDb ? argv[4] : argv[3];
const char *zType = bDb ? argv[5] : argv[4];
int nDb = (int)strlen(zDb)+1;
int nTab = (int)strlen(zTab)+1;
i64 nDb = strlen(zDb)+1;
i64 nTab = strlen(zTab)+1;
int eType = 0;
rc = fts5VocabTableType(zType, pzErr, &eType);
+22
View File
@@ -520,4 +520,26 @@ do_execsql_test 15.3 {
{columnsize {1 1} columntext {c d} columntotalsize {2 2} poslist {} tokenize {c d} rowcount 2}
}
#-------------------------------------------------------------------------
#
reset_db
do_execsql_test 16.0 {
CREATE TABLE t1(x);
BEGIN EXCLUSIVE;
}
sqlite3 db2 test.db
do_test 16.1 {
catchsql { SELECT * FROM t1 } db2
} {1 {database is locked}}
do_execsql_test 16.2 {
ROLLBACK;
}
do_test 16.3 {
catchsql { SELECT * FROM t1 } db2
} {0 {}}
finish_test
+1 -1
View File
@@ -81,7 +81,7 @@ do_execsql_test 3.0 {
}
#-------------------------------------------------------------------------
# Test that a crash occuring when the second or subsequent tokens in a
# Test that a crash occurring when the second or subsequent tokens in a
# phrase matched zero rows has been fixed.
#
do_execsql_test 4.0 {
+2 -2
View File
@@ -79,7 +79,7 @@ $(bin.version-info): $(dir.tool)/version-info.c $(sqlite3.h) $(dir.top)/Makefile
$(MAKE) -C $(dir.top) version-info
# Be explicit about which Java files to compile so that we can work on
# in-progress files without requiring them to be in a compilable statae.
# in-progress files without requiring them to be in a compilable state.
JAVA_FILES.main := $(patsubst %,$(dir.src.jni)/annotation/%,\
Experimental.java \
NotNull.java \
@@ -451,7 +451,7 @@ distclean: clean
-rm -fr $(dir.bld.c) $(dir.doc)
########################################################################
# disttribution bundle rules...
# distribution bundle rules...
ifeq (,$(filter snapshot,$(MAKECMDGOALS)))
dist-name-prefix := sqlite-jni
+1 -1
View File
@@ -169,7 +169,7 @@ deliberately return an error code, instead of segfaulting, when passed
a `null`.
Client-defined callbacks _must never throw exceptions_ unless _very
explitly documented_ as being throw-safe. Exceptions are generally
explicitly documented_ as being throw-safe. Exceptions are generally
reserved for higher-level bindings which are constructed to
specifically deal with them and ensure that they do not leak C-level
resources. In some cases, callback handlers are permitted to throw, in
+4 -4
View File
@@ -948,7 +948,7 @@ static JNIEnv * s3jni_env(void){
}
/*
** Fetches the S3JniGlobal.envCache row for the given env, allocing a
** Fetches the S3JniGlobal.envCache row for the given env, allocating a
** row if needed. When a row is allocated, its state is initialized
** insofar as possible. Calls (*env)->FatalError() if allocation of an
** entry fails. That's hypothetically possible but "shouldn't happen."
@@ -1603,7 +1603,7 @@ static void * NativePointerHolder__get(JNIEnv * env, jobject jNph,
** 2023-11-09: testing has not revealed any measurable performance
** difference between the approach of passing type T to C compared to
** passing pointer-to-T to C, and adding support for the latter
** everywhere requires sigificantly more code. As of this writing, the
** everywhere requires significantly more code. As of this writing, the
** older/simpler approach is being applied except for (A) where the
** newer approach has already been applied and (B) hot-spot APIs where
** a difference of microseconds (i.e. below our testing measurement
@@ -3290,7 +3290,7 @@ static void s3jni_rollback_hook_impl(void *pP){
static jobject s3jni_commit_rollback_hook(int isCommit, JNIEnv * const env,
jlong jpDb, jobject jHook){
S3JniDb * ps;
jobject pOld = 0; /* previous hoook */
jobject pOld = 0; /* previous hook */
S3JniHook * pHook; /* ps->hooks.commit|rollback */
S3JniDb_mutex_enter;
@@ -5696,7 +5696,7 @@ JniDeclFtsApi(jint,xCreateFunction)(JniArgsEnvObj, jstring jName,
typedef struct S3JniFts5AuxData S3JniFts5AuxData;
/*
** TODO: this middle-man struct is no longer necessary. Conider
** TODO: this middle-man struct is no longer necessary. Consider
** removing it and passing around jObj itself instead.
*/
struct S3JniFts5AuxData {
+9 -9
View File
@@ -199,16 +199,16 @@ public final class CApi {
}
private static native sqlite3_backup sqlite3_backup_init(
@NotNull long ptrToDbDest, @NotNull String destTableName,
@NotNull long ptrToDbSrc, @NotNull String srcTableName
@NotNull long ptrToDbDest, @NotNull String destSchemaName,
@NotNull long ptrToDbSrc, @NotNull String srcSchemaName
);
public static sqlite3_backup sqlite3_backup_init(
@NotNull sqlite3 dbDest, @NotNull String destTableName,
@NotNull sqlite3 dbSrc, @NotNull String srcTableName
@NotNull sqlite3 dbDest, @NotNull String destSchemaName,
@NotNull sqlite3 dbSrc, @NotNull String srcSchemaName
){
return sqlite3_backup_init( dbDest.getNativePointer(), destTableName,
dbSrc.getNativePointer(), srcTableName );
return sqlite3_backup_init( dbDest.getNativePointer(), destSchemaName,
dbSrc.getNativePointer(), srcSchemaName );
}
private static native int sqlite3_backup_pagecount(@NotNull long ptrToBackup);
@@ -264,7 +264,7 @@ public final class CApi {
}
/**
Convenience overload which is equivalant to passing its arguments
Convenience overload which is equivalent to passing its arguments
to sqlite3_bind_nio_buffer() with the values 0 and -1 for the
final two arguments.
*/
@@ -312,7 +312,7 @@ public final class CApi {
The byte range of the buffer may be restricted by providing a
start index and a number of bytes. beginPos may not be negative.
Negative howMany is interpretated as the remainder of the buffer
Negative howMany is interpreted as the remainder of the buffer
past the given start position, up to the buffer's limit() (as
opposed its capacity()).
@@ -1076,7 +1076,7 @@ public final class CApi {
/**
<p>Works like in the C API with the exception that it only supports
the following subset of configution flags:
the following subset of configuration flags:
<p>SQLITE_CONFIG_SINGLETHREAD
SQLITE_CONFIG_MULTITHREAD
@@ -18,7 +18,7 @@ package org.sqlite.jni.capi;
classes which have a call() method implementing some specific
callback interface on behalf of the C library.
<p>Unless very explicitely documented otherwise, callbacks must
<p>Unless very explicitly documented otherwise, callbacks must
never throw. Any which do throw but should not might trigger debug
output regarding the error, but the exception will not be
propagated. For callback interfaces which support returning error
@@ -20,7 +20,7 @@ public interface PrepareMultiCallback extends CallbackProxy {
/**
Gets passed a sqlite3_stmt which it may handle in arbitrary ways,
transfering ownership of it to this function.
transferring ownership of it to this function.
sqlite3_prepare_multi() will _not_ finalize st - it is up
to the call() implementation how st is handled.
@@ -264,7 +264,7 @@ public class SQLTester {
threw = true;
outln("🔥EXCEPTION: ",e.getClass().getSimpleName(),": ",e.getMessage());
++nAbortedScript;
if( keepGoing ) outln("Continuing anyway becaure of the keep-going option.");
if( keepGoing ) outln("Continuing anyway because of the keep-going option.");
else if( e.isFatal() ) throw e;
}finally{
final long timeEnd = System.currentTimeMillis();
@@ -101,7 +101,7 @@ interpreter is in a "verbose" mode, the interpreter might choose to emit
an informational message along the lines of "test script NAME abandoned
due to unsupported command: --whatever".
The initial implemention will only recognize a few commands. Other
The initial implementation will only recognize a few commands. Other
commands may be added later. The following is the initial set of
commands:
@@ -661,7 +661,7 @@ public final class Sqlite implements AutoCloseable {
}
/**
Equivallent to prepareMulti(X,prepFlags,visitor), where X is
Equivalent to prepareMulti(X,prepFlags,visitor), where X is
sql.getBytes(StandardCharsets.UTF_8).
*/
public void prepareMulti(String sql, int prepFlags, PrepareMulti visitor){
+1 -1
View File
@@ -570,7 +570,7 @@ struct FreelistEntry {
/*
** A snapshot of a database. A snapshot contains all the information required
** to read or write a database file on disk. See the description of struct
** Database below for futher details.
** Database below for further details.
*/
struct Snapshot {
Database *pDatabase; /* Database this snapshot belongs to */
+1 -1
View File
@@ -169,7 +169,7 @@
** The argument to this macro must be of type u32. On a little-endian
** architecture, it returns the u32 value that results from interpreting
** the 4 bytes as a big-endian value. On a big-endian architecture, it
** returns the value that would be produced by intepreting the 4 bytes
** returns the value that would be produced by interpreting the 4 bytes
** of the input value as a little-endian integer.
*/
#define BYTESWAP32(x) ( \
+2 -2
View File
@@ -793,7 +793,7 @@ void lsmFsClose(FileSystem *pFS){
**
** This function returns a pointer to an object that can be linked into
** the list described above. The returned object now 'owns' the database
** file descriptr, so that when the FileSystem object is destroyed, it
** file descriptor, so that when the FileSystem object is destroyed, it
** will not be closed.
**
** This function may be called at most once in the life-time of a
@@ -2293,7 +2293,7 @@ int lsmFsMetaPageGet(
);
}
#ifndef NDEBUG
/* pPg->aData causes an uninitialized access via a downstreadm write().
/* pPg->aData causes an uninitialized access via a downstream write().
After discussion on this list, this memory should not, for performance
reasons, be memset. However, tracking down "real" misuse is more
difficult with this "false" positive, so it is set when NDEBUG.
+1 -1
View File
@@ -758,7 +758,7 @@ void lsmLogTell(
}
/*
** Seek (rewind) back to the log file offset stored by an ealier call to
** Seek (rewind) back to the log file offset stored by an earlier call to
** lsmLogTell() in *pMark.
*/
void lsmLogSeek(
+3 -3
View File
@@ -2652,7 +2652,7 @@ int lsmSortedLoadFreelist(
void **ppVal, /* OUT: Blob containing LSM free-list */
int *pnVal /* OUT: Size of *ppVal blob in bytes */
){
MultiCursor *pCsr; /* Cursor used to retreive free-list */
MultiCursor *pCsr; /* Cursor used to retrieve free-list */
int rc = LSM_OK; /* Return Code */
assert( pDb->pWorker );
@@ -2764,7 +2764,7 @@ static int mcursorLocationOk(MultiCursor *pCsr, int bDeleteOk){
}
/* If the cursor points to a system key (free-list entry), and the
** CURSOR_IGNORE_SYSTEM flag is set, skip thie entry. */
** CURSOR_IGNORE_SYSTEM flag is set, skip this entry. */
if( (pCsr->flags & CURSOR_IGNORE_SYSTEM) && rtTopic(eType)!=0 ){
return 0;
}
@@ -3586,7 +3586,7 @@ static int mergeWorkerBtreeWrite(
Hierarchy *p = &pMW->hier;
lsm_db *pDb = pMW->pDb; /* Database handle */
int rc = LSM_OK; /* Return Code */
int iLevel; /* Level of b-tree hierachy to write to */
int iLevel; /* Level of b-tree hierarchy to write to */
int nData; /* Size of aData[] in bytes */
u8 *aData; /* Page data for level iLevel */
int iOff; /* Offset on b-tree page to write record to */
+2 -2
View File
@@ -482,9 +482,9 @@ struct amatch_rule {
amatch_rule *pNext; /* Next rule in order of increasing rCost */
char *zFrom; /* Transform from (a string from user input) */
amatch_cost rCost; /* Cost of this transformation */
amatch_langid iLang; /* The langauge to which this rule belongs */
amatch_langid iLang; /* The language to which this rule belongs */
amatch_len nFrom, nTo; /* Length of the zFrom and zTo strings */
char zTo[4]; /* Tranform to V.W value (extra space appended) */
char zTo[4]; /* Transform to V.W value (extra space appended) */
};
/*
+1 -1
View File
@@ -49,7 +49,7 @@
** USAGE EXAMPLES:
**
** Show the table btrees in a schema order with the tables with the most
** rows occuring first:
** rows occurring first:
**
** SELECT name, nEntry
** FROM sqlite_btreeinfo
+6 -1
View File
@@ -41,6 +41,11 @@ SQLITE_EXTENSION_INIT1
#ifndef SQLITE_OMIT_VIRTUALTABLE
#ifndef IsAlnum
#define IsAlnum(X) isalnum((unsigned char)X)
#endif
/* completion_vtab is a subclass of sqlite3_vtab which will
** serve as the underlying representation of a completion virtual table
*/
@@ -377,7 +382,7 @@ static int completionFilter(
}
if( pCur->zLine!=0 && pCur->zPrefix==0 ){
int i = pCur->nLine;
while( i>0 && (isalnum(pCur->zLine[i-1]) || pCur->zLine[i-1]=='_') ){
while( i>0 && (IsAlnum(pCur->zLine[i-1]) || pCur->zLine[i-1]=='_') ){
i--;
}
pCur->nPrefix = pCur->nLine - i;
+1 -1
View File
@@ -315,7 +315,7 @@ typedef struct CsvTable {
} CsvTable;
/* Allowed values for tstFlags */
#define CSVTEST_FIDX 0x0001 /* Pretend that constrained searchs cost less*/
#define CSVTEST_FIDX 0x0001 /* Pretend that constrained search cost less*/
/* A cursor for the CSV virtual table */
typedef struct CsvCursor {
+5 -2
View File
@@ -27,6 +27,9 @@ SQLITE_EXTENSION_INIT1
# define UNUSED_PARAMETER(X) (void)(X)
#endif
#ifndef IsSpace
#define IsSpace(X) isspace((unsigned char)X)
#endif
/* A decimal object */
typedef struct Decimal Decimal;
@@ -76,7 +79,7 @@ static Decimal *decimalNewFromText(const char *zIn, int n){
p->nFrac = 0;
p->a = sqlite3_malloc64( n+1 );
if( p->a==0 ) goto new_from_text_failed;
for(i=0; isspace(zIn[i]); i++){}
for(i=0; IsSpace(zIn[i]); i++){}
if( zIn[i]=='-' ){
p->sign = 1;
i++;
@@ -731,7 +734,7 @@ static void decimalSubFunc(
decimal_free(pB);
}
/* Aggregate funcion: decimal_sum(X)
/* Aggregate function: decimal_sum(X)
**
** Works like sum() except that it uses decimal arithmetic for unlimited
** precision.
+3 -3
View File
@@ -68,7 +68,7 @@
** AND distance<200;
**
** This first query outputs the string "abcdefg" and all strings that
** can be derived from that string by appling the specified transformations.
** can be derived from that string by applying the specified transformations.
** The strings are output together with their total transformation cost
** (called "distance") and appear in order of increasing cost. No string
** is output more than once. If there are multiple ways to transform the
@@ -97,7 +97,7 @@
** LIMIT 20
**
** The query above gives the 20 closest words to the $word being tested.
** (Note that for good performance, the vocubulary.w column should be
** (Note that for good performance, the vocabulary.w column should be
** indexed.)
**
** A similar query can be used to find all words in the dictionary that
@@ -207,7 +207,7 @@ struct fuzzer_rule {
** Every stem is added to a hash table as it is output. Generation of
** duplicate stems is suppressed.
**
** Active stems (those that might generate new outputs) are kepts on a linked
** Active stems (those that might generate new outputs) are kept on a linked
** list sorted by increasing cost. The cost is the sum of rBaseCost and
** pRule->rCost.
*/
+1 -1
View File
@@ -79,7 +79,7 @@
** WITH c(name,bin) AS (VALUES
** ('minimum positive value', x'0000000000000001'),
** ('maximum subnormal value', x'000fffffffffffff'),
** ('mininum positive nornal value', x'0010000000000000'),
** ('minimum positive normal value', x'0010000000000000'),
** ('maximum value', x'7fefffffffffffff'))
** SELECT c.name, decimal_mul(ieee754_mantissa(c.bin),pow2.v)
** FROM pow2, c WHERE pow2.x=ieee754_exponent(c.bin);
+1 -1
View File
@@ -286,7 +286,7 @@ static const unsigned char sqlite3CtypeMap[256] = {
#define TK_VARIABLE TK_LITERAL
#define TK_BLOB TK_LITERAL
/* Disable nuisence warnings about case fall-through */
/* Disable nuisance warnings about case fall-through */
#if !defined(deliberate_fall_through) && defined(__GCC__) && __GCC__>=7
# define deliberate_fall_through __attribute__((fallthrough));
#else
+1 -1
View File
@@ -205,7 +205,7 @@ static int percentBinarySearch(Percentile *p, double y, int bExact){
/*
** Generate an error for a percentile function.
**
** The error format string must have exactly one occurrance of "%%s()"
** The error format string must have exactly one occurrence of "%%s()"
** (with two '%' characters). That substring will be replaced by the name
** of the function.
*/
+3 -5
View File
@@ -139,7 +139,7 @@ static sqlite3_int64 genSeqMember(
smBase += (mxI64 - mxI64/2) * smStep;
}
/* Under UBSAN (or on 1's complement machines), must do this last term
* in steps to avoid the dreaded (and harmless) signed multiply overlow. */
* in steps to avoid the dreaded (and harmless) signed multiply overflow. */
if( ix>=2 ){
sqlite3_int64 ix2 = (sqlite3_int64)ix/2;
smBase += ix2*smStep;
@@ -519,8 +519,7 @@ static int seriesFilter(
pCur->ss.iBase += ((d+szStep-1)/szStep)*szStep;
}
if( pCur->ss.iTerm>iMax ){
sqlite3_uint64 d = pCur->ss.iTerm - iMax;
pCur->ss.iTerm -= ((d+szStep-1)/szStep)*szStep;
pCur->ss.iTerm = iMax;
}
}else{
sqlite3_int64 szStep = -pCur->ss.iStep;
@@ -530,8 +529,7 @@ static int seriesFilter(
pCur->ss.iBase -= ((d+szStep-1)/szStep)*szStep;
}
if( pCur->ss.iTerm<iMin ){
sqlite3_uint64 d = iMin - pCur->ss.iTerm;
pCur->ss.iTerm += ((d+szStep-1)/szStep)*szStep;
pCur->ss.iTerm = iMin;
}
}
}
+1 -1
View File
@@ -64,7 +64,7 @@
**
** typeof(Y)='blob' The hash is taken over prefix "Bnnn:" followed
** by the binary content of the blob. The "nnn"
** in the prefix is the mimimum-length decimal
** in the prefix is the minimum-length decimal
** representation of the byte-length of the blob.
**
** According to the rules above, all of the following SELECT statements
+1 -1
View File
@@ -346,7 +346,7 @@ totype_atof_calc:
/* store the result */
*pResult = result;
/* return true if number and no extra non-whitespace chracters after */
/* return true if number and no extra non-whitespace characters after */
return z>=zEnd && nDigits>0 && eValid && nonNum==0;
}
+1 -1
View File
@@ -16,7 +16,7 @@
** of digits compare in numeric order.
**
** * Leading zeros are handled properly, in the sense that
** they do not mess of the maginitude comparison of embedded
** they do not mess of the magnitude comparison of embedded
** strings of digits. "x00123y" is equal to "x123y".
**
** * Only unsigned integers are recognized. Plus and minus
+1 -1
View File
@@ -24,7 +24,7 @@ SQLITE_EXTENSION_INIT1
** To use this module, first compile it as a loadable extension. See
** https://www.sqlite.org/loadext.html#build for compilations instructions.
**
** After compliing, load this extension, then open database connections to be
** After compiling, load this extension, then open database connections to be
** measured. Query usages status using the vfsstat virtual table:
**
** SELECT * FROM vfsstat;
+1 -1
View File
@@ -120,7 +120,7 @@
**
** Individual APIs can be enabled or disabled by name, with or without
** the initial "x" character. For example, to set up for tracing lock
** primatives only:
** primitives only:
**
** PRAGMA vfstrace('-all, +Lock,Unlock,ShmLock');
**
+1 -1
View File
@@ -425,7 +425,7 @@ static int vtshimRollbackTo(sqlite3_vtab *pBase, int n){
return rc;
}
/* The destructor function for a disposible module */
/* The destructor function for a disposable module */
static void vtshimAuxDestructor(void *pXAux){
vtshim_aux *pAux = (vtshim_aux*)pXAux;
assert( pAux->pAllVtab==0 );
+1 -1
View File
@@ -4822,7 +4822,7 @@ static int rbuVfsFileSize(sqlite3_file *pFile, sqlite_int64 *pSize){
/* If this is an RBU vacuum operation and this is the target database,
** pretend that it has at least one page. Otherwise, SQLite will not
** check for the existance of a *-wal file. rbuVfsRead() contains
** check for the existence of a *-wal file. rbuVfsRead() contains
** similar logic. */
if( rc==SQLITE_OK && *pSize==0
&& p->pRbu && rbuIsVacuum(p->pRbu)
+3 -3
View File
@@ -49,7 +49,7 @@
**
** "RBU" stands for "Resumable Bulk Update". As in a large database update
** transmitted via a wireless network to a mobile device. A transaction
** applied using this extension is hence refered to as an "RBU update".
** applied using this extension is hence referred to as an "RBU update".
**
**
** LIMITATIONS
@@ -346,7 +346,7 @@ SQLITE_API sqlite3rbu *sqlite3rbu_open(
** the next call to sqlite3rbu_vacuum() opens a handle that starts a
** new RBU vacuum operation.
**
** As with sqlite3rbu_open(), Zipvfs users should rever to the comment
** As with sqlite3rbu_open(), Zipvfs users should refer to the comment
** describing the sqlite3rbu_create_vfs() API function below for
** a description of the complications associated with using RBU with
** zipvfs databases.
@@ -442,7 +442,7 @@ SQLITE_API int sqlite3rbu_savestate(sqlite3rbu *pRbu);
**
** If the RBU update has been completely applied, mark the RBU database
** as fully applied. Otherwise, assuming no error has occurred, save the
** current state of the RBU update appliation to the RBU database.
** current state of the RBU update application to the RBU database.
**
** If an error has already occurred as part of an sqlite3rbu_step()
** or sqlite3rbu_open() call, or if one occurs within this function, an
+2
View File
@@ -39,6 +39,7 @@ do_test 1.2 {
} [list {*}{
{BEGIN}
{PRAGMA writable_schema = on}
{PRAGMA foreign_keys = off}
{PRAGMA encoding = 'UTF-8'}
{PRAGMA page_size = '1024'}
{PRAGMA auto_vacuum = '0'}
@@ -67,6 +68,7 @@ do_test 1.4 {
} [list {*}{
{BEGIN}
{PRAGMA writable_schema = on}
{PRAGMA foreign_keys = off}
{PRAGMA encoding = 'UTF-8'}
{PRAGMA page_size = '1024'}
{PRAGMA auto_vacuum = '0'}
+45 -16
View File
@@ -33,6 +33,16 @@ typedef unsigned int u32;
typedef unsigned char u8;
typedef sqlite3_int64 i64;
/*
** Work around C99 "flex-array" syntax for pre-C99 compilers, so as
** to avoid complaints from -fsanitize=strict-bounds.
*/
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
# define FLEXARRAY
#else
# define FLEXARRAY 1
#endif
typedef struct RecoverTable RecoverTable;
typedef struct RecoverColumn RecoverColumn;
@@ -140,9 +150,12 @@ struct RecoverColumn {
typedef struct RecoverBitmap RecoverBitmap;
struct RecoverBitmap {
i64 nPg; /* Size of bitmap */
u32 aElem[1]; /* Array of 32-bit bitmasks */
u32 aElem[FLEXARRAY]; /* Array of 32-bit bitmasks */
};
/* Size in bytes of a RecoverBitmap object sufficient to cover 32 pages */
#define SZ_RECOVERBITMAP_32 (16)
/*
** State variables (part of the sqlite3_recover structure) used while
** recovering data for tables identified in the recovered schema (state
@@ -382,7 +395,7 @@ static int recoverError(
*/
static RecoverBitmap *recoverBitmapAlloc(sqlite3_recover *p, i64 nPg){
int nElem = (nPg+1+31) / 32;
int nByte = sizeof(RecoverBitmap) + nElem*sizeof(u32);
int nByte = SZ_RECOVERBITMAP_32 + nElem*sizeof(u32);
RecoverBitmap *pRet = (RecoverBitmap*)recoverMalloc(p, nByte);
if( pRet ){
@@ -2574,37 +2587,53 @@ static void recoverUninstallWrapper(sqlite3_recover *p){
static void recoverStep(sqlite3_recover *p){
assert( p && p->errCode==SQLITE_OK );
switch( p->eState ){
case RECOVER_STATE_INIT:
case RECOVER_STATE_INIT: {
int bUseWrapper = 1;
/* This is the very first call to sqlite3_recover_step() on this object.
*/
recoverSqlCallback(p, "BEGIN");
recoverSqlCallback(p, "PRAGMA writable_schema = on");
recoverSqlCallback(p, "PRAGMA foreign_keys = off");
recoverEnterMutex();
recoverInstallWrapper(p);
/* Open the output database. And register required virtual tables and
** user functions with the new handle. */
recoverOpenOutput(p);
/* Open transactions on both the input and output databases. */
sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_RESET_CACHE, 0);
recoverExec(p, p->dbIn, "PRAGMA writable_schema = on");
recoverExec(p, p->dbIn, "BEGIN");
if( p->errCode==SQLITE_OK ) p->bCloseTransaction = 1;
recoverExec(p, p->dbIn, "SELECT 1 FROM sqlite_schema");
recoverTransferSettings(p);
recoverOpenRecovery(p);
recoverCacheSchema(p);
/* Attempt to open a transaction and read page 1 of the input database.
** Two attempts may be made - one with a wrapper installed to ensure
** that the database header is sane, and then if that attempt returns
** SQLITE_NOTADB, then again with no wrapper. The second attempt is
** required for encrypted databases. */
if( p->errCode==SQLITE_OK ){
do{
p->errCode = SQLITE_OK;
if( bUseWrapper ) recoverInstallWrapper(p);
/* Open a transaction on the input database. */
sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_RESET_CACHE, 0);
recoverExec(p, p->dbIn, "PRAGMA writable_schema = on");
recoverExec(p, p->dbIn, "BEGIN");
if( p->errCode==SQLITE_OK ) p->bCloseTransaction = 1;
recoverExec(p, p->dbIn, "SELECT 1 FROM sqlite_schema");
recoverTransferSettings(p);
recoverOpenRecovery(p);
recoverCacheSchema(p);
if( bUseWrapper ) recoverUninstallWrapper(p);
}while( p->errCode==SQLITE_NOTADB
&& (bUseWrapper--)
&& SQLITE_OK==sqlite3_exec(p->dbIn, "ROLLBACK", 0, 0, 0)
);
}
recoverUninstallWrapper(p);
recoverLeaveMutex();
recoverExec(p, p->dbOut, "BEGIN");
recoverWriteSchema1(p);
p->eState = RECOVER_STATE_WRITING;
break;
}
case RECOVER_STATE_WRITING: {
if( p->w1.pTbls==0 ){
+1 -1
View File
@@ -110,7 +110,7 @@ static int cidxConnect(
" current_key TEXT," /* SQLite quote() text of key values */
" index_name HIDDEN," /* IN: name of the index being scanned */
" after_key HIDDEN," /* IN: Start scanning after this key */
" scanner_sql HIDDEN" /* debuggingn info: SQL used for scanner */
" scanner_sql HIDDEN" /* debugging info: SQL used for scanner */
")"
);
pRet = cidxMalloc(&rc, sizeof(CidxTable));
+1 -1
View File
@@ -24,7 +24,7 @@ and query r-tree structures using ordinary SQL statements.
3 and 11. Unlike regular SQLite tables, r-tree tables are strongly
typed.
The leftmost column is always the pimary key and contains 64-bit
The leftmost column is always the primary key and contains 64-bit
integer values. Each subsequent column contains a 32-bit real
value. For each pair of real values, the first (leftmost) must be
less than or equal to the second. R-tree tables may be
+2 -2
View File
@@ -771,7 +771,7 @@ static void geopolyBBoxFinal(
** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2).
** Returns:
**
** +2 x0,y0 is on the line segement
** +2 x0,y0 is on the line segment
**
** +1 x0,y0 is beneath line segment
**
@@ -877,7 +877,7 @@ static void geopolyWithinFunc(
sqlite3_free(p2);
}
/* Objects used by the overlap algorihm. */
/* Objects used by the overlap algorithm. */
typedef struct GeoEvent GeoEvent;
typedef struct GeoSegment GeoSegment;
typedef struct GeoOverlap GeoOverlap;
+16 -5
View File
@@ -94,6 +94,14 @@ typedef unsigned int u32;
# define ALWAYS(X) (X)
# define NEVER(X) (X)
#endif
#ifndef offsetof
#define offsetof(STRUCTURE,FIELD) ((size_t)((char*)&((STRUCTURE*)0)->FIELD))
#endif
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
# define FLEXARRAY
#else
# define FLEXARRAY 1
#endif
#endif /* !defined(SQLITE_AMALGAMATION) */
/* Macro to check for 4-byte alignment. Only used inside of assert() */
@@ -414,9 +422,13 @@ struct RtreeMatchArg {
RtreeGeomCallback cb; /* Info about the callback functions */
int nParam; /* Number of parameters to the SQL function */
sqlite3_value **apSqlParam; /* Original SQL parameter values */
RtreeDValue aParam[1]; /* Values for parameters to the SQL function */
RtreeDValue aParam[FLEXARRAY]; /* Values for parameters to the SQL function */
};
/* Size of an RtreeMatchArg object with N parameters */
#define SZ_RTREEMATCHARG(N) \
(offsetof(RtreeMatchArg,aParam)+(N)*sizeof(RtreeDValue))
#ifndef MAX
# define MAX(x,y) ((x) < (y) ? (y) : (x))
#endif
@@ -2105,7 +2117,7 @@ static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
}
/*
** Return the N-dimensional volumn of the cell stored in *p.
** Return the N-dimensional volume of the cell stored in *p.
*/
static RtreeDValue cellArea(Rtree *pRtree, RtreeCell *p){
RtreeDValue area = (RtreeDValue)1;
@@ -3871,7 +3883,7 @@ static sqlite3_stmt *rtreeCheckPrepare(
/*
** The second and subsequent arguments to this function are a printf()
** style format string and arguments. This function formats the string and
** appends it to the report being accumuated in pCheck.
** appends it to the report being accumulated in pCheck.
*/
static void rtreeCheckAppendMsg(RtreeCheck *pCheck, const char *zFmt, ...){
va_list ap;
@@ -4369,8 +4381,7 @@ static void geomCallback(sqlite3_context *ctx, int nArg, sqlite3_value **aArg){
sqlite3_int64 nBlob;
int memErr = 0;
nBlob = sizeof(RtreeMatchArg) + (nArg-1)*sizeof(RtreeDValue)
+ nArg*sizeof(sqlite3_value*);
nBlob = SZ_RTREEMATCHARG(nArg) + nArg*sizeof(sqlite3_value*);
pBlob = (RtreeMatchArg *)sqlite3_malloc64(nBlob);
if( !pBlob ){
sqlite3_result_error_nomem(ctx);
+1 -1
View File
@@ -116,7 +116,7 @@ set testprefix rtreedoc2-2
# 1-dimensional R*Tree, 4 for a 2-dimensional R*Tree, 6 for a
# 3-dimensional R*Tree, and so forth.
#
# The second argument refered to above is the length of the list passed
# The second argument referred to above is the length of the list passed
# as the 3rd parameter to the Tcl script.
#
do_execsql_test 1.0 {
+2 -2
View File
@@ -1190,7 +1190,7 @@ static int sessionTableInfo(
/*
** This function is called to initialize the SessionTable.nCol, azCol[]
** abPK[] and azDflt[] members of SessionTable object pTab. If these
** fields are already initilialized, this function is a no-op.
** fields are already initialized, this function is a no-op.
**
** If an error occurs, an error code is stored in sqlite3_session.rc and
** non-zero returned. Or, if no error occurs but the table has no primary
@@ -3013,7 +3013,7 @@ static int sessionGenerateChangeset(
){
sqlite3 *db = pSession->db; /* Source database handle */
SessionTable *pTab; /* Used to iterate through attached tables */
SessionBuffer buf = {0,0,0}; /* Buffer in which to accumlate changeset */
SessionBuffer buf = {0,0,0}; /* Buffer in which to accumulate changeset */
int rc; /* Return code */
assert( xOutput==0 || (pnChangeset==0 && ppChangeset==0) );
-13
View File
@@ -883,19 +883,6 @@ int sqlite3changeset_concat(
void **ppOut /* OUT: Buffer containing output changeset */
);
/*
** CAPI3REF: Upgrade the Schema of a Changeset/Patchset
*/
int sqlite3changeset_upgrade(
sqlite3 *db,
const char *zDb,
int nIn, const void *pIn, /* Input changeset */
int *pnOut, void **ppOut /* OUT: Inverse of input */
);
/*
** CAPI3REF: Changegroup Handle
**
+13 -11
View File
@@ -103,7 +103,7 @@ else
ifeq (,$(filter $(OPTIMIZED_TARGETS),$(MAKECMDGOALS)))
$(info ==============================================================)
$(info == Development build. Make one of (dist, snapshot) for a)
$(info == smaller release build.)
$(info == smaller and faster release build.)
$(info ==============================================================)
endif
endif
@@ -136,8 +136,9 @@ JS_BUILD_NAMES := sqlite3 sqlite3-wasmfs
# target of browsers.
#
# - node = for use by node.js for node.js, as opposed to by node.js on
# behalf o browser-side code (use bundler-friendly for that). Note
# behalf of browser-side code (use bundler-friendly for that). Note
# that persistent storage (OPFS) is not available in these builds.
# These builds are UNTESTED and UNSUPPORTED!
#
JS_BUILD_MODES := vanilla esm bunder-friendly node
@@ -326,7 +327,7 @@ endif
# If the canonical build process finds the file
# sqlite3_wasm_extra_init.c in the main wasm build directory, it
# arranges to include that file in the build of sqlite3.wasm and
# defines SQLITE_EXTRA_INIT=sqlite3_wasm_extra_init.
# defines SQLITE_EXTRA_INIT_MUTEXED=sqlite3_wasm_extra_init.
#
# sqlite3_wasm_extra_init() must be a function with this signature:
#
@@ -358,7 +359,7 @@ endif
# Slight caveat: this uses the version info from the in-tree
# sqlite3.c/h, which may diff from a user-provided $(sqlite3.c). The
# end result is that the generated JS files may have static version
# info from $(bin.version-info) which differ from their runtime-emited
# info from $(bin.version-info) which differ from their runtime-emitted
# version info (e.g. from sqlite3_libversion()).
bin.version-info := $(dir.top)/version-info
.NOTPARALLEL: $(bin.version-info)
@@ -512,7 +513,7 @@ sqlite3-api-build-version.js := $(dir.tmp)/sqlite3-api-build-version.js
# sqlite3-api.jses = the list of JS files which make up
# $(sqlite3-api.js.in), in the order they need to be assembled.
sqlite3-api.jses := $(sqlite3-license-version.js)
# sqlite3-api-prologue.js: initial boostrapping bits:
# sqlite3-api-prologue.js: initial bootstrapping bits:
sqlite3-api.jses += $(dir.api)/sqlite3-api-prologue.js
# whwhasm.js and jaccwabyt.js: Low-level utils, mostly replacing
# Emscripten glue:
@@ -891,12 +892,13 @@ EXPORTED_FUNCTIONS.fiddle := $(dir.tmp)/EXPORTED_FUNCTIONS.fiddle
########################################################################
########################################################################
# We have to ensure that we do not build $(sqlite3*.*js) in parallel
# because they all result in the creation of $(sqlite3.wasm). We have
# no way to build just a .[m]js file without also building the .wasm
# file because the generated .[m]js file has to include info about the
# imports needed by the wasm file, so they have to be built
# for any builds which result in the creation of $(sqlite3.wasm). We
# have no way to build just a .[m]js file without also building the
# .wasm file because the generated .[m]js file has to include info
# about the imports needed by the wasm file, so they have to be built
# together. i.e. we're building $(sqlite3.wasm) multiple times, but
# that's unavoidable (and harmless, just a waste of build time).
# that's unavoidable (and harmless, but is a significant waste of
# build time).
$(sqlite3.wasm): $(sqlite3.js)
$(sqlite3.mjs): $(sqlite3.js)
$(sqlite3-bundler-friendly.mjs): $(sqlite3.mjs)
@@ -907,7 +909,7 @@ $(sqlite3-node.mjs): $(sqlite3.mjs)
# We need separate copies of certain supplementary JS files for the
# bundler-friendly build. Concretely, any supplemental JS files which
# themselves use importScripts() or Workers or URL() constructors
# which refer to other in-tree (m)JS files quire a bundler-friendly
# which refer to other in-tree (m)JS files require a bundler-friendly
# copy.
sqlite3-worker1.js.in := $(dir.api)/sqlite3-worker1.c-pp.js
sqlite3-worker1-promiser.js.in := $(dir.api)/sqlite3-worker1-promiser.c-pp.js
+1 -1
View File
@@ -1835,7 +1835,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
if(!(tgt instanceof StructBinder.StructType)){
toss("Usage error: target object is-not-a StructType.");
}else if(!(func instanceof Function) && !wasm.isPtr(func)){
toss("Usage errror: expecting a Function or WASM pointer to one.");
toss("Usage error: expecting a Function or WASM pointer to one.");
}
if(1===arguments.length){
return (n,f)=>callee(tgt, n, f, applyArgcCheck);
+5 -5
View File
@@ -124,7 +124,7 @@
globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
apiConfig = (globalThis.sqlite3ApiConfig || sqlite3ApiBootstrap.defaultConfig)
){
if(sqlite3ApiBootstrap.sqlite3){ /* already initalized */
if(sqlite3ApiBootstrap.sqlite3){ /* already initialized */
(sqlite3ApiBootstrap.sqlite3.config || console).warn(
"sqlite3ApiBootstrap() called multiple times.",
"Config and external initializers are ignored on calls after the first."
@@ -869,7 +869,7 @@ globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
Emscripten -sWASM_BIGINT flag, else false. When
enabled, certain 64-bit sqlite3 APIs are enabled which
are not otherwise enabled due to JS/WASM int64
impedence mismatches.
impedance mismatches.
*/
bigIntEnabled: !!config.bigIntEnabled,
/**
@@ -880,7 +880,7 @@ globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
/**
When Emscripten compiles with `-sIMPORTED_MEMORY`, it
initalizes the heap and imports it into wasm, as opposed to
initializes the heap and imports it into wasm, as opposed to
the other way around. In this case, the memory is not
available via this.exports.memory.
*/
@@ -1453,7 +1453,7 @@ globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
creates (or overwrites) the given file using those APIs. This is
primarily intended for use in Emscripten-based builds where the POSIX
APIs are transparently proxied by an in-memory virtual filesystem.
It may behave diffrently in other environments.
It may behave differently in other environments.
The first argument must be either a JS string or WASM C-string
holding the filename. Note that this routine does _not_ create
@@ -1555,7 +1555,7 @@ globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
- "memdb": results are undefined.
- "kvvfs": will fail with an I/O error due to strict internal
requirments of that VFS's xTruncate().
requirements of that VFS's xTruncate().
- "unix" and related: will use the WASM build's equivalent of the
POSIX I/O APIs. This will work so long as neither a specific
+2 -2
View File
@@ -61,7 +61,7 @@ const installAsyncProxy = function(){
}
/**
Will hold state copied to this object from the syncronous side of
Will hold state copied to this object from the synchronous side of
this API.
*/
const state = Object.create(null);
@@ -722,7 +722,7 @@ const installAsyncProxy = function(){
https://github.com/tomayac/sqlite-wasm/issues/12
is reporting that this occassionally, under high loads,
is reporting that this occasionally, under high loads,
returns 'ok', which leads to the whichOp being 0 (which
isn't a valid operation ID and leads to an exception,
along with a corresponding ugly console log
+127 -25
View File
@@ -501,22 +501,10 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
currently-opened client-specified filenames. */
getFileNames(){
const rc = [];
const iter = this.#mapFilenameToSAH.keys();
for(const n of iter) rc.push(n);
for(const n of this.#mapFilenameToSAH.keys()) rc.push(n);
return rc;
}
// #createFileObject(sah,clientName,opaqueName){
// const f = Object.assign(Object.create(null),{
// clientName, opaqueName
// });
// this.#mapSAHToMeta.set(sah, f);
// return f;
// }
// #unmapFileObject(sah){
// this.#mapSAHToMeta.delete(sah);
// }
/**
Adds n files to the pool's capacity. This change is
persistent across settings. Returns a Promise which resolves
@@ -557,8 +545,9 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
}
/**
Releases all currently-opened SAHs. The only legal
operation after this is acquireAccessHandles().
Releases all currently-opened SAHs. The only legal operation
after this is acquireAccessHandles() or (if this is called from
pauseVfs()) either of isPaused() or unpauseVfs().
*/
releaseAccessHandles(){
for(const ah of this.#mapSAHToName.keys()) ah.close();
@@ -568,17 +557,21 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
}
/**
Opens all files under this.vfsDir/this.#dhOpaque and acquires
a SAH for each. returns a Promise which resolves to no value
but completes once all SAHs are acquired. If acquiring an SAH
throws, SAHPool.$error will contain the corresponding
exception.
Opens all files under this.vfsDir/this.#dhOpaque and acquires a
SAH for each. Returns a Promise which resolves to no value but
completes once all SAHs are acquired. If acquiring an SAH
throws, this.$error will contain the corresponding Error
object.
If it throws, it releases any SAHs which it may have
acquired before the exception was thrown, leaving the VFS in a
well-defined but unusable state.
If clearFiles is true, the client-stored state of each file is
cleared when its handle is acquired, including its name, flags,
and any data stored after the metadata block.
*/
async acquireAccessHandles(clearFiles){
async acquireAccessHandles(clearFiles=false){
const files = [];
for await (const [name,h] of this.#dhOpaque){
if('file'===h.kind){
@@ -832,12 +825,18 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
Removes this object's sqlite3_vfs registration and shuts down
this object, releasing all handles, mappings, and whatnot,
including deleting its data directory. There is currently no
way to "revive" the object and reaquire its resources.
way to "revive" the object and reaquire its
resources. Similarly, there is no recovery strategy if removal
of any given SAH fails, so such errors are ignored by this
function.
This function is intended primarily for testing.
Resolves to true if it did its job, false if the
VFS has already been shut down.
@see pauseVfs()
@see unpauseVfs()
*/
async removeVfs(){
if(!this.#cVfs.pointer || !this.#dhOpaque) return false;
@@ -853,13 +852,77 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
);
this.#dhVfsRoot = this.#dhVfsParent = undefined;
}catch(e){
sqlite3.config.error(this.vfsName,"removeVfs() failed:",e);
sqlite3.config.error(this.vfsName,"removeVfs() failed with no recovery strategy:",e);
/*otherwise ignored - there is no recovery strategy*/
}
return true;
}
/**
"Pauses" this VFS by unregistering it from SQLite and
relinquishing all open SAHs, leaving the associated files
intact. If this object is already paused, this is a
no-op. Returns this object.
This function throws if SQLite has any opened file handles
hosted by this VFS, as the alternative would be to invoke
Undefined Behavior by closing file handles out from under the
library. Similarly, automatically closing any database handles
opened by this VFS would invoke Undefined Behavior in
downstream code which is holding those pointers.
If this function throws due to open file handles then it has
no side effects. If the OPFS API throws while closing handles
then the VFS is left in an undefined state.
@see isPaused()
@see unpauseVfs()
*/
pauseVfs(){
if(this.#mapS3FileToOFile_.size>0){
sqlite3.SQLite3Error.toss(
capi.SQLITE_MISUSE, "Cannot pause VFS",
this.vfsName,"because it has opened files."
);
}
if(this.#mapSAHToName.size>0){
capi.sqlite3_vfs_unregister(this.vfsName);
this.releaseAccessHandles();
}
return this;
}
/**
Returns true if this pool is currently paused else false.
@see pauseVfs()
@see unpauseVfs()
*/
isPaused(){
return 0===this.#mapSAHToName.size;
}
/**
"Unpauses" this VFS, reacquiring all SAH's and (if successful)
re-registering it with SQLite. This is a no-op if the VFS is
not currently paused.
The returned Promise resolves to this object. See
acquireAccessHandles() for how it behaves if it throws due to
SAH acquisition failure.
@see isPaused()
@see pauseVfs()
*/
async unpauseVfs(){
if(0===this.#mapSAHToName.size){
return this.acquireAccessHandles(false).
then(()=>capi.sqlite3_vfs_register(this.#cVfs, 0),this);
}
return this;
}
//! Documented elsewhere in this file.
exportFile(name){
const sah = this.#mapFilenameToSAH.get(name) || toss("File not found:",name);
@@ -984,6 +1047,10 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
async removeVfs(){ return this.#p.removeVfs() }
pauseVfs(){ this.#p.pauseVfs(); return this; }
async unpauseVfs(){ return this.#p.unpauseVfs().then(()=>this); }
isPaused(){ return this.#p.isPaused() }
}/* class OpfsSAHPoolUtil */;
/**
@@ -1038,7 +1105,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
- `clearOnInit`: (default=false) if truthy, contents and filename
mapping are removed from each SAH it is acquired during
initalization of the VFS, leaving the VFS's storage in a pristine
initialization of the VFS, leaving the VFS's storage in a pristine
state. Use this only for databases which need not survive a page
reload.
@@ -1165,7 +1232,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
VFS-hosted database file. The result of the resolved Promise when
called this way is the size of the resulting database.
On succes this routine rewrites the database header bytes in the
On success this routine rewrites the database header bytes in the
output file (not the input array) to force disabling of WAL mode.
On a write error, the handle is removed from the pool and made
@@ -1217,6 +1284,41 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
Clears all client-defined state of all SAHs and makes all of them
available for re-use by the pool. Results are undefined if any such
handles are currently in use, e.g. by an sqlite3 db.
APIs specific to the "pause" capability (added in version 3.49):
Summary: "pausing" the VFS disassociates it from SQLite and
relinquishes its SAHs so that they may be opened by another
instance of this VFS (running in a separate tab/page or Worker).
"Unpausing" it takes back control, if able.
- pauseVfs()
"Pauses" this VFS by unregistering it from SQLite and
relinquishing all open SAHs, leaving the associated files intact.
This enables pages/tabs to coordinate semi-concurrent usage of
this VFS. If this object is already paused, this is a
no-op. Returns this object. Throws if SQLite has any opened file
handles hosted by this VFS. If this function throws due to open
file handles then it has no side effects. If the OPFS API throws
while closing handles then the VFS is left in an undefined state.
- isPaused()
Returns true if this VFS is paused, else false.
- [async] unpauseVfs()
Restores the VFS to an active state after having called
pauseVfs() on it. This is a no-op if the VFS is not paused. The
returned Promise resolves to this object on success. A rejected
Promise means there was a problem reacquiring the SAH handles
(possibly because they're in use by another instance or have
since been removed). Generically speaking, there is no recovery
strategy for that type of error, but if the problem is simply
that the OPFS files are locked, then a later attempt to unpause
it, made after the concurrent instance releases the SAHs, may
recover from the situation.
*/
sqlite3.installOpfsSAHPoolVfs = async function(options=Object.create(null)){
options = Object.assign(Object.create(null), optionDefaults, (options||{}));
+1 -1
View File
@@ -459,7 +459,7 @@ const installOpfsVfs = function callee(options){
Runs the given operation (by name) in the async worker
counterpart, waits for its response, and returns the result
which the async worker writes to SAB[state.opIds.rc]. The
2nd and subsequent arguments must be the aruguments for the
2nd and subsequent arguments must be the arguments for the
async op.
*/
const opRun = (op,...args)=>{
+7 -5
View File
@@ -128,7 +128,9 @@
#endif
#ifdef SQLITE_WASM_EXTRA_INIT
# define SQLITE_EXTRA_INIT sqlite3_wasm_extra_init
/* SQLITE_EXTRA_INIT vs SQLITE_EXTRA_INIT_MUTEXED:
** see https://sqlite.org/forum/forumpost/14183b98fc0b1dea */
# define SQLITE_EXTRA_INIT_MUTEXED sqlite3_wasm_extra_init
#endif
/*
@@ -284,7 +286,7 @@ SQLITE_WASM_EXPORT void * sqlite3__wasm_stack_alloc(int n){
/*
** State for the "pseudo-stack" allocator implemented in
** sqlite3__wasm_pstack_xyz(). In order to avoid colliding with
** Emscripten-controled stack space, it carves out a bit of stack
** Emscripten-controlled stack space, it carves out a bit of stack
** memory to use for that purpose. This memory ends up in the
** WASM-managed memory, such that routines which manipulate the wasm
** heap can also be used to manipulate this memory.
@@ -311,7 +313,7 @@ SQLITE_WASM_EXPORT void * sqlite3__wasm_pstack_ptr(void){
return PStack.pPos;
}
/*
** Sets the pstack position poitner to p. Results are undefined if the
** Sets the pstack position pointer to p. Results are undefined if the
** given value did not come from sqlite3__wasm_pstack_ptr().
*/
SQLITE_WASM_EXPORT void sqlite3__wasm_pstack_restore(unsigned char * p){
@@ -980,7 +982,7 @@ const char * sqlite3__wasm_enum_json(void){
#undef _DefGroup
/*
** Emit an array of "StructBinder" struct descripions, which look
** Emit an array of "StructBinder" struct descriptions, which look
** like:
**
** {
@@ -1417,7 +1419,7 @@ int sqlite3__wasm_db_serialize( sqlite3 *pDb, const char *zSchema,
** NULL), or nData is negative, SQLITE_MISUSE are returned.
**
** On success, it creates a new file with the given name, populated
** with the fist nData bytes of pData. If pData is NULL, the file is
** with the first nData bytes of pData. If pData is NULL, the file is
** created and/or truncated to nData bytes.
**
** Whether or not directory components of zFilename are created
@@ -335,8 +335,8 @@ sqlite3Worker1Promiser.v2 = function(config){
/**
When built as a module, we export sqlite3Worker1Promiser.v2()
instead of sqlite3Worker1Promise() because (A) its interface is more
conventional for ESM usage and (B) the ESM option export option for
this API did not exist until v2 was created, so there's no backwards
conventional for ESM usage and (B) the ESM export option for this
API did not exist until v2 was created, so there's no backwards
incompatibility.
*/
export default sqlite3Worker1Promiser.v2;
+2 -2
View File
@@ -36,7 +36,7 @@
** - `#pragma` is in place for adding "meta-commands", but it does not
** yet have any concrete list of documented commands.
**
* - `#stderr` outputs its file name, line number, and the remaininder
* - `#stderr` outputs its file name, line number, and the remainder
** of that line to stderr.
**
** - `#//` acts as a single-line comment, noting that there must be as
@@ -1215,7 +1215,7 @@ static void cmpp_kwd_if(CmppKeyword const * pKw, CmppTokenizer *t){
CmppLevel_push(t);
break;
default:
cmpp_kwd__misuse(pKw, t, "Unpexected keyword token type");
cmpp_kwd__misuse(pKw, t, "Unexpected keyword token type");
break;
}
buul = db_define_has((char const *)t->args.argv[1]);
+3 -3
View File
@@ -798,7 +798,7 @@ globalThis.WhWasmUtilInstaller = function(target){
*/
target.peek8 = (...ptr)=>target.peek( (1===ptr.length ? ptr[0] : ptr), 'i8' );
/**
Convience form of poke() intended for setting individual bytes.
Convenience form of poke() intended for setting individual bytes.
Its difference from poke() is that it always writes to the
i8-sized heap view.
*/
@@ -1769,7 +1769,7 @@ globalThis.WhWasmUtilInstaller = function(target){
/** If true, the constructor emits a warning. The intent is that
this be set to true after bootstrapping of the higher-level
client library is complete, to warn downstream clients that
they shouldn't be relying on this implemenation detail which
they shouldn't be relying on this implementation detail which
does not have a stable interface. */
xArg.FuncPtrAdapter.warnOnUse = false;
@@ -1949,7 +1949,7 @@ globalThis.WhWasmUtilInstaller = function(target){
- `json:dealloc` (results): works exactly like `string:dealloc` but
returns the same thing as the `json` adapter. Note the
warning in `string:dealloc` regarding maching allocators and
warning in `string:dealloc` regarding matching allocators and
deallocators.
The type names for results and arguments are validated when
+1 -1
View File
@@ -103,7 +103,7 @@
if(0===db.selectValue('select count(*) from sqlite_master')){
log("DB is empty. Use the init button to populate it.");
}else{
log("DB contains data from a previous session. Use the Clear Ctorage button to delete it.");
log("DB contains data from a previous session. Use the Clear Storage button to delete it.");
btnSelect.click();
}
};
+1 -1
View File
@@ -91,7 +91,7 @@ all: fiddle
fiddle_remote ?=
ifeq (,$(fiddle_remote))
ifneq (,$(wildcard /home/stephan))
fiddle_remote = wh:www/wh/sqlite3/.
fiddle_remote = wh:www/wasm-testing/fiddle/.
else ifneq (,$(wildcard /home/drh))
#fiddle_remote = if appropriate, add that user@host:/path here
endif
+1 -1
View File
@@ -112,7 +112,7 @@
/**
A proxy for localStorage or sessionStorage or a
page-instance-local proxy, if neither one is availble.
page-instance-local proxy, if neither one is available.
Which exact storage implementation is uses is unspecified, and
apps must not rely on it.
+1 -1
View File
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SQLite3 Fiddle</title>
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
<!-- to add a togglable terminal-style view, uncomment the following
<!-- to add a toggleable terminal-style view, uncomment the following
two lines and ensure that these files are on the web server. -->
<!--script src="jqterm/jqterm-bundle.min.js"></script>
<link rel="stylesheet" href="jqterm/jquery.terminal.min.css"/-->
+4
View File
@@ -119,6 +119,10 @@
<li><a href='tests/opfs/concurrency/index.html'>OPFS concurrency</a>
tests using multiple workers.
</li>
<li><a href='tests/opfs/sahpool/index.html'>OPFS SAHPool cooperative semi-concurrency</a>
demonstrates usage of the OPFS SAHPool VFS's "pause" feature to coordinate
access to a database.
</li>
</ul>
</li>
<li><strong>WASMFS</strong>-specific tests which require that
+1 -1
View File
@@ -561,7 +561,7 @@ globalThis.Jaccwabyt = function StructBinderFactory(config){
const dbg = ctor.prototype.debugFlags.__flags;
/*
TODO?: set prototype of descr to an object which can set/fetch
its prefered representation, e.g. conversion to string or mapped
its preferred representation, e.g. conversion to string or mapped
function. Advantage: we can avoid doing that via if/else if/else
in the get/set methods.
*/
+2 -2
View File
@@ -176,7 +176,7 @@ essentially boils down to:
3. [Feed (2) to the function generated by (1)](#step-3) to create JS
constuctor functions for each struct. This is done at runtime, as
opposed to during a build-process step, and can be set up in such a
way that it does not require any maintenace after its initial
way that it does not require any maintenance after its initial
setup.
4. [Create and use instances of those structs](#step-4).
@@ -950,7 +950,7 @@ const char * wasm__ctype_json(void){
assert(LEVEL<5); memset(pos, '}', LEVEL); pos+=LEVEL; lenCheck
////////////////////////////////////////////////////////////////////
// Macros for emiting StructBinders...
// Macros for emitting StructBinders...
#define StructBinder__(TYPE) \
n = 0; \
outf("%s{", (structCount++ ? ", " : "")); \

Some files were not shown because too many files have changed in this diff Show More