tkt3121.test 1.2 KB

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