1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Avoid loading the entire record into memory for an sqlite3_preupdate_old() call that retrieves an IPK value.

FossilOrigin-Name: 7f4de43733200beeb3ff0a70d51bbc68f5331895698ea95a82741cfd7bb66834
This commit is contained in:
dan
2024-11-04 16:59:02 +00:00
parent 88ef6be57d
commit 4bf24c8830
6 changed files with 121 additions and 59 deletions

View File

@ -0,0 +1,55 @@
# 2024 November 04
#
# 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.
#
#***********************************************************************
#
if {![info exists testdir]} {
set testdir [file join [file dirname [info script]] .. .. test]
}
source [file join [file dirname [info script]] session_common.tcl]
source $testdir/tester.tcl
ifcapable !session {finish_test; return}
if {$::tcl_platform(pointerSize)<8} {
finish_test
return
}
set testprefix sessionblob
forcedelete test.db2
sqlite3 db2 test.db2
set NBLOB 2000000
do_execsql_test 1.0 {
CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
INSERT INTO t1 VALUES(123, zeroblob($NBLOB));
}
do_test 1.1 {
sqlite3session S db main
S attach t1
} {}
set b2 [string repeat x 1000]
do_test 1.2 {
set ::blob [db incrblob t1 b 123]
for {set ii 0} {$ii < $NBLOB} {incr ii [string length $b2]} {
seek $::blob $ii
puts -nonewline $::blob $b2
}
close $::blob
} {}
S delete
finish_test