/ Check-in [8462fb43]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Rearrange the order of conditions in an "if" statement to facilitate testing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8462fb43c275a70db59c4339650225deeadeef00
User & Date: drh 2013-09-04 18:14:53
Context
2013-09-05
18:40
When preparing an UPDATE statement, avoid generating VDBE code for those foreign key related actions and constraint checks that may be seen to be unnecessary by considering the subset of table columns potentially modified by the UPDATE. check-in: e940b5de user: dan tags: trunk
2013-09-04
18:14
Rearrange the order of conditions in an "if" statement to facilitate testing. check-in: 8462fb43 user: drh tags: trunk
16:38
Add tests to improve coverage when SQLITE_ENABLE_STAT3 is defined. check-in: f929e9b4 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  2545   2545     int rc = SQLITE_OK;
  2546   2546     int nOut = (int)*pnOut;
  2547   2547   
  2548   2548   #ifdef SQLITE_ENABLE_STAT3_OR_STAT4
  2549   2549     Index *p = pBuilder->pNew->u.btree.pIndex;
  2550   2550     int nEq = pBuilder->pNew->u.btree.nEq;
  2551   2551   
  2552         -  if( nEq==pBuilder->nRecValid
         2552  +  if( p->nSample>0
         2553  +   && nEq==pBuilder->nRecValid
  2553   2554      && nEq<p->nSampleCol
  2554         -   && p->nSample 
  2555   2555      && OptimizationEnabled(pParse->db, SQLITE_Stat3) 
  2556   2556     ){
  2557   2557       UnpackedRecord *pRec = pBuilder->pRec;
  2558   2558       tRowcnt a[2];
  2559   2559       u8 aff;
  2560   2560   
  2561   2561       /* Variable iLower will be set to the estimate of the number of rows in