SQLite

Check-in [bd37ce3fb8]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: bd37ce3fb8dee8d538f6afc0bfc13cdc3ebdd504e6461f0130c6ecc8af585f68
User & Date: dan 2019-07-22 11:38:43.410
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: fd7316cda0 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: bd37ce3fb8 user: dan tags: trunk)
2019-07-20
18:00
Early detection of a corrupt R-Tree in the R-Tree search algorithm. (check-in: 2bf5a4c164 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/resolve.c.
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
          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 ){







|







888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
          pNC->ncFlags &= ~(NC_AllowWin | (!pWin ? NC_AllowAgg : 0));
#else
          pNC->ncFlags &= ~NC_AllowAgg;
#endif
        }
      }
#ifndef SQLITE_OMIT_WINDOWFUNC
      else if( ExprHasProperty(pExpr, EP_WinFunc) ){
        is_agg = 1;
      }
#endif
      sqlite3WalkExprList(pWalker, pList);
      if( is_agg ){
#ifndef SQLITE_OMIT_WINDOWFUNC
        if( pWin ){
Changes to test/altertab3.test.
327
328
329
330
331
332
333














334

  END;
}

do_execsql_test 13.2 {
  ALTER TABLE t1 RENAME TO t1x;
}















finish_test








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

>
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
  END;
}

do_execsql_test 13.2 {
  ALTER TABLE t1 RENAME TO t1x;
}

#-------------------------------------------------------------------------
reset_db
do_execsql_test 14.1 {
  CREATE TABLE t1(a);
  CREATE TABLE t2(b);
  CREATE TRIGGER AFTER INSERT ON t1 BEGIN
    SELECT sum() FILTER (WHERE (SELECT sum() FILTER (WHERE 0)) AND a);
  END;
}

do_catchsql_test 14.2 {
  ALTER TABLE t1 RENAME TO t1x;
} {1 {error in trigger AFTER: no such column: a}}

finish_test