Commit Graph

671 Commits

Author SHA1 Message Date
Pekka Enberg
de40442677 core: Remove unused import from btree.rs 2024-11-20 11:55:49 +02:00
Pekka Enberg
fc07445e0a Merge 'sim: improve simulator' from Pere Diaz Bou
Newly improved simulator with CREATE TABLE, INSERT, SELECT, connection
management, etc...
This new simulator is finding a bunch of bugs with write path so after
this PR I will start fixing those.

Closes #405
2024-11-20 08:59:13 +02:00
Pere Diaz Bou
51ad827f1f fmt 2024-11-19 17:56:24 +01:00
Pere Diaz Bou
f5a1f7c800 various fixes in btree
* read_u8 now takes self.offset into account
* shift cell pointers left on balance_root with offset > 0
* fix wrong writes to page in degragment_page
2024-11-19 17:15:19 +01:00
jussisaurio
b86501f12e Merge 'implement CAST(col as type)' from Jussi Saurio
Closes #398

Reviewed-by: Pere Diaz Bou <pere-altea@hotmail.com>

Closes #404
2024-11-18 20:53:58 +02:00
jussisaurio
9efd45025d enum instead of string 2024-11-18 18:26:04 +02:00
Pere Diaz Bou
db343ac5ea fix page1 balancing 2024-11-18 16:25:06 +01:00
Pere Diaz Bou
4aa5612334 fix schema query 2024-11-18 14:06:50 +01:00
Pere Diaz Bou
a738ef6e91 comment use of rng in limbo 2024-11-18 13:40:37 +01:00
Pere Diaz Bou
44e22c50cf sim: improve simulator 2024-11-18 13:40:37 +01:00
Pere Diaz Bou
9c4ca28bd9 Merge 'CREATE TABLE support' from Pekka Enberg
Closes #383
2024-11-18 13:40:20 +01:00
Pere Diaz Bou
80f60852df remove wrong comment 2024-11-18 10:41:20 +01:00
Pere Diaz Bou
9f72655e30 tree_create -> btree_create 2024-11-18 10:31:47 +01:00
Pekka Enberg
5efc218e6e Merge 'support subtract in translate_expr() (not in condition expressions yet)' from Jussi Saurio
closes #402

Closes #403
2024-11-18 09:28:23 +02:00
jussisaurio
62761d2b34 uppercase only once 2024-11-17 22:22:03 +02:00
jussisaurio
ddd0cc041c implement CAST(col as type) 2024-11-17 22:12:22 +02:00
jussisaurio
491bdd3bfc support subtract in translate_expr() (not in condition expressions yet) 2024-11-17 18:47:16 +02:00
jussisaurio
9a4864bc6a support parenthesized(single expr) in translate_expr() 2024-11-17 18:36:30 +02:00
jussisaurio
ccdcf302ca quick fix for #399 2024-11-17 17:06:09 +02:00
jussisaurio
3cc9d9d79f vendor sqlite3-parser (lemon-rs) 2024-11-16 20:08:59 +02:00
Pekka Enberg
9473668196 core: Bump jsonb dependency
The `fast-float` library has soundness issues, which why `jsonb`
switched to `fast-float2`:

https://github.com/databendlabs/jsonb/issues/68
2024-11-16 18:58:13 +02:00
Pere Diaz Bou
569e98cb32 fmt 2024-11-16 17:08:22 +01:00
Pere Diaz Bou
d1dee484df properly format table and "if not exists" support 2024-11-16 17:02:53 +01:00
Pere Diaz Bou
090615b289 create btree table + parse schema 2024-11-16 16:24:28 +01:00
Pere Diaz Bou
66e20df309 fix some offset usages in btree 2024-11-16 16:23:06 +01:00
Pekka Enberg
fc5e42bb94 CREATE TABLE support 2024-11-16 13:07:10 +01:00
Pekka Enberg
85b70e381d core: Make mockall a dev dependency 2024-11-16 13:18:35 +02:00
Pekka Enberg
cd5db55cf2 core: Make JSON support configurable
This adds a `json` feature flag, which allows users to disable JSON
support if needed.
2024-11-16 09:49:09 +02:00
Pere Diaz Bou
6cd0f03643 core: create databases from limbo 2024-11-15 12:09:07 +01:00
Pere Diaz Bou
87c80b2a07 use core wal file for wasm 2024-11-14 17:54:20 +01:00
Pere Diaz Bou
c46bd63b5a core: drop mutex on contents
There is no need to have mutexes on buffers, we will introduce mutexes
if we want later on a file level to introduce serializability.
2024-11-13 19:13:15 +01:00
Pere Diaz Bou
2a787aedb5 core: extract page stack and document a bit 2024-11-13 17:13:30 +01:00
Pere Diaz Bou
e2276c2e9d O_DIRECT disable on WAL 2024-11-13 13:45:42 +00:00
Pere Diaz Bou
94a45eab9e checkpoint inflight 2024-11-13 12:04:54 +00:00
Pere Diaz Bou
cbfb45e55b more trace logs 2024-11-13 11:31:22 +00:00
Pere Diaz Bou
87957bf4f2 checkpoint log state 2024-11-13 11:24:07 +00:00
Pere Diaz Bou
78118bae81 fmt 2024-11-13 09:34:36 +00:00
Pere Diaz Bou
eb4105282b btree: fix btree traversal 2024-11-12 23:10:38 +00:00
Pere Diaz Bou
8d1d2d36cc core/linux: aligned wal header read 2024-11-12 17:53:59 +00:00
Pere Diaz Bou
48f0e72e14 checkpoint on drop connection 2024-11-12 17:03:30 +01:00
Pere Diaz Bou
807496a146 core: load pages if not loaded
Since pages are now tracked with a single centralized structure, it is
possible for a page to have been unloaded a be kept in memory for
metadata purposes like going back in the stack.

Using the example of going to a parent page which was unloaded for
whatever reason: in this case we need to check if it's loaded, if not,
we load it. Locked still means the same thing, loaded just means the
contents of a page are present in memory and if they are present, they
must be in cache.
2024-11-12 14:44:25 +01:00
Pere Diaz Bou
cd2b61d838 btree: cursor with lineal stack structure
Removed MemPage from the code in favor of an array to encode the stack
of the cursor. This is both simpler and better in terms of memory
access.
2024-11-12 10:21:22 +01:00
Pere Diaz Bou
ce8378793e btree: run until finished or IO + bug fixes 2024-11-11 17:03:15 +01:00
Pere Diaz Bou
74974d07e7 clippy fix 2024-11-08 11:14:29 +01:00
Pere Diaz Bou
e5836df160 write state machine
Returning on ongoing IO requires to save the current state, therefore a
state machine makes sense for write operations. This information is
encoded in WriteInfo/WriteState.
2024-11-08 11:10:49 +01:00
Pere Diaz Bou
ecfcd8835f rename get_page -> get_current_page 2024-11-07 15:37:21 +01:00
Pere Diaz Bou
7d8fc80f4b use len instead of size 2024-11-07 14:01:35 +01:00
Pere Diaz Bou
ce1367b76a move wal creation 2024-11-07 13:51:02 +01:00
Pere Diaz Bou
218c32e0e6 remove unix import in windoews 2024-11-07 13:34:48 +01:00
Pere Diaz Bou
0b46648c0e write wal header on init 2024-11-07 13:29:57 +01:00