1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/vtab_err.test Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,71 @@
1.4 +# 2006 June 10
1.5 +#
1.6 +# The author disclaims copyright to this source code. In place of
1.7 +# a legal notice, here is a blessing:
1.8 +#
1.9 +# May you do good and not evil.
1.10 +# May you find forgiveness for yourself and forgive others.
1.11 +# May you share freely, never taking more than you give.
1.12 +#
1.13 +#***********************************************************************
1.14 +#
1.15 +# $Id: vtab_err.test,v 1.8 2007/09/03 16:12:10 drh Exp $
1.16 +
1.17 +set testdir [file dirname $argv0]
1.18 +source $testdir/tester.tcl
1.19 +
1.20 +ifcapable !vtab {
1.21 + finish_test
1.22 + return
1.23 +}
1.24 +
1.25 +
1.26 +
1.27 +unset -nocomplain echo_module_begin_fail
1.28 +do_ioerr_test vtab_err-1 -tclprep {
1.29 + register_echo_module [sqlite3_connection_pointer db]
1.30 +} -sqlbody {
1.31 + BEGIN;
1.32 + CREATE TABLE r(a PRIMARY KEY, b, c);
1.33 + CREATE VIRTUAL TABLE e USING echo(r);
1.34 + INSERT INTO e VALUES(1, 2, 3);
1.35 + INSERT INTO e VALUES('a', 'b', 'c');
1.36 + UPDATE e SET c = 10;
1.37 + DELETE FROM e WHERE a = 'a';
1.38 + COMMIT;
1.39 + BEGIN;
1.40 + CREATE TABLE r2(a, b, c);
1.41 + INSERT INTO r2 SELECT * FROM e;
1.42 + INSERT INTO e SELECT a||'x', b, c FROM r2;
1.43 + COMMIT;
1.44 +}
1.45 +
1.46 +ifcapable !memdebug {
1.47 + puts "Skipping vtab_err-2 tests: not compiled with -DSQLITE_MEMDEBUG..."
1.48 + finish_test
1.49 + return
1.50 +}
1.51 +source $testdir/malloc_common.tcl
1.52 +
1.53 +
1.54 +do_malloc_test vtab_err-2 -tclprep {
1.55 + register_echo_module [sqlite3_connection_pointer db]
1.56 +} -sqlbody {
1.57 + BEGIN;
1.58 + CREATE TABLE r(a PRIMARY KEY, b, c);
1.59 + CREATE VIRTUAL TABLE e USING echo(r);
1.60 + INSERT INTO e VALUES(1, 2, 3);
1.61 + INSERT INTO e VALUES('a', 'b', 'c');
1.62 + UPDATE e SET c = 10;
1.63 + DELETE FROM e WHERE a = 'a';
1.64 + COMMIT;
1.65 + BEGIN;
1.66 + CREATE TABLE r2(a, b, c);
1.67 + INSERT INTO r2 SELECT * FROM e;
1.68 + INSERT INTO e SELECT a||'x', b, c FROM r2;
1.69 + COMMIT;
1.70 +}
1.71 +
1.72 +sqlite3_memdebug_fail -1
1.73 +
1.74 +finish_test