Fossil SCM
Cherrypick 3 bug-fixes from SQLite trunk, discovered just after the SQLite 3.15 release, among them a fix to VACUUM to prevent it from running out of memory on very large databases See [http://www.sqlite.org/src/info/34a579141b2c5ac|34a579141b2c5ac] and [http://www.sqlite.org/src/info/fef4bb4bd9185ec8f|fef4bb4bd9185ec8f] (most likely, those 3 will be in SQLite 3.15.1, if ever released)
Commit
360694a797718c4b2ab92def5714e98cab70ea95
Parent
83a359ff397f8b5…
2 files changed
+2
-2
+8
-5
+2
-2
| --- Dockerfile | ||
| +++ Dockerfile | ||
| @@ -1,15 +1,15 @@ | ||
| 1 | 1 | ### |
| 2 | 2 | # Dockerfile for Fossil |
| 3 | 3 | ### |
| 4 | -FROM fedora:23 | |
| 4 | +FROM fedora:24 | |
| 5 | 5 | |
| 6 | 6 | ### Now install some additional parts we will need for the build |
| 7 | 7 | RUN dnf update -y && dnf install -y gcc make zlib-devel openssl-devel tar && dnf clean all && groupadd -r fossil -g 433 && useradd -u 431 -r -g fossil -d /opt/fossil -s /sbin/nologin -c "Fossil user" fossil |
| 8 | 8 | |
| 9 | 9 | ### If you want to build "trunk", change the next line accordingly. |
| 10 | -ENV FOSSIL_INSTALL_VERSION release | |
| 10 | +ENV FOSSIL_INSTALL_VERSION branch-1.36 | |
| 11 | 11 | |
| 12 | 12 | RUN curl "http://core.tcl.tk/tcl/tarball/tcl-src.tar.gz?name=tcl-src&uuid=release" | tar zx |
| 13 | 13 | RUN cd tcl-src/unix && ./configure --prefix=/usr --disable-load && make && make install |
| 14 | 14 | RUN curl "http://www.fossil-scm.org/index.html/tarball/fossil-src.tar.gz?name=fossil-src&uuid=${FOSSIL_INSTALL_VERSION}" | tar zx |
| 15 | 15 | RUN cd fossil-src && ./configure --disable-fusefs --json --with-th1-docs --with-th1-hooks --with-tcl --with-tcl-stubs --with-tcl-private-stubs |
| 16 | 16 |
| --- Dockerfile | |
| +++ Dockerfile | |
| @@ -1,15 +1,15 @@ | |
| 1 | ### |
| 2 | # Dockerfile for Fossil |
| 3 | ### |
| 4 | FROM fedora:23 |
| 5 | |
| 6 | ### Now install some additional parts we will need for the build |
| 7 | RUN dnf update -y && dnf install -y gcc make zlib-devel openssl-devel tar && dnf clean all && groupadd -r fossil -g 433 && useradd -u 431 -r -g fossil -d /opt/fossil -s /sbin/nologin -c "Fossil user" fossil |
| 8 | |
| 9 | ### If you want to build "trunk", change the next line accordingly. |
| 10 | ENV FOSSIL_INSTALL_VERSION release |
| 11 | |
| 12 | RUN curl "http://core.tcl.tk/tcl/tarball/tcl-src.tar.gz?name=tcl-src&uuid=release" | tar zx |
| 13 | RUN cd tcl-src/unix && ./configure --prefix=/usr --disable-load && make && make install |
| 14 | RUN curl "http://www.fossil-scm.org/index.html/tarball/fossil-src.tar.gz?name=fossil-src&uuid=${FOSSIL_INSTALL_VERSION}" | tar zx |
| 15 | RUN cd fossil-src && ./configure --disable-fusefs --json --with-th1-docs --with-th1-hooks --with-tcl --with-tcl-stubs --with-tcl-private-stubs |
| 16 |
| --- Dockerfile | |
| +++ Dockerfile | |
| @@ -1,15 +1,15 @@ | |
| 1 | ### |
| 2 | # Dockerfile for Fossil |
| 3 | ### |
| 4 | FROM fedora:24 |
| 5 | |
| 6 | ### Now install some additional parts we will need for the build |
| 7 | RUN dnf update -y && dnf install -y gcc make zlib-devel openssl-devel tar && dnf clean all && groupadd -r fossil -g 433 && useradd -u 431 -r -g fossil -d /opt/fossil -s /sbin/nologin -c "Fossil user" fossil |
| 8 | |
| 9 | ### If you want to build "trunk", change the next line accordingly. |
| 10 | ENV FOSSIL_INSTALL_VERSION branch-1.36 |
| 11 | |
| 12 | RUN curl "http://core.tcl.tk/tcl/tarball/tcl-src.tar.gz?name=tcl-src&uuid=release" | tar zx |
| 13 | RUN cd tcl-src/unix && ./configure --prefix=/usr --disable-load && make && make install |
| 14 | RUN curl "http://www.fossil-scm.org/index.html/tarball/fossil-src.tar.gz?name=fossil-src&uuid=${FOSSIL_INSTALL_VERSION}" | tar zx |
| 15 | RUN cd fossil-src && ./configure --disable-fusefs --json --with-th1-docs --with-th1-hooks --with-tcl --with-tcl-stubs --with-tcl-private-stubs |
| 16 |
+8
-5
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -122354,11 +122354,11 @@ | ||
| 122354 | 122354 | } |
| 122355 | 122355 | #endif |
| 122356 | 122356 | |
| 122357 | 122357 | sqlite3BtreeSetCacheSize(pTemp, db->aDb[iDb].pSchema->cache_size); |
| 122358 | 122358 | sqlite3BtreeSetSpillSize(pTemp, sqlite3BtreeSetSpillSize(pMain,0)); |
| 122359 | - sqlite3BtreeSetPagerFlags(pTemp, PAGER_SYNCHRONOUS_OFF); | |
| 122359 | + sqlite3BtreeSetPagerFlags(pTemp, PAGER_SYNCHRONOUS_OFF|PAGER_CACHESPILL); | |
| 122360 | 122360 | |
| 122361 | 122361 | /* Begin a transaction and take an exclusive lock on the main database |
| 122362 | 122362 | ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, |
| 122363 | 122363 | ** to ensure that we do not try to change the page-size on a WAL database. |
| 122364 | 122364 | */ |
| @@ -127537,10 +127537,11 @@ | ||
| 127537 | 127537 | Expr *pNew; |
| 127538 | 127538 | Expr *pLeft = sqlite3ExprForVectorField(pParse, pExpr->pLeft, i); |
| 127539 | 127539 | Expr *pRight = sqlite3ExprForVectorField(pParse, pExpr->pRight, i); |
| 127540 | 127540 | |
| 127541 | 127541 | pNew = sqlite3PExpr(pParse, pExpr->op, pLeft, pRight, 0); |
| 127542 | + transferJoinMarkings(pNew, pExpr); | |
| 127542 | 127543 | idxNew = whereClauseInsert(pWC, pNew, TERM_DYNAMIC); |
| 127543 | 127544 | exprAnalyze(pSrc, pWC, idxNew); |
| 127544 | 127545 | } |
| 127545 | 127546 | pTerm = &pWC->a[idxTerm]; |
| 127546 | 127547 | pTerm->wtFlags = TERM_CODED|TERM_VIRTUAL; /* Disable the original */ |
| @@ -132640,17 +132641,19 @@ | ||
| 132640 | 132641 | pLevel->addrLikeRep); |
| 132641 | 132642 | VdbeCoverage(v); |
| 132642 | 132643 | } |
| 132643 | 132644 | #endif |
| 132644 | 132645 | if( pLevel->iLeftJoin ){ |
| 132646 | + int ws = pLoop->wsFlags; | |
| 132645 | 132647 | addr = sqlite3VdbeAddOp1(v, OP_IfPos, pLevel->iLeftJoin); VdbeCoverage(v); |
| 132646 | - assert( (pLoop->wsFlags & WHERE_IDX_ONLY)==0 | |
| 132647 | - || (pLoop->wsFlags & WHERE_INDEXED)!=0 ); | |
| 132648 | - if( (pLoop->wsFlags & WHERE_IDX_ONLY)==0 ){ | |
| 132648 | + assert( (ws & WHERE_IDX_ONLY)==0 || (ws & WHERE_INDEXED)!=0 ); | |
| 132649 | + if( (ws & WHERE_IDX_ONLY)==0 ){ | |
| 132649 | 132650 | sqlite3VdbeAddOp1(v, OP_NullRow, pTabList->a[i].iCursor); |
| 132650 | 132651 | } |
| 132651 | - if( pLoop->wsFlags & WHERE_INDEXED ){ | |
| 132652 | + if( (ws & WHERE_INDEXED) | |
| 132653 | + || ((ws & WHERE_MULTI_OR) && pLevel->u.pCovidx) | |
| 132654 | + ){ | |
| 132652 | 132655 | sqlite3VdbeAddOp1(v, OP_NullRow, pLevel->iIdxCur); |
| 132653 | 132656 | } |
| 132654 | 132657 | if( pLevel->op==OP_Return ){ |
| 132655 | 132658 | sqlite3VdbeAddOp2(v, OP_Gosub, pLevel->p1, pLevel->addrFirst); |
| 132656 | 132659 | }else{ |
| 132657 | 132660 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -122354,11 +122354,11 @@ | |
| 122354 | } |
| 122355 | #endif |
| 122356 | |
| 122357 | sqlite3BtreeSetCacheSize(pTemp, db->aDb[iDb].pSchema->cache_size); |
| 122358 | sqlite3BtreeSetSpillSize(pTemp, sqlite3BtreeSetSpillSize(pMain,0)); |
| 122359 | sqlite3BtreeSetPagerFlags(pTemp, PAGER_SYNCHRONOUS_OFF); |
| 122360 | |
| 122361 | /* Begin a transaction and take an exclusive lock on the main database |
| 122362 | ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, |
| 122363 | ** to ensure that we do not try to change the page-size on a WAL database. |
| 122364 | */ |
| @@ -127537,10 +127537,11 @@ | |
| 127537 | Expr *pNew; |
| 127538 | Expr *pLeft = sqlite3ExprForVectorField(pParse, pExpr->pLeft, i); |
| 127539 | Expr *pRight = sqlite3ExprForVectorField(pParse, pExpr->pRight, i); |
| 127540 | |
| 127541 | pNew = sqlite3PExpr(pParse, pExpr->op, pLeft, pRight, 0); |
| 127542 | idxNew = whereClauseInsert(pWC, pNew, TERM_DYNAMIC); |
| 127543 | exprAnalyze(pSrc, pWC, idxNew); |
| 127544 | } |
| 127545 | pTerm = &pWC->a[idxTerm]; |
| 127546 | pTerm->wtFlags = TERM_CODED|TERM_VIRTUAL; /* Disable the original */ |
| @@ -132640,17 +132641,19 @@ | |
| 132640 | pLevel->addrLikeRep); |
| 132641 | VdbeCoverage(v); |
| 132642 | } |
| 132643 | #endif |
| 132644 | if( pLevel->iLeftJoin ){ |
| 132645 | addr = sqlite3VdbeAddOp1(v, OP_IfPos, pLevel->iLeftJoin); VdbeCoverage(v); |
| 132646 | assert( (pLoop->wsFlags & WHERE_IDX_ONLY)==0 |
| 132647 | || (pLoop->wsFlags & WHERE_INDEXED)!=0 ); |
| 132648 | if( (pLoop->wsFlags & WHERE_IDX_ONLY)==0 ){ |
| 132649 | sqlite3VdbeAddOp1(v, OP_NullRow, pTabList->a[i].iCursor); |
| 132650 | } |
| 132651 | if( pLoop->wsFlags & WHERE_INDEXED ){ |
| 132652 | sqlite3VdbeAddOp1(v, OP_NullRow, pLevel->iIdxCur); |
| 132653 | } |
| 132654 | if( pLevel->op==OP_Return ){ |
| 132655 | sqlite3VdbeAddOp2(v, OP_Gosub, pLevel->p1, pLevel->addrFirst); |
| 132656 | }else{ |
| 132657 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -122354,11 +122354,11 @@ | |
| 122354 | } |
| 122355 | #endif |
| 122356 | |
| 122357 | sqlite3BtreeSetCacheSize(pTemp, db->aDb[iDb].pSchema->cache_size); |
| 122358 | sqlite3BtreeSetSpillSize(pTemp, sqlite3BtreeSetSpillSize(pMain,0)); |
| 122359 | sqlite3BtreeSetPagerFlags(pTemp, PAGER_SYNCHRONOUS_OFF|PAGER_CACHESPILL); |
| 122360 | |
| 122361 | /* Begin a transaction and take an exclusive lock on the main database |
| 122362 | ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, |
| 122363 | ** to ensure that we do not try to change the page-size on a WAL database. |
| 122364 | */ |
| @@ -127537,10 +127537,11 @@ | |
| 127537 | Expr *pNew; |
| 127538 | Expr *pLeft = sqlite3ExprForVectorField(pParse, pExpr->pLeft, i); |
| 127539 | Expr *pRight = sqlite3ExprForVectorField(pParse, pExpr->pRight, i); |
| 127540 | |
| 127541 | pNew = sqlite3PExpr(pParse, pExpr->op, pLeft, pRight, 0); |
| 127542 | transferJoinMarkings(pNew, pExpr); |
| 127543 | idxNew = whereClauseInsert(pWC, pNew, TERM_DYNAMIC); |
| 127544 | exprAnalyze(pSrc, pWC, idxNew); |
| 127545 | } |
| 127546 | pTerm = &pWC->a[idxTerm]; |
| 127547 | pTerm->wtFlags = TERM_CODED|TERM_VIRTUAL; /* Disable the original */ |
| @@ -132640,17 +132641,19 @@ | |
| 132641 | pLevel->addrLikeRep); |
| 132642 | VdbeCoverage(v); |
| 132643 | } |
| 132644 | #endif |
| 132645 | if( pLevel->iLeftJoin ){ |
| 132646 | int ws = pLoop->wsFlags; |
| 132647 | addr = sqlite3VdbeAddOp1(v, OP_IfPos, pLevel->iLeftJoin); VdbeCoverage(v); |
| 132648 | assert( (ws & WHERE_IDX_ONLY)==0 || (ws & WHERE_INDEXED)!=0 ); |
| 132649 | if( (ws & WHERE_IDX_ONLY)==0 ){ |
| 132650 | sqlite3VdbeAddOp1(v, OP_NullRow, pTabList->a[i].iCursor); |
| 132651 | } |
| 132652 | if( (ws & WHERE_INDEXED) |
| 132653 | || ((ws & WHERE_MULTI_OR) && pLevel->u.pCovidx) |
| 132654 | ){ |
| 132655 | sqlite3VdbeAddOp1(v, OP_NullRow, pLevel->iIdxCur); |
| 132656 | } |
| 132657 | if( pLevel->op==OP_Return ){ |
| 132658 | sqlite3VdbeAddOp2(v, OP_Gosub, pLevel->p1, pLevel->addrFirst); |
| 132659 | }else{ |
| 132660 |