Set the connection error code when sqlite3_blob_read() or
sqlite3_blob_write() fail.  Ticket #2464. (CVS 4137)

FossilOrigin-Name: 3bd990be3cb8a74be9eaa8d5710852be6733cb58
diff --git a/test/incrblob.test b/test/incrblob.test
index 07ab66e..5cd7040 100644
--- a/test/incrblob.test
+++ b/test/incrblob.test
@@ -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 @@
   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