Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: third_party/sqlite/sqlite-src-3170000/test/backup5.test

Issue 2747283002: [sql] Import reference version of SQLite 3.17.. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # 2014 November 13
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
13 set testdir [file dirname $argv0]
14 source $testdir/tester.tcl
15 set testprefix backup5
16
17 forcedelete test2.db
18
19 do_execsql_test 1.0 {
20 CREATE TABLE t1(a, b);
21 CREATE TABLE t2(a, b);
22 INSERT INTO t2 VALUES(1, 1);
23 INSERT INTO t2 VALUES(2, 2);
24 INSERT INTO t2 VALUES(3, 3);
25 }
26
27 do_test 1.1 {
28 forcecopy test.db test.db2
29 db eval {
30 DROP TABLE t2;
31 INSERT INTO t1 VALUES(zeroblob(1000), zeroblob(1000));
32 INSERT INTO t1 VALUES(randomblob(1000), randomblob(1000));
33 }
34 } {}
35
36 do_test 1.2 {
37 sqlite3 db2 test.db2
38 set stmt [sqlite3_prepare_v2 db2 "SELECT * FROM t2" -1 dummy]
39 sqlite3_step $stmt
40 } {SQLITE_ROW}
41
42 do_test 1.3 {
43 list [catch { sqlite3_backup B db2 main db main } msg] $msg
44 } {1 {sqlite3_backup_init() failed}}
45
46 do_test 1.4 {
47 sqlite3_errmsg db2
48 } {destination database is in use}
49
50 do_test 1.5 {
51 sqlite3_reset $stmt
52 sqlite3_backup B db2 main db main
53 B step 200
54 B finish
55 } {SQLITE_OK}
56
57 do_test 1.6 {
58 list [sqlite3_step $stmt] [sqlite3_finalize $stmt]
59 } {SQLITE_ERROR SQLITE_ERROR}
60
61 do_test 1.7 {
62 sqlite3_errmsg db2
63 } {no such table: t2}
64
65 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/sqlite-src-3170000/test/backup4.test ('k') | third_party/sqlite/sqlite-src-3170000/test/backup_ioerr.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698