~ubuntu-branches/ubuntu/maverick/sqlite3/maverick-updates

« back to all changes in this revision

Viewing changes to test/attach2.test

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2008-10-01 20:16:18 UTC
  • mfrom: (3.1.20 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081001201618-yfvqqj1qs29wdtcc
Tags: 3.5.9-5
Backport fix for distinct on indexes (closes: #500792).

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
# focus of this script is testing the ATTACH and DETACH commands
13
13
# and related functionality.
14
14
#
15
 
# $Id: attach2.test,v 1.35 2006/01/03 00:33:50 drh Exp $
 
15
# $Id: attach2.test,v 1.38 2007/12/13 21:54:11 drh Exp $
16
16
#
17
17
 
18
18
set testdir [file dirname $argv0]
19
19
source $testdir/tester.tcl
20
20
 
 
21
ifcapable !attach {
 
22
  finish_test
 
23
  return
 
24
}
 
25
 
21
26
# Ticket #354
22
27
#
23
28
# Databases test.db and test2.db contain identical schemas.  Make
154
159
proc lock_status {testnum db expected_result} {
155
160
  # If the database was compiled with OMIT_TEMPDB set, then 
156
161
  # the lock_status list will not contain an entry for the temp
157
 
  # db. But the test code doesn't know this, so it's easiest 
 
162
  # db. But the test code doesn't know this, so its easiest 
158
163
  # to filter it out of the $expected_result list here.
159
164
  ifcapable !tempdb {
160
165
    set expected_result [concat \
212
217
lock_status 4.4.1 db {main shared temp closed file2 unlocked}
213
218
lock_status 4.4.2 db2 {main unlocked temp closed file2 unlocked}
214
219
 
 
220
# We have to make sure that the cache_size and the soft_heap_limit
 
221
# are large enough to hold the entire change in memory.  If either
 
222
# is set too small, then changes will spill to the database, forcing
 
223
# a reserved lock to promote to exclusive.  That will mess up our
 
224
# test results. 
 
225
 
 
226
set soft_limit [sqlite3_soft_heap_limit 0]
 
227
 
 
228
 
215
229
do_test attach2-4.5 {
216
230
  # Handle 'db2' reserves file2.
217
231
  execsql {BEGIN} db2
314
328
db close
315
329
db2 close
316
330
file delete -force test2.db
 
331
sqlite3_soft_heap_limit $soft_limit
317
332
 
318
333
# These tests - attach2-5.* - check that the master journal file is deleted
319
334
# correctly when a multi-file transaction is committed or rolled back.