aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sqlite.h.in3
-rw-r--r--src/vdbeblob.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index 5b67b7abd..240a3bab2 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -4835,7 +4835,8 @@ int sqlite3_blob_open(
** SQLite error code is returned and the blob handle is considered aborted.
** ^All subsequent calls to [sqlite3_blob_read()], [sqlite3_blob_write()] or
** [sqlite3_blob_reopen()] on an aborted blob handle immediately return
-** SQLITE_ABORT.
+** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
+** always returns zero.
**
** ^This function sets the database handle error code and message.
*/
diff --git a/src/vdbeblob.c b/src/vdbeblob.c
index f43fc6499..f26cc87ea 100644
--- a/src/vdbeblob.c
+++ b/src/vdbeblob.c
@@ -419,7 +419,7 @@ int sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){
*/
int sqlite3_blob_bytes(sqlite3_blob *pBlob){
Incrblob *p = (Incrblob *)pBlob;
- return p ? p->nByte : 0;
+ return (p && p->pStmt) ? p->nByte : 0;
}
/*
@@ -457,6 +457,7 @@ int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
}
rc = sqlite3ApiExit(db, rc);
+ assert( rc==SQLITE_OK || p->pStmt==0 );
sqlite3_mutex_leave(db->mutex);
return rc;
}