2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A# The author disclaims copyright to this source code. In place of
2N/A# a legal notice, here is a blessing:
2N/A# May you do good and not evil.
2N/A# May you find forgiveness for yourself and forgive others.
2N/A# May you share freely, never taking more than you give.
2N/A#***********************************************************************
2N/A# This file implements regression tests for TCL interface to the
2N/A# The focus of the tests in this file is the following interface:
2N/Aset testdir [file dirname $argv0]
2N/A proc commit_hook {} {
2N/A db commit_hook ::commit_hook
2N/A CREATE TABLE t2(a,b);
2N/A INSERT INTO t2 VALUES(1,2);
2N/A INSERT INTO t2 SELECT a+1, b+1 FROM t2;
2N/A INSERT INTO t2 SELECT a+2, b+2 FROM t2;
2N/A proc commit_hook {} {
2N/A set ::commit_cnt [execsql {SELECT * FROM t2}]
2N/A INSERT INTO t2 VALUES(5,6);
2N/A} {1 2 2 3 3 4 4 5 5 6}
2N/A proc commit_hook {} {
2N/A set ::commit_cnt [execsql {SELECT * FROM t2}]
2N/A INSERT INTO t2 VALUES(6,7);
2N/A} {1 {constraint failed}}
2N/A} {1 2 2 3 3 4 4 5 5 6 6 7}
2N/A execsql {SELECT * FROM t2}
2N/A} {1 2 2 3 3 4 4 5 5 6}