SQLite

Check-in [d6aacc5dc7]
Login

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

Overview
Comment:Make sure the lookaside test script saturates the lookaside buffer even when SQLITE_DEBUG is off. Ticket #3289 (CVS 5560)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d6aacc5dc7c06f97fb5faa3d85a8f2d8ab0dd554
User & Date: drh 2008-08-12 15:48:25.000
Context
2008-08-13
14:07
A partial fix for ticket #3292. This fixes the original problem but there are other similar problems lurking in the code still. (CVS 5561) (check-in: 055f173ab1 user: drh tags: trunk)
2008-08-12
15:48
Make sure the lookaside test script saturates the lookaside buffer even when SQLITE_DEBUG is off. Ticket #3289 (CVS 5560) (check-in: d6aacc5dc7 user: drh tags: trunk)
15:21
Revise the initialization and shutdown logic so that it no longer keeps a recursive mutex allocated for the whole interval but instead releases the mutex as soon as possible. Do not reset status values upon initialization. (CVS 5559) (check-in: 697fe7a316 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/lookaside.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 2008 August 01
#
# 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.
#
#***********************************************************************
#
# Tests for the lookaside memory allocator.
#
# $Id: lookaside.test,v 1.4 2008/08/05 17:53:24 drh Exp $

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

catch {db close}
sqlite3_shutdown
sqlite3_config_pagecache 0 0













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 2008 August 01
#
# 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.
#
#***********************************************************************
#
# Tests for the lookaside memory allocator.
#
# $Id: lookaside.test,v 1.5 2008/08/12 15:48:25 drh Exp $

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

catch {db close}
sqlite3_shutdown
sqlite3_config_pagecache 0 0
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
do_test lookaside-1.2 {
  sqlite3_db_config_lookaside db 1 20 20
} {0}
do_test lookaside-1.3 {
  sqlite3_db_status db SQLITE_DBSTATUS_LOOKASIDE_USED 0
} {0 0 0}
do_test lookaside-1.4 {
  db eval {CREATE TABLE t1(x);}
  foreach {x y z} [sqlite3_db_status db SQLITE_DBSTATUS_LOOKASIDE_USED 0] break
  expr {$x==0 && $y<$z && $z==20}
} {1}
do_test lookaside-1.5 {
  foreach {x y z} [sqlite3_db_status db SQLITE_DBSTATUS_LOOKASIDE_USED 1] break
  expr {$x==0 && $y<$z && $z==20}
} {1}







|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
do_test lookaside-1.2 {
  sqlite3_db_config_lookaside db 1 20 20
} {0}
do_test lookaside-1.3 {
  sqlite3_db_status db SQLITE_DBSTATUS_LOOKASIDE_USED 0
} {0 0 0}
do_test lookaside-1.4 {
  db eval {CREATE TABLE t1(w,x,y,z);}
  foreach {x y z} [sqlite3_db_status db SQLITE_DBSTATUS_LOOKASIDE_USED 0] break
  expr {$x==0 && $y<$z && $z==20}
} {1}
do_test lookaside-1.5 {
  foreach {x y z} [sqlite3_db_status db SQLITE_DBSTATUS_LOOKASIDE_USED 1] break
  expr {$x==0 && $y<$z && $z==20}
} {1}