SQLite

Check-in [72745bde90]
Login

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

Overview
Comment:Fix a bug in malloc.test causing the exclusive permutation to fail. Changes to test code only. (CVS 6251)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 72745bde90a9b4ffae1496f1668e4bb0678bd400
User & Date: danielk1977 2009-02-04 08:17:57.000
Context
2009-02-04
10:09
Do not attempt to use the sub-journal file descriptor if it is not opened (as in journal_mode=off mode). Ticket #3636. (CVS 6252) (check-in: 20bd760554 user: danielk1977 tags: trunk)
08:17
Fix a bug in malloc.test causing the exclusive permutation to fail. Changes to test code only. (CVS 6251) (check-in: 72745bde90 user: danielk1977 tags: trunk)
03:59
Changes to completely remove all floating point ops if SQLITE_OMIT_FLOATING_POINT defined. Note that w/o fp, date/time, round, nan, etc. are all gone or limited in functionality. Updated some of the test scripts to support missing fp and 64-bit functionality. Ticket #3029. (CVS 6250) (check-in: 5cef400023 user: shane 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.74 2009/01/16 16:40:14 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.75 2009/02/04 08:17:57 danielk1977 Exp $

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


# Only run these tests if memory debugging is turned on.
#
732
733
734
735
736
737
738

739
740
741
742
743
744
745
746
747
748
749
750
751
752



753
754
755
756
757
758
759
# the malloc failure and rollback, the change counter will not
# be updated. This could corrupt another processes cache.
#
do_malloc_test 32 -tclprep {
  # Build a small database containing an indexed table.
  #
  db eval {

    BEGIN;
    CREATE TABLE t1(a PRIMARY KEY, b);
    INSERT INTO t1 VALUES(1, 'one');
    INSERT INTO t1 VALUES(2, 'two');
    INSERT INTO t1 VALUES(3, 'three');
    COMMIT;
    PRAGMA locking_mode = exclusive;
  }

  # Open a second database connection. Load the table (but not index)
  # into the second connections pager cache.
  #
  sqlite3 db2 test.db
  db2 eval { SELECT b FROM t1 }




} -tclbody {
  # Running in exclusive mode, perform a database transaction that 
  # modifies both the database table and index. For iterations where
  # the malloc failure occurs after updating the change counter but
  # before committing the transaction, this should result in the
  # transaction being rolled back but the changeCounterDone flag







>













|
>
>
>







732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
# the malloc failure and rollback, the change counter will not
# be updated. This could corrupt another processes cache.
#
do_malloc_test 32 -tclprep {
  # Build a small database containing an indexed table.
  #
  db eval {
    PRAGMA locking_mode = normal;
    BEGIN;
    CREATE TABLE t1(a PRIMARY KEY, b);
    INSERT INTO t1 VALUES(1, 'one');
    INSERT INTO t1 VALUES(2, 'two');
    INSERT INTO t1 VALUES(3, 'three');
    COMMIT;
    PRAGMA locking_mode = exclusive;
  }

  # Open a second database connection. Load the table (but not index)
  # into the second connections pager cache.
  #
  sqlite3 db2 test.db
  db2 eval { 
    PRAGMA locking_mode = normal;
    SELECT b FROM t1;
  }

} -tclbody {
  # Running in exclusive mode, perform a database transaction that 
  # modifies both the database table and index. For iterations where
  # the malloc failure occurs after updating the change counter but
  # before committing the transaction, this should result in the
  # transaction being rolled back but the changeCounterDone flag