Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Side by Side Diff: third_party/sqlite/src/src/expr.c

Issue 15070002: Backport SQLite memcmp patch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 ** 2001 September 15 2 ** 2001 September 15
3 ** 3 **
4 ** The author disclaims copyright to this source code. In place of 4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing: 5 ** a legal notice, here is a blessing:
6 ** 6 **
7 ** May you do good and not evil. 7 ** May you do good and not evil.
8 ** May you find forgiveness for yourself and forgive others. 8 ** May you find forgiveness for yourself and forgive others.
9 ** May you share freely, never taking more than you give. 9 ** May you share freely, never taking more than you give.
10 ** 10 **
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 if( i>pParse->nVar ){ 572 if( i>pParse->nVar ){
573 pParse->nVar = (int)i; 573 pParse->nVar = (int)i;
574 } 574 }
575 }else{ 575 }else{
576 /* Wildcards like ":aaa", "$aaa" or "@aaa". Reuse the same variable 576 /* Wildcards like ":aaa", "$aaa" or "@aaa". Reuse the same variable
577 ** number as the prior appearance of the same name, or if the name 577 ** number as the prior appearance of the same name, or if the name
578 ** has never appeared before, reuse the same variable number 578 ** has never appeared before, reuse the same variable number
579 */ 579 */
580 int i; 580 int i;
581 u32 n; 581 u32 n;
582 n = sqlite3Strlen30(z); 582 n = sqlite3Strlen30(z);
wtc 2013/05/08 22:39:27 The variable |n| can be removed. It is assigned a
Scott Hess - ex-Googler 2013/05/08 22:56:51 This was one of the spots where I had to manually
583 for(i=0; i<pParse->nVarExpr; i++){ 583 for(i=0; i<pParse->nVarExpr; i++){
584 Expr *pE = pParse->apVarExpr[i]; 584 Expr *pE = pParse->apVarExpr[i];
585 assert( pE!=0 ); 585 assert( pE!=0 );
586 if( memcmp(pE->u.zToken, z, n)==0 && pE->u.zToken[n]==0 ){ 586 if( strcmp(pE->u.zToken, z)==0 ){
587 pExpr->iColumn = pE->iColumn; 587 pExpr->iColumn = pE->iColumn;
588 break; 588 break;
589 } 589 }
590 } 590 }
591 if( i>=pParse->nVarExpr ){ 591 if( i>=pParse->nVarExpr ){
592 pExpr->iColumn = (ynVar)(++pParse->nVar); 592 pExpr->iColumn = (ynVar)(++pParse->nVar);
593 if( pParse->nVarExpr>=pParse->nVarExprAlloc-1 ){ 593 if( pParse->nVarExpr>=pParse->nVarExprAlloc-1 ){
594 pParse->nVarExprAlloc += pParse->nVarExprAlloc + 10; 594 pParse->nVarExprAlloc += pParse->nVarExprAlloc + 10;
595 pParse->apVarExpr = 595 pParse->apVarExpr =
596 sqlite3DbReallocOrFree( 596 sqlite3DbReallocOrFree(
(...skipping 3151 matching lines...) Expand 10 before | Expand all | Expand 10 after
3748 } 3748 }
3749 return i; 3749 return i;
3750 } 3750 }
3751 void sqlite3ReleaseTempRange(Parse *pParse, int iReg, int nReg){ 3751 void sqlite3ReleaseTempRange(Parse *pParse, int iReg, int nReg){
3752 sqlite3ExprCacheRemove(pParse, iReg, nReg); 3752 sqlite3ExprCacheRemove(pParse, iReg, nReg);
3753 if( nReg>pParse->nRangeReg ){ 3753 if( nReg>pParse->nRangeReg ){
3754 pParse->nRangeReg = nReg; 3754 pParse->nRangeReg = nReg;
3755 pParse->iRangeReg = iReg; 3755 pParse->iRangeReg = iReg;
3756 } 3756 }
3757 } 3757 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698