SQLite

Check-in [b115856408]
Login

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

Overview
Comment:Add test case to demonstrate a "BEGIN EXCLUSIVE" command returning SQLITE_BUSY_SNAPSHOT.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b115856408b6aa5538be67beb619d7aff0630bea
User & Date: dan 2016-10-25 15:06:11.142
Context
2016-10-26
13:58
Merge the SQLITE_ENABLE_URI_00_ERROR compile-time option. (check-in: 86675ae0ab user: drh tags: trunk)
12:15
Add compile time option SQLITE_ENABLE_URI_00_ERROR. If defined, any "%00" escape found in a URI is treated as an error. (check-in: e8a9bfece2 user: dan tags: uri-00-error)
2016-10-25
15:39
Enhance the "PRAGMA index_info" and "PRAGMA index_xinfo" statements so that they work on WITHOUT ROWID tables and provide information about the underlying index btree that implements the WITHOUT ROWID table. (Leaf check-in: fe49fb0313 user: drh tags: index-info-on-table)
15:06
Add test case to demonstrate a "BEGIN EXCLUSIVE" command returning SQLITE_BUSY_SNAPSHOT. (check-in: b115856408 user: dan tags: trunk)
2016-10-24
01:01
Performance optimization in moveToRoot(). Avoid repeated validity checking of the root page on each call. Once is enough. (check-in: 98795c2dd9 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/wal6.test.
229
230
231
232
233
234
235





























236
237
238

do_test 4.4.1 { 
  catchsql { SELECT * FROM t1 } db2 
} {0 {1 2}}
do_test 4.4.2 { 
  catchsql { SELECT * FROM t2 } db2 
} {1 {database disk image is malformed}}































finish_test







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



229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267

do_test 4.4.1 { 
  catchsql { SELECT * FROM t1 } db2 
} {0 {1 2}}
do_test 4.4.2 { 
  catchsql { SELECT * FROM t2 } db2 
} {1 {database disk image is malformed}}

#-------------------------------------------------------------------------
# Confirm that it is possible to get an SQLITE_BUSY_SNAPSHOT error from
# "BEGIN EXCLUSIVE" if the connection already has an open read-transaction.
#
reset_db
sqlite3 db2 test.db
do_execsql_test 5.1 {
  PRAGMA journal_mode = wal;
  CREATE TABLE t1(x, y);
  INSERT INTO t1 VALUES(1, 2);
  INSERT INTO t1 VALUES(3, 4);
} {wal}
do_test 5.2 {
  set res [list]
  db eval {
    SELECT * FROM t1
  } {
    if {$x==1} {
      db2 eval { INSERT INTO t1 VALUES(5, 6) }
    } 
    if {$x==3} {
      set res [catchsql {BEGIN EXCLUSIVE}]
      lappend res [sqlite3_extended_errcode db]
    } 
  }
  set res
} {1 {database is locked} SQLITE_BUSY_SNAPSHOT}



finish_test