0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2024-12-12 15:33:44 +00:00
ad hoc ad79ef48a2
libsql wal tests (#1408)
* add tests

* add bench
2024-05-24 13:59:17 +00:00

61 lines
2.4 KiB
Plaintext

PRAGMA auto_vacuum = 0;
PRAGMA page_size=4096;
CREATE TABLE t1(a,b);
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<20)
INSERT INTO t1(a,b) SELECT x, randomblob(300) FROM c;
CREATE INDEX t1a ON t1(a);
CREATE INDEX t1b ON t1(b);
SELECT sum(a), sum(length(b)) FROM t1;
PRAGMA integrity_check;
PRAGMA journal_mode;
PRAGMA page_count;
PRAGMA auto_vacuum = 0;
PRAGMA page_size=8192;
PRAGMA journal_mode=WAL;
CREATE TABLE t1(a,b);
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<20)
INSERT INTO t1(a,b) SELECT x, randomblob(1300) FROM c;
CREATE INDEX t1a ON t1(a);
CREATE INDEX t1b ON t1(b);
SELECT sum(a), sum(length(b)) FROM t1;
PRAGMA integrity_check;
PRAGMA journal_mode;
PRAGMA page_size;
PRAGMA page_count;
PRAGMA journal_mode = wal;
CREATE TABLE t1(a);
INSERT INTO t1 VALUES(1), (2), (3), (4);
PRAGMA page_size=512;
PRAGMA auto_vacuum = 0;
CREATE TABLE t1(a,b,c);
CREATE INDEX t1a ON t1(a);
CREATE INDEX t1bc ON t1(b,c);
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<10)
INSERT INTO t1(a,b,c) SELECT x, randomblob(100),randomblob(100) FROM c;
PRAGMA page_count;
PRAGMA integrity_check;
UPDATE sqlite_dbpage SET data=
X'53514C69746520666F726D61742033000200030100402020000000000000001300000000000000000000000300000004000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000D00000003017C0001D801AC017C00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002E03061715110145696E6465787431626374310443524541544520494E4445582074316263204F4E20743128622C63292A0206171311013F696E64657874316174310343524541544520494E44455820743161204F4E20743128612926010617111101397461626C657431743102435245415445205441424C4520743128612C622C6329' WHERE pgno=1;
PRAGMA integrity_check;
PRAGMA page_count;
PRAGMA integrity_check;
PRAGMA encoding = 'utf8';
CREATE TABLE t1(a, b);
PRAGMA encoding;