1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Various bugfixes. 68 Test cases still fail. (CVS 1471)

FossilOrigin-Name: 67a140cf78d99e38ccd94751c4f8ead1a2b96859
This commit is contained in:
danielk1977
2004-05-27 09:28:41 +00:00
parent f44795013f
commit c572ef7fcd
17 changed files with 314 additions and 111 deletions

View File

@@ -606,6 +606,28 @@ int sqlite3VdbeList(
return rc;
}
/*
** If pOp is an OP_HexBlob opcode, then transform it to an OP_Blob
** opcode.
*/
static int translateOp(Op *pOp){
if( pOp->opcode==OP_HexBlob ){
char *zBlob = sqlite3HexToBlob(pOp->p3);
if( !zBlob ){
if( sqlite3_malloc_failed ){
return SQLITE_NOMEM;
}
return SQLITE_ERROR;
}
pOp->p1 = strlen(pOp->p3)/2;
if( pOp->p3type==P3_DYNAMIC ){
sqliteFree(pOp->p3);
}
pOp->p3 = zBlob;
pOp->p3type = P3_DYNAMIC;
}
}
/*
** Prepare a virtual machine for execution. This involves things such
** as allocating stack space and initializing the program counter.
@@ -677,6 +699,12 @@ void sqlite3VdbeMakeReady(
}
}
#endif
{
int i;
for(i=0; i<p->nOp; i++){
translateOp(&p->aOp[i]);
}
}
}
@@ -1270,12 +1298,13 @@ int sqlite3VdbeSerialGet(
/* String or blob */
assert( serial_type>=12 );
len = sqlite3VdbeSerialTypeLen(serial_type);
pMem->z = buf;
pMem->n = len;
if( serial_type&0x01 ){
pMem->flags = MEM_Str | MEM_Ephem;
pMem->n = len;
pMem->enc = enc;
}else{
pMem->flags = MEM_Blob | MEM_Ephem;
pMem->n = len;
}
sqlite3VdbeMemMakeWriteable(pMem);
return len;