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

A different way to clear the subtype on VDBE registers when the value of the register is overwritten with new content. To fix [[f45ac567eaa9f93].

FossilOrigin-Name: 2e9fb1295cd31fc29c97444c3dec82fef68e939f
This commit is contained in:
dan
2016-01-30 15:46:03 +00:00
parent af30fdf6ed
commit 5b6c8e4e1d
7 changed files with 45 additions and 21 deletions

View File

@@ -188,7 +188,8 @@ sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){
return sqlite3VdbeIntValue((Mem*)pVal);
}
unsigned int sqlite3_value_subtype(sqlite3_value *pVal){
return ((Mem*)pVal)->eSubtype;
Mem *pMem = (Mem*)pVal;
return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
}
const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
@@ -369,8 +370,10 @@ void sqlite3_result_null(sqlite3_context *pCtx){
sqlite3VdbeMemSetNull(pCtx->pOut);
}
void sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
pCtx->pOut->eSubtype = eSubtype & 0xff;
Mem *pOut = pCtx->pOut;
assert( sqlite3_mutex_held(pOut->db->mutex) );
pOut->eSubtype = eSubtype & 0xff;
pOut->flags |= MEM_Subtype;
}
void sqlite3_result_text(
sqlite3_context *pCtx,