sqlite/test/memjournal2.test
drh d5e040b6f0 Add string_agg(X,Y) as an alias for group_concat(X,Y), for compatibility
with SQLServer and PG.

FossilOrigin-Name: b91c19bf2680f60d7826ab5d9e7902e2dc2a55d847bbea565a6489d47f2cc8f1
2023-10-20 20:19:30 +00:00

62 lines
1.4 KiB
Plaintext

# 2022 Jan 01
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
# Tests focused on the in-memory journal.
#
# TESTRUNNER: slow
set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/malloc_common.tcl
set testprefix memjournal2
do_execsql_test 1.0 {
PRAGMA journal_mode = memory;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b UNIQUE);
} {memory}
set nRow [expr 2000]
do_execsql_test 1.1 {
BEGIN;
WITH s(i) AS (
SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<$nRow
)
INSERT INTO t1 SELECT NULL, randomblob(700) FROM s;
}
for {set jj 200} {$jj <= 300} {incr jj} {
do_execsql_test 1.2.$jj.1 {
SAVEPOINT one;
UPDATE t1 SET b=randomblob(700) WHERE a<=$jj;
}
do_execsql_test 1.2.$jj.2 {
SAVEPOINT two;
UPDATE t1 SET b=randomblob(700) WHERE a==1;
ROLLBACK TO two;
RELEASE two;
}
do_execsql_test 1.2.$jj.3 {
SAVEPOINT two;
UPDATE t1 SET b=randomblob(700) WHERE a==1;
ROLLBACK TO two;
RELEASE two;
}
do_execsql_test 1.2.$jj.4 {
PRAGMA integrity_check;
ROLLBACK TO one;
RELEASE one;
} {ok}
}
finish_test