/ 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 Unified Diffs Show Whitespace Changes Patch

Changes to ext/misc/series.c.

327
328
329
330
331
332
333

334
335
336
337
338
339
340
  aIdx[0] = aIdx[1] = aIdx[2] = -1;
  pConstraint = pIdxInfo->aConstraint;
  for(i=0; i<pIdxInfo->nConstraint; i++, pConstraint++){
    int iCol;    /* 0 for start, 1 for stop, 2 for step */
    int iMask;   /* bitmask for those column */
    if( pConstraint->iColumn<SERIES_COLUMN_START ) continue;
    iCol = pConstraint->iColumn - SERIES_COLUMN_START;

    iMask = 1 << iCol;
    if( pConstraint->usable==0 ){
      unusableMask |=  iMask;
      continue;
    }else if( pConstraint->op==SQLITE_INDEX_CONSTRAINT_EQ ){
      idxNum |= iMask;
      aIdx[iCol] = i;







>







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