mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Merge test improvements and minor fixes from trunk.
FossilOrigin-Name: 0298a9a780695b666e7c683700d9f2f889d6f826
This commit is contained in:
@@ -162,7 +162,10 @@ int sqlite3_clear_bindings(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( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){
|
||||
assert( p->flags==MEM_Null && p->z==0 );
|
||||
return 0;
|
||||
}
|
||||
p->flags |= MEM_Blob;
|
||||
return p->n ? p->z : 0;
|
||||
}else{
|
||||
@@ -424,6 +427,15 @@ void sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
|
||||
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
|
||||
sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
|
||||
}
|
||||
int sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
|
||||
Mem *pOut = pCtx->pOut;
|
||||
assert( sqlite3_mutex_held(pOut->db->mutex) );
|
||||
if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){
|
||||
return SQLITE_TOOBIG;
|
||||
}
|
||||
sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
void sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
|
||||
pCtx->isError = errCode;
|
||||
pCtx->fErrorOrAux = 1;
|
||||
@@ -1403,6 +1415,20 @@ int sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
int sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
|
||||
int rc;
|
||||
Vdbe *p = (Vdbe *)pStmt;
|
||||
sqlite3_mutex_enter(p->db->mutex);
|
||||
if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
|
||||
rc = SQLITE_TOOBIG;
|
||||
}else{
|
||||
assert( (n & 0x7FFFFFFF)==n );
|
||||
rc = sqlite3_bind_zeroblob(pStmt, i, n);
|
||||
}
|
||||
rc = sqlite3ApiExit(p->db, rc);
|
||||
sqlite3_mutex_leave(p->db->mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Return the number of wildcards that can be potentially bound to.
|
||||
|
Reference in New Issue
Block a user