1
0

mallocF.test 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 #2794, #2795, #2796, and #2797
  13. # have been fixed.
  14. #
  15. # $Id: mallocF.test,v 1.4 2008/02/18 22:24:58 drh Exp $
  16. set testdir [file dirname $argv0]
  17. source $testdir/tester.tcl
  18. source $testdir/malloc_common.tcl
  19. # Only run these tests if memory debugging is turned on.
  20. #
  21. if {!$MEMDEBUG} {
  22. puts "Skipping mallocF tests: not compiled with -DSQLITE_MEMDEBUG..."
  23. finish_test
  24. return
  25. }
  26. # tickets #2794 and #2795 and #2797
  27. #
  28. set PREP {
  29. CREATE TABLE t1(x,y);
  30. INSERT INTO t1 VALUES('abc123', 5);
  31. INSERT INTO t1 VALUES('xyz987', 42);
  32. }
  33. do_malloc_test malloeF-1 -sqlprep $PREP -sqlbody {
  34. SELECT * FROM t1 WHERE x GLOB 'abc*'
  35. }
  36. # ticket #2796
  37. #
  38. set PREP {
  39. CREATE TABLE t1(x PRIMARY KEY,y UNIQUE);
  40. INSERT INTO t1 VALUES('abc123', 5);
  41. INSERT INTO t1 VALUES('xyz987', 42);
  42. }
  43. do_malloc_test malloeF-2 -sqlprep $PREP -sqlbody {
  44. SELECT x FROM t1
  45. WHERE y=1 OR y=2 OR y=3 OR y=4 OR y=5
  46. OR y=6 OR y=7 OR y=8 OR y=9 OR y=10
  47. OR y=11 OR y=12 OR y=13 OR y=14 OR y=15
  48. OR y=x
  49. }
  50. set PREP {
  51. CREATE TABLE t1(x PRIMARY KEY,y UNIQUE);
  52. INSERT INTO t1 VALUES('abc123', 5);
  53. INSERT INTO t1 VALUES('xyz987', 42);
  54. }
  55. do_malloc_test malloeF-3 -sqlprep $PREP -sqlbody {
  56. SELECT x FROM t1 WHERE y BETWEEN 10 AND 29
  57. }
  58. # Ticket #2843
  59. #
  60. set PREP {
  61. CREATE TABLE t1(x);
  62. CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
  63. SELECT 'hello';
  64. END;
  65. }
  66. do_malloc_test mallocF-4 -sqlprep $PREP -sqlbody {
  67. INSERT INTO t1 VALUES(random());
  68. }
  69. finish_test