/ Check-in [6aea2258]
Login

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

Overview
Comment:Fix a bug in the whereRangeSkipScanEst() procedure (added by check-in [d09ca6d5efad3e4cfa]) where it fails to consider the possibility of a ROWID column when computing the affinity of a table column.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6aea2258dd7d3967900cefe4cd0af48a7ee7e169
User & Date: drh 2014-07-24 22:41:20
Context
2014-07-24
23:23
Improve the performance of the ANALYZE command by taking advantage of UNIQUE constraints on indices. check-in: 114dcf33 user: drh tags: trunk
22:41
Fix a bug in the whereRangeSkipScanEst() procedure (added by check-in [d09ca6d5efad3e4cfa]) where it fails to consider the possibility of a ROWID column when computing the affinity of a table column. check-in: 6aea2258 user: drh tags: trunk
12:39
Add the readfile(FILENAME) and writefile(FILENAME,CONTENT) SQL functions to the command-line shell. check-in: fb1048cb user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  2043   2043   ){
  2044   2044     Index *p = pLoop->u.btree.pIndex;
  2045   2045     int nEq = pLoop->u.btree.nEq;
  2046   2046     sqlite3 *db = pParse->db;
  2047   2047     int nLower = -1;
  2048   2048     int nUpper = p->nSample+1;
  2049   2049     int rc = SQLITE_OK;
  2050         -  u8 aff = p->pTable->aCol[ p->aiColumn[nEq] ].affinity;
         2050  +  int iCol = p->aiColumn[nEq];
         2051  +  u8 aff = iCol>=0 ? p->pTable->aCol[iCol].affinity : SQLITE_AFF_INTEGER;
  2051   2052     CollSeq *pColl;
  2052   2053     
  2053   2054     sqlite3_value *p1 = 0;          /* Value extracted from pLower */
  2054   2055     sqlite3_value *p2 = 0;          /* Value extracted from pUpper */
  2055   2056     sqlite3_value *pVal = 0;        /* Value extracted from record */
  2056   2057   
  2057   2058     pColl = sqlite3LocateCollSeq(pParse, p->azColl[nEq]);