/ Check-in [b59f94e4da]
Login

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

Overview
Comment:When a virtual table reports orderByConsumed, that tells us nothing about whether or not the SQLITE_DISTINCTBY constraint is met. Fix for ticket [7e59041f9c4e5102]. Test cases in TH3.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b59f94e4da9b1653f2004b214407a50340dd476b27e6ec7e29e501a95db9c963
User & Date: drh 2019-11-08 20:13:44
Context
2019-11-09
14:38
Make sure the WITH stack in the Parse object is disabled following an error. check-in: de6e6d6846 user: drh tags: trunk
2019-11-08
20:13
When a virtual table reports orderByConsumed, that tells us nothing about whether or not the SQLITE_DISTINCTBY constraint is met. Fix for ticket [7e59041f9c4e5102]. Test cases in TH3. check-in: b59f94e4da user: drh tags: trunk
2019-11-07
14:51
Fix the xferCompatibleIndex() function so that it recognizes that a PRIMARY KEY index for a WITHOUT ROWID table is different from a UNIQUE constraint index on the primary key. Ticket [302027baf1374498] check-in: 34f64f11ca user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/where.c.

3692
3693
3694
3695
3696
3697
3698
3699


3700
3701
3702
3703
3704
3705
3706
    if( iLoop<nLoop ){
      pLoop = pPath->aLoop[iLoop];
      if( wctrlFlags & WHERE_ORDERBY_LIMIT ) continue;
    }else{
      pLoop = pLast;
    }
    if( pLoop->wsFlags & WHERE_VIRTUALTABLE ){
      if( pLoop->u.vtab.isOrdered ) obSat = obDone;


      break;
    }else if( wctrlFlags & WHERE_DISTINCTBY ){
      pLoop->u.btree.nDistinctCol = 0;
    }
    iCur = pWInfo->pTabList->a[pLoop->iTab].iCursor;

    /* Mark off any ORDER BY term X that is a column in the table of







|
>
>







3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
    if( iLoop<nLoop ){
      pLoop = pPath->aLoop[iLoop];
      if( wctrlFlags & WHERE_ORDERBY_LIMIT ) continue;
    }else{
      pLoop = pLast;
    }
    if( pLoop->wsFlags & WHERE_VIRTUALTABLE ){
      if( pLoop->u.vtab.isOrdered && (wctrlFlags & WHERE_DISTINCTBY)==0 ){
        obSat = obDone;
      }
      break;
    }else if( wctrlFlags & WHERE_DISTINCTBY ){
      pLoop->u.btree.nDistinctCol = 0;
    }
    iCur = pWInfo->pTabList->a[pLoop->iTab].iCursor;

    /* Mark off any ORDER BY term X that is a column in the table of