"Noah Hart" <[EMAIL PROTECTED]> wrote:
> In expr.c, around line 2253, there is a nested loop which reads:
> 
>         for(i=0; i<pSrcList->nSrc; i++, pItem++){
>           if( pExpr->iTable==pItem->iCursor ){
>             for(i=0; i<pSrcList->nSrc; i++, pItem++){
>               if( pCol->iTable==pExpr->iTable &&
>                   pCol->iColumn==pExpr->iColumn ){
>                 break;
>               }
>             }
>             if( i>=pAggInfo->nColumn ... ){
>             }
>             break;
>           }
>         }
> 
> In this final line, which loop variable does the i refer to?
> the first one: for(i=0; i<pSrcList->nSrc; i++, pItem++){
> Or then next : for(i=0; i<pSrcList->nSrc; i++, pItem++){
> 
> are the two "i" the same variable, and it is intended that the
> second loop reset the Outer loop variable each time the inner 
> loop is run, and that the assignment statement affect the outer 
> loop as well?
> 

Once the first "if" statement fires, the outer loop is done, and 
it is ok to reuse the outer loop variable inside the "if".  So the 
code is correct as written. Nevertheless, I have changed the loop 
variable on the inner loop to avoid unnecessary confusion.

--
D. Richard Hipp  <[EMAIL PROTECTED]>


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to