os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/vtab8.test
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/vtab8.test	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,78 @@
     1.4 +# 2006 August 29
     1.5 +#
     1.6 +# The author disclaims copyright to this source code.  In place of
     1.7 +# a legal notice, here is a blessing:
     1.8 +#
     1.9 +#    May you do good and not evil.
    1.10 +#    May you find forgiveness for yourself and forgive others.
    1.11 +#    May you share freely, never taking more than you give.
    1.12 +#
    1.13 +#***********************************************************************
    1.14 +# This file implements regression tests for SQLite library.  The
    1.15 +# focus of this file inserting into virtual tables from a SELECT
    1.16 +# statement.
    1.17 +#
    1.18 +# $Id: vtab8.test,v 1.2 2007/03/02 08:12:23 danielk1977 Exp $
    1.19 +
    1.20 +set testdir [file dirname $argv0]
    1.21 +source $testdir/tester.tcl
    1.22 +
    1.23 +ifcapable !vtab {
    1.24 +  finish_test
    1.25 +  return
    1.26 +}
    1.27 +
    1.28 +register_echo_module [sqlite3_connection_pointer db]
    1.29 +
    1.30 +# See ticket #2244
    1.31 +#
    1.32 +do_test vtab1.2244-1 {
    1.33 +  execsql {
    1.34 +    CREATE TABLE t2244(a, b);
    1.35 +    CREATE VIRTUAL TABLE t2244e USING echo(t2244);
    1.36 +    INSERT INTO t2244 VALUES('AA', 'BB');
    1.37 +    INSERT INTO t2244 VALUES('CC', 'DD');
    1.38 +    SELECT rowid, * FROM t2244e;
    1.39 +  }
    1.40 +} {1 AA BB 2 CC DD}
    1.41 +do_test vtab1.2244-2 {
    1.42 +  execsql {
    1.43 +    SELECT * FROM t2244e WHERE rowid = 10;
    1.44 +  }
    1.45 +} {}
    1.46 +do_test vtab1.2244-3 {
    1.47 +  execsql {
    1.48 +    UPDATE t2244e SET a = 'hello world' WHERE 0;
    1.49 +    SELECT rowid, * FROM t2244e;
    1.50 +  }
    1.51 +} {1 AA BB 2 CC DD}
    1.52 +
    1.53 +do_test vtab1-2250-2 {
    1.54 +  execsql {
    1.55 +    CREATE TABLE t2250(a, b);
    1.56 +    INSERT INTO t2250 VALUES(10, 20);
    1.57 +    CREATE VIRTUAL TABLE t2250e USING echo(t2250);
    1.58 +    select max(rowid) from t2250;
    1.59 +    select max(rowid) from t2250e;
    1.60 +  }
    1.61 +} {1 1}
    1.62 +
    1.63 +# See ticket #2260.
    1.64 +#
    1.65 +do_test vtab1.2260-1 {
    1.66 +  execsql {
    1.67 +    CREATE TABLE t2260a_real(a, b);
    1.68 +    CREATE TABLE t2260b_real(a, b);
    1.69 +
    1.70 +    CREATE INDEX i2260 ON t2260a_real(a);
    1.71 +    CREATE INDEX i2260x ON t2260b_real(a);
    1.72 +
    1.73 +    CREATE VIRTUAL TABLE t2260a USING echo(t2260a_real);
    1.74 +    CREATE VIRTUAL TABLE t2260b USING echo(t2260b_real);
    1.75 +
    1.76 +    SELECT * FROM t2260a, t2260b WHERE t2260a.a = t2260b.a AND t2260a.a > 101;
    1.77 +  }
    1.78 +} {}
    1.79 +
    1.80 +unset -nocomplain echo_module_begin_fail
    1.81 +finish_test