diff options
Diffstat (limited to 'kexi/3rdparty/kexisql/src/where.c')
-rw-r--r-- | kexi/3rdparty/kexisql/src/where.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/kexi/3rdparty/kexisql/src/where.c b/kexi/3rdparty/kexisql/src/where.c index bb6a7f4f..714972f8 100644 --- a/kexi/3rdparty/kexisql/src/where.c +++ b/kexi/3rdparty/kexisql/src/where.c @@ -29,9 +29,9 @@ struct ExprInfo { ** p->pLeft is not the column of any table */ short int idxRight; /* p->pRight is a column in this table number. -1 if ** p->pRight is not the column of any table */ - unsigned prereqLeft; /* Bittqmask of tables referenced by p->pLeft */ - unsigned prereqRight; /* Bittqmask of tables referenced by p->pRight */ - unsigned prereqAll; /* Bittqmask of tables referenced by p */ + unsigned prereqLeft; /* Bitmask of tables referenced by p->pLeft */ + unsigned prereqRight; /* Bitmask of tables referenced by p->pRight */ + unsigned prereqAll; /* Bitmask of tables referenced by p */ }; /* @@ -81,12 +81,12 @@ static int exprSplit(int nSlot, ExprInfo *aSlot, Expr *pExpr){ } /* -** Initialize an expression tqmask set +** Initialize an expression mask set */ #define initMaskSet(P) memset(P, 0, sizeof(*P)) /* -** Return the bittqmask for the given cursor. Assign a new bittqmask +** Return the bitmask for the given cursor. Assign a new bitmask ** if this is the first time the cursor has been seen. */ static int getMask(ExprMaskSet *pMaskSet, int iCursor){ @@ -103,13 +103,13 @@ static int getMask(ExprMaskSet *pMaskSet, int iCursor){ } /* -** Destroy an expression tqmask set +** Destroy an expression mask set */ #define freeMaskSet(P) /* NO-OP */ /* ** This routine walks (recursively) an expression tree and generates -** a bittqmask indicating which tables are used in that expression +** a bitmask indicating which tables are used in that expression ** tree. ** ** In order for this routine to work, the calling function must have @@ -120,26 +120,26 @@ static int getMask(ExprMaskSet *pMaskSet, int iCursor){ ** the VDBE cursor number of the table. */ static int exprTableUsage(ExprMaskSet *pMaskSet, Expr *p){ - unsigned int tqmask = 0; + unsigned int mask = 0; if( p==0 ) return 0; if( p->op==TK_COLUMN ){ - tqmask = getMask(pMaskSet, p->iTable); - if( tqmask==0 ) tqmask = -1; - return tqmask; + mask = getMask(pMaskSet, p->iTable); + if( mask==0 ) mask = -1; + return mask; } if( p->pRight ){ - tqmask = exprTableUsage(pMaskSet, p->pRight); + mask = exprTableUsage(pMaskSet, p->pRight); } if( p->pLeft ){ - tqmask |= exprTableUsage(pMaskSet, p->pLeft); + mask |= exprTableUsage(pMaskSet, p->pLeft); } if( p->pList ){ int i; for(i=0; i<p->pList->nExpr; i++){ - tqmask |= exprTableUsage(pMaskSet, p->pList->a[i].pExpr); + mask |= exprTableUsage(pMaskSet, p->pList->a[i].pExpr); } } - return tqmask; + return mask; } /* @@ -391,7 +391,7 @@ WhereInfo *sqliteWhereBegin( int nExpr; /* Number of subexpressions in the WHERE clause */ int loopMask; /* One bit set for each outer loop */ int haveKey; /* True if KEY is on the stack */ - ExprMaskSet maskSet; /* The expression tqmask set */ + ExprMaskSet maskSet; /* The expression mask set */ int iDirectEq[32]; /* Term of the form ROWID==X for the N-th table */ int iDirectLt[32]; /* Term of the form ROWID<X or ROWID<=X */ int iDirectGt[32]; /* Term of the form ROWID>X or ROWID>=X */ @@ -448,16 +448,16 @@ WhereInfo *sqliteWhereBegin( if( pParse->trigStack ){ int x; if( (x = pParse->trigStack->newIdx) >= 0 ){ - int tqmask = ~getMask(&maskSet, x); - aExpr[i].prereqRight &= tqmask; - aExpr[i].prereqLeft &= tqmask; - aExpr[i].prereqAll &= tqmask; + int mask = ~getMask(&maskSet, x); + aExpr[i].prereqRight &= mask; + aExpr[i].prereqLeft &= mask; + aExpr[i].prereqAll &= mask; } if( (x = pParse->trigStack->oldIdx) >= 0 ){ - int tqmask = ~getMask(&maskSet, x); - aExpr[i].prereqRight &= tqmask; - aExpr[i].prereqLeft &= tqmask; - aExpr[i].prereqAll &= tqmask; + int mask = ~getMask(&maskSet, x); + aExpr[i].prereqRight &= mask; + aExpr[i].prereqLeft &= mask; + aExpr[i].prereqAll &= mask; } } } @@ -476,13 +476,13 @@ WhereInfo *sqliteWhereBegin( ** ** Actually, if there are more than 32 tables in the join, only the ** first 32 tables are candidates for indices. This is (again) due - ** to the limit of 32 bits in an integer bittqmask. + ** to the limit of 32 bits in an integer bitmask. */ loopMask = 0; for(i=0; i<pTabList->nSrc && i<ARRAYSIZE(iDirectEq); i++){ int j; int iCur = pTabList->a[i].iCursor; /* The cursor for this table */ - int tqmask = getMask(&maskSet, iCur); /* Cursor tqmask for this table */ + int mask = getMask(&maskSet, iCur); /* Cursor mask for this table */ Table *pTab = pTabList->a[i].pTab; Index *pIdx; Index *pBestIdx = 0; @@ -524,7 +524,7 @@ WhereInfo *sqliteWhereBegin( } } if( iDirectEq[i]>=0 ){ - loopMask |= tqmask; + loopMask |= mask; pWInfo->a[i].pIdx = 0; continue; } @@ -651,7 +651,7 @@ WhereInfo *sqliteWhereBegin( pWInfo->a[i].pIdx = pBestIdx; pWInfo->a[i].score = bestScore; pWInfo->a[i].bRev = 0; - loopMask |= tqmask; + loopMask |= mask; if( pBestIdx ){ pWInfo->a[i].iCur = pParse->nTab++; pWInfo->peakNTab = pParse->nTab; |