/ Check-in [d4b6ad33]
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:Restore fix [f15591f802], which was accidentally clobbered by the stat4 merge.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d4b6ad3333cc3bad500c2ebf7a6ea552b6762b69
User & Date: dan 2013-08-29 14:56:14
Context
2013-08-29
23:36
Make the unix VFS defensive against the error of having a database file open on file descriptors 1 or 2, as an error message might easily be written onto those file descriptors and thus overwrite and corrupt the database. check-in: 30d38cc4 user: drh tags: trunk
21:26
Never leave an open file descriptor pointing into the middle of the database file if the file descriptor number is 2 or less. check-in: 3426673e user: drh tags: overwrite-avoidance
15:08
Merge from trunk: (1) Recent bug fixes (2) STAT4 support (3) win32-longpath support. check-in: e7ebc8f7 user: drh tags: sessions
14:56
Restore fix [f15591f802], which was accidentally clobbered by the stat4 merge. check-in: d4b6ad33 user: dan tags: trunk
10:46
Candidate fix for [9f2eb3abac]: Have the whereShortCut() planner ignore indexes with more than four columns. check-in: c1152bdc user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  4305   4305     saved_nOut = pNew->nOut;
  4306   4306     pNew->rSetup = 0;
  4307   4307     rLogSize = estLog(whereCost(pProbe->aiRowEst[0]));
  4308   4308     for(; rc==SQLITE_OK && pTerm!=0; pTerm = whereScanNext(&scan)){
  4309   4309       int nIn = 0;
  4310   4310   #ifdef SQLITE_ENABLE_STAT3_OR_STAT4
  4311   4311       int nRecValid = pBuilder->nRecValid;
  4312         -    assert( pNew->nOut==saved_nOut );
  4313         -    if( (pTerm->wtFlags & TERM_VNULL)!=0 && pSrc->pTab->aCol[iCol].notNull ){
  4314         -      continue; /* skip IS NOT NULL constraints on a NOT NULL column */
         4312  +#endif
         4313  +    if( (pTerm->eOperator==WO_ISNULL || (pTerm->wtFlags&TERM_VNULL)!=0)
         4314  +     && (iCol<0 || pSrc->pTab->aCol[iCol].notNull)
         4315  +    ){
         4316  +      continue; /* ignore IS [NOT] NULL constraints on NOT NULL columns */
  4315   4317       }
  4316         -#endif
  4317   4318       if( pTerm->prereqRight & pNew->maskSelf ) continue;
  4318   4319   
  4319   4320       assert( pNew->nOut==saved_nOut );
  4320   4321   
  4321   4322       pNew->wsFlags = saved_wsFlags;
  4322   4323       pNew->u.btree.nEq = saved_nEq;
  4323   4324       pNew->nLTerm = saved_nLTerm;