/ Check-in [cd13b499]
Login

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

Overview
Comment:Add an assert() to the generate_series virtual table to verify assumptions about the design.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: cd13b499a20a7d476edb8500537edef4c5151410ba0300469ebf0f7ba16964b8
User & Date: drh 2018-11-16 15:41:27
Context
2018-11-16
16:04
Fix the JSON table-valued functions to make use of SQLITE_CONSTRAINT. check-in: 3f34f4f5 user: drh tags: trunk
15:41
Add an assert() to the generate_series virtual table to verify assumptions about the design. check-in: cd13b499 user: drh tags: trunk
15:08
Update the generate_series() table-valued function to make use of the new SQLITE_CONSTRAINT return from xBestIndex. check-in: 4372ad64 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/misc/series.c.

   327    327     aIdx[0] = aIdx[1] = aIdx[2] = -1;
   328    328     pConstraint = pIdxInfo->aConstraint;
   329    329     for(i=0; i<pIdxInfo->nConstraint; i++, pConstraint++){
   330    330       int iCol;    /* 0 for start, 1 for stop, 2 for step */
   331    331       int iMask;   /* bitmask for those column */
   332    332       if( pConstraint->iColumn<SERIES_COLUMN_START ) continue;
   333    333       iCol = pConstraint->iColumn - SERIES_COLUMN_START;
          334  +    assert( iCol>=0 && iCol<=2 );
   334    335       iMask = 1 << iCol;
   335    336       if( pConstraint->usable==0 ){
   336    337         unusableMask |=  iMask;
   337    338         continue;
   338    339       }else if( pConstraint->op==SQLITE_INDEX_CONSTRAINT_EQ ){
   339    340         idxNum |= iMask;
   340    341         aIdx[iCol] = i;