1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Set the connection error code when sqlite3_blob_read() or

sqlite3_blob_write() fail.  Ticket #2464. (CVS 4137)

FossilOrigin-Name: 3bd990be3cb8a74be9eaa8d5710852be6733cb58
This commit is contained in:
drh
2007-06-27 00:36:13 +00:00
parent 6d31df30d8
commit 0e8003dff6
4 changed files with 25 additions and 11 deletions

View File

@ -9,7 +9,7 @@
#
#***********************************************************************
#
# $Id: incrblob.test,v 1.11 2007/06/15 15:08:08 danielk1977 Exp $
# $Id: incrblob.test,v 1.12 2007/06/27 00:36:14 drh Exp $
#
set testdir [file dirname $argv0]
@ -558,5 +558,18 @@ do_test incrblob-7.3.3 {
read $::b
} $::otherdata
finish_test
# Attempt to write on a read-only blob. Make sure the error code
# gets set. Ticket #2464.
#
do_test incrblob-7.4 {
set rc [catch {sqlite3_blob_write $::b 10 HELLO} msg]
lappend rc $msg
} {1 SQLITE_READONLY}
do_test incrblob-7.5 {
sqlite3_errcode db
} {SQLITE_READONLY}
do_test incrblob-7.6 {
sqlite3_errmsg db
} {attempt to write a readonly database}
finish_test