SQLite

Check-in [a33d235609]
Login

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

Overview
Comment:Proposed fix for a problem in the query planner.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | planner-fix
Files: files | file ages | folders
SHA1: a33d23560959a127e37d8213dc00210cd4b05352
User & Date: drh 2016-06-28 22:27:56.883
Context
2016-07-01
19:48
Add test cases to the transitive constraint fix. (Closed-Leaf check-in: c952af89c2 user: drh tags: planner-fix)
2016-06-28
22:27
Proposed fix for a problem in the query planner. (check-in: a33d235609 user: drh tags: planner-fix)
2016-06-26
04:06
Prevent the WhereLoop.rSetup cost estimate from going negative on complex queries. (check-in: f810508591 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/whereexpr.c.
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
   && (!sqlite3IsNumericAffinity(aff1) || !sqlite3IsNumericAffinity(aff2))
  ){
    return 0;
  }
  pColl = sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft, pExpr->pRight);
  if( pColl==0 || sqlite3StrICmp(pColl->zName, "BINARY")==0 ) return 1;
  pColl = sqlite3ExprCollSeq(pParse, pExpr->pLeft);
  /* Since pLeft and pRight are both a column references, their collating
  ** sequence should always be defined. */
  zColl1 = ALWAYS(pColl) ? pColl->zName : 0;
  pColl = sqlite3ExprCollSeq(pParse, pExpr->pRight);
  zColl2 = ALWAYS(pColl) ? pColl->zName : 0;
  return sqlite3StrICmp(zColl1, zColl2)==0;
}

/*
** Recursively walk the expressions of a SELECT statement and generate
** a bitmask indicating which tables are used in that expression
** tree.
*/







<
<
|

|
|







781
782
783
784
785
786
787


788
789
790
791
792
793
794
795
796
797
798
   && (!sqlite3IsNumericAffinity(aff1) || !sqlite3IsNumericAffinity(aff2))
  ){
    return 0;
  }
  pColl = sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft, pExpr->pRight);
  if( pColl==0 || sqlite3StrICmp(pColl->zName, "BINARY")==0 ) return 1;
  pColl = sqlite3ExprCollSeq(pParse, pExpr->pLeft);


  zColl1 = pColl ? pColl->zName : 0;
  pColl = sqlite3ExprCollSeq(pParse, pExpr->pRight);
  zColl2 = pColl ? pColl->zName : 0;
  return sqlite3_stricmp(zColl1, zColl2)==0;
}

/*
** Recursively walk the expressions of a SELECT statement and generate
** a bitmask indicating which tables are used in that expression
** tree.
*/