SQLite

Check-in [20d8ea45af]
Login

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

Overview
Comment:Add another test to incrblob2.test. This test failed to reveal any new bugs. (CVS 5214)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 20d8ea45afcddf22632c3de984147826d0616d3f
User & Date: danielk1977 2008-06-12 14:42:07.000
Context
2008-06-12
16:35
Convert the date/time functions to work with milliseconds since the julian epoch internally (instead of days since the epoch) in order to avoid problems with floating-point roundoff error. The interface is unchanged. (CVS 5215) (check-in: ed35f8a983 user: drh tags: trunk)
14:42
Add another test to incrblob2.test. This test failed to reveal any new bugs. (CVS 5214) (check-in: 20d8ea45af user: danielk1977 tags: trunk)
13:50
Avoid unnecessary float->text->float conversions in date/time processing. This change necessary to reproduce the problem reported by BareFoot. (CVS 5213) (check-in: 6ec4d7653b user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/incrblob2.test.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#    May you share freely, never taking more than you give.
#
#***********************************************************************
#
# Test that it is possible to have two open blob handles on a single
# blob object.
#
# $Id: incrblob2.test,v 1.2 2008/06/10 17:30:26 danielk1977 Exp $
#

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

ifcapable {!autovacuum || !pragma || !incrblob} {
  finish_test







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#    May you share freely, never taking more than you give.
#
#***********************************************************************
#
# Test that it is possible to have two open blob handles on a single
# blob object.
#
# $Id: incrblob2.test,v 1.3 2008/06/12 14:42:07 danielk1977 Exp $
#

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

ifcapable {!autovacuum || !pragma || !incrblob} {
  finish_test
282
283
284
285
286
287
288
289





































290
291
    catchsql { INSERT INTO t1 VALUES(3, 'klmno') } db2
  } {0 {}}

  db2 close
  db close
  sqlite3_enable_shared_cache $::enable_shared_cache
}






































finish_test









>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
    catchsql { INSERT INTO t1 VALUES(3, 'klmno') } db2
  } {0 {}}

  db2 close
  db close
  sqlite3_enable_shared_cache $::enable_shared_cache
}

#--------------------------------------------------------------------------
# The following tests - incrblob2-6.* - test a specific scenario that might
# be causing an error.
#
sqlite3 db test.db
do_test incrblob2-6.1 {
  execsql {
    DELETE FROM t1;
    INSERT INTO t1 VALUES(1, zeroblob(100));
  }
  
  set rdHandle [db incrblob -readonly t1 data 1]
  set wrHandle [db incrblob t1 data 1]

  sqlite3_blob_read $rdHandle 0 100

  sqlite3_blob_write $wrHandle 0 ABCDEF
  close $wrHandle
  close $rdHandle
} {}

do_test incrblob2-6.2 {
  set rdHandle [db incrblob -readonly t1 data 1]
  sqlite3_blob_read $rdHandle 0 2
} {AB}

do_test incrblob2-6.3 {
  set wrHandle [db incrblob t1 data 1]
  sqlite3_blob_write $wrHandle 0 ZZZZZZZZZZ
  sqlite3_blob_read $rdHandle 2 4
} {ZZZZ}

do_test incrblob2-6.4 {
  close $wrHandle
  close $rdHandle
} {}

finish_test