mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Fix the handling of -init option to the sqlite shell. Ticket #568.
Also add hooks for encrypting the database. (CVS 1206) FossilOrigin-Name: 3c796de8d1af55944f396f08feaa9e69c1652896
This commit is contained in:
@ -15,21 +15,26 @@
|
||||
# interface is pretty well tested. This file contains some addition
|
||||
# tests for fringe issues that the main test suite does not cover.
|
||||
#
|
||||
# $Id: tclsqlite.test,v 1.17 2004/01/15 02:44:04 drh Exp $
|
||||
# $Id: tclsqlite.test,v 1.18 2004/02/01 01:22:52 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
# Check the error messages generated by tclsqlite
|
||||
#
|
||||
if {[sqlite -has-crypto]} {
|
||||
set r "sqlite HANDLE FILENAME ?-key CRYPTOKEY?"
|
||||
} else {
|
||||
set r "sqlite HANDLE FILENAME ?MODE?"
|
||||
}
|
||||
do_test tcl-1.1 {
|
||||
set v [catch {sqlite bogus} msg]
|
||||
lappend v $msg
|
||||
} {1 {wrong # args: should be "sqlite HANDLE FILENAME ?MODE?"}}
|
||||
} [list 1 "wrong # args: should be \"$r\""]
|
||||
do_test tcl-1.2 {
|
||||
set v [catch {db bogus} msg]
|
||||
lappend v $msg
|
||||
} {1 {bad option "bogus": must be authorizer, busy, changes, close, commit_hook, complete, errorcode, eval, function, last_insert_rowid, onecolumn, progress, timeout, or trace}}
|
||||
} {1 {bad option "bogus": must be authorizer, busy, changes, close, commit_hook, complete, errorcode, eval, function, last_insert_rowid, onecolumn, progress, rekey, timeout, or trace}}
|
||||
do_test tcl-1.3 {
|
||||
execsql {CREATE TABLE t1(a int, b int)}
|
||||
execsql {INSERT INTO t1 VALUES(10,20)}
|
||||
@ -98,8 +103,9 @@ do_test tcl-3.1 {
|
||||
INSERT INTO t1 SELECT a*2+1, b*2+1 FROM t1;
|
||||
INSERT INTO t1 SELECT a*2+3, b*2+3 FROM t1;
|
||||
}
|
||||
db onecolumn {SELECT * FROM t1 ORDER BY a}
|
||||
} {10}
|
||||
set rc [catch {db onecolumn {SELECT * FROM t1 ORDER BY a}} msg]
|
||||
lappend rc $msg
|
||||
} {0 10}
|
||||
do_test tcl-3.2 {
|
||||
db onecolumn {SELECT * FROM t1 WHERE a<0}
|
||||
} {}
|
||||
|
Reference in New Issue
Block a user