sl@0: # 2006 August 29 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: # This file implements regression tests for SQLite library. The sl@0: # focus of this file inserting into virtual tables from a SELECT sl@0: # statement. sl@0: # sl@0: # $Id: vtab8.test,v 1.2 2007/03/02 08:12:23 danielk1977 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: register_echo_module [sqlite3_connection_pointer db] sl@0: sl@0: # See ticket #2244 sl@0: # sl@0: do_test vtab1.2244-1 { sl@0: execsql { sl@0: CREATE TABLE t2244(a, b); sl@0: CREATE VIRTUAL TABLE t2244e USING echo(t2244); sl@0: INSERT INTO t2244 VALUES('AA', 'BB'); sl@0: INSERT INTO t2244 VALUES('CC', 'DD'); sl@0: SELECT rowid, * FROM t2244e; sl@0: } sl@0: } {1 AA BB 2 CC DD} sl@0: do_test vtab1.2244-2 { sl@0: execsql { sl@0: SELECT * FROM t2244e WHERE rowid = 10; sl@0: } sl@0: } {} sl@0: do_test vtab1.2244-3 { sl@0: execsql { sl@0: UPDATE t2244e SET a = 'hello world' WHERE 0; sl@0: SELECT rowid, * FROM t2244e; sl@0: } sl@0: } {1 AA BB 2 CC DD} sl@0: sl@0: do_test vtab1-2250-2 { sl@0: execsql { sl@0: CREATE TABLE t2250(a, b); sl@0: INSERT INTO t2250 VALUES(10, 20); sl@0: CREATE VIRTUAL TABLE t2250e USING echo(t2250); sl@0: select max(rowid) from t2250; sl@0: select max(rowid) from t2250e; sl@0: } sl@0: } {1 1} sl@0: sl@0: # See ticket #2260. sl@0: # sl@0: do_test vtab1.2260-1 { sl@0: execsql { sl@0: CREATE TABLE t2260a_real(a, b); sl@0: CREATE TABLE t2260b_real(a, b); sl@0: sl@0: CREATE INDEX i2260 ON t2260a_real(a); sl@0: CREATE INDEX i2260x ON t2260b_real(a); sl@0: sl@0: CREATE VIRTUAL TABLE t2260a USING echo(t2260a_real); sl@0: CREATE VIRTUAL TABLE t2260b USING echo(t2260b_real); sl@0: sl@0: SELECT * FROM t2260a, t2260b WHERE t2260a.a = t2260b.a AND t2260a.a > 101; sl@0: } sl@0: } {} sl@0: sl@0: unset -nocomplain echo_module_begin_fail sl@0: finish_test