sl@0: # 2008 May 16 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: tkt3121.test,v 1.2 2008/07/12 14:52:21 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: # Register the module sl@0: register_echo_module [sqlite3_connection_pointer db] sl@0: sl@0: do_test vtabD-1.1 { sl@0: execsql { sl@0: PRAGMA encoding = 'utf16'; sl@0: sl@0: CREATE TABLE r1(field); sl@0: CREATE TABLE r2(col PRIMARY KEY, descr); sl@0: sl@0: INSERT INTO r1 VALUES('abcd'); sl@0: INSERT INTO r2 VALUES('abcd', 'A nice description'); sl@0: INSERT INTO r2 VALUES('efgh', 'Another description'); sl@0: sl@0: CREATE VIRTUAL TABLE t1 USING echo(r1); sl@0: CREATE VIRTUAL TABLE t2 USING echo(r2); sl@0: } sl@0: } {} sl@0: sl@0: do_test vtabD-1.2 { sl@0: execsql { sl@0: select sl@0: t1.field as Field, sl@0: t2.descr as Descr sl@0: from t1 inner join t2 on t1.field = t2.col order by t1.field sl@0: } sl@0: } {abcd {A nice description}} sl@0: sl@0: finish_test