-C Comment\schanges\sin\sbtree.c\sand\sadded\sa\smissing\s"else"\sin\spragma.c.\s(CVS\s3757)
-D 2007-03-30T11:12:08
+C Remove\sthe\sanonymous\sunion\sfrom\sthe\ssqlite3_value\sstructure\ssince\ssome\ncompilers\sare\sunable\sto\sdeal\swith\sit.\s(CVS\s3758)
+D 2007-03-30T11:23:45
F Makefile.in 2f2c3bf69faf0ae7b8e8af4f94f1986849034530
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
F src/utf.c 67ecb1032bc0b42c105e88d65ef9d9f626eb0e1f
F src/util.c 8e8180ee5597f2474c1da311ff3c464b6966c0f1
F src/vacuum.c 8bd895d29e7074e78d4e80f948e35ddc9cf2beef
-F src/vdbe.c e214ce8f760f839d7171714f895e362facaae4dd
+F src/vdbe.c d5a4fc1e18af2a2873d022450c4a776f6c17bac3
F src/vdbe.h 0025259af1939fb264a545816c69e4b5b8d52691
-F src/vdbeInt.h b2ca85ca8abfbba86e380b06c7673dc81c6784c3
-F src/vdbeapi.c 6cff63a5b3a52af04b2bef0f7e27ed7ea6f85183
-F src/vdbeaux.c 2cf328d44683f1d6b537809536873b1999be6f20
+F src/vdbeInt.h 4b19fd8febad3fd14c4c97adaefc06754d323132
+F src/vdbeapi.c 7ac14f2e3b2283dcd35f5edefd31a8342cff783c
+F src/vdbeaux.c d768c22c8aa0fbf9bf1408b4fc9ed0b38b1146ca
F src/vdbefifo.c 3ca8049c561d5d67cbcb94dc909ae9bb68c0bf8f
-F src/vdbemem.c 58a8be2231b0b13e2e77098debe173e79d22f791
+F src/vdbemem.c d3696b4b0e5f32272659816cdfa2348c650b1ba0
F src/vtab.c 7fbda947e28cbe7adb3ba752a76ca9ef29936750
F src/where.c b5f8e2a0b0758b631c236aef3c7ed9c3b197eae8
F tclinstaller.tcl 046e3624671962dc50f0481d7c25b38ef803eb42
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
-P ea49ddf64aa6073b8018dc2faaf199704d359412
-R 22ce942b887da75ba44b7e076e36f7c6
+P 9a7d7e31908e9bac14a68bbc2fb4e1ca593ea234
+R 96b0eb3d9aac4cea00de02819c2dff8c
U drh
-Z 7ba311631083a1f0131b460fe5fb57bd
+Z 42c64bfd0c87e235823de57a2239ca19
** 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.596 2007/03/29 05:51:49 drh Exp $
+** $Id: vdbe.c,v 1.597 2007/03/30 11:23:45 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
sqlite3VdbeChangeEncoding(pRec, SQLITE_UTF8);
if( !realnum && sqlite3atoi64(pRec->z, &value) ){
sqlite3VdbeMemRelease(pRec);
- pRec->i = value;
+ pRec->u.i = value;
pRec->flags = MEM_Int;
}else{
sqlite3VdbeMemRealify(pRec);
case OP_Integer: {
pTos++;
pTos->flags = MEM_Int;
- pTos->i = pOp->p1;
+ pTos->u.i = pOp->p1;
break;
}
pTos->z = pOp->p3;
pTos->n = strlen(pTos->z);
pTos->enc = SQLITE_UTF8;
- pTos->i = sqlite3VdbeIntValue(pTos);
+ pTos->u.i = sqlite3VdbeIntValue(pTos);
pTos->flags |= MEM_Int;
break;
}
pTos->flags = MEM_Null;
}else if( (pTos->flags & pNos->flags & MEM_Int)==MEM_Int ){
i64 a, b;
- a = pTos->i;
- b = pNos->i;
+ a = pTos->u.i;
+ b = pNos->u.i;
switch( pOp->opcode ){
case OP_Add: b += a; break;
case OP_Subtract: b -= a; break;
Release(pTos);
pTos--;
Release(pTos);
- pTos->i = b;
+ pTos->u.i = b;
pTos->flags = MEM_Int;
}else{
double a, b;
Release(pTos);
pTos--;
Release(pTos);
- pTos->i = a;
+ pTos->u.i = a;
pTos->flags = MEM_Int;
break;
}
case OP_AddImm: { /* no-push */
assert( pTos>=p->aStack );
sqlite3VdbeMemIntegerify(pTos);
- pTos->i += pOp->p1;
+ pTos->u.i += pOp->p1;
break;
}
break;
}
if( pTos->flags & MEM_Int ){
- v = pTos->i + (pOp->p1!=0);
+ v = pTos->u.i + (pOp->p1!=0);
}else{
/* FIX ME: should this not be assert( pTos->flags & MEM_Real ) ??? */
sqlite3VdbeMemRealify(pTos);
if( pOp->p1 && pTos->r==(double)v ) v++;
}
Release(pTos);
- pTos->i = v;
+ pTos->u.i = v;
pTos->flags = MEM_Int;
break;
}
}else{
pTos++;
pTos->flags = MEM_Int;
- pTos->i = res;
+ pTos->u.i = res;
}
break;
}
v1 = 2;
}else{
sqlite3VdbeMemIntegerify(pTos);
- v1 = pTos->i==0;
+ v1 = pTos->u.i==0;
}
if( pNos->flags & MEM_Null ){
v2 = 2;
}else{
sqlite3VdbeMemIntegerify(pNos);
- v2 = pNos->i==0;
+ v2 = pNos->u.i==0;
}
if( pOp->opcode==OP_And ){
static const unsigned char and_logic[] = { 0, 1, 2, 1, 1, 1, 2, 1, 2 };
if( v1==2 ){
pTos->flags = MEM_Null;
}else{
- pTos->i = v1==0;
+ pTos->u.i = v1==0;
pTos->flags = MEM_Int;
}
break;
pTos->flags = MEM_Real;
}else if( pTos->flags & MEM_Int ){
Release(pTos);
- if( pOp->opcode==OP_Negative || pTos->i<0 ){
- pTos->i = -pTos->i;
+ if( pOp->opcode==OP_Negative || pTos->u.i<0 ){
+ pTos->u.i = -pTos->u.i;
}
pTos->flags = MEM_Int;
}else if( pTos->flags & MEM_Null ){
if( pTos->flags & MEM_Null ) break; /* Do nothing to NULLs */
sqlite3VdbeMemIntegerify(pTos);
assert( (pTos->flags & MEM_Dyn)==0 );
- pTos->i = !pTos->i;
+ pTos->u.i = !pTos->u.i;
pTos->flags = MEM_Int;
break;
}
if( pTos->flags & MEM_Null ) break; /* Do nothing to NULLs */
sqlite3VdbeMemIntegerify(pTos);
assert( (pTos->flags & MEM_Dyn)==0 );
- pTos->i = ~pTos->i;
+ pTos->u.i = ~pTos->u.i;
pTos->flags = MEM_Int;
break;
}
*/
rc = sqlite3BtreeGetMeta(db->aDb[pOp->p1].pBt, 1 + pOp->p2, (u32 *)&iMeta);
pTos++;
- pTos->i = iMeta;
+ pTos->u.i = iMeta;
pTos->flags = MEM_Int;
break;
}
assert( pTos>=p->aStack );
sqlite3VdbeMemIntegerify(pTos);
/* See note about index shifting on OP_ReadCookie */
- rc = sqlite3BtreeUpdateMeta(pDb->pBt, 1+pOp->p2, (int)pTos->i);
+ rc = sqlite3BtreeUpdateMeta(pDb->pBt, 1+pOp->p2, (int)pTos->u.i);
if( pOp->p2==0 ){
/* When the schema cookie changes, record the new cookie internally */
- pDb->pSchema->schema_cookie = pTos->i;
+ pDb->pSchema->schema_cookie = pTos->u.i;
db->flags |= SQLITE_InternChanges;
}else if( pOp->p2==1 ){
/* Record changes in the file format */
- pDb->pSchema->file_format = pTos->i;
+ pDb->pSchema->file_format = pTos->u.i;
}
assert( (pTos->flags & MEM_Dyn)==0 );
pTos--;
assert( pTos>=p->aStack );
sqlite3VdbeMemIntegerify(pTos);
- iDb = pTos->i;
+ iDb = pTos->u.i;
assert( (pTos->flags & MEM_Dyn)==0 );
pTos--;
assert( iDb>=0 && iDb<db->nDb );
if( p2<=0 ){
assert( pTos>=p->aStack );
sqlite3VdbeMemIntegerify(pTos);
- p2 = pTos->i;
+ p2 = pTos->u.i;
assert( (pTos->flags & MEM_Dyn)==0 );
pTos--;
assert( p2>=2 );
if( pC->isTable ){
i64 iKey;
sqlite3VdbeMemIntegerify(pTos);
- iKey = intToKey(pTos->i);
+ iKey = intToKey(pTos->u.i);
if( pOp->p2==0 && pOp->opcode==OP_MoveGe ){
pC->movetoTarget = iKey;
pC->deferredMoveto = 1;
if( rc!=SQLITE_OK ){
goto abort_due_to_error;
}
- pC->lastRowid = pTos->i;
+ pC->lastRowid = pTos->u.i;
pC->rowidIsValid = res==0;
}else{
assert( pTos->flags & MEM_Blob );
*/
assert( pNos>=p->aStack );
sqlite3VdbeMemIntegerify(pTos);
- R = pTos->i;
+ R = pTos->u.i;
assert( (pTos->flags & MEM_Dyn)==0 );
pTos--;
assert( i>=0 && i<p->nCursor );
** constraint.)
*/
pTos++;
- pTos->i = v;
+ pTos->u.i = v;
pTos->flags = MEM_Int;
}
break;
u64 iKey;
assert( pTos->flags & MEM_Int );
assert( p->apCsr[i]->isTable );
- iKey = intToKey(pTos->i);
+ iKey = intToKey(pTos->u.i);
rc = sqlite3BtreeMoveto(pCrsr, 0, iKey, 0,&res);
- pC->lastRowid = pTos->i;
+ pC->lastRowid = pTos->u.i;
pC->rowidIsValid = res==0;
pC->nullRow = 0;
pC->cacheStatus = CACHE_STALE;
assert( i>=0 && i<p->nCursor );
assert( p->apCsr[i]!=0 );
pTos++;
- pTos->i = p->apCsr[i]->seqCount++;
+ pTos->u.i = p->apCsr[i]->seqCount++;
pTos->flags = MEM_Int;
break;
}
pMem = &p->aMem[pOp->p2];
sqlite3VdbeMemIntegerify(pMem);
assert( (pMem->flags & MEM_Int)!=0 ); /* mem(P2) holds an integer */
- if( pMem->i==MAX_ROWID || pC->useRandomRowid ){
+ if( pMem->u.i==MAX_ROWID || pC->useRandomRowid ){
rc = SQLITE_FULL;
goto abort_due_to_error;
}
- if( v<pMem->i+1 ){
- v = pMem->i + 1;
+ if( v<pMem->u.i+1 ){
+ v = pMem->u.i + 1;
}
- pMem->i = v;
+ pMem->u.i = v;
}
#endif
pC->cacheStatus = CACHE_STALE;
}
pTos++;
- pTos->i = v;
+ pTos->u.i = v;
pTos->flags = MEM_Int;
break;
}
assert( pNos->flags & MEM_Int );
assert( pC->isTable );
- iKey = intToKey(pNos->i);
+ iKey = intToKey(pNos->u.i);
if( pOp->p2 & OPFLAG_NCHANGE ) p->nChange++;
- if( pOp->p2 & OPFLAG_LASTROWID ) db->lastRowid = pNos->i;
- if( pC->nextRowidValid && pNos->i>=pC->nextRowid ){
+ if( pOp->p2 & OPFLAG_LASTROWID ) db->lastRowid = pNos->u.i;
+ if( pC->nextRowidValid && pNos->u.i>=pC->nextRowid ){
pC->nextRowidValid = 0;
}
if( pTos->flags & MEM_Null ){
sqlite3BtreeKeySize(pC->pCursor, &v);
v = keyToInt(v);
}
- pTos->i = v;
+ pTos->u.i = v;
pTos->flags = MEM_Int;
break;
}
goto abort_due_to_error;
}
pTos->flags = MEM_Int;
- pTos->i = rowid;
+ pTos->u.i = rowid;
}
}
break;
rc = sqlite3BtreeDropTable(db->aDb[pOp->p2].pBt, pOp->p1, &iMoved);
pTos++;
pTos->flags = MEM_Int;
- pTos->i = iMoved;
+ pTos->u.i = iMoved;
#ifndef SQLITE_OMIT_AUTOVACUUM
if( rc==SQLITE_OK && iMoved!=0 ){
sqlite3RootPageMoved(&db->aDb[pOp->p2], iMoved, pOp->p1);
rc = sqlite3BtreeCreateTable(pDb->pBt, &pgno, flags);
pTos++;
if( rc==SQLITE_OK ){
- pTos->i = pgno;
+ pTos->u.i = pgno;
pTos->flags = MEM_Int;
}else{
pTos->flags = MEM_Null;
assert( (pnErr->flags & MEM_Int)!=0 );
for(j=0; j<nRoot; j++){
Mem *pMem = &pTos[-j];
- aRoot[j] = pMem->i;
+ aRoot[j] = pMem->u.i;
}
aRoot[j] = 0;
popStack(&pTos, nRoot);
pTos++;
z = sqlite3BtreeIntegrityCheck(db->aDb[pOp->p2].pBt, aRoot, nRoot,
- pnErr->i, &nErr);
- pnErr->i -= nErr;
+ pnErr->u.i, &nErr);
+ pnErr->u.i -= nErr;
if( nErr==0 ){
assert( z==0 );
pTos->flags = MEM_Null;
case OP_FifoWrite: { /* no-push */
assert( pTos>=p->aStack );
sqlite3VdbeMemIntegerify(pTos);
- sqlite3VdbeFifoPush(&p->sFifo, pTos->i);
+ sqlite3VdbeFifoPush(&p->sFifo, pTos->u.i);
assert( (pTos->flags & MEM_Dyn)==0 );
pTos--;
break;
pc = pOp->p2 - 1;
}else{
pTos++;
- pTos->i = v;
+ pTos->u.i = v;
pTos->flags = MEM_Int;
}
break;
pMem = &p->aMem[i];
sqlite3VdbeMemIntegerify(pMem);
sqlite3VdbeMemIntegerify(pTos);
- if( pMem->i<pTos->i){
- pMem->i = pTos->i;
+ if( pMem->u.i<pTos->u.i){
+ pMem->u.i = pTos->u.i;
}
break;
}
assert( i>=0 && i<p->nMem );
pMem = &p->aMem[i];
assert( pMem->flags==MEM_Int );
- pMem->i += pOp->p1;
+ pMem->u.i += pOp->p1;
break;
}
assert( i>=0 && i<p->nMem );
pMem = &p->aMem[i];
assert( pMem->flags==MEM_Int );
- if( pMem->i>0 ){
+ if( pMem->u.i>0 ){
pc = pOp->p2 - 1;
}
break;
assert( i>=0 && i<p->nMem );
pMem = &p->aMem[i];
assert( pMem->flags==MEM_Int );
- if( pMem->i<0 ){
+ if( pMem->u.i<0 ){
pc = pOp->p2 - 1;
}
break;
assert( i>=0 && i<p->nMem );
pMem = &p->aMem[i];
assert( pMem->flags==MEM_Int );
- if( pMem->i==0 ){
+ if( pMem->u.i==0 ){
pc = pOp->p2 - 1;
}
break;
/* Grab the index number and argc parameters off the top of the stack. */
assert( (&pTos[-1])>=p->aStack );
assert( (pTos[0].flags&MEM_Int)!=0 && pTos[-1].flags==MEM_Int );
- nArg = pTos[-1].i;
+ nArg = pTos[-1].u.i;
/* Invoke the xFilter method */
{
if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse;
p->inVtabMethod = 1;
- rc = pModule->xFilter(pCur->pVtabCursor, pTos->i, pOp->p3, nArg, apArg);
+ rc = pModule->xFilter(pCur->pVtabCursor, pTos->u.i, pOp->p3, nArg, apArg);
p->inVtabMethod = 0;
if( rc==SQLITE_OK ){
res = pModule->xEof(pCur->pVtabCursor);
pTos++;
pTos->flags = MEM_Int;
- pTos->i = iRow;
+ pTos->u.i = iRow;
}
break;
if( pTos[i].flags & MEM_Null ){
fprintf(p->trace, " NULL");
}else if( (pTos[i].flags & (MEM_Int|MEM_Str))==(MEM_Int|MEM_Str) ){
- fprintf(p->trace, " si:%lld", pTos[i].i);
+ fprintf(p->trace, " si:%lld", pTos[i].u.i);
}else if( pTos[i].flags & MEM_Int ){
- fprintf(p->trace, " i:%lld", pTos[i].i);
+ fprintf(p->trace, " i:%lld", pTos[i].u.i);
}else if( pTos[i].flags & MEM_Real ){
fprintf(p->trace, " r:%g", pTos[i].r);
}else{
Mem *pMem = p->aStack;
pMem->flags = MEM_Int;
pMem->type = SQLITE_INTEGER;
- pMem->i = i; /* Program counter */
+ pMem->u.i = i; /* Program counter */
pMem++;
pMem->flags = MEM_Static|MEM_Str|MEM_Term;
pMem++;
pMem->flags = MEM_Int;
- pMem->i = pOp->p1; /* P1 */
+ pMem->u.i = pOp->p1; /* P1 */
pMem->type = SQLITE_INTEGER;
pMem++;
pMem->flags = MEM_Int;
- pMem->i = pOp->p2; /* P2 */
+ pMem->u.i = pOp->p2; /* P2 */
pMem->type = SQLITE_INTEGER;
pMem++;
if( flags&MEM_Int ){
/* Figure out whether to use 1, 2, 4, 6 or 8 bytes. */
# define MAX_6BYTE ((((i64)0x00001000)<<32)-1)
- i64 i = pMem->i;
+ i64 i = pMem->u.i;
u64 u;
if( file_format>=4 && (i&1)==i ){
return 8+i;
assert( sizeof(v)==sizeof(pMem->r) );
memcpy(&v, &pMem->r, sizeof(v));
}else{
- v = pMem->i;
+ v = pMem->u.i;
}
len = i = sqlite3VdbeSerialTypeLen(serial_type);
while( i-- ){
break;
}
case 1: { /* 1-byte signed integer */
- pMem->i = (signed char)buf[0];
+ pMem->u.i = (signed char)buf[0];
pMem->flags = MEM_Int;
return 1;
}
case 2: { /* 2-byte signed integer */
- pMem->i = (((signed char)buf[0])<<8) | buf[1];
+ pMem->u.i = (((signed char)buf[0])<<8) | buf[1];
pMem->flags = MEM_Int;
return 2;
}
case 3: { /* 3-byte signed integer */
- pMem->i = (((signed char)buf[0])<<16) | (buf[1]<<8) | buf[2];
+ pMem->u.i = (((signed char)buf[0])<<16) | (buf[1]<<8) | buf[2];
pMem->flags = MEM_Int;
return 3;
}
case 4: { /* 4-byte signed integer */
- pMem->i = (buf[0]<<24) | (buf[1]<<16) | (buf[2]<<8) | buf[3];
+ pMem->u.i = (buf[0]<<24) | (buf[1]<<16) | (buf[2]<<8) | buf[3];
pMem->flags = MEM_Int;
return 4;
}
u64 x = (((signed char)buf[0])<<8) | buf[1];
u32 y = (buf[2]<<24) | (buf[3]<<16) | (buf[4]<<8) | buf[5];
x = (x<<32) | y;
- pMem->i = *(i64*)&x;
+ pMem->u.i = *(i64*)&x;
pMem->flags = MEM_Int;
return 6;
}
y = (buf[4]<<24) | (buf[5]<<16) | (buf[6]<<8) | buf[7];
x = (x<<32) | y;
if( serial_type==6 ){
- pMem->i = *(i64*)&x;
+ pMem->u.i = *(i64*)&x;
pMem->flags = MEM_Int;
}else{
assert( sizeof(x)==8 && sizeof(pMem->r)==8 );
}
case 8: /* Integer 0 */
case 9: { /* Integer 1 */
- pMem->i = serial_type-8;
+ pMem->u.i = serial_type-8;
pMem->flags = MEM_Int;
return 0;
}
sqlite3GetVarint32((u8*)&m.z[szHdr-1], &typeRowid);
lenRowid = sqlite3VdbeSerialTypeLen(typeRowid);
sqlite3VdbeSerialGet((u8*)&m.z[m.n-lenRowid], typeRowid, &v);
- *rowid = v.i;
+ *rowid = v.u.i;
sqlite3VdbeMemRelease(&m);
return SQLITE_OK;
}
** FIX ME: It would be better if sqlite3_snprintf() could do UTF-16.
*/
if( fg & MEM_Int ){
- sqlite3_snprintf(NBFS, z, "%lld", pMem->i);
+ sqlite3_snprintf(NBFS, z, "%lld", pMem->u.i);
}else{
assert( fg & MEM_Real );
sqlite3_snprintf(NBFS, z, "%!.15g", pMem->r);
int rc = SQLITE_OK;
if( pFunc && pFunc->xFinalize ){
sqlite3_context ctx;
- assert( (pMem->flags & MEM_Null)!=0 || pFunc==pMem->pDef );
+ assert( (pMem->flags & MEM_Null)!=0 || pFunc==pMem->u.pDef );
ctx.s.flags = MEM_Null;
ctx.s.z = pMem->zShort;
ctx.pMem = pMem;
if( p->flags & (MEM_Dyn|MEM_Agg) ){
if( p->xDel ){
if( p->flags & MEM_Agg ){
- sqlite3VdbeMemFinalize(p, p->pDef);
+ sqlite3VdbeMemFinalize(p, p->u.pDef);
assert( (p->flags & MEM_Agg)==0 );
sqlite3VdbeMemRelease(p);
}else{
i64 sqlite3VdbeIntValue(Mem *pMem){
int flags = pMem->flags;
if( flags & MEM_Int ){
- return pMem->i;
+ return pMem->u.i;
}else if( flags & MEM_Real ){
return (i64)pMem->r;
}else if( flags & (MEM_Str|MEM_Blob) ){
if( pMem->flags & MEM_Real ){
return pMem->r;
}else if( pMem->flags & MEM_Int ){
- return (double)pMem->i;
+ return (double)pMem->u.i;
}else if( pMem->flags & (MEM_Str|MEM_Blob) ){
double val = 0.0;
if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8)
*/
void sqlite3VdbeIntegerAffinity(Mem *pMem){
assert( pMem->flags & MEM_Real );
- pMem->i = pMem->r;
- if( ((double)pMem->i)==pMem->r ){
+ pMem->u.i = pMem->r;
+ if( ((double)pMem->u.i)==pMem->r ){
pMem->flags |= MEM_Int;
}
}
** Convert pMem to type integer. Invalidate any prior representations.
*/
int sqlite3VdbeMemIntegerify(Mem *pMem){
- pMem->i = sqlite3VdbeIntValue(pMem);
+ pMem->u.i = sqlite3VdbeIntValue(pMem);
sqlite3VdbeMemRelease(pMem);
pMem->flags = MEM_Int;
return SQLITE_OK;
*/
void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
sqlite3VdbeMemRelease(pMem);
- pMem->i = val;
+ pMem->u.i = val;
pMem->flags = MEM_Int;
pMem->type = SQLITE_INTEGER;
}
if( (f1 & f2 & MEM_Int)==0 ){
double r1, r2;
if( (f1&MEM_Real)==0 ){
- r1 = pMem1->i;
+ r1 = pMem1->u.i;
}else{
r1 = pMem1->r;
}
if( (f2&MEM_Real)==0 ){
- r2 = pMem2->i;
+ r2 = pMem2->u.i;
}else{
r2 = pMem2->r;
}
}else{
assert( f1&MEM_Int );
assert( f2&MEM_Int );
- if( pMem1->i < pMem2->i ) return -1;
- if( pMem1->i > pMem2->i ) return 1;
+ if( pMem1->u.i < pMem2->u.i ) return -1;
+ if( pMem1->u.i > pMem2->u.i ) return 1;
return 0;
}
}
|| (pMem->flags&MEM_Null)==0 );
/* If the MEM is both real and integer, the values are equal */
assert( (pMem->flags & (MEM_Int|MEM_Real))!=(MEM_Int|MEM_Real)
- || pMem->r==pMem->i );
+ || pMem->r==pMem->u.i );
}
#endif
}
}else if( op==TK_UMINUS ) {
if( SQLITE_OK==sqlite3ValueFromExpr(pExpr->pLeft, enc, affinity, &pVal) ){
- pVal->i = -1 * pVal->i;
+ pVal->u.i = -1 * pVal->u.i;
pVal->r = -1.0 * pVal->r;
}
}