/ Check-in [81eed055]
Login

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

Overview
Comment:Minor tweak to patch on this branch to reclaim some cycles.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | filter-clause
Files: files | file ages | folders
SHA3-256: 81eed055de856068109a7e332cca0c3ff1120ebe2bfa5ed6383b165c726e0a7c
User & Date: dan 2019-07-05 17:38:55
Context
2019-07-05
19:10
Another very small performance improvement. check-in: 7a1e30a1 user: dan tags: filter-clause
17:38
Minor tweak to patch on this branch to reclaim some cycles. check-in: 81eed055 user: dan tags: filter-clause
2019-07-03
18:31
Add tests for the FILTER clause. And a bugfix. check-in: 28aa1702 user: dan tags: filter-clause
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/select.c.

6236
6237
6238
6239
6240
6241
6242

6243

6244
6245
6246
6247
6248
6249
6250
    for(i=0; i<sAggInfo.nFunc; i++){
      Expr *pExpr = sAggInfo.aFunc[i].pExpr;
      assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
      sNC.ncFlags |= NC_InAggFunc;
      sqlite3ExprAnalyzeAggList(&sNC, pExpr->x.pList);
#ifndef SQLITE_OMIT_WINDOWFUNC
      assert( !ExprHasProperty(pExpr, EP_WinFunc) );

      sqlite3ExprAnalyzeAggregates(&sNC, pExpr->y.pFilter);

#endif
      sNC.ncFlags &= ~NC_InAggFunc;
    }
    sAggInfo.mxReg = pParse->nMem;
    if( db->mallocFailed ) goto select_end;
#if SELECTTRACE_ENABLED
    if( sqlite3SelectTrace & 0x400 ){







>
|
>







6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
    for(i=0; i<sAggInfo.nFunc; i++){
      Expr *pExpr = sAggInfo.aFunc[i].pExpr;
      assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
      sNC.ncFlags |= NC_InAggFunc;
      sqlite3ExprAnalyzeAggList(&sNC, pExpr->x.pList);
#ifndef SQLITE_OMIT_WINDOWFUNC
      assert( !ExprHasProperty(pExpr, EP_WinFunc) );
      if( pExpr->y.pFilter ){
        sqlite3ExprAnalyzeAggregates(&sNC, pExpr->y.pFilter);
      }
#endif
      sNC.ncFlags &= ~NC_InAggFunc;
    }
    sAggInfo.mxReg = pParse->nMem;
    if( db->mallocFailed ) goto select_end;
#if SELECTTRACE_ENABLED
    if( sqlite3SelectTrace & 0x400 ){

Changes to test/window2.tcl.

419
420
421
422
423
424
425




426
427
428
429
430
431

execsql_float_test 4.9 {
  SELECT 
    rank() OVER win AS rank,
    cume_dist() OVER win AS cume_dist FROM t1
  WINDOW win AS (ORDER BY 1);
}







finish_test









>
>
>
>






419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435

execsql_float_test 4.9 {
  SELECT 
    rank() OVER win AS rank,
    cume_dist() OVER win AS cume_dist FROM t1
  WINDOW win AS (ORDER BY 1);
}

execsql_test 4.10 {
  SELECT count(*) OVER (ORDER BY b) FROM t1
}



finish_test


Changes to test/window2.test.

889
890
891
892
893
894
895




896
      error "list element [set i] does not match: got=[set r] expected=[set r2]"
    }
    incr i
  }
  set {} {}
} {}





finish_test







>
>
>
>

889
890
891
892
893
894
895
896
897
898
899
900
      error "list element [set i] does not match: got=[set r] expected=[set r2]"
    }
    incr i
  }
  set {} {}
} {}

do_execsql_test 4.10 {
  SELECT count(*) OVER (ORDER BY b) FROM t1
} {3   3   3   6   6   6}

finish_test