mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Have the sqlite3_context object carry the encoding for the prepared statement
that it represents, so that sqlite3_result() and similar can set the encoding according to the prepared statement, even if the database encoding has changed. dbsqlfuzz c409b10d0a6bccf78ab00f47e1d29d42ee5b3565 FossilOrigin-Name: d4e19314f564126e180e091f9135c7bc55a10442edb46fbd3a4cfad21201dfa6
This commit is contained in:
@@ -391,7 +391,7 @@ static void setResultStrOrError(
|
||||
}
|
||||
return;
|
||||
}
|
||||
sqlite3VdbeChangeEncoding(pOut, ENC(pOut->db));
|
||||
sqlite3VdbeChangeEncoding(pOut, pCtx->enc);
|
||||
if( sqlite3VdbeMemTooBig(pOut) ){
|
||||
sqlite3_result_error_toobig(pCtx);
|
||||
}
|
||||
@@ -540,7 +540,7 @@ void sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
|
||||
Mem *pOut = pCtx->pOut;
|
||||
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
|
||||
sqlite3VdbeMemCopy(pOut, pValue);
|
||||
sqlite3VdbeChangeEncoding(pOut, ENC(pOut->db));
|
||||
sqlite3VdbeChangeEncoding(pOut, pCtx->enc);
|
||||
if( sqlite3VdbeMemTooBig(pOut) ){
|
||||
sqlite3_result_error_toobig(pCtx);
|
||||
}
|
||||
|
Reference in New Issue
Block a user