3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
13 # $Id: tkt3424.test,v 1.2 2009/06/05 17:09:12 drh Exp $
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
20 CREATE TABLE names(id INTEGER, data TEXT, code TEXT);
21 INSERT INTO names VALUES(1,'E1','AAA');
22 INSERT INTO names VALUES(2,NULL,'BBB');
24 CREATE TABLE orig(code TEXT, data TEXT);
25 INSERT INTO orig VALUES('AAA','E1');
26 INSERT INTO orig VALUES('AAA','E2');
27 INSERT INTO orig VALUES('AAA','E3');
28 INSERT INTO orig VALUES('AAA','E4');
29 INSERT INTO orig VALUES('AAA','E5');
36 names LEFT OUTER JOIN orig
37 ON names.data = orig.data AND names.code = orig.code;
39 } {1 E1 AAA AAA E1 2 {} BBB {} {}}
42 execsql { CREATE INDEX udx_orig_code_data ON orig(code, data) }
48 names LEFT OUTER JOIN orig
49 ON names.data = orig.data AND names.code = orig.code;
51 } {1 E1 AAA AAA E1 2 {} BBB {} {}}