SQLite

Check-in [61f0526978]
Login

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

Overview
Comment:New testcase() macros to ensure coverage of the ORDER BY LIMIT optimization code in where.c.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 61f0526978af667781c57bcc87510e4524efd0d8
User & Date: drh 2016-10-12 15:15:30.391
Context
2016-10-12
18:26
Add to sqlite3_analyzer command-line options --version and --tclsh, and also the undocumented --debug option. (check-in: e87d02d289 user: drh tags: trunk)
15:15
New testcase() macros to ensure coverage of the ORDER BY LIMIT optimization code in where.c. (check-in: 61f0526978 user: drh tags: trunk)
14:48
Fix a problem affecting queries that match the pattern (... WHERE ipk IN (....) ORDER BY ? LIMIT ?). Fix for [96c1454c]. (check-in: 8e2b25f9b8 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/where.c.
4127
4128
4129
4130
4131
4132
4133


4134
4135
4136
4137
4138
4139
4140
        pWInfo->nOBSat = 0;
        if( nLoop>0 && (wsFlags & WHERE_ONEROW)==0 
         && (wsFlags & (WHERE_IPK|WHERE_COLUMN_IN))!=(WHERE_IPK|WHERE_COLUMN_IN)
        ){
          Bitmask m = 0;
          int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, pFrom,
                      WHERE_ORDERBY_LIMIT, nLoop-1, pFrom->aLoop[nLoop-1], &m);


          if( rc==pWInfo->pOrderBy->nExpr ){
            pWInfo->bOrderedInnerLoop = 1;
            pWInfo->revMask = m;
          }
        }
      }
    }







>
>







4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
        pWInfo->nOBSat = 0;
        if( nLoop>0 && (wsFlags & WHERE_ONEROW)==0 
         && (wsFlags & (WHERE_IPK|WHERE_COLUMN_IN))!=(WHERE_IPK|WHERE_COLUMN_IN)
        ){
          Bitmask m = 0;
          int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, pFrom,
                      WHERE_ORDERBY_LIMIT, nLoop-1, pFrom->aLoop[nLoop-1], &m);
          testcase( wsFlags & WHERE_IPK );
          testcase( wsFlags & WHERE_COLUMN_IN );
          if( rc==pWInfo->pOrderBy->nExpr ){
            pWInfo->bOrderedInnerLoop = 1;
            pWInfo->revMask = m;
          }
        }
      }
    }