1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Begin adding the zeroblob API to support incremental blob i/o. (CVS 3894)

FossilOrigin-Name: 7a01836dde45098796693bc6cb6045c4059adf1a
This commit is contained in:
drh
2007-05-02 01:34:31 +00:00
parent 290283fe69
commit b026e05eb2
12 changed files with 216 additions and 48 deletions

View File

@@ -37,6 +37,7 @@ int sqlite3_expired(sqlite3_stmt *pStmt){
const void *sqlite3_value_blob(sqlite3_value *pVal){
Mem *p = (Mem*)pVal;
if( p->flags & (MEM_Blob|MEM_Str) ){
sqlite3VdbeMemExpandBlob(p);
if( (p->flags & MEM_Term)==0 ){
p->flags &= ~MEM_Str;
}
@@ -151,6 +152,9 @@ void sqlite3_result_text16le(
void sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
sqlite3VdbeMemCopy(&pCtx->s, pValue);
}
void sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
sqlite3VdbeMemSetZeroBlob(&pCtx->s, n);
}
/*
@@ -790,6 +794,15 @@ int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
}
return rc;
}
int sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
int rc;
Vdbe *p = (Vdbe *)pStmt;
rc = vdbeUnbind(p, i);
if( rc==SQLITE_OK ){
sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
}
return rc;
}
/*
** Return the number of wildcards that can be potentially bound to.