SQLite

Check-in [c4072267]
Login

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

Overview
Comment:Assign a fake name to the ephemeral subquery tables that are created when making parse-tree changes for window functions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | early-winfunc-rewrite-dev
Files: files | file ages | folders
SHA3-256: c4072267dc870830aaf1b3d34b98230e9eda3bb7708af9b33be28966f6ddd493
User & Date: drh 2020-06-05 18:17:39
Context
2020-06-06
20:48
Merge multiple changes from trunk to address concerns with window-function parse-tree rewriting. (check-in: 05418b2a user: drh tags: branch-3.32-early-winfunc-rewrite)
2020-06-05
21:36
Improved tracing of window function parse tree rewrites. (check-in: 7e8060cf user: drh tags: early-winfunc-rewrite-dev)
18:17
Assign a fake name to the ephemeral subquery tables that are created when making parse-tree changes for window functions. (check-in: c4072267 user: drh tags: early-winfunc-rewrite-dev)
15:40
New test case for fuzzdata8.db. (check-in: 2870d117 user: drh tags: early-winfunc-rewrite-dev)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/window.c.

1052
1053
1054
1055
1056
1057
1058


1059
1060
1061
1062
1063
1064
1065
        /* Might actually be some other kind of error, but in that case
        ** pParse->nErr will be set, so if SQLITE_NOMEM is set, we will get
        ** the correct error message regardless. */
        rc = SQLITE_NOMEM;
      }else{
        memcpy(pTab, pTab2, sizeof(Table));
        pTab->tabFlags |= TF_Ephemeral;


        p->pSrc->a[0].pTab = pTab;
        pTab = pTab2;
        memset(&w, 0, sizeof(w));
        w.xExprCallback = sqlite3WindowExtraAggFuncDepth;
        w.xSelectCallback = sqlite3WalkerDepthIncrease;
        w.xSelectCallback2 = sqlite3WalkerDepthDecrease;
        sqlite3WalkSelect(&w, pSub);







>
>







1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
        /* Might actually be some other kind of error, but in that case
        ** pParse->nErr will be set, so if SQLITE_NOMEM is set, we will get
        ** the correct error message regardless. */
        rc = SQLITE_NOMEM;
      }else{
        memcpy(pTab, pTab2, sizeof(Table));
        pTab->tabFlags |= TF_Ephemeral;
        assert( pTab->zName==0 );
        pTab->zName = sqlite3MPrintf(db, "$wintab_%p", pTab);
        p->pSrc->a[0].pTab = pTab;
        pTab = pTab2;
        memset(&w, 0, sizeof(w));
        w.xExprCallback = sqlite3WindowExtraAggFuncDepth;
        w.xSelectCallback = sqlite3WalkerDepthIncrease;
        w.xSelectCallback2 = sqlite3WalkerDepthDecrease;
        sqlite3WalkSelect(&w, pSub);