/ Check-in [81fd941d]
Login

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

Overview
Comment:Candidate fix for ticket [d02e1406a58ea02].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.7.14
Files: files | file ages | folders
SHA1: 81fd941da62956e32d1c4ffcdb39abecba7a6f3b
User & Date: drh 2012-10-04 16:00:24
Context
2012-10-04
19:37
Version 3.7.14.1 check-in: 091570e4 user: drh tags: release, version-3.7.14.1, branch-3.7.14
16:00
Candidate fix for ticket [d02e1406a58ea02]. check-in: 81fd941d user: drh tags: branch-3.7.14
15:36
Increase the version number to 3.7.14.1. The version of autoconf used is different from the previous release so there are huge differences in the generated "configure" script. check-in: 972dbd5f user: drh tags: branch-3.7.14
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  4443   4443   
  4444   4444             /* Finish the loop through table entries that match term pOrTerm. */
  4445   4445             sqlite3WhereEnd(pSubWInfo);
  4446   4446           }
  4447   4447         }
  4448   4448       }
  4449   4449       pLevel->u.pCovidx = pCov;
  4450         -    pLevel->iIdxCur = iCovCur;
         4450  +    if( pCov ) pLevel->iIdxCur = iCovCur;
  4451   4451       if( pAndExpr ){
  4452   4452         pAndExpr->pLeft = 0;
  4453   4453         sqlite3ExprDelete(pParse->db, pAndExpr);
  4454   4454       }
  4455   4455       sqlite3VdbeChangeP1(v, iRetInit, sqlite3VdbeCurrentAddr(v));
  4456   4456       sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->addrBrk);
  4457   4457       sqlite3VdbeResolveLabel(v, iLoopBody);

Changes to test/whereD.test.

   156    156   
   157    157   do_searchcount_test 3.5.1 {
   158    158     SELECT a, b FROM t3 WHERE (a=1 AND b='one') OR rowid=4
   159    159   } {1 one 2 two search 2}
   160    160   do_searchcount_test 3.5.2 {
   161    161     SELECT a, c FROM t3 WHERE (a=1 AND b='one') OR rowid=4
   162    162   } {1 i 2 ii search 2}
          163  +
          164  +# Ticket [d02e1406a58ea02d] (2012-10-04)
          165  +# LEFT JOIN with an OR in the ON clause causes segfault 
          166  +#
          167  +do_test 4.1 {
          168  +  db eval {
          169  +    CREATE TABLE t41(a,b,c);
          170  +    INSERT INTO t41 VALUES(1,2,3), (4,5,6);
          171  +    CREATE TABLE t42(d,e,f);
          172  +    INSERT INTO t42 VALUES(3,6,9), (4,8,12);
          173  +    SELECT * FROM t41 AS x LEFT JOIN t42 AS y ON (y.d=x.c) OR (y.e=x.b);
          174  +  }
          175  +} {1 2 3 3 6 9 4 5 6 {} {} {}}
          176  +do_test 4.2 {
          177  +  db eval {
          178  +    CREATE INDEX t42d ON t42(d);
          179  +    CREATE INDEX t42e ON t42(e);
          180  +    SELECT * FROM t41 AS x LEFT JOIN t42 AS y ON (y.d=x.c) OR (y.e=x.b);
          181  +  }
          182  +} {1 2 3 3 6 9 4 5 6 {} {} {}}
          183  +do_test 4.2 {
          184  +  db eval {
          185  +    SELECT * FROM t41 AS x LEFT JOIN t42 AS y ON (y.d=x.c) OR (y.d=x.b);
          186  +  }
          187  +} {1 2 3 3 6 9 4 5 6 {} {} {}}
   163    188   
   164    189   finish_test