/ Check-in [bbfb2908]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Refinement to check-in [348e7f193a963390] that avoids unreachable branches.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: bbfb2908ecd113c88e69a0984cbe2550463cdd3a67648b0e4e3578e80630136e
User & Date: drh 2019-07-19 15:00:32
Context
2019-07-19
15:03
New test cases added to test/fuzzdata8.db. check-in: 39be3c61 user: drh tags: trunk
15:00
Refinement to check-in [348e7f193a963390] that avoids unreachable branches. check-in: bbfb2908 user: drh tags: trunk
14:32
Fix a problem with renaming a table when the schema contains an invocation of a window function that is not currently registered. check-in: ff290feb user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/walker.c.

    21     21   /*
    22     22   ** Walk all expressions linked into the list of Window objects passed
    23     23   ** as the second argument.
    24     24   */
    25     25   static int walkWindowList(Walker *pWalker, Window *pList){
    26     26     Window *pWin;
    27     27     for(pWin=pList; pWin; pWin=pWin->pNextWin){
    28         -    if( sqlite3WalkExprList(pWalker, pWin->pOrderBy) ) return WRC_Abort;
    29         -    if( sqlite3WalkExprList(pWalker, pWin->pPartition) ) return WRC_Abort;
    30         -    if( sqlite3WalkExpr(pWalker, pWin->pFilter) ) return WRC_Abort;
    31         -    if( sqlite3WalkExpr(pWalker, pWin->pStart) ) return WRC_Abort;
    32         -    if( sqlite3WalkExpr(pWalker, pWin->pEnd) ) return WRC_Abort;
           28  +    int rc;
           29  +    rc = sqlite3WalkExprList(pWalker, pWin->pOrderBy);
           30  +    if( rc ) return WRC_Abort;
           31  +    rc = sqlite3WalkExprList(pWalker, pWin->pPartition);
           32  +    if( rc ) return WRC_Abort;
           33  +    rc = sqlite3WalkExpr(pWalker, pWin->pFilter);
           34  +    if( rc ) return WRC_Abort;
           35  +
           36  +    /* The next two are purely for calls to sqlite3RenameExprUnmap()
           37  +    ** within sqlite3WindowOffsetExpr().  Because of constraints imposed
           38  +    ** by sqlite3WindowOffsetExpr(), they can never fail.  The results do
           39  +    ** not matter anyhow. */
           40  +    rc = sqlite3WalkExpr(pWalker, pWin->pStart);
           41  +    if( NEVER(rc) ) return WRC_Abort;
           42  +    rc = sqlite3WalkExpr(pWalker, pWin->pEnd);
           43  +    if( NEVER(rc) ) return WRC_Abort;
    33     44     }
    34     45     return WRC_Continue;
    35     46   }
    36     47   #endif
    37     48   
    38     49   /*
    39     50   ** Walk an expression tree.  Invoke the callback once for each node