SQLite

Check-in [7d55ec374d]
Login

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

Overview
Comment:Fix a recently introduced test script bug causing rollback.test to throw an exception when run using the "onefile" variation. (CVS 5778)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7d55ec374d62c6d3d588949b96e194920083fe4e
User & Date: danielk1977 2008-10-07 15:00:09.000
Context
2008-10-07
15:25
Remove the SQLITE_MUTEX_APPDEF compile-time option. The SQLITE_THREADSAFE=0 option always removes all mutex code. For application-defined mutexes only, use SQLITE_THREADSAFE=1 with SQLITE_MUTEX_NOOP=1. Ticket #3421. (CVS 5779) (check-in: 02a12eb1cf user: drh tags: trunk)
15:00
Fix a recently introduced test script bug causing rollback.test to throw an exception when run using the "onefile" variation. (CVS 5778) (check-in: 7d55ec374d user: danielk1977 tags: trunk)
14:06
Have sqlite3_bind_value() call sqlite3ApiExit() before returning. Otherwise the db->mallocFailed flag may not be cleared. (CVS 5777) (check-in: 6b7c8d5640 user: danielk1977 tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/permutations.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 2008 June 21
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
#
# $Id: permutations.test,v 1.32 2008/09/29 14:27:41 danielk1977 Exp $

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

# Argument processing.
#
#puts "PERM-DEBUG: argv=$argv"











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 2008 June 21
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
#
# $Id: permutations.test,v 1.33 2008/10/07 15:00:09 danielk1977 Exp $

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

# Argument processing.
#
#puts "PERM-DEBUG: argv=$argv"
147
148
149
150
151
152
153

154
155
156
157
158
159
160
      }
    } else {
      # puts "skipping file $file"
    }
  }

  uplevel $options(-shutdown)

}

proc shared_cache_setting {} {
  set ret 0
  catch {
    set ret [sqlite3_enable_shared_cache]
  }







>







147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
      }
    } else {
      # puts "skipping file $file"
    }
  }

  uplevel $options(-shutdown)
  set ::permutations_test_prefix ""
}

proc shared_cache_setting {} {
  set ret 0
  catch {
    set ret [sqlite3_enable_shared_cache]
  }
Changes to test/rollback.test.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is verifying that a rollback in one statement
# caused by an ON CONFLICT ROLLBACK clause aborts any other pending
# statements.
#
# $Id: rollback.test,v 1.7 2008/10/07 11:51:20 danielk1977 Exp $

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

set DB [sqlite3_connection_pointer db]

do_test rollback-1.1 {







|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is verifying that a rollback in one statement
# caused by an ON CONFLICT ROLLBACK clause aborts any other pending
# statements.
#
# $Id: rollback.test,v 1.8 2008/10/07 15:00:09 danielk1977 Exp $

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

set DB [sqlite3_connection_pointer db]

do_test rollback-1.1 {
75
76
77
78
79
80
81


82
83
84
85
86
87
88
89
do_test rollback-1.8 {
  sqlite3_step $STMT
} {SQLITE_ROW}
do_test rollback-1.9 {
  sqlite3_finalize $STMT
} {SQLITE_OK}



if {$tcl_platform(platform) == "unix"} {
  do_test rollback-2.1 {
    execsql {
      BEGIN;
      INSERT INTO t3 VALUES('hello world');
    }
    file copy -force test.db testA.db
    file copy -force test.db-journal testA.db-journal







>
>
|







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
do_test rollback-1.8 {
  sqlite3_step $STMT
} {SQLITE_ROW}
do_test rollback-1.9 {
  sqlite3_finalize $STMT
} {SQLITE_OK}

set permutation ""
catch {set permutation $::permutations_test_prefix}
if {$tcl_platform(platform) == "unix" && $permutation ne "onefile"} {
  do_test rollback-2.1 {
    execsql {
      BEGIN;
      INSERT INTO t3 VALUES('hello world');
    }
    file copy -force test.db testA.db
    file copy -force test.db-journal testA.db-journal
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
  # 
  do_test rollback-2.2 {
    sqlite3 db2 testA.db
    execsql {
      SELECT distinct tbl_name FROM sqlite_master;
    } db2
  } {t1 t3}

  do_test rollback-2.3 {
    file exists testA.db-journal
  } 0

  do_test rollback-2.4 {
    execsql {
      SELECT distinct tbl_name FROM sqlite_master;
    } db2
  } {t1 t3}

  db2 close
}

finish_test







<



<










121
122
123
124
125
126
127

128
129
130

131
132
133
134
135
136
137
138
139
140
  # 
  do_test rollback-2.2 {
    sqlite3 db2 testA.db
    execsql {
      SELECT distinct tbl_name FROM sqlite_master;
    } db2
  } {t1 t3}

  do_test rollback-2.3 {
    file exists testA.db-journal
  } 0

  do_test rollback-2.4 {
    execsql {
      SELECT distinct tbl_name FROM sqlite_master;
    } db2
  } {t1 t3}

  db2 close
}

finish_test