-C Omit\ssome\sextra\scode\swhen\sOMIT_INCRBLOB\sis\sdefined.\s(CVS\s4014)
-D 2007-05-16T14:23:00
+C Change\sa\sfew\sselected\sfunctions\sto\smacros\sto\sspeed\sthings\sup.\s(CVS\s4015)
+D 2007-05-16T17:28:43
F Makefile.in 87b200ad9970907f76df734d29dff3d294c10935
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
F src/analyze.c e8fcb1c35ace8418615eb18d9601f321ac86b2ec
F src/attach.c ba628db0c2b6a362f036d017bf1196cdfe4ebb37
F src/auth.c 5ea90bc93dfea46e9fe4bf531e14c7cd98219ecb
-F src/btree.c 0c2f9b06c90d7c59925c03153c9d47fd739c8ca5
+F src/btree.c 911798b91bbad31a033ed501b95c76df8541874b
F src/btree.h 1d527bf61ed176f980c34999d5793a0fd45dcf8c
-F src/btreeInt.h 701343a0da648efb9591bb1f7b1a66199c270331
+F src/btreeInt.h f92c0577f49d961c0148b477a25647e8fd80eecf
F src/build.c 50992d92e131a9aa9aa6657fb1ddc13e176fd70c
F src/callback.c 9c12535669a638f90a67e10440b99c7b93c0fbf4
F src/complete.c 7d1a44be8f37de125fcafd3d3a018690b3799675
F src/limits.h cf772eb244aae5859fa1554394866c27d3f3639c
F src/loadext.c afe4f4755dc49c36ef505748bbdddecb9f1d02a2
F src/main.c 797dc983716c1480f6af78a36be3add8806211a1
-F src/malloc.c b89e31258a85158d15795bf87ae3ba007e56329b
+F src/malloc.c 07790014b4b126016ce3c94885a215e45eb07ad5
F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217
F src/os.c 1f10b47acc1177fb9225edb4f5f0d25ed716f9cb
F src/os.h 213dd1f8f7ab9159c04a893eadc0cdd52515df16
F src/shell.c d07ae326b3815d80f71c69b3c7584382e47f6447
F src/sqlite.h.in aa3c0c02883663944db09ee79f3165d3c4ad7c47
F src/sqlite3ext.h 7d0d363ea7327e817ef0dfe1b7eee1f171b72890
-F src/sqliteInt.h 0f3b39aebdb6d0490abafb48bec7047e799dfbfa
+F src/sqliteInt.h 58edde37943f4f8155986f0c33735ba31fc66e9f
F src/table.c a8de75bcedf84d4060d804264b067ab3b1a3561d
F src/tclsqlite.c f425c7583665ef78dd8397b2de0b8e0028e80ce2
F src/test1.c 84c841e1088f743200b87581506e93f70344bd32
F src/trigger.c 420192efe3e6f03addf7897c60c3c8bf913d3493
F src/update.c 3359041db390a8f856d67272f299600e2104f350
F src/utf.c b881fe54498f6a35de424a62f8e071b621111728
-F src/util.c a44710b94da6d0d606521a5e1fd40c8067282c74
+F src/util.c b99afc6940747ec504ac98ce551fc31181c3fcc0
F src/vacuum.c 8bd895d29e7074e78d4e80f948e35ddc9cf2beef
-F src/vdbe.c d0f60420211ce8c298ea37d1832105741b27af0f
+F src/vdbe.c 51baf9ba77e986db857c69d63a979bb5227317ae
F src/vdbe.h 001c5b257567c1d3de7feb2203aac71d0d7b16a3
F src/vdbeInt.h 7d2bf163d6d4e815724a457f2216dd8e38c3955c
F src/vdbeapi.c f89d6bc5264e66f44589e454fbeeee96854d0dd3
F src/vdbeaux.c 62011e2ccf5fa9b3dcc7fa6ff5f0e0638d324a70
F src/vdbeblob.c 96f3572fdc45eda5be06e6372b612bc30742d9f0
F src/vdbefifo.c 3ca8049c561d5d67cbcb94dc909ae9bb68c0bf8f
-F src/vdbemem.c 596624a0b71aa2fb052cae640342dae9c734f8ad
+F src/vdbemem.c 89ffe903b4de158b29fe8459f6f816d1f860d4ee
F src/vtab.c c5ebebf615b2f29499fbe97a584c4bb342632aa0
F src/where.c f3920748cc650fc25ac916215500bdb90dee568e
F tclinstaller.tcl 4356d9d94d2b5ed5e68f9f0c80c4df3048dd7617
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 57e17c7cda23a3b3e1d0a691af07c35c1c644dcc
-R ef969dbd235873a63df830f4d99dc586
+P 1d89be287d34423b1a405cde0490260e7c731f07
+R 0c3a8d9f8c5cece70d3226582e2755a8
U danielk1977
-Z e60d12dc0d97c78167f71ea169cd880a
+Z 6ba55ff12f0d9efe11930a5738e558b9
-1d89be287d34423b1a405cde0490260e7c731f07
\ No newline at end of file
+93f811ec747f6a42daf9ee27cd8b013f248552a1
\ No newline at end of file
** May you share freely, never taking more than you give.
**
*************************************************************************
-** $Id: btree.c,v 1.381 2007/05/12 10:41:48 danielk1977 Exp $
+** $Id: btree.c,v 1.382 2007/05/16 17:28:43 danielk1977 Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
**
** This routine works only for pages that do not contain overflow cells.
*/
+#define findCell(pPage, iCell) \
+ ((pPage)->aData + get2byte(&(pPage)->aData[(pPage)->cellOffset+2*(iCell)]))
u8 *sqlite3BtreeFindCell(MemPage *pPage, int iCell){
u8 *data = pPage->aData;
assert( iCell>=0 );
assert( iCell<get2byte(&data[pPage->hdrOffset+3]) );
- return data + get2byte(&data[pPage->cellOffset+2*iCell]);
+ return findCell(pPage, iCell);
}
/*
iCell--;
}
}
- return sqlite3BtreeFindCell(pPage, iCell);
+ return findCell(pPage, iCell);
}
/*
** are two versions of this function. sqlite3BtreeParseCell() takes a
** cell index as the second argument and sqlite3BtreeParseCellPtr()
** takes a pointer to the body of the cell as its second argument.
+**
+** Within this file, the parseCell() macro can be called instead of
+** sqlite3BtreeParseCellPtr(). Using some compilers, this will be faster.
*/
void sqlite3BtreeParseCellPtr(
MemPage *pPage, /* Page containing the cell */
pInfo->nSize = pInfo->iOverflow + 4;
}
}
+#define parseCell(pPage, iCell, pInfo) \
+ sqlite3BtreeParseCellPtr((pPage), findCell((pPage), (iCell)), (pInfo))
void sqlite3BtreeParseCell(
MemPage *pPage, /* Page containing the cell */
int iCell, /* The cell index. First cell is 0 */
CellInfo *pInfo /* Fill in this structure */
){
- sqlite3BtreeParseCellPtr(pPage, sqlite3BtreeFindCell(pPage, iCell), pInfo);
+ parseCell(pPage, iCell, pInfo);
}
/*
nCell = pPage->nCell;
for(i=0; i<nCell; i++){
- u8 *pCell = sqlite3BtreeFindCell(pPage, i);
+ u8 *pCell = findCell(pPage, i);
rc = ptrmapPutOvflPtr(pPage, pCell);
if( rc!=SQLITE_OK ){
nCell = pPage->nCell;
for(i=0; i<nCell; i++){
- u8 *pCell = sqlite3BtreeFindCell(pPage, i);
+ u8 *pCell = findCell(pPage, i);
if( eType==PTRMAP_OVERFLOW1 ){
CellInfo info;
sqlite3BtreeParseCellPtr(pPage, pCell, &info);
}
/*
-** Make sure the BtCursor.info field of the given cursor is valid.
-** If it is not already valid, call sqlite3BtreeParseCell() to fill it in.
+** The GET_CELL_INFO() macro. Takes one argument, a pointer to a valid
+** btree cursor (type BtCursor*). This macro makes sure the BtCursor.info
+** field of the given cursor is valid. If it is not already valid, call
+** sqlite3BtreeParseCell() to fill it in.
**
** BtCursor.info is a cache of the information in the current cell.
** Using this cache reduces the number of calls to sqlite3BtreeParseCell().
*/
-static void getCellInfo(BtCursor *pCur){
- if( pCur->info.nSize==0 ){
- sqlite3BtreeParseCell(pCur->pPage, pCur->idx, &pCur->info);
- }else{
#ifndef NDEBUG
+ static void assertCellInfo(BtCursor *pCur){
CellInfo info;
memset(&info, 0, sizeof(info));
sqlite3BtreeParseCell(pCur->pPage, pCur->idx, &info);
assert( memcmp(&info, &pCur->info, sizeof(info))==0 );
-#endif
}
-}
+#else
+ #define assertCellInfo(x)
+#endif
+
+#define GET_CELL_INFO(pCur) \
+ if( pCur->info.nSize==0 ) \
+ sqlite3BtreeParseCell(pCur->pPage, pCur->idx, &pCur->info); \
+ else \
+ assertCellInfo(pCur);
+
/*
** Set *pSize to the size of the buffer needed to hold the value of
if( pCur->eState==CURSOR_INVALID ){
*pSize = 0;
}else{
- getCellInfo(pCur);
+ GET_CELL_INFO(pCur);
*pSize = pCur->info.nKey;
}
}
/* Not pointing at a valid entry - set *pSize to 0. */
*pSize = 0;
}else{
- getCellInfo(pCur);
+ GET_CELL_INFO(pCur);
*pSize = pCur->info.nData;
}
}
assert( pCur->idx>=0 && pCur->idx<pPage->nCell );
assert( offset>=0 );
- getCellInfo(pCur);
+ GET_CELL_INFO(pCur);
aPayload = pCur->info.pCell + pCur->info.nHeader;
nKey = (pPage->intKey ? 0 : pCur->info.nKey);
assert( pCur->eState==CURSOR_VALID );
pPage = pCur->pPage;
assert( pCur->idx>=0 && pCur->idx<pPage->nCell );
- getCellInfo(pCur);
+ GET_CELL_INFO(pCur);
aPayload = pCur->info.pCell;
aPayload += pCur->info.nHeader;
if( pPage->intKey ){
assert( pCur->eState==CURSOR_VALID );
while( !(pPage = pCur->pPage)->leaf ){
assert( pCur->idx>=0 && pCur->idx<pPage->nCell );
- pgno = get4byte(sqlite3BtreeFindCell(pPage, pCur->idx));
+ pgno = get4byte(findCell(pPage, pCur->idx));
rc = moveToChild(pCur, pgno);
if( rc ) return rc;
}
pCur->info.nSize = 0;
if( pPage->intKey ){
u8 *pCell;
- pCell = sqlite3BtreeFindCell(pPage, pCur->idx) + pPage->childPtrSize;
+ pCell = findCell(pPage, pCur->idx) + pPage->childPtrSize;
if( pPage->hasData ){
u32 dummy;
pCell += getVarint32(pCell, &dummy);
}else if( lwr>=pPage->nCell ){
chldPg = get4byte(&pPage->aData[pPage->hdrOffset+8]);
}else{
- chldPg = get4byte(sqlite3BtreeFindCell(pPage, lwr));
+ chldPg = get4byte(findCell(pPage, lwr));
}
if( chldPg==0 ){
assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell );
assert( pPage->isInit );
assert( pCur->idx>=0 );
if( !pPage->leaf ){
- pgno = get4byte( sqlite3BtreeFindCell(pPage, pCur->idx) );
+ pgno = get4byte( findCell(pPage, pCur->idx) );
rc = moveToChild(pCur, pgno);
if( rc ) return rc;
rc = moveToRightmost(pCur);
if( pPage->leaf ) return SQLITE_OK;
for(i=0; i<pPage->nCell; i++){
- u8 *pCell = sqlite3BtreeFindCell(pPage, i);
+ u8 *pCell = findCell(pPage, i);
if( !pPage->leaf ){
rc = reparentPage(pBt, get4byte(pCell), pPage, i);
if( rc!=SQLITE_OK ) return rc;
** pPage is the next-to-right child.
*/
assert( pPage->nCell>0 );
- pCell = sqlite3BtreeFindCell(pPage, pPage->nCell-1);
+ pCell = findCell(pPage, pPage->nCell-1);
sqlite3BtreeParseCellPtr(pPage, pCell, &info);
rc = fillInCell(pParent, parentCell, 0, info.nKey, 0, 0, 0, &parentSize);
if( rc!=SQLITE_OK ){
pgno = pPage->pgno;
assert( pgno==sqlite3PagerPagenumber(pPage->pDbPage) );
for(idx=0; idx<pParent->nCell; idx++){
- if( get4byte(sqlite3BtreeFindCell(pParent, idx))==pgno ){
+ if( get4byte(findCell(pParent, idx))==pgno ){
break;
}
}
nDiv = 0;
for(i=0, k=nxDiv; i<NB; i++, k++){
if( k<pParent->nCell ){
- apDiv[i] = sqlite3BtreeFindCell(pParent, k);
+ apDiv[i] = findCell(pParent, k);
nDiv++;
assert( !pParent->leaf );
pgnoOld[i] = get4byte(apDiv[i]);
int i;
zeroPage(pPage, pChild->aData[0]);
for(i=0; i<pChild->nCell; i++){
- apCell[i] = sqlite3BtreeFindCell(pChild,i);
+ apCell[i] = findCell(pChild,i);
szCell[i] = cellSizePtr(pChild, apCell[i]);
}
assemblePage(pPage, pChild->nCell, apCell, szCell);
if( loc==0 && CURSOR_VALID==pCur->eState ){
int szOld;
assert( pCur->idx>=0 && pCur->idx<pPage->nCell );
- oldCell = sqlite3BtreeFindCell(pPage, pCur->idx);
+ oldCell = findCell(pPage, pCur->idx);
if( !pPage->leaf ){
memcpy(newCell, oldCell, 4);
}
** data. The clearCell() call frees any overflow pages associated with the
** cell. The cell itself is still intact.
*/
- pCell = sqlite3BtreeFindCell(pPage, pCur->idx);
+ pCell = findCell(pPage, pCur->idx);
if( !pPage->leaf ){
pgnoChild = get4byte(pCell);
}
TRACE(("DELETE: table=%d delete internal from %d replace from leaf %d\n",
pCur->pgnoRoot, pPage->pgno, leafCur.pPage->pgno));
dropCell(pPage, pCur->idx, cellSizePtr(pPage, pCell));
- pNext = sqlite3BtreeFindCell(leafCur.pPage, leafCur.idx);
+ pNext = findCell(leafCur.pPage, leafCur.idx);
szNext = cellSizePtr(leafCur.pPage, pNext);
assert( MX_CELL_SIZE(pBt)>=szNext+4 );
tempCell = sqliteMallocRaw( MX_CELL_SIZE(pBt) );
rc = getAndInitPage(pBt, pgno, &pPage, pParent);
if( rc ) goto cleardatabasepage_out;
for(i=0; i<pPage->nCell; i++){
- pCell = sqlite3BtreeFindCell(pPage, i);
+ pCell = findCell(pPage, i);
if( !pPage->leaf ){
rc = clearDatabasePage(pBt, get4byte(pCell), pPage->pParent, 1);
if( rc ) goto cleardatabasepage_out;
*/
sqlite3_snprintf(sizeof(zContext), zContext,
"On tree page %d cell %d: ", iPage, i);
- pCell = sqlite3BtreeFindCell(pPage,i);
+ pCell = findCell(pPage,i);
sqlite3BtreeParseCellPtr(pPage, pCell, &info);
sz = info.nData;
if( !pPage->intKey ) sz += info.nKey;
** May you share freely, never taking more than you give.
**
*************************************************************************
-** $Id: btreeInt.h,v 1.3 2007/05/16 14:23:00 danielk1977 Exp $
+** $Id: btreeInt.h,v 1.4 2007/05/16 17:28:43 danielk1977 Exp $
**
** This file implements a external (disk-based) database using BTrees.
** For a detailed discussion of BTrees, refer to
/*
** Read or write a two- and four-byte big-endian integer values.
*/
-#define get2byte(x) ((x)[0]<<8 | (x)[1])
+#define get2byte(x) ((x)[0]<<8 | (x)[1])
+#define put2byte(p,v) ((p)[0] = (v)>>8, (p)[1] = (v))
#define get4byte sqlite3Get4byte
-#define put2byte sqlite3Put2byte
#define put4byte sqlite3Put4byte
/*
** Memory allocation functions used throughout sqlite.
**
**
-** $Id: malloc.c,v 1.1 2007/05/05 11:48:54 drh Exp $
+** $Id: malloc.c,v 1.2 2007/05/16 17:28:43 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
** then the connection error-code (the value returned by sqlite3_errcode())
** is set to SQLITE_NOMEM.
*/
-static int mallocHasFailed = 0;
+int sqlite3_mallocHasFailed = 0;
int sqlite3ApiExit(sqlite3* db, int rc){
if( sqlite3MallocFailed() ){
- mallocHasFailed = 0;
+ sqlite3_mallocHasFailed = 0;
sqlite3OsLeaveMutex();
sqlite3Error(db, SQLITE_NOMEM, 0);
rc = SQLITE_NOMEM;
return rc & (db ? db->errMask : 0xff);
}
-/*
-** Return true is a malloc has failed in this thread since the last call
-** to sqlite3ApiExit(), or false otherwise.
-*/
-int sqlite3MallocFailed(){
- return (mallocHasFailed && sqlite3OsInMutex(1));
-}
-
/*
** Set the "malloc has failed" condition to true for this thread.
*/
void sqlite3FailedMalloc(){
if( !sqlite3MallocFailed() ){
sqlite3OsEnterMutex();
- assert( mallocHasFailed==0 );
- mallocHasFailed = 1;
+ assert( sqlite3_mallocHasFailed==0 );
+ sqlite3_mallocHasFailed = 1;
}
}
*************************************************************************
** Internal interface definitions for SQLite.
**
-** @(#) $Id: sqliteInt.h,v 1.568 2007/05/15 16:51:37 drh Exp $
+** @(#) $Id: sqliteInt.h,v 1.569 2007/05/16 17:28:43 danielk1977 Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_
#endif
+/* Variable sqlite3_mallocHasFailed is set to true after a malloc()
+** failure occurs.
+**
+** The sqlite3MallocFailed() macro returns true if a malloc has failed
+** in this thread since the last call to sqlite3ApiExit(), or false
+** otherwise.
+*/
+extern int sqlite3_mallocHasFailed;
+#define sqlite3MallocFailed() (sqlite3_mallocHasFailed && sqlite3OsInMutex(1))
+
#define sqliteFree(x) sqlite3FreeX(x)
#define sqliteAllocSize(x) sqlite3AllocSize(x)
-
/*
** An instance of this structure might be allocated to store information
** specific to a single thread.
typedef struct WhereInfo WhereInfo;
typedef struct WhereLevel WhereLevel;
+#include "os.h"
+
/*
** Each database file to be accessed by the system is an instance
** of the following structure. There are normally two of these structures
void (*)(sqlite3_context*,int,sqlite3_value **),
void (*)(sqlite3_context*,int,sqlite3_value **), void (*)(sqlite3_context*));
int sqlite3ApiExit(sqlite3 *db, int);
-int sqlite3MallocFailed(void);
void sqlite3FailedMalloc(void);
void sqlite3AbortOtherActiveVdbes(sqlite3 *, Vdbe *);
int sqlite3OpenTempDatabase(Parse *);
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
-** $Id: util.c,v 1.203 2007/05/15 16:51:37 drh Exp $
+** $Id: util.c,v 1.204 2007/05/16 17:28:43 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
/*
-** Read or write a two- and four-byte big-endian integer values.
+** Read or write a four-byte big-endian integer value.
*/
-u32 sqlite3Get2byte(const u8 *p){
- return (p[0]<<8) | p[1];
-}
u32 sqlite3Get4byte(const u8 *p){
return (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
}
-void sqlite3Put2byte(unsigned char *p, u32 v){
- p[0] = v>>8;
- p[1] = v;
-}
void sqlite3Put4byte(unsigned char *p, u32 v){
p[0] = v>>24;
p[1] = v>>16;
** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
-** $Id: vdbe.c,v 1.620 2007/05/16 14:23:00 danielk1977 Exp $
+** $Id: vdbe.c,v 1.621 2007/05/16 17:28:43 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
if( ((P)->flags&MEM_Ephem)!=0 \
&& sqlite3VdbeMemMakeWriteable(P) ){ goto no_mem;}
+/*
+** Call sqlite3VdbeMemExpandBlob() on the supplied value (type Mem*)
+** P if required.
+*/
+#define ExpandBlob(P) (((P)->flags&MEM_Zero)?sqlite3VdbeMemExpandBlob(P):0)
+
/*
** Argument pMem points at a memory cell that will be passed to a
** user-defined function or returned to the user as the result of a query.
assert( MEM_Str==(MEM_Blob>>3) );
pTos->flags |= (pTos->flags&MEM_Blob)>>3;
applyAffinity(pTos, SQLITE_AFF_TEXT, encoding);
- rc = sqlite3VdbeMemExpandBlob(pTos);
+ rc = ExpandBlob(pTos);
assert( pTos->flags & MEM_Str );
pTos->flags &= ~(MEM_Int|MEM_Real|MEM_Blob);
break;
}
assert( pOp->p3type==P3_COLLSEQ || pOp->p3==0 );
- sqlite3VdbeMemExpandBlob(pNos);
- sqlite3VdbeMemExpandBlob(pTos);
+ ExpandBlob(pNos);
+ ExpandBlob(pTos);
res = sqlite3MemCompare(pNos, pTos, (CollSeq*)pOp->p3);
switch( pOp->opcode ){
case OP_Eq: res = res==0; break;
containsNull = 1;
}
if( pRec->flags&MEM_Zero && pRec->n>0 ){
- sqlite3VdbeMemExpandBlob(pRec);
+ ExpandBlob(pRec);
}
serial_type = sqlite3VdbeSerialType(pRec, file_format);
len = sqlite3VdbeSerialTypeLen(serial_type);
pC->rowidIsValid = res==0;
}else{
assert( pTos->flags & MEM_Blob );
- sqlite3VdbeMemExpandBlob(pTos);
+ ExpandBlob(pTos);
rc = sqlite3BtreeMoveto(pC->pCursor, pTos->z, pTos->n, 0, &res);
if( rc!=SQLITE_OK ){
goto abort_due_to_error;
assert( pTos->flags & MEM_Blob );
if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){
assert( pC->isTable==0 );
- rc = sqlite3VdbeMemExpandBlob(pTos);
+ rc = ExpandBlob(pTos);
if( rc==SQLITE_OK ){
int nKey = pTos->n;
const char *zKey = pTos->z;
assert( pTos->flags & MEM_Blob ); /* Created using OP_MakeRecord */
assert( pC->deferredMoveto==0 );
- sqlite3VdbeMemExpandBlob(pTos);
+ ExpandBlob(pTos);
*pC->pIncrKey = pOp->p3!=0;
assert( pOp->p3==0 || pOp->opcode!=OP_IdxGT );
rc = sqlite3VdbeIdxKeyCompare(pC, pTos->n, (u8*)pTos->z, &res);
#include <ctype.h>
#include "vdbeInt.h"
+/*
+** Call sqlite3VdbeMemExpandBlob() on the supplied value (type Mem*)
+** P if required.
+*/
+#define expandBlob(P) (((P)->flags&MEM_Zero)?sqlite3VdbeMemExpandBlob(P):0)
+
/*
** If pMem is an object with a valid string representation, this routine
** ensures the internal encoding for the string representation is
int sqlite3VdbeMemDynamicify(Mem *pMem){
int n;
u8 *z;
- sqlite3VdbeMemExpandBlob(pMem);
+ expandBlob(pMem);
if( (pMem->flags & (MEM_Ephem|MEM_Static|MEM_Short))==0 ){
return SQLITE_OK;
}
int sqlite3VdbeMemMakeWriteable(Mem *pMem){
int n;
u8 *z;
- sqlite3VdbeMemExpandBlob(pMem);
+ expandBlob(pMem);
if( (pMem->flags & (MEM_Ephem|MEM_Static))==0 ){
return SQLITE_OK;
}
}
assert( (MEM_Blob>>3) == MEM_Str );
pVal->flags |= (pVal->flags & MEM_Blob)>>3;
- sqlite3VdbeMemExpandBlob(pVal);
+ expandBlob(pVal);
if( pVal->flags&MEM_Str ){
sqlite3VdbeChangeEncoding(pVal, enc & ~SQLITE_UTF16_ALIGNED);
if( (enc & SQLITE_UTF16_ALIGNED)!=0 && 1==(1&(int)pVal->z) ){