mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Fix a problem with the parameters to an OP_Affinity in one of the VM programs generated by sqlite3_index_writer() that was causing an OOB read.
FossilOrigin-Name: 447b33b34a9836992f5a8d50cd8647a10435c144
This commit is contained in:
51
ext/ota/ota7.test
Normal file
51
ext/ota/ota7.test
Normal file
@ -0,0 +1,51 @@
|
||||
# 2014 October 21
|
||||
#
|
||||
# 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 contains tests for the OTA module. Specifically, it tests the
|
||||
# that affinities are correctly applied to values within the OTA database.
|
||||
#
|
||||
|
||||
if {![info exists testdir]} {
|
||||
set testdir [file join [file dirname [info script]] .. .. test]
|
||||
}
|
||||
source $testdir/tester.tcl
|
||||
set ::testprefix ota7
|
||||
|
||||
do_test 1.0 {
|
||||
execsql {
|
||||
CREATE TABLE t1(a INT PRIMARY KEY, b) WITHOUT ROWID;
|
||||
INSERT INTO t1 VALUES(1, 'abc');
|
||||
INSERT INTO t1 VALUES(2, 'def');
|
||||
}
|
||||
|
||||
forcedelete ota.db
|
||||
sqlite3 ota ota.db
|
||||
ota eval {
|
||||
CREATE TABLE data_t1(a, b, ota_control);
|
||||
INSERT INTO data_t1 VALUES('1', NULL, 1);
|
||||
}
|
||||
ota close
|
||||
} {}
|
||||
|
||||
do_test 1.1 {
|
||||
sqlite3ota ota test.db ota.db
|
||||
while { [ota step]=="SQLITE_OK" } {}
|
||||
ota close
|
||||
} {SQLITE_DONE}
|
||||
|
||||
sqlite3 db test.db
|
||||
do_execsql_test 1.2 {
|
||||
SELECT * FROM t1
|
||||
} {2 def}
|
||||
|
||||
finish_test
|
||||
|
||||
|
Reference in New Issue
Block a user