sl@0: # 2006 June 10 sl@0: # sl@0: # The author disclaims copyright to this source code. In place of sl@0: # a legal notice, here is a blessing: sl@0: # sl@0: # May you do good and not evil. sl@0: # May you find forgiveness for yourself and forgive others. sl@0: # May you share freely, never taking more than you give. sl@0: # sl@0: #*********************************************************************** sl@0: # sl@0: # $Id: vtab_err.test,v 1.8 2007/09/03 16:12:10 drh Exp $ sl@0: sl@0: set testdir [file dirname $argv0] sl@0: source $testdir/tester.tcl sl@0: sl@0: ifcapable !vtab { sl@0: finish_test sl@0: return sl@0: } sl@0: sl@0: sl@0: sl@0: unset -nocomplain echo_module_begin_fail sl@0: do_ioerr_test vtab_err-1 -tclprep { sl@0: register_echo_module [sqlite3_connection_pointer db] sl@0: } -sqlbody { sl@0: BEGIN; sl@0: CREATE TABLE r(a PRIMARY KEY, b, c); sl@0: CREATE VIRTUAL TABLE e USING echo(r); sl@0: INSERT INTO e VALUES(1, 2, 3); sl@0: INSERT INTO e VALUES('a', 'b', 'c'); sl@0: UPDATE e SET c = 10; sl@0: DELETE FROM e WHERE a = 'a'; sl@0: COMMIT; sl@0: BEGIN; sl@0: CREATE TABLE r2(a, b, c); sl@0: INSERT INTO r2 SELECT * FROM e; sl@0: INSERT INTO e SELECT a||'x', b, c FROM r2; sl@0: COMMIT; sl@0: } sl@0: sl@0: ifcapable !memdebug { sl@0: puts "Skipping vtab_err-2 tests: not compiled with -DSQLITE_MEMDEBUG..." sl@0: finish_test sl@0: return sl@0: } sl@0: source $testdir/malloc_common.tcl sl@0: sl@0: sl@0: do_malloc_test vtab_err-2 -tclprep { sl@0: register_echo_module [sqlite3_connection_pointer db] sl@0: } -sqlbody { sl@0: BEGIN; sl@0: CREATE TABLE r(a PRIMARY KEY, b, c); sl@0: CREATE VIRTUAL TABLE e USING echo(r); sl@0: INSERT INTO e VALUES(1, 2, 3); sl@0: INSERT INTO e VALUES('a', 'b', 'c'); sl@0: UPDATE e SET c = 10; sl@0: DELETE FROM e WHERE a = 'a'; sl@0: COMMIT; sl@0: BEGIN; sl@0: CREATE TABLE r2(a, b, c); sl@0: INSERT INTO r2 SELECT * FROM e; sl@0: INSERT INTO e SELECT a||'x', b, c FROM r2; sl@0: COMMIT; sl@0: } sl@0: sl@0: sqlite3_memdebug_fail -1 sl@0: sl@0: finish_test