/ Check-in [ff290feb97]
Login

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

Overview
Comment:Fix a problem with renaming a table when the schema contains an invocation of a window function that is not currently registered.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ff290feb97f689cf6ce4162d6aa36f9f9dcf1bff3096847d53a85f39f728d2de
User & Date: dan 2019-07-19 14:32:42
Context
2019-07-19
15:00
Refinement to check-in [348e7f193a963390] that avoids unreachable branches. check-in: bbfb2908ec 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: ff290feb97 user: dan tags: trunk
11:20
Fix a problem with renaming tables when the schema contains WINDOW definitions with (illegal) non-numeric expressions as part of a PRECEDING or FOLLOWING clause. check-in: 348e7f193a user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/resolve.c.

887
888
889
890
891
892
893





894
895
896
897
898
899
900
#ifndef SQLITE_OMIT_WINDOWFUNC
          pNC->ncFlags &= ~(NC_AllowWin | (!pWin ? NC_AllowAgg : 0));
#else
          pNC->ncFlags &= ~NC_AllowAgg;
#endif
        }
      }





      sqlite3WalkExprList(pWalker, pList);
      if( is_agg ){
#ifndef SQLITE_OMIT_WINDOWFUNC
        if( pWin ){
          Select *pSel = pNC->pWinSelect;
          if( IN_RENAME_OBJECT==0 ){
            sqlite3WindowUpdate(pParse, pSel->pWinDefn, pWin, pDef);







>
>
>
>
>







887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
#ifndef SQLITE_OMIT_WINDOWFUNC
          pNC->ncFlags &= ~(NC_AllowWin | (!pWin ? NC_AllowAgg : 0));
#else
          pNC->ncFlags &= ~NC_AllowAgg;
#endif
        }
      }
#ifndef SQLITE_OMIT_WINDOWFUNC
      else if( pWin ){
        is_agg = 1;
      }
#endif
      sqlite3WalkExprList(pWalker, pList);
      if( is_agg ){
#ifndef SQLITE_OMIT_WINDOWFUNC
        if( pWin ){
          Select *pSel = pNC->pWinSelect;
          if( IN_RENAME_OBJECT==0 ){
            sqlite3WindowUpdate(pParse, pSel->pWinDefn, pWin, pDef);

Changes to test/altertab3.test.

313
314
315
316
317
318
319
320













321

END;
}

do_execsql_test 12.2 {
  ALTER TABLE t1 RENAME TO t1x;
}














finish_test








>
>
>
>
>
>
>
>
>
>
>
>
>

313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334

END;
}

do_execsql_test 12.2 {
  ALTER TABLE t1 RENAME TO t1x;
}

#-------------------------------------------------------------------------
reset_db
do_execsql_test 13.1 {
  CREATE TABLE t1(a);
  CREATE TRIGGER r1 INSERT ON t1 BEGIN
    SELECT a(*) OVER (ORDER BY (SELECT 1)) FROM t1;
  END;
}

do_execsql_test 13.2 {
  ALTER TABLE t1 RENAME TO t1x;
}

finish_test