aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeblob.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2010-12-06 17:11:05 +0000
committerdan <dan@noemail.net>2010-12-06 17:11:05 +0000
commiteefab7512bfe4d43b3f868d80e3818aa61db01bc (patch)
tree634d4aa3dd439979d1baf604956d564ba2baa707 /src/vdbeblob.c
parent7a856fa64ae77f60b74d8f18e37f7232ef150135 (diff)
downloadsqlite-eefab7512bfe4d43b3f868d80e3818aa61db01bc.tar.gz
sqlite-eefab7512bfe4d43b3f868d80e3818aa61db01bc.zip
Have sqlite3_blob_bytes() return 0 following a failed call to sqlite3_reopen_blob().
FossilOrigin-Name: 476a8b492124d31e0656e61a6183ab55684c0bdf
Diffstat (limited to 'src/vdbeblob.c')
-rw-r--r--src/vdbeblob.c3
1 files changed, 2 insertions, 1 deletions
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;
}