blob: 2e8fdbb629870809f7d10f4fffec830df9d278a8 [file] [log] [blame]
danielk19772d1a8d22008-05-16 15:40:40 +00001# 2008 May 16
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#
drhe8f52c52008-07-12 14:52:20 +000012# $Id: tkt3121.test,v 1.2 2008/07/12 14:52:21 drh Exp $
danielk19772d1a8d22008-05-16 15:40:40 +000013
14set testdir [file dirname $argv0]
15source $testdir/tester.tcl
16
17ifcapable !vtab {
18 finish_test
19 return
20}
21
22# Register the module
23register_echo_module [sqlite3_connection_pointer db]
24
25do_test vtabD-1.1 {
26 execsql {
27 PRAGMA encoding = 'utf16';
28
29 CREATE TABLE r1(field);
30 CREATE TABLE r2(col PRIMARY KEY, descr);
31
32 INSERT INTO r1 VALUES('abcd');
33 INSERT INTO r2 VALUES('abcd', 'A nice description');
34 INSERT INTO r2 VALUES('efgh', 'Another description');
35
36 CREATE VIRTUAL TABLE t1 USING echo(r1);
37 CREATE VIRTUAL TABLE t2 USING echo(r2);
38 }
39} {}
40
41do_test vtabD-1.2 {
42 execsql {
43 select
44 t1.field as Field,
45 t2.descr as Descr
46 from t1 inner join t2 on t1.field = t2.col order by t1.field
47 }
48} {abcd {A nice description}}
49
50finish_test