SQLite

Check-in [41d58a01]
Login

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

Overview
Comment:Fix a problem in the generate_series() extension introduced by [d50b784807333c54].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 41d58a014ce89356932d717843a1fa6e0735f15a7b7265c41ac85a9722a5d826
User & Date: drh 2024-10-09 16:32:19
Context
2024-10-10
10:47
Improvements to TCL9 support. Fixes to the Makefiles so that the "install" targets are consistent and so that they work better with TCL9. (check-in: bcfae718 user: drh tags: trunk)
2024-10-09
16:32
Fix a problem in the generate_series() extension introduced by [d50b784807333c54]. (check-in: 41d58a01 user: drh tags: trunk)
16:28
Fix the xCheckReservedLock() method of the flock VFS to avoid dropping the file lock. (check-in: f7acb189 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to ext/misc/series.c.
654
655
656
657
658
659
660

661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700

701
702
703
704
705
706
707
      }else{
        assert( op==SQLITE_INDEX_CONSTRAINT_OFFSET );
        aIdx[4] = i;
        idxNum |= 0x40;
      }
      continue;
    }

    if( pConstraint->iColumn==SERIES_COLUMN_VALUE ){
      switch( op ){
        case SQLITE_INDEX_CONSTRAINT_EQ:
        case SQLITE_INDEX_CONSTRAINT_IS: {
          idxNum |=  0x0080;
          idxNum &= ~0x3300;
          aIdx[5] = i;
          aIdx[6] = -1;
          bStartSeen = 1;
          break;
        }
        case SQLITE_INDEX_CONSTRAINT_GE: {
          if( idxNum & 0x0080 ) break;
          idxNum |=  0x0100;
          idxNum &= ~0x0200;
          aIdx[5] = i;
          bStartSeen = 1;
          break;
        }
        case SQLITE_INDEX_CONSTRAINT_GT: {
          if( idxNum & 0x0080 ) break;
          idxNum |=  0x0200;
          idxNum &= ~0x0100;
          aIdx[5] = i;
          bStartSeen = 1;
          break;
        }
        case SQLITE_INDEX_CONSTRAINT_LE: {
          if( idxNum & 0x0080 ) break;
          idxNum |=  0x1000;
          idxNum &= ~0x2000;
          aIdx[6] = i;
          break;
        }
        case SQLITE_INDEX_CONSTRAINT_LT: {
          if( idxNum & 0x0080 ) break;
          idxNum |=  0x2000;
          idxNum &= ~0x1000;
          aIdx[6] = i;
          break;

        }
      }
      continue;
    }
    iCol = pConstraint->iColumn - SERIES_COLUMN_START;
    assert( iCol>=0 && iCol<=2 );
    iMask = 1 << iCol;







>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>







654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
      }else{
        assert( op==SQLITE_INDEX_CONSTRAINT_OFFSET );
        aIdx[4] = i;
        idxNum |= 0x40;
      }
      continue;
    }
    if( pConstraint->iColumn<SERIES_COLUMN_START ){
      if( pConstraint->iColumn==SERIES_COLUMN_VALUE ){
        switch( op ){
          case SQLITE_INDEX_CONSTRAINT_EQ:
          case SQLITE_INDEX_CONSTRAINT_IS: {
            idxNum |=  0x0080;
            idxNum &= ~0x3300;
            aIdx[5] = i;
            aIdx[6] = -1;
            bStartSeen = 1;
            break;
          }
          case SQLITE_INDEX_CONSTRAINT_GE: {
            if( idxNum & 0x0080 ) break;
            idxNum |=  0x0100;
            idxNum &= ~0x0200;
            aIdx[5] = i;
            bStartSeen = 1;
            break;
          }
          case SQLITE_INDEX_CONSTRAINT_GT: {
            if( idxNum & 0x0080 ) break;
            idxNum |=  0x0200;
            idxNum &= ~0x0100;
            aIdx[5] = i;
            bStartSeen = 1;
            break;
          }
          case SQLITE_INDEX_CONSTRAINT_LE: {
            if( idxNum & 0x0080 ) break;
            idxNum |=  0x1000;
            idxNum &= ~0x2000;
            aIdx[6] = i;
            break;
          }
          case SQLITE_INDEX_CONSTRAINT_LT: {
            if( idxNum & 0x0080 ) break;
            idxNum |=  0x2000;
            idxNum &= ~0x1000;
            aIdx[6] = i;
            break;
          }
        }
      }
      continue;
    }
    iCol = pConstraint->iColumn - SERIES_COLUMN_START;
    assert( iCol>=0 && iCol<=2 );
    iMask = 1 << iCol;