1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Have sqlite3_blob_bytes() return 0 following a failed call to sqlite3_reopen_blob().

FossilOrigin-Name: 476a8b492124d31e0656e61a6183ab55684c0bdf
This commit is contained in:
dan
2010-12-06 17:11:05 +00:00
parent 7a856fa64a
commit eefab7512b
5 changed files with 18 additions and 23 deletions

View File

@@ -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;
}