/ Check-in [db367738]
Login

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

Overview
Comment:An optimization to sqlite3VdbeSerialType(). (CVS 2278)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: db36773830cc81c38b78d1776a495d49475523be
User & Date: drh 2005-01-26 17:47:03
Context
2005-01-26
21:55
Propagate detected database corruption up through the call stack. (CVS 2279) check-in: 2c54aba5 user: drh tags: trunk
17:47
An optimization to sqlite3VdbeSerialType(). (CVS 2278) check-in: db367738 user: drh tags: trunk
10:39
Add an entry to faq.tcl regarding SQLITE_SCHEMA errors. (CVS 2277) check-in: 12defe8c user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbeaux.c.

  1496   1496     if( flags&MEM_Null ){
  1497   1497       return 0;
  1498   1498     }
  1499   1499     if( flags&MEM_Int ){
  1500   1500       /* Figure out whether to use 1, 2, 4, 6 or 8 bytes. */
  1501   1501   #   define MAX_6BYTE ((((i64)0x00010000)<<32)-1)
  1502   1502       i64 i = pMem->i;
  1503         -    if( i>=-127 && i<=127 ) return 1;
  1504         -    if( i>=-32767 && i<=32767 ) return 2;
  1505         -    if( i>=-8388607 && i<=8388607 ) return 3;
  1506         -    if( i>=-2147483647 && i<=2147483647 ) return 4;
  1507         -    if( i>=-MAX_6BYTE && i<=MAX_6BYTE ) return 5;
         1503  +    u64 u = i<0 ? -i : i;
         1504  +    if( u<=127 ) return 1;
         1505  +    if( u<=32767 ) return 2;
         1506  +    if( u<=8388607 ) return 3;
         1507  +    if( u<=2147483647 ) return 4;
         1508  +    if( u<=MAX_6BYTE ) return 5;
  1508   1509       return 6;
  1509   1510     }
  1510   1511     if( flags&MEM_Real ){
  1511   1512       return 7;
  1512   1513     }
  1513   1514     if( flags&MEM_Str ){
  1514   1515       int n = pMem->n;