/ Check-in [bd37ce3f]
Login

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

Overview
Comment:Fix a problem with renaming tables when the schema contains an invocation of a currently unregistered aggregate with a FILTER clause.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: bd37ce3fb8dee8d538f6afc0bfc13cdc3ebdd504e6461f0130c6ecc8af585f68
User & Date: dan 2019-07-22 11:38:43
Context
2019-07-22
16:33
Remove Window objects from the corresponding Select.pWin list when they are deleted, as they are, for example, when the ORDER BY clause is optimized out. check-in: fd7316cd user: dan tags: trunk
11:38
Fix a problem with renaming tables when the schema contains an invocation of a currently unregistered aggregate with a FILTER clause. check-in: bd37ce3f user: dan tags: trunk
2019-07-20
18:00
Early detection of a corrupt R-Tree in the R-Tree search algorithm. check-in: 2bf5a4c1 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/resolve.c.

   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    894   #ifndef SQLITE_OMIT_WINDOWFUNC
   895         -      else if( pWin ){
          895  +      else if( ExprHasProperty(pExpr, EP_WinFunc) ){
   896    896           is_agg = 1;
   897    897         }
   898    898   #endif
   899    899         sqlite3WalkExprList(pWalker, pList);
   900    900         if( is_agg ){
   901    901   #ifndef SQLITE_OMIT_WINDOWFUNC
   902    902           if( pWin ){

Changes to test/altertab3.test.

   327    327     END;
   328    328   }
   329    329   
   330    330   do_execsql_test 13.2 {
   331    331     ALTER TABLE t1 RENAME TO t1x;
   332    332   }
   333    333   
          334  +#-------------------------------------------------------------------------
          335  +reset_db
          336  +do_execsql_test 14.1 {
          337  +  CREATE TABLE t1(a);
          338  +  CREATE TABLE t2(b);
          339  +  CREATE TRIGGER AFTER INSERT ON t1 BEGIN
          340  +    SELECT sum() FILTER (WHERE (SELECT sum() FILTER (WHERE 0)) AND a);
          341  +  END;
          342  +}
          343  +
          344  +do_catchsql_test 14.2 {
          345  +  ALTER TABLE t1 RENAME TO t1x;
          346  +} {1 {error in trigger AFTER: no such column: a}}
          347  +
   334    348   finish_test
          349  +