SQLite

Check-in [46639f68]
Login

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

Overview
Comment:When a table-valued function appears as the right table of a RIGHT JOIN, the argument constraints on the table-valued function should be considered part of the ON clause of the RIGHT JOIN. Fix for the problem reported by forum post 422e635f3beafbf6. Test cases in TH3. Possibly related to the enhancement at [501609eddf2a46d5].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 46639f682975dac6efec4e230aca2c9b127b4fc77e0b465fad38ef4caa9b7a4c
User & Date: drh 2023-02-26 20:57:09
References
2023-02-27
14:48
Further to [46639f682975dac6], the parameters of a table valued function that is on the left side of a RIGHT JOIN do not need to be in the ON clause. Add new test cases and tags to associated test cases with the code. (check-in: 18ee689d user: drh tags: trunk)
Context
2023-02-27
07:12
Extend wasm build to enable inclusion of client-custom C code, initialized via the SQLITE_EXTRA_INIT mechanism, per discussion in forum post 1e1c04f3ed1bc96b. (check-in: 68a52caf user: stephan tags: trunk)
2023-02-26
21:09
When a table-valued function appears as the right table of a RIGHT JOIN, the argument constraints on the table-valued function should be considered part of the ON clause of the RIGHT JOIN. (check-in: d225d077 user: drh tags: branch-3.41)
20:57
When a table-valued function appears as the right table of a RIGHT JOIN, the argument constraints on the table-valued function should be considered part of the ON clause of the RIGHT JOIN. Fix for the problem reported by forum post 422e635f3beafbf6. Test cases in TH3. Possibly related to the enhancement at [501609eddf2a46d5]. (check-in: 46639f68 user: drh tags: trunk)
11:36
In the omit-unused-subquery-columns optimization, be sure to remove the EP_Skip and EP_Unlikely flags from the result set expressions that get nulled-out. dbsqlfuzz bf1d3ed6e0e0dd8766027797d43db40c776d2b15. (check-in: 21aec65e user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/whereexpr.c.
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
    pColRef->iColumn = k++;
    assert( ExprUseYTab(pColRef) );
    pColRef->y.pTab = pTab;
    pItem->colUsed |= sqlite3ExprColUsed(pColRef);
    pRhs = sqlite3PExpr(pParse, TK_UPLUS, 
        sqlite3ExprDup(pParse->db, pArgs->a[j].pExpr, 0), 0);
    pTerm = sqlite3PExpr(pParse, TK_EQ, pColRef, pRhs);
    if( pItem->fg.jointype & (JT_LEFT|JT_LTORJ) ){
      joinType = EP_OuterON;
    }else{
      joinType = EP_InnerON;
    }
    sqlite3SetJoinExpr(pTerm, pItem->iCursor, joinType);
    whereClauseInsert(pWC, pTerm, TERM_DYNAMIC);
  }







|







1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
    pColRef->iColumn = k++;
    assert( ExprUseYTab(pColRef) );
    pColRef->y.pTab = pTab;
    pItem->colUsed |= sqlite3ExprColUsed(pColRef);
    pRhs = sqlite3PExpr(pParse, TK_UPLUS, 
        sqlite3ExprDup(pParse->db, pArgs->a[j].pExpr, 0), 0);
    pTerm = sqlite3PExpr(pParse, TK_EQ, pColRef, pRhs);
    if( pItem->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT) ){
      joinType = EP_OuterON;
    }else{
      joinType = EP_InnerON;
    }
    sqlite3SetJoinExpr(pTerm, pItem->iCursor, joinType);
    whereClauseInsert(pWC, pTerm, TERM_DYNAMIC);
  }