/ Check-in [a60afd04]
Login

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

Overview
Comment:Tests in lock.test no conform to the new locking scheme. (CVS 1557)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a60afd04c5296020e5e72c4d35063fd1e6f90e9e
User & Date: drh 2004-06-10 01:08:06
Context
2004-06-10
01:30
Add the vdbe_listing and sql_trace pragmas used for debugging. (CVS 1558) check-in: 28c3cc08 user: drh tags: trunk
01:08
Tests in lock.test no conform to the new locking scheme. (CVS 1557) check-in: a60afd04 user: drh tags: trunk
00:51
Fix a buffer overrun in the atomic multifile commit logic of the pager. (CVS 1556) check-in: 3b78ffe0 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/trans.test.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
89
90
91
92
93
94
95
96
97
98
99
100
101
102

103
104
105
106

107
108

109
110
111

112
113
114

115
116
117
118

119
120

121
122
123
124

125
126

127
128
129

130
131
132

133
134
135
136

137
138

139
140
141
142

143
144
145
146
147
148
149
...
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193

194
195
196
197

198
199

200
201
202
203

204
205

206
207
208
209
210
211
212

213
214
215
216

217
218

219
220
221
222

223
224
225
226
227
228
229
#    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 database locks.
#
# $Id: trans.test,v 1.21 2004/06/09 19:03:55 drh Exp $


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


# Create several tables to work with.
................................................................................
  execsql {
    BEGIN;
    UPDATE one SET a = 0 WHERE 0;
    SELECT a FROM one ORDER BY a;
  }
} {1 2 3}
do_test trans-3.2 {
  set v [catch {execsql {
    SELECT a FROM two ORDER BY a;
  } altdb} msg]
  lappend v $msg
} {1 {database is locked}}
do_test trans-3.3 {
  set v [catch {execsql {

    SELECT a FROM one ORDER BY a;
  } altdb} msg]
  lappend v $msg
} {1 {database is locked}}

do_test trans-3.4 {
  set v [catch {execsql {

    INSERT INTO one VALUES(4,'four');
  }} msg]
  lappend v $msg

} {0 {}}
do_test trans-3.5 {
  set v [catch {execsql {

    SELECT a FROM two ORDER BY a;
  } altdb} msg]
  lappend v $msg
} {1 {database is locked}}

do_test trans-3.6 {
  set v [catch {execsql {

    SELECT a FROM one ORDER BY a;
  } altdb} msg]
  lappend v $msg
} {1 {database is locked}}

do_test trans-3.7 {
  set v [catch {execsql {

    INSERT INTO two VALUES(4,'IV');
  }} msg]
  lappend v $msg

} {0 {}}
do_test trans-3.8 {
  set v [catch {execsql {

    SELECT a FROM two ORDER BY a;
  } altdb} msg]
  lappend v $msg
} {1 {database is locked}}

do_test trans-3.9 {
  set v [catch {execsql {

    SELECT a FROM one ORDER BY a;
  } altdb} msg]
  lappend v $msg
} {1 {database is locked}}

