/ Check-in [e2db1123]
Login

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

Overview
Comment:Remove some affinity tests that became unreachable due to the prior change.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e2db1123faac26c0e0b6a1ebef1685ea7633bfcafd1ff743ba5380700f7745af
User & Date: drh 2019-08-31 01:33:19
Context
2019-08-31
17:14
If a DELETE trigger fired by an UPDATE OR REPLACE statement deletes the row being updated, do not attempt to proceed with the original UPDATE operation. Fix for [d6a0fbc1]. check-in: 4145b3e0 user: dan tags: trunk
01:33
Remove some affinity tests that became unreachable due to the prior change. check-in: e2db1123 user: drh tags: trunk
2019-08-30
23:56
When the affinity of a table column is INT or REAL, make the affinity of corresponding index columns NUMERIC. This increases the precision of index lookups for large numbers so that it matches the precision of ordinary comparison operators. Ticket [40812aea1fde9594] check-in: e0d909c7 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

  2199   2199       if( p->op==TK_UMINUS ) unaryMinus = 1;
  2200   2200       p = p->pLeft;
  2201   2201     }
  2202   2202     op = p->op;
  2203   2203     if( op==TK_REGISTER ) op = p->op2;
  2204   2204     switch( op ){
  2205   2205       case TK_INTEGER: {
  2206         -      return aff==SQLITE_AFF_INTEGER || aff==SQLITE_AFF_NUMERIC;
         2206  +      return aff>=SQLITE_AFF_NUMERIC;
  2207   2207       }
  2208   2208       case TK_FLOAT: {
  2209         -      return aff==SQLITE_AFF_REAL || aff==SQLITE_AFF_NUMERIC;
         2209  +      return aff>=SQLITE_AFF_NUMERIC;
  2210   2210       }
  2211   2211       case TK_STRING: {
  2212   2212         return !unaryMinus && aff==SQLITE_AFF_TEXT;
  2213   2213       }
  2214   2214       case TK_BLOB: {
  2215   2215         return !unaryMinus;
  2216   2216       }
  2217   2217       case TK_COLUMN: {
  2218   2218         assert( p->iTable>=0 );  /* p cannot be part of a CHECK constraint */
  2219         -      return p->iColumn<0
  2220         -          && (aff==SQLITE_AFF_INTEGER || aff==SQLITE_AFF_NUMERIC);
         2219  +      return aff>=SQLITE_AFF_NUMERIC && p->iColumn<0;
  2221   2220       }
  2222   2221       default: {
  2223   2222         return 0;
  2224   2223       }
  2225   2224     }
  2226   2225   }
  2227   2226   

Changes to src/wherecode.c.

   751    751         if( zAff ){
   752    752           if( sqlite3CompareAffinity(pRight, zAff[j])==SQLITE_AFF_BLOB ){
   753    753             zAff[j] = SQLITE_AFF_BLOB;
   754    754           }
   755    755           if( sqlite3ExprNeedsNoAffinityChange(pRight, zAff[j]) ){
   756    756             zAff[j] = SQLITE_AFF_BLOB;
   757    757           }
   758         -        if( zAff[j]==SQLITE_AFF_REAL ) zAff[j] = SQLITE_AFF_NUMERIC;
   759    758         }
   760    759       }
   761    760     }
   762    761     *pzAff = zAff;
   763    762     return regBase;
   764    763   }
   765    764