PageRenderTime 51ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/src/sqlite/test/tkt3424.test

#
Unknown | 53 lines | 46 code | 7 blank | 0 comment | 0 complexity | b85594ba7479d50e7a8d7ce285e04590 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. # 2008 October 06
  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. #
  13. # $Id: tkt3424.test,v 1.2 2009/06/05 17:09:12 drh Exp $
  14. set testdir [file dirname $argv0]
  15. source $testdir/tester.tcl
  16. do_test tkt3424-1.1 {
  17. execsql {
  18. CREATE TABLE names(id INTEGER, data TEXT, code TEXT);
  19. INSERT INTO names VALUES(1,'E1','AAA');
  20. INSERT INTO names VALUES(2,NULL,'BBB');
  21. CREATE TABLE orig(code TEXT, data TEXT);
  22. INSERT INTO orig VALUES('AAA','E1');
  23. INSERT INTO orig VALUES('AAA','E2');
  24. INSERT INTO orig VALUES('AAA','E3');
  25. INSERT INTO orig VALUES('AAA','E4');
  26. INSERT INTO orig VALUES('AAA','E5');
  27. }
  28. } {}
  29. do_test tkt3424-1.2 {
  30. execsql {
  31. SELECT * FROM
  32. names LEFT OUTER JOIN orig
  33. ON names.data = orig.data AND names.code = orig.code;
  34. }
  35. } {1 E1 AAA AAA E1 2 {} BBB {} {}}
  36. do_test tkt3424-1.3 {
  37. execsql { CREATE INDEX udx_orig_code_data ON orig(code, data) }
  38. } {}
  39. do_test tkt3424-1.4 {
  40. execsql {
  41. SELECT * FROM
  42. names LEFT OUTER JOIN orig
  43. ON names.data = orig.data AND names.code = orig.code;
  44. }
  45. } {1 E1 AAA AAA E1 2 {} BBB {} {}}
  46. finish_test