SQLite

All files named ”src/memdb.c”
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

History for src/memdb.c

2025-02-17
17:33
[a3feb427cd] part of check-in [215650a5a1] 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. (check-in: [215650a5a1] user: drh branch: trunk, size: 27192)
2024-01-20
16:29
[16679def11] part of check-in [e638d5e408] Rig sqlite3_serialize() so that it will initialize a previously uninitialized database prior to serializing it, so that it does not have a zero-byte size and does not return NULL (except for OOM). Forum thread 498777780e16880a. (check-in: [e638d5e408] user: drh branch: trunk, size: 27182)
2023-01-05
13:55
[acb274058f] part of check-in [4f512a39af] Remove the unused sqlite3IsMemdb() routine, to avoid a harmless compiler warning. (check-in: [4f512a39af] user: drh branch: branch-3.40, size: 26828)
2022-12-20
15:02
[559c42e61e] part of check-in [01fa760212] Add ALWAYS() to always-true branches in the locking logic of the memdb VFS. (check-in: [01fa760212] user: drh branch: trunk, size: 26950)
2022-12-19
19:04
[eb4730f11d] part of check-in [5c4d94147d] Remove an unused variable. (check-in: [5c4d94147d] user: drh branch: trunk, size: 26934)
14:06
[92195f35bf] part of check-in [7fe158aa80] Fix an assert() in fts5. Simplify memdb xLock/xUnlock some. (check-in: [7fe158aa80] user: dan branch: trunk, size: 26956)
2022-12-15
18:56
[1d4adda82e] part of check-in [bd537f2057] Fix an incompatibility between the Tcl interface and the "memdb" vfs by allowing memdb to accept filenames that begin with '\' characters. (check-in: [bd537f2057] user: dan branch: trunk, size: 26975)
2022-12-07
16:58
[3c1f3a3daa] part of check-in [d71a08375a] Streamline and improve testing of the locking in the memdb VFS. Follow-on to [15f0be8a640e7bfa]. (check-in: [d71a08375a] user: drh branch: trunk, size: 26955)
2022-12-05
14:23
[281e5cea33] part of check-in [d18cce37b5] Fix a problem in the memdb vfs xLock() function allowing clients to upgrade to EXCLUSIVE locks when other connections are holding SHARED. (check-in: [d18cce37b5] user: drh branch: branch-3.40, size: 26360)
14:12
[fa280078fb] part of check-in [15f0be8a64] Fix a problem in the memdb vfs xLock() function allowing clients to upgrade to EXCLUSIVE locks when other connections are holding SHARED. Forum post 5adb92e2baca3678. (check-in: [15f0be8a64] user: dan branch: trunk, size: 26482)
2022-11-19
00:08
[a42248bc04] part of check-in [ff494449ef] Databases created using sqlite3_deserialize() should report their filename as an empty string, not as "x". Fix for ticket [53043c9793715f08]. (check-in: [ff494449ef] user: drh branch: trunk, size: 25906)
2021-11-08
15:46
[c2dc88f97c] part of check-in [b1e2929860] Fix an assert() in memdbTruncate() that could fail when processing a corrupt database. (check-in: [b1e2929860] user: dan branch: trunk, size: 25784)
2021-10-27
15:19
[a6c2bb1257] part of check-in [22fdc658a7] Fix a harmless compiler warning in memdb.c. (check-in: [22fdc658a7] user: drh branch: trunk, size: 25730)
2021-10-23
17:46
[ca36b36c49] part of check-in [5ee14715a5] Fix the memdb VFS so that it does not allow mmap if it is resizable, and so that it never opens a disk file for any reason. (check-in: [5ee14715a5] user: drh branch: trunk, size: 25704)
2021-09-10
18:35
[cd8cf3ee96] part of check-in [d577030cda] Fix (luckily harmless) typo in memdb.c per https://sqlite.org/forum/forumpost/15af8872d5999df1 (check-in: [d577030cda] user: larrybr branch: trunk, size: 25815)
2021-07-20
02:02
[73622017aa] part of check-in [18068cc606] It does not work to deserialized into TEMP, so do not allow it. The sqlite3_deserialize() routine now returns SQLITE_ERROR if you try. (check-in: [18068cc606] user: drh branch: trunk, size: 25811)
2021-06-15
15:15
[2f2e8efc6e] part of check-in [272a15b9f4] Add NULL checks on all sqlite3_vfs_find(0) calls. This is not strictly necessary. There are no vulnerabilities here. However, adding these checks avoids unnecessary static analyzer complaints. Forum post ce1193be15. (check-in: [272a15b9f4] user: drh branch: trunk, size: 25783)
2021-05-19
02:33
[f6ce717b26] part of check-in [1155696c70] Cure some TCL test failures and narrow an object scope. (check-in: [1155696c70] user: larrybr branch: trunk, size: 25731)
2021-05-17
17:14
[5028ea4245] part of check-in [ace12a3912] Fix harmless compiler warnings. (check-in: [ace12a3912] user: drh branch: trunk, size: 25720)
2021-05-12
15:39
[41acf2b1a8] part of check-in [b635375dbe] Fix a race condition that can lead to deadlock in the memdb VFS if one thread is trying to open an existing database at the same moment that another thread that is the only prior user of that database is trying to close it. (check-in: [b635375dbe] user: drh branch: trunk, size: 25121)
02:52
[0c95e0299c] part of check-in [98dae595d8] Respond correctly to OOM during mutex allocation. (check-in: [98dae595d8] user: drh branch: memdb-enhancement, size: 25073)
02:09
[653a1f08f8] part of check-in [6c20d9d4b7] Mark an unreachable branch as NEVER(). (check-in: [6c20d9d4b7] user: drh branch: memdb-enhancement, size: 24850)
2021-05-10
23:48
[1f9e82a7f8] part of check-in [0617c66ac2] Enhance the memdb VFS to provide the ability to share a single database among multiple database connections. (check-in: [0617c66ac2] user: drh branch: memdb-enhancement, size: 24745)
2021-05-08
17:18
[4dac796ed6] part of check-in [6df3b03e00] Enable the sqlite3_serialize() and sqlite3_deserialize() interfaces by default. Omit the SQLITE_ENABLE_DESERIALIZE option and replace it with the SQLITE_OMIT_DESERIALIZE option. (check-in: [6df3b03e00] user: drh branch: trunk, size: 18606)
2021-04-09
20:50
[eab3c87582] part of check-in [09c96b4c02] Have the VFS in memdb.c return SQLITE_IOERR_NOMEM instead of SQLITE_NOMEM when an OOM error is encountered. This is required to get the pager module to handle such OOM errors correctly in some cases. (check-in: [09c96b4c02] user: dan branch: trunk, size: 18609)
2020-10-20
14:40
[ab0632d424] part of check-in [602d736916] Fix the sqlite3_hard_heap_limit() so that it works with sqlite3_realloc64() in addition to sqlite3_malloc64(). Improvements to OOM processing and debugging aids in the fuzzcheck utility. (check-in: [602d736916] user: drh branch: trunk, size: 18603)
2020-10-17
22:13
[23e8f0b975] part of check-in [d6fac8a1d3] Fix the SQLITE_DESERIALIZE_FREEONCLOSE flag so that it works as it is documented to work. See forum post ba1dff667a (check-in: [d6fac8a1d3] user: drh branch: trunk, size: 18546)
2020-07-24
09:17
[d58e398e31] part of check-in [270ac1a0f2] Fix other potentiall pointer aliasing problems associated with subclassing of the sqlite3_file object for various VFS implementations. (check-in: [270ac1a0f2] user: drh branch: trunk, size: 18311)
2020-06-19
15:24
[9480d2b7aa] part of check-in [7a876209a6] Extend the refactoring into extensions. Clean up stray newlines. (check-in: [7a876209a6] user: drh branch: trunk, size: 18312)
2020-05-21
20:38
[252137ca12] part of check-in [ce36b6d133] Change a NEVER macro into a NO_TEST comment, as the conditional is reachable, but only when compiling for Windows 32-bit. (check-in: [ce36b6d133] user: drh branch: trunk, size: 18313)
2020-05-17
00:26
[1d05bcc3fb] part of check-in [1313557b51] Use the sqlite3Realloc() interface internally, rather than the public sqlite3_realloc64() equivalent, to avoid unnecessary calls to sqlite3_initialize(). (check-in: [1313557b51] user: drh branch: trunk, size: 18263)
2019-01-31
16:09
[02a5fcec19] part of check-in [80151d7e3b] Remove an incorrect assert() from the deserialize in-memory database VFS. (check-in: [80151d7e3b] user: drh branch: trunk, size: 18266)
15:38
[8689716299] part of check-in [cb72ee0478] Add the SQLITE_CONFIG_MEMDB_MAXSIZE configuration option for configuring the default maximum size of an in-memory database created using sqlite3_deserialize(). This is necessary to make the interface reasonably testable. (check-in: [cb72ee0478] user: drh branch: trunk, size: 18292)
2019-01-25
14:16
[d95f6ad26f] part of check-in [2c1ef40e78] Fix the xFetch method of the "memdb" VFS (used by deserialize) so that it is robust against corrupt database file. (check-in: [2c1ef40e78] user: drh branch: dbsqlfuzz-in-fuzzcheck, size: 18433)
2019-01-22
16:43
[6099be387f] part of check-in [b9eccef782] Fix the SQLITE_DESERIALIZE_READONLY feature so that it does not cause an assertion fault in the pager. (check-in: [b9eccef782] user: drh branch: trunk, size: 18351)
16:06
[25d36740e4] part of check-in [30f08d5888] Enhancements to deserialize: (1) Add the SQLITE_FCNTL_SIZE_LIMIT file control to set a maximum size for an in-memory database, defaulting to SQLITE_MEMDB_DEFAULT_MAXSIZE or 1GiB. (2) Honor the SQLITE_DESERIALIZE_READONLY flag. (3) Enhance the TCL interface to support -maxsize N and -readonly BOOLEAN. (4) Add the --maxsize option to the ".open" command and on the command-line for the CLI. (check-in: [30f08d5888] user: drh branch: trunk, size: 18224)
2018-09-12
01:05
[cb4013d56f] part of check-in [78862252da] Fix some harmless compiler warnings seen with MSVC. (check-in: [78862252da] user: mistachkin branch: trunk, size: 17359)
2018-03-28
15:06
[e94c478a75] part of check-in [d282f06469] Minor comment changes. (check-in: [d282f06469] user: drh branch: trunk, size: 17359)
2018-03-08
19:56
[2bcebf99f7] part of check-in [0798c91aa9] Enable API armor handling for the new deserialize APIs. (check-in: [0798c91aa9] user: mistachkin branch: trunk, size: 17357)
2018-03-07
01:37
[00ece105cf] part of check-in [fadbc5e23f] Mark an unreachable branch using NEVER(). (check-in: [fadbc5e23f] user: drh branch: memdb, size: 17041)
2018-03-06
21:43
[f5d49ef349] part of check-in [f07e97aed4] Improved documentation for sqlite3_serialize() and sqlite3_deserialize(). Change the name of the compile-time option to enable these interfaces from SQLITE_ENABLE_MEMDB to SQLITE_ENABLE_DESERIALIZE. (check-in: [f07e97aed4] user: drh branch: memdb, size: 16838)
20:54
[3f14ea29ae] part of check-in [b58ca4cb0c] Handle some boundary cases in memdb associated with OOM faults. (check-in: [b58ca4cb0c] user: drh branch: memdb, size: 16826)
19:14
[ffdca40946] part of check-in [6c3f723a68] Simplifications to the memdb VFS. (check-in: [6c3f723a68] user: drh branch: memdb, size: 16894)
04:01
[a559d61e55] part of check-in [a14fed69d0] Improvements to the memdb VFS. (check-in: [a14fed69d0] user: drh branch: memdb, size: 16188)
2018-03-01
22:18
[f01e30a224] part of check-in [5b01b9914f] Allow the zSchema argument to sqlite3_serialize() to be NULL to mean the main database. (check-in: [5b01b9914f] user: drh branch: memdb, size: 15874)
2018-01-03
22:48
[d58bb51e60] part of check-in [fa6069fb3b] Miscellaneous code and comment cleanup. (check-in: [fa6069fb3b] user: drh branch: memdb, size: 15812)
19:03
[67c01e51b9] part of check-in [2f6e9df9f0] Replace sqlite3_memdb_config() with sqlite3_deserialize(). Remove the "db memdb" command from the TCL interface, replacing it with "db serialize" and "db deserialize". (check-in: [2f6e9df9f0] user: drh branch: memdb, size: 16570)
16:49
[39dd9443f9] part of check-in [8cf2ed4eff] Replace the sqlite3_memdb_ptr() interface with the more general sqlite3_serialize() interface. (check-in: [8cf2ed4eff] user: drh branch: memdb, size: 16192)
13:20
[13c69aee01] part of check-in [47398ae772] Simplify the "sqlite3" command in the TCL interface. The filename is now optional. There is a new --memdb option with an argument that is the blob to which the database content should be initialized. (check-in: [47398ae772] user: drh branch: memdb, size: 14571)
01:28
Added: [46109bc6c8] part of check-in [fb2ac2d2fa] Add support for the "memdb" VFS and the sqlite3_memdb_ptr() and sqlite3_memdb_config() interfaces, to enable an SQLite database to be manipulated as an in-memory object. (check-in: [fb2ac2d2fa] user: drh branch: memdb, size: 14412)