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

@ -1,5 +1,5 @@
C Update\sthe\sFAQ\sto\sdescribe\show\smoving\ssqlite3\shandles\sacross\sthreads\sis\nnot\ssafe\swith\sSQLITE_ENABLE_MEMORY_MANAGEMENT.\s\sTickets\s#2357\sand\s#2463.\s(CVS\s4136)
D 2007-06-27T00:08:40
C Set\sthe\sconnection\serror\scode\swhen\ssqlite3_blob_read()\sor\nsqlite3_blob_write()\sfail.\s\sTicket\s#2464.\s(CVS\s4137)
D 2007-06-27T00:36:14
F Makefile.in 7f7485a4cc039476a42e534b3f26ec90e2f9753e
F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -143,7 +143,7 @@ F src/vdbe.h 001c5b257567c1d3de7feb2203aac71d0d7b16a3
F src/vdbeInt.h 7d2bf163d6d4e815724a457f2216dd8e38c3955c
F src/vdbeapi.c 7930b9a188ab385287ca3eb3840af7225cb43549
F src/vdbeaux.c c580d3605edc2c24ba9bd26fa7aa8b4fff10daa4
F src/vdbeblob.c 96f3572fdc45eda5be06e6372b612bc30742d9f0
F src/vdbeblob.c bb30b3e387c35ba869949494b2736aff97159470
F src/vdbefifo.c 3ca8049c561d5d67cbcb94dc909ae9bb68c0bf8f
F src/vdbemem.c ca4d3994507cb0a9504820293af69f5c778b4abd
F src/vtab.c 60dc6d881c3049ec0e9f780e6beb953dbd78673d
@ -266,7 +266,7 @@ F test/hook.test 7e7645fd9a033f79cce8fdff151e32715e7ec50a
F test/icu.test e6bfae7f625c88fd14df6f540fe835bdfc1e4329
F test/in.test 369cb2aa1eab02296b4ec470732fe8c131260b1d
F test/in2.test b1f447f4f0f67e9f83ff931e7e2e30873f9ea055
F test/incrblob.test a23b9431596581f1f4ac03d04fa97c31776693d5
F test/incrblob.test 1e74ef0f6df83ec8071d727d8f30295f11de0677
F test/incrblob_err.test 2501bec57e317e7051451b5093b47fc61a96c85a
F test/incrvacuum.test 92d0efe609509c65804be016cb376d5ec5abb5a5
F test/incrvacuum2.test 82397ceb5941cbe852fd29bb33fcdf5665bc80c2
@ -516,7 +516,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P 5c93324b937b4d8394b0eb7d7fe74f7965623cbe
R f301b87e0a5b037cd827261dc87d1b34
P 2640f518deba1d196201fac903ec4d3ab26d4bb3
R cb9e25036d94d8667607dda541f483a6
U drh
Z 516a346f8c7e5fef81f1bad761ac02ef
Z f443a2324ae948e8ecfe65cdb660841d

View File

@ -1 +1 @@
2640f518deba1d196201fac903ec4d3ab26d4bb3
3bd990be3cb8a74be9eaa8d5710852be6733cb58

View File

@ -12,7 +12,7 @@
**
** This file contains code used to implement incremental BLOB I/O.
**
** $Id: vdbeblob.c,v 1.10 2007/05/08 20:37:40 drh Exp $
** $Id: vdbeblob.c,v 1.11 2007/06/27 00:36:14 drh Exp $
*/
#include "sqliteInt.h"
@ -278,6 +278,7 @@ static int blobReadWrite(
sqlite3VdbeFinalize(v);
p->pStmt = 0;
}else{
db->errCode = rc;
v->rc = rc;
}

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