3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
12 # $Id: vtab_err.test,v 1.8 2007/09/03 16:12:10 drh Exp $
14 set testdir [file dirname $argv0]
15 source $testdir/tester.tcl
23 unset -nocomplain echo_module_begin_fail
24 do_ioerr_test vtab_err-1 -tclprep {
25 register_echo_module [sqlite3_connection_pointer db]
28 CREATE TABLE r(a PRIMARY KEY, b, c);
29 CREATE VIRTUAL TABLE e USING echo(r);
30 INSERT INTO e VALUES(1, 2, 3);
31 INSERT INTO e VALUES('a', 'b', 'c');
33 DELETE FROM e WHERE a = 'a';
36 CREATE TABLE r2(a, b, c);
37 INSERT INTO r2 SELECT * FROM e;
38 INSERT INTO e SELECT a||'x', b, c FROM r2;
42 source $testdir/malloc_common.tcl
45 do_malloc_test vtab_err-2 -tclprep {
46 register_echo_module [sqlite3_connection_pointer db]
49 CREATE TABLE r(a PRIMARY KEY, b, c);
50 CREATE VIRTUAL TABLE e USING echo(r);
51 INSERT INTO e VALUES(1, 2, 3);
52 INSERT INTO e VALUES('a', 'b', 'c');
54 DELETE FROM e WHERE a = 'a';
57 CREATE TABLE r2(a, b, c);
58 INSERT INTO r2 SELECT * FROM e;
59 INSERT INTO e SELECT a||'x', b, c FROM r2;
63 sqlite3_memdebug_fail -1
66 register_echo_module [sqlite3_connection_pointer db]
67 do_execsql_test vtab_err-3.0 {
68 CREATE TABLE r(a PRIMARY KEY, b, c);
69 CREATE VIRTUAL TABLE e USING echo(r);
71 faultsim_save_and_close
73 do_faultsim_test vtab_err-3 -faults oom-t* -prep {
74 faultsim_restore_and_reopen
75 register_echo_module [sqlite3_connection_pointer db]
84 faultsim_test_result {0 {}}