/ Check-in [ff290feb]
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: 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
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: 348e7f19 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/resolve.c.

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

Changes to test/altertab3.test.

   313    313   
   314    314   END;
   315    315   }
   316    316   
   317    317   do_execsql_test 12.2 {
   318    318     ALTER TABLE t1 RENAME TO t1x;
   319    319   }
          320  +
          321  +#-------------------------------------------------------------------------
          322  +reset_db
          323  +do_execsql_test 13.1 {
          324  +  CREATE TABLE t1(a);
          325  +  CREATE TRIGGER r1 INSERT ON t1 BEGIN
          326  +    SELECT a(*) OVER (ORDER BY (SELECT 1)) FROM t1;
          327  +  END;
          328  +}
          329  +
          330  +do_execsql_test 13.2 {
          331  +  ALTER TABLE t1 RENAME TO t1x;
          332  +}
   320    333   
   321    334   finish_test