SQLite

Check-in [e4c8b1c3aa]
Login

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

Overview
Comment:Add more tests of the sqlite_interrupt() logic - looking for a reported memory leak. (Didn't find it.) (CVS 1246)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e4c8b1c3aa9d288f518c6394187354e6fa18978e
User & Date: drh 2004-02-18 01:31:54.000
Context
2004-02-18
16:56
Begin updating the architecture description to better describe how things are currently put together. (CVS 1247) (check-in: 062ecc1368 user: drh tags: trunk)
01:31
Add more tests of the sqlite_interrupt() logic - looking for a reported memory leak. (Didn't find it.) (CVS 1246) (check-in: e4c8b1c3aa user: drh tags: trunk)
2004-02-17
18:26
Avoid line endings munging by Cygwin; ticket #370 (CVS 1245) (check-in: 50e67948f8 user: dougcurrie tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/interrupt.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 2004 Feb 8
#
# 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.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this script is the sqlite_interrupt() API.
#
# $Id: interrupt.test,v 1.2 2004/02/12 15:31:22 drh Exp $


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

# Compute a checksum on the entire database.
#













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 2004 Feb 8
#
# 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.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this script is the sqlite_interrupt() API.
#
# $Id: interrupt.test,v 1.3 2004/02/18 01:31:54 drh Exp $


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

# Compute a checksum on the entire database.
#
136
137
138
139
140
141
142
143




























144
  do_test interrupt-3.$i.5 {
    catchsql {SELECT name FROM sqlite_temp_master};
    execsql {
      SELECT name FROM sqlite_temp_master;
    }
  } {}
}





























finish_test








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

136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
  do_test interrupt-3.$i.5 {
    catchsql {SELECT name FROM sqlite_temp_master};
    execsql {
      SELECT name FROM sqlite_temp_master;
    }
  } {}
}

# There are reports of a memory leak if an interrupt occurs during
# the beginning of a complex query - before the first callback.  We
# will try to reproduce it here:
#
execsql {
  UPDATE t1 SET b=round((100-rowid)/10);
}
set sql {
  SELECT sum(a.a), max(a.a), min(b.a), a.b 
  FROM t1 AS a, t1 AS b
  WHERE b.rowid=a.b
  GROUP BY 4 ORDER BY 1;
}
set sqlite_interrupt_count 1000000
execsql $sql
set max_count [expr {1000000-$sqlite_interrupt_count}]
for {set i 1} {$i<$max_count-5} {incr i 1} {
  do_test interrupt-4.$i.1 {
    set ::sqlite_interrupt_count $::i
    catchsql {
      SELECT sum(a.a), max(a.a), min(b.a), a.b 
      FROM t1 AS a, t1 AS b
      WHERE b.rowid=a.b
      GROUP BY 4 ORDER BY 1;
    }
  } {1 interrupted}
}

finish_test