SQLite

Check-in [3d7a8de248]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a bug in the previous commit - use SQL comments instead of Tcl comments in SQL blocks. (CVS 6155)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3d7a8de248ad5fba0e9c88f439cd2d988dcbab8c
User & Date: danielk1977 2009-01-10 11:13:40.000
Context
2009-01-10
13:24
Remove some unused code from expr.c in order to increase test coverage. (CVS 6156) (check-in: 2cbea64fb0 user: drh tags: trunk)
11:13
Fix a bug in the previous commit - use SQL comments instead of Tcl comments in SQL blocks. (CVS 6155) (check-in: 3d7a8de248 user: danielk1977 tags: trunk)
11:10
Add a malloc failure test case that covers a few previously untested lines in pager.c (CVS 6154) (check-in: 000aedb047 user: danielk1977 tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/malloc.test.
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# This file attempts to check the behavior of the SQLite library in 
# an out-of-memory situation. When compiled with -DSQLITE_DEBUG=1, 
# the SQLite library accepts a special command (sqlite3_memdebug_fail N C)
# which causes the N-th malloc to fail.  This special feature is used
# to see what happens in the library if a malloc were to really fail
# due to an out-of-memory situation.
#
# $Id: malloc.test,v 1.71 2009/01/10 11:10:19 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl


# Only run these tests if memory debugging is turned on.
#







|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# This file attempts to check the behavior of the SQLite library in 
# an out-of-memory situation. When compiled with -DSQLITE_DEBUG=1, 
# the SQLite library accepts a special command (sqlite3_memdebug_fail N C)
# which causes the N-th malloc to fail.  This special feature is used
# to see what happens in the library if a malloc were to really fail
# due to an out-of-memory situation.
#
# $Id: malloc.test,v 1.72 2009/01/10 11:13:40 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl


# Only run these tests if memory debugging is turned on.
#
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
  #
  db eval {
    BEGIN;
      DELETE FROM t1;
    ROLLBACK;
  }
} -sqlbody {
  # This statement requires the 'no-content' pages loaded by the DELETE
  # statement above. When requesting the pages, the content is loaded
  # from the database file. The point of this test case is to test handling
  # of malloc errors (including SQLITE_IOERR_NOMEM errors) when loading
  # the content.
  SELECT * FROM t1 ORDER BY x;
}


# Ensure that no file descriptors were leaked.
do_test malloc-99.X {
  catch {db close}
  set sqlite_open_file_count
} {0}

puts open-file-count=$sqlite_open_file_count
finish_test







|
|
|
|
|












696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
  #
  db eval {
    BEGIN;
      DELETE FROM t1;
    ROLLBACK;
  }
} -sqlbody {
  -- This statement requires the 'no-content' pages loaded by the DELETE
  -- statement above. When requesting the pages, the content is loaded
  -- from the database file. The point of this test case is to test handling
  -- of malloc errors (including SQLITE_IOERR_NOMEM errors) when loading
  -- the content.
  SELECT * FROM t1 ORDER BY x;
}


# Ensure that no file descriptors were leaked.
do_test malloc-99.X {
  catch {db close}
  set sqlite_open_file_count
} {0}

puts open-file-count=$sqlite_open_file_count
finish_test