do_test trans-3.10 {
  execsql {END TRANSACTION}
} {}
do_test trans-3.11 {
  set v [catch {execsql {
    SELECT a FROM two ORDER BY a;
  } altdb} msg]
................................................................................
do_test trans-4.2 {
  set v [catch {execsql {
    ROLLBACK;
  } db} msg]
  lappend v $msg
} {1 {cannot rollback - no transaction is active}}
do_test trans-4.3 {
  set v [catch {execsql {
    BEGIN TRANSACTION;
    UPDATE two SET a = 0 WHERE 0;
    SELECT a FROM two ORDER BY a;
  } db} msg]
  lappend v $msg
} {0 {1 4 5 10}}
do_test trans-4.4 {
  set v [catch {execsql {

    SELECT a FROM two ORDER BY a;
  } altdb} msg]
  lappend v $msg
} {1 {database is locked}}

do_test trans-4.5 {
  set v [catch {execsql {

    SELECT a FROM one ORDER BY a;
  } altdb} msg]
  lappend v $msg
} {1 {database is locked}}

do_test trans-4.6 {
  set v [catch {execsql {

    BEGIN TRANSACTION;
    SELECT a FROM one ORDER BY a;
  } db} msg]
  lappend v $msg
} {1 {cannot start a transaction within a transaction}}
do_test trans-4.7 {
  set v [catch {execsql {

    SELECT a FROM two ORDER BY a;
  } altdb} msg]
  lappend v $msg
} {1 {database is locked}}

do_test trans-4.8 {
  set v [catch {execsql {

    SELECT a FROM one ORDER BY a;
  } altdb} msg]
  lappend v $msg
} {1 {database is locked}}

do_test trans-4.9 {
  set v [catch {execsql {
    END TRANSACTION;
    SELECT a FROM two ORDER BY a;
  } db} msg]
  lappend v $msg
} {0 {1 4 5 10}}







|







 







|

|
|
<

<
>

|
<
<
>

<
>

<
<
>


<
>

|
<
<
>

<
>

|
<
<
>

<
>

<
<
>


<
>

|
<
<
>

<
>

|
<
<
>







 







|



|
<


<
>

|
<
<
>

<
>

|
<
<
>

<
>


|
<


<
>

|
<
<
>

<
>

|
<
<
>







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
89
90
91
92
93
94
95
96
97
98
99

100

101
102
103


104
105

106
107


108
109
110

111
112
113


114
115

116
117
118


119
120

121
122


123
124
125

126
127
128


129
130

131
132
133


134
135
136
137
138
139
140
141
...
170
171
172
173
174
175
176
177
178
179
180
181

182
183

184
185
186


187
188

189
190
191


192
193

194
195
196
197

198
199

200
201
202


203
204

205
206
207


208
209
210
211
212
213
214
215
#    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 database locks.
#
# $Id: trans.test,v 1.22 2004/06/10 01:08:06 drh Exp $


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


# Create several tables to work with.
................................................................................
  execsql {
    BEGIN;
    UPDATE one SET a = 0 WHERE 0;
    SELECT a FROM one ORDER BY a;
  }
} {1 2 3}
do_test trans-3.2 {
  catchsql {
    SELECT a FROM two ORDER BY a;
  } altdb
} {0 {1 5 10}}

do_test trans-3.3 {

  catchsql {
    SELECT a FROM one ORDER BY a;
  } altdb


} {0 {1 2 3}}
do_test trans-3.4 {

  catchsql {
    INSERT INTO one VALUES(4,'four');


  }
} {0 {}}
do_test trans-3.5 {

  catchsql {
    SELECT a FROM two ORDER BY a;
  } altdb


} {0 {1 5 10}}
do_test trans-3.6 {

  catchsql {
    SELECT a FROM one ORDER BY a;
  } altdb


} {0 {1 2 3}}
do_test trans-3.7 {

  catchsql {
    INSERT INTO two VALUES(4,'IV');


  }
} {0 {}}
do_test trans-3.8 {

  catchsql {
    SELECT a FROM two ORDER BY a;
  } altdb


} {0 {1 5 10}}
do_test trans-3.9 {

  catchsql {
    SELECT a FROM one ORDER BY a;
  } altdb


} {0 {1 2 3}}
do_test trans-3.10 {
  execsql {END TRANSACTION}
} {}
do_test trans-3.11 {
  set v [catch {execsql {
    SELECT a FROM two ORDER BY a;
  } altdb} msg]
................................................................................
do_test trans-4.2 {
  set v [catch {execsql {
    ROLLBACK;
  } db} msg]
  lappend v $msg
} {1 {cannot rollback - no transaction is active}}
do_test trans-4.3 {
  catchsql {
    BEGIN TRANSACTION;
    UPDATE two SET a = 0 WHERE 0;
    SELECT a FROM two ORDER BY a;
  } db

} {0 {1 4 5 10}}
do_test trans-4.4 {

  catchsql {
    SELECT a FROM two ORDER BY a;
  } altdb


} {0 {1 4 5 10}}
do_test trans-4.5 {

  catchsql {
    SELECT a FROM one ORDER BY a;
  } altdb


} {0 {1 2 3 4}}
do_test trans-4.6 {

  catchsql {
    BEGIN TRANSACTION;
    SELECT a FROM one ORDER BY a;
  } db

} {1 {cannot start a transaction within a transaction}}
do_test trans-4.7 {

  catchsql {
    SELECT a FROM two ORDER BY a;
  } altdb


} {0 {1 4 5 10}}
do_test trans-4.8 {

  catchsql {
    SELECT a FROM one ORDER BY a;
  } altdb


} {0 {1 2 3 4}}
do_test trans-4.9 {
  set v [catch {execsql {
    END TRANSACTION;
    SELECT a FROM two ORDER BY a;
  } db} msg]
  lappend v $msg
} {0 {1 4 5 10}}