xref: /sqlite-3.40.0/test/vtab_err.test (revision a298e90d)
1# 2006 June 10
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# $Id: vtab_err.test,v 1.1 2006/06/22 09:53:50 danielk1977 Exp $
13
14set testdir [file dirname $argv0]
15source $testdir/tester.tcl
16
17ifcapable !vtab {
18  finish_test
19  return
20}
21
22do_ioerr_test vtab_err-1 -tclprep {
23  register_echo_module [sqlite3_connection_pointer db]
24} -sqlbody {
25  BEGIN;
26  CREATE TABLE r(a PRIMARY KEY, b, c);
27  CREATE VIRTUAL TABLE e USING echo(r);
28  INSERT INTO e VALUES(1, 2, 3);
29  INSERT INTO e VALUES('a', 'b', 'c');
30  UPDATE e SET c = 10;
31  DELETE FROM e WHERE a = 'a';
32  COMMIT;
33  BEGIN;
34    CREATE TABLE r2(a, b, c);
35    INSERT INTO r2 SELECT * FROM e;
36    INSERT INTO e SELECT a||'x', b, c FROM r2;
37  COMMIT;
38}
39
40
41finish_test
42
43