1
0

tkt-91e2e8ba6f.test 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # 2011 June 23
  2. #
  3. # May you do good and not evil.
  4. # May you find forgiveness for yourself and forgive others.
  5. # May you share freely, never taking more than you give.
  6. #
  7. #***********************************************************************
  8. #
  9. # This file contains tests for SQLite. Specifically, it tests that SQLite
  10. # does not crash and an error is returned if localhost() fails. This
  11. # is the problem reported by ticket 91e2e8ba6f.
  12. #
  13. set testdir [file dirname $argv0]
  14. source $testdir/tester.tcl
  15. set testprefix tkt-91e2e8ba6f
  16. do_execsql_test 1.1 {
  17. CREATE TABLE t1(x INTEGER, y REAL);
  18. INSERT INTO t1 VALUES(11, 11);
  19. } {}
  20. do_execsql_test 1.2 {
  21. SELECT x/10, y/10 FROM t1;
  22. } {1 1.1}
  23. do_execsql_test 1.3 {
  24. SELECT x/10, y/10 FROM (SELECT * FROM t1);
  25. } {1 1.1}
  26. do_execsql_test 1.4 {
  27. SELECT x/10, y/10 FROM (SELECT * FROM t1 LIMIT 5 OFFSET 0);
  28. } {1 1.1}
  29. do_execsql_test 1.5 {
  30. SELECT x/10, y/10 FROM (SELECT * FROM t1 LIMIT 5 OFFSET 0) LIMIT 5 OFFSET 0;
  31. } {1 1.1}
  32. do_execsql_test 1.6 {
  33. SELECT a.x/10, a.y/10 FROM
  34. (SELECT * FROM t1 LIMIT 5 OFFSET 0) AS a, t1 AS b WHERE a.x = b.x
  35. LIMIT 5 OFFSET 0;
  36. } {1 1.1}
  37. do_execsql_test 1.7 {
  38. CREATE VIEW v1 AS SELECT * FROM t1 LIMIT 5;
  39. SELECT a.x/10, a.y/10 FROM v1 AS a, t1 AS b WHERE a.x = b.x LIMIT 5 OFFSET 0;
  40. } {1 1.1}
  41. finish_test