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

Correctly handle 64-bit integers in SQL statements. (CVS 1408)

FossilOrigin-Name: 34f03ba6a9d6e2144d0c6cbbbeb37b4c69705f1f
This commit is contained in:
drh
2004-05-19 20:41:03 +00:00
parent 7cf6e4de35
commit fec19aad44
10 changed files with 156 additions and 112 deletions

View File

@@ -1387,13 +1387,13 @@ int sqlite3MemCompare(Mem *pMem1, Mem *pMem2){
** if both values are integers.
*/
if( combined_flags&(MEM_Int|MEM_Real) ){
i64 diff;
if( !(pMem1->flags&(MEM_Int|MEM_Real)) ){
return 1;
}
if( !(pMem2->flags&(MEM_Int|MEM_Real)) ){
return -1;
}
if( combined_flags&MEM_Real ){
if( pMem1->flags&MEM_Int ){
pMem1->r = pMem1->i;
@@ -1405,8 +1405,8 @@ int sqlite3MemCompare(Mem *pMem1, Mem *pMem2){
if( pMem1->r > pMem2->r ) return 1;
return 0;
}
return (pMem1->i - pMem2->i);
diff = pMem1->i - pMem2->i;
return diff<0 ? -1 : diff==0 ? 0 : +1;
}
rc = (pMem2->flags&MEM_Null) - (pMem1->flags&MEM_Null);
@@ -1667,12 +1667,6 @@ int sqlite3VdbeIdxKeyCompare(
len = nCellKey-2;
while( pCellKey[len] && --len );
#if 0
if( ignorerowid ){
nKey--;
while( pKey[nKey] && --nKey );
}
#endif
*res = sqlite3VdbeKeyCompare(pC, len, pCellKey, nKey, pKey);
if( freeCellKey ){