#
#***********************************************************************
#
-# This file contains tests for the OTA module. Specifically, it tests the
-# that affinities are correctly applied to values within the OTA database.
+# This file contains tests for the OTA module.
#
+
if {![info exists testdir]} {
set testdir [file join [file dirname [info script]] .. .. test]
}
source $testdir/tester.tcl
set ::testprefix ota7
+# Test index:
+#
+# 1.*: That affinities are correctly applied to values within the
+# OTA database.
+#
+# 2.*: Tests for multi-column primary keys.
+#
+
do_test 1.0 {
execsql {
CREATE TABLE t1(a INT PRIMARY KEY, b) WITHOUT ROWID;
SELECT * FROM t1
} {2 def}
+#-------------------------------------------------------------------------
+#
+foreach {tn tbl} {
+ 1 { CREATE TABLE t1(a, b, c, PRIMARY KEY(a, b)) WITHOUT ROWID }
+} {
+ reset_db
+
+ execsql $tbl
+ do_execsql_test 2.$tn.1 {
+ CREATE INDEX t1c ON t1(c);
+ INSERT INTO t1 VALUES(1, 1, 'a');
+ INSERT INTO t1 VALUES(1, 2, 'b');
+ INSERT INTO t1 VALUES(2, 1, 'c');
+ INSERT INTO t1 VALUES(2, 2, 'd');
+ }
+
+ do_test 2.$tn.2 {
+ forcedelete ota.db
+ sqlite3 ota ota.db
+ execsql {
+ CREATE TABLE data_t1(a, b, c, ota_control);
+ INSERT INTO data_t1 VALUES(3, 1, 'e', 0);
+ INSERT INTO data_t1 VALUES(3, 2, 'f', 0);
+ INSERT INTO data_t1 VALUES(1, 2, NULL, 1);
+ INSERT INTO data_t1 VALUES(2, 1, 'X', '..x');
+ } ota
+ ota close
+ } {}
+
+ do_test 2.$tn.3 {
+ set rc "SQLITE_OK"
+ while {$rc == "SQLITE_OK"} {
+ sqlite3ota ota test.db ota.db
+ ota step
+ set rc [ota close]
+ }
+ set rc
+ } {SQLITE_DONE}
+
+ do_execsql_test 2.$tn.1 {
+ SELECT * FROM t1 ORDER BY a, b
+ } {
+ 1 1 a
+ 2 1 X
+ 2 2 d
+ 3 1 e
+ 3 2 f
+ }
+}
+
finish_test
-C Changes\sso\sthat\ssqlite3_ckpt_open()\sworks\swith\szipvfs\sdatabases.
-D 2014-11-17T17:57:06.217
+C Add\stests\sfor\sWITHOUT\sROWID\stables\swith\scomposite\sprimary\skeys.
+D 2014-11-17T18:35:30.003
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F ext/ota/ota4.test 60f897f329a6782ef2f24862640acf3c52e48077
F ext/ota/ota5.test ad0799daf8923ddebffe75ae8c5504ca90b7fadb
F ext/ota/ota6.test 82f1f757ec9b2ad07d6de4060b8e3ba8e44dfdd3
-F ext/ota/ota7.test feba6072af04bc4bee192f7576aac60cef6a4727
+F ext/ota/ota7.test 36e740da2b67cc086ff9f2975d2929b8beaa1016
F ext/ota/otafault.test be02466863015a583cc0ceb6aca871a5e6f7a71b
F ext/ota/sqlite3ota.c c7f8cdf55449b5169f79632e78f8e5049abf904c
F ext/ota/sqlite3ota.h 7b20abe9247d292429d00f0a5c237ff6e0dc0196
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 447b33b34a9836992f5a8d50cd8647a10435c144
-R a385542ae873f1383b1a1f964429fd33
+P acbed3380d8a35bf2f1ec133540cb5e9fccb9b42
+R 27bbe427f24c751c6dfa08920b459629
U dan
-Z a2dd6eb93ee736daa85bc89fdfbf459a
+Z 78767b94770b1205744fff578a5ff365