SQLite

Check-in [e12da0d316]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:When SQLITE_OMIT_FLOATING_POINT is defined, make sure the result of a mathematical operation is always tagged as an integer.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e12da0d316fcc34a75554d59fe6d11d9f0e059e2
User & Date: drh 2010-01-13 16:25:43.000
Context
2010-01-13
16:43
When SQLITE_OMIT_FLOATING_POINT is defined, the floating-point formats in the sqlite3_*printf() functions should pull an int64 off of the parameter list and ignore it. (check-in: 3fd6f9ad06 user: drh tags: trunk)
16:25
When SQLITE_OMIT_FLOATING_POINT is defined, make sure the result of a mathematical operation is always tagged as an integer. (check-in: e12da0d316 user: drh tags: trunk)
15:15
Make the doubleToInt64() routine a pass-through when using OMIT_FLOATING_POINT. (check-in: 417167182e user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbe.c.
1293
1294
1295
1296
1297
1298
1299




1300
1301
1302
1303
1304
1305
1306
1307

1308
1309
1310
1311
1312
1313
1314
        iB = (i64)rB;
        if( iA==0 ) goto arithmetic_result_is_null;
        if( iA==-1 ) iA = 1;
        rB = (double)(iB % iA);
        break;
      }
    }




    if( sqlite3IsNaN(rB) ){
      goto arithmetic_result_is_null;
    }
    pOut->r = rB;
    MemSetTypeFlag(pOut, MEM_Real);
    if( (flags & MEM_Real)==0 ){
      sqlite3VdbeIntegerAffinity(pOut);
    }

  }
  break;

arithmetic_result_is_null:
  sqlite3VdbeMemSetNull(pOut);
  break;
}







>
>
>
>








>







1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
        iB = (i64)rB;
        if( iA==0 ) goto arithmetic_result_is_null;
        if( iA==-1 ) iA = 1;
        rB = (double)(iB % iA);
        break;
      }
    }
#ifdef SQLITE_OMIT_FLOATING_POINT
    pOut->u.i = rB;
    MemSetTypeFlag(pOut, MEM_Int);
#else
    if( sqlite3IsNaN(rB) ){
      goto arithmetic_result_is_null;
    }
    pOut->r = rB;
    MemSetTypeFlag(pOut, MEM_Real);
    if( (flags & MEM_Real)==0 ){
      sqlite3VdbeIntegerAffinity(pOut);
    }
#endif
  }
  break;

arithmetic_result_is_null:
  sqlite3VdbeMemSetNull(pOut);
  break;
}