mirror of
https://github.com/status-im/sqlcipher.git
synced 2026-08-30 22:11:14 +00:00
Snapshot of upstream SQLite 3.8.0.1
This commit is contained in:
+1
-1
@@ -1717,7 +1717,7 @@ static char *csv_read_one_field(CSVReader *p){
|
||||
}
|
||||
if( (c==cSep && pc==cQuote)
|
||||
|| (c=='\n' && pc==cQuote)
|
||||
|| (c=='\n' && pc=='\r' && p->n>2 && p->z[p->n-2]==cQuote)
|
||||
|| (c=='\n' && pc=='\r' && p->n>=2 && p->z[p->n-2]==cQuote)
|
||||
|| (c==EOF && pc==cQuote)
|
||||
){
|
||||
do{ p->n--; }while( p->z[p->n]!=cQuote );
|
||||
|
||||
+13
-4
@@ -1205,8 +1205,10 @@ static int isMatchOfColumn(
|
||||
** a join, then transfer the appropriate markings over to derived.
|
||||
*/
|
||||
static void transferJoinMarkings(Expr *pDerived, Expr *pBase){
|
||||
pDerived->flags |= pBase->flags & EP_FromJoin;
|
||||
pDerived->iRightJoinTable = pBase->iRightJoinTable;
|
||||
if( pDerived ){
|
||||
pDerived->flags |= pBase->flags & EP_FromJoin;
|
||||
pDerived->iRightJoinTable = pBase->iRightJoinTable;
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(SQLITE_OMIT_OR_OPTIMIZATION) && !defined(SQLITE_OMIT_SUBQUERY)
|
||||
@@ -1663,6 +1665,7 @@ static void exprAnalyze(
|
||||
pNewExpr = sqlite3PExpr(pParse, ops[i],
|
||||
sqlite3ExprDup(db, pExpr->pLeft, 0),
|
||||
sqlite3ExprDup(db, pList->a[i].pExpr, 0), 0);
|
||||
transferJoinMarkings(pNewExpr, pExpr);
|
||||
idxNew = whereClauseInsert(pWC, pNewExpr, TERM_VIRTUAL|TERM_DYNAMIC);
|
||||
testcase( idxNew==0 );
|
||||
exprAnalyze(pSrc, pWC, idxNew);
|
||||
@@ -1730,6 +1733,7 @@ static void exprAnalyze(
|
||||
pNewExpr1 = sqlite3PExpr(pParse, TK_GE,
|
||||
sqlite3ExprAddCollateToken(pParse,pNewExpr1,&sCollSeqName),
|
||||
pStr1, 0);
|
||||
transferJoinMarkings(pNewExpr1, pExpr);
|
||||
idxNew1 = whereClauseInsert(pWC, pNewExpr1, TERM_VIRTUAL|TERM_DYNAMIC);
|
||||
testcase( idxNew1==0 );
|
||||
exprAnalyze(pSrc, pWC, idxNew1);
|
||||
@@ -1737,6 +1741,7 @@ static void exprAnalyze(
|
||||
pNewExpr2 = sqlite3PExpr(pParse, TK_LT,
|
||||
sqlite3ExprAddCollateToken(pParse,pNewExpr2,&sCollSeqName),
|
||||
pStr2, 0);
|
||||
transferJoinMarkings(pNewExpr2, pExpr);
|
||||
idxNew2 = whereClauseInsert(pWC, pNewExpr2, TERM_VIRTUAL|TERM_DYNAMIC);
|
||||
testcase( idxNew2==0 );
|
||||
exprAnalyze(pSrc, pWC, idxNew2);
|
||||
@@ -5546,11 +5551,15 @@ static int whereShortCut(WhereLoopBuilder *pBuilder){
|
||||
pLoop->rRun = 33; /* 33==whereCost(10) */
|
||||
}else{
|
||||
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
||||
if( pIdx->onError==OE_None || pIdx->pPartIdxWhere!=0 ) continue;
|
||||
assert( pLoop->aLTermSpace==pLoop->aLTerm );
|
||||
assert( ArraySize(pLoop->aLTermSpace)==4 );
|
||||
if( pIdx->onError==OE_None
|
||||
|| pIdx->pPartIdxWhere!=0
|
||||
|| pIdx->nColumn>ArraySize(pLoop->aLTermSpace)
|
||||
) continue;
|
||||
for(j=0; j<pIdx->nColumn; j++){
|
||||
pTerm = findTerm(pWC, iCur, pIdx->aiColumn[j], 0, WO_EQ, pIdx);
|
||||
if( pTerm==0 ) break;
|
||||
whereLoopResize(pWInfo->pParse->db, pLoop, j);
|
||||
pLoop->aLTerm[j] = pTerm;
|
||||
}
|
||||
if( j!=pIdx->nColumn ) continue;
|
||||
|
||||
Reference in New Issue
Block a user