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

Clarification on the best practices for using the _bytes() APIs.

Change sqlite3_value_blob() to force the representation to be purely
a BLOB and not a dual BLOB/String.  Ticket #2360. (CVS 4005)

FossilOrigin-Name: cf2dd45b58380de7f3e167b5357848d12872caa3
This commit is contained in:
drh
2007-05-15 13:27:07 +00:00
parent 4a919118d3
commit 1f0feef80b
5 changed files with 65 additions and 52 deletions

View File

@@ -38,9 +38,9 @@ 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;
}
p->flags &= ~MEM_Str;
p->flags |= MEM_Blob;
p->type = SQLITE_BLOB;
return p->z;
}else{
return sqlite3_value_text(pVal);