interplane.Get Omega
Read in your language

sqlite

[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.

Brought by drakestapleton

branch master Branches Tags History

sqlite / ext / session / sessionblob.test

55 lines · 1178 bytes Raw Blame History
1# 2024 November 04
2#
3# The author disclaims copyright to this source code. In place of
4# a legal notice, here is a blessing:
5#
6# May you do good and not evil.
7# May you find forgiveness for yourself and forgive others.
8# May you share freely, never taking more than you give.
9#
10#***********************************************************************
11#
12
13if {![info exists testdir]} {
14 set testdir [file join [file dirname [info script]] .. .. test]
15}
16source [file join [file dirname [info script]] session_common.tcl]
17source $testdir/tester.tcl
18ifcapable !session {finish_test; return}
19
20if {$::tcl_platform(pointerSize)<8} {
21 finish_test
22 return
23}
24
25set testprefix sessionblob
26
27forcedelete test.db2
28sqlite3 db2 test.db2
29
30set NBLOB 2000000
31
32do_execsql_test 1.0 {
33 CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
34 INSERT INTO t1 VALUES(123, zeroblob($NBLOB));
35}
36
37do_test 1.1 {
38 sqlite3session S db main
39 S attach t1
40} {}
41
42set b2 [string repeat x 1000]
43do_test 1.2 {
44 set ::blob [db incrblob t1 b 123]
45 for {set ii 0} {$ii < $NBLOB} {incr ii [string length $b2]} {
46 seek $::blob $ii
47 puts -nonewline $::blob $b2
48 }
49 close $::blob
50} {}
51
52S delete
53
54finish_test
55