mallocE.test 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # 2007 Aug 29
  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. # This test script checks that tickets #2784 and #2789 have been fixed.
  13. #
  14. # $Id: mallocE.test,v 1.3 2008/02/18 22:24:58 drh Exp $
  15. set testdir [file dirname $argv0]
  16. source $testdir/tester.tcl
  17. source $testdir/malloc_common.tcl
  18. # Only run these tests if memory debugging is turned on.
  19. #
  20. if {!$MEMDEBUG} {
  21. puts "Skipping mallocE tests: not compiled with -DSQLITE_MEMDEBUG..."
  22. finish_test
  23. return
  24. }
  25. # ticket #2784
  26. #
  27. set PREP {
  28. PRAGMA page_size = 1024;
  29. CREATE TABLE t1(a, b, c);
  30. CREATE TABLE t2(x, y, z);
  31. }
  32. do_malloc_test mallocE-1 -sqlprep $PREP -sqlbody {
  33. SELECT p, q FROM (SELECT a+b AS p, b+c AS q FROM t1, t2 WHERE c>5)
  34. LEFT JOIN t2 ON p=x;
  35. }
  36. # Ticket #2789
  37. #
  38. do_malloc_test mallocE-2 -sqlprep $PREP -sqlbody {
  39. SELECT x, y2 FROM (SELECT a+b AS x, b+c AS y2 FROM t1, t2 WHERE c>5)
  40. LEFT JOIN t2 USING(x) WHERE y2>11;
  41. }
  42. finish_test