SQLite

Check-in [048add13fc]
Login

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

Overview
Comment:Handle oversize floating point values carefully when converting to integers for the '%' binary operator.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 048add13fc10e69ae504a49c4663612381d928b2cf1f9cdab4ff34bd40f601a3
User & Date: drh 2019-01-18 17:53:50.691
References
2020-08-27
13:21 Ticket [be31cf009c] Unexpected result for % and '1E1' status still Open with 6 other changes (artifact: 8b261c7523 user: drh)
2020-08-26
14:12 New ticket [be31cf009c]. (artifact: 3102412d99 user: mrigger)
Context
2019-01-18
18:52
Avoid integer overflow when computing the array of a bounding box with the rtree_i32 virtual table. (check-in: b352f1590d user: drh tags: trunk)
17:53
Handle oversize floating point values carefully when converting to integers for the '%' binary operator. (check-in: 048add13fc user: drh tags: trunk)
16:06
Fix a fairly obscure problem allowing an "ALTER TABLE RENAME col TO ..." statement to modify the schema in such a way as to break a reference within a trigger program. (check-in: 64bec9e621 user: dan tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/vdbe.c.
1579
1580
1581
1582
1583
1584
1585
1586
1587


1588
1589
1590
1591
1592
1593
1594
1579
1580
1581
1582
1583
1584
1585


1586
1587
1588
1589
1590
1591
1592
1593
1594







-
-
+
+







      case OP_Divide: {
        /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */
        if( rA==(double)0 ) goto arithmetic_result_is_null;
        rB /= rA;
        break;
      }
      default: {
        iA = (i64)rA;
        iB = (i64)rB;
        iA = sqlite3VdbeIntValue(pIn1);
        iB = sqlite3VdbeIntValue(pIn2);
        if( iA==0 ) goto arithmetic_result_is_null;
        if( iA==-1 ) iA = 1;
        rB = (double)(iB % iA);
        break;
      }
    }
#ifdef SQLITE_OMIT_FLOATING_POINT