mirror of
https://github.com/sqlite/sqlite.git
synced 2026-10-23 21:49:02 +03:00
And avoid a buffer overread in the session module when an UPDATE change is rebased against a baseline that records fewer columns than the UPDATE. FossilOrigin-Name: 37c90c8fc2d694dabc7c8e7fd49ae2ab46f91f9b88fd7c829b72225881598495
62 lines
2.4 KiB
Plaintext
62 lines
2.4 KiB
Plaintext
# 2026 July 6
|
|
#
|
|
# 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.
|
|
#
|
|
#***********************************************************************
|
|
# This file implements regression tests for SQLite library.
|
|
#
|
|
|
|
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}
|
|
|
|
set testprefix sessionrebase2
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
# Bug https://sqlite.org/bugs/forumpost/70e16d367d
|
|
#
|
|
set input "54280100000000000000000000000000000000000000000000000000000000000000000000000000000074310017000200000000000000070000000000000000000000000000000000000000000000000000000000000000000000000000000002c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c14141414141414102c141414141414141"
|
|
|
|
set rebaser "5401017431001200020000000000000007"
|
|
|
|
set I [db one {SELECT unhex($input)}]
|
|
set R [db one {SELECT unhex($rebaser)}]
|
|
do_test 1.0 {
|
|
sqlite3rebaser_create R
|
|
R configure $R
|
|
set I2 [R rebase $I]
|
|
R delete
|
|
} {}
|
|
|
|
#-------------------------------------------------------------------------
|
|
# Ensure that is an error to pass a patchset to sqlite3rebase_configure().
|
|
#
|
|
set input "0000ff0021"
|
|
set rebaser [string map {{ } {}} \
|
|
"5003030000 7400 0921 010000000d00490006"
|
|
]
|
|
|
|
set I [db one {SELECT unhex($input)}]
|
|
set R [db one {SELECT unhex($rebaser)}]
|
|
|
|
do_test 2.0 {
|
|
sqlite3rebaser_create R
|
|
list [catch { R configure $R } msg] $msg
|
|
} {1 SQLITE_ERROR}
|
|
|
|
do_test 2.1 {
|
|
set I2 [R rebase $I]
|
|
R delete
|
|
} {}
|
|
|
|
finish_test
|