/ Check-in [ec7e224f]
Login

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

Overview
Comment:Add further tests to window8.test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | window-functions
Files: files | file ages | folders
SHA3-256: ec7e224f50271a69a28074270b01328ec0ee38751fcb93b2c598d8be2b77a95d
User & Date: dan 2019-03-19 19:39:42
Wiki:window-functions
Context
2019-03-21
13:51
Remove assert() statements based on the counter-factual proposition that 0 is not a valid cursor number. check-in: c7b33618 user: dan tags: window-functions
2019-03-19
19:39
Add further tests to window8.test. check-in: ec7e224f user: dan tags: window-functions
19:19
Fix a problem with EXCLUDE clauses on window frames with no ORDER BY. check-in: e0255063 user: dan tags: window-functions
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/window8.tcl.

   241    241       1 { RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING }
   242    242       2 { ORDER BY a NULLS FIRST 
   243    243           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING }
   244    244       3 { PARTITION BY coalesce(a, '') 
   245    245           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING }
   246    246       4 { ORDER BY a NULLS FIRST GROUPS 6 PRECEDING }
   247    247       5 { ORDER BY c NULLS FIRST RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING }
          248  +    6 { ORDER BY c NULLS FIRST RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING }
          249  +    7 { ORDER BY c NULLS FIRST, b NULLS FIRST, a NULLS FIRST
          250  +        ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING }
   248    251     } {
   249    252       execsql_test 5.$tn.$tn2.1 "
   250    253         SELECT max(c) OVER win,
   251         -             min(c) OVER win
          254  +             min(c) OVER win,
          255  +             count(a) OVER win
   252    256         FROM t3
   253    257         WINDOW win AS ( $frame $ex )
   254         -      ORDER BY 1 NULLS FIRST, 2 NULLS FIRST
          258  +      ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
   255    259       "
   256    260   
   257    261       execsql_test 5.$tn.$tn2.2 "
   258    262         SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
   259         -             rank() OVER win
          263  +             rank() OVER win,
          264  +             dense_rank() OVER win
   260    265         FROM t3
   261    266         WINDOW win AS ( $frame $ex )
   262         -      ORDER BY 1 NULLS FIRST, 2 NULLS FIRST
          267  +      ORDER BY 1 NULLS FIRST, 2 NULLS FIRST, 3 NULLS FIRST
   263    268       "
   264    269     }
   265    270   }
   266    271   
   267    272   finish_test
   268    273   
   269    274   

Changes to test/window8.test.

  3556   3556       (NULL, 'bb', 355), (NULL, 'cc', 158), (NULL, 'aa', 399), 
  3557   3557       ('JJ', NULL, 839), ('FF', NULL, 618), ('BB', NULL, 393), 
  3558   3558       (NULL, 'bb', 629), (NULL, NULL, 667), (NULL, NULL, 870);
  3559   3559   } {}
  3560   3560   
  3561   3561   do_execsql_test 5.1.1.1 {
  3562   3562     SELECT max(c) OVER win,
  3563         -             min(c) OVER win
         3563  +             min(c) OVER win,
         3564  +             count(a) OVER win
  3564   3565         FROM t3
  3565   3566         WINDOW win AS (  RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE NO OTHERS  )
  3566         -      ORDER BY 1 , 2
  3567         -} {979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3568         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3569         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3570         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3571         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3572         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3573         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3574         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3575         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3576         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3577         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3578         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3579         -  979 102   979 102   979 102   979 102   979 102}
         3567  +      ORDER BY 1 , 2 , 3
         3568  +} {979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3569  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3570  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3571  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3572  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3573  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3574  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3575  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3576  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3577  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3578  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3579  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3580  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3581  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3582  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83}
  3580   3583   
  3581   3584   do_execsql_test 5.1.1.2 {
  3582   3585     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  3583         -             rank() OVER win
         3586  +             rank() OVER win,
         3587  +             dense_rank() OVER win
  3584   3588         FROM t3
  3585   3589         WINDOW win AS (  RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE NO OTHERS  )
  3586         -      ORDER BY 1 , 2
  3587         -} {23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3588         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3589         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3590         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3591         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3592         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3593         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3594         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3595         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3596         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3597         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3598         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3599         -  23155 1   23155 1   23155 1   23155 1   23155 1}
         3590  +      ORDER BY 1 , 2 , 3
         3591  +} {23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3592  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3593  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3594  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3595  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3596  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3597  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3598  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3599  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3600  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3601  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3602  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3603  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3604  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3605  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1}
  3600   3606   
  3601   3607   do_execsql_test 5.1.2.1 {
  3602   3608     SELECT max(c) OVER win,
  3603         -             min(c) OVER win
         3609  +             min(c) OVER win,
         3610  +             count(a) OVER win
  3604   3611         FROM t3
  3605   3612         WINDOW win AS (  ORDER BY a  
  3606   3613           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE NO OTHERS  )
  3607         -      ORDER BY 1 , 2
  3608         -} {899 113   899 113   899 113   899 113   899 113   899 113   899 113
  3609         -  899 113   899 113   899 113   899 113   899 113   899 113   899 113
  3610         -  899 113   899 113   979 102   979 102   979 102   979 102   979 102
  3611         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3612         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3613         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3614         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3615         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3616         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3617         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3618         -  979 102   979 102   979 113   979 113   979 113   979 113   979 113
  3619         -  979 113   979 113   979 113   979 113   979 113   979 113   979 113
  3620         -  979 113   979 113   979 113   979 113   979 113}
         3614  +      ORDER BY 1 , 2 , 3
         3615  +} {899 113 9   899 113 9   899 113 9   899 113 9   899 113 9   899 113 9
         3616  +  899 113 9   899 113 9   899 113 9   899 113 16   899 113 16   899 113 16
         3617  +  899 113 16   899 113 16   899 113 16   899 113 16   979 102 44   979 102 44
         3618  +  979 102 44   979 102 44   979 102 44   979 102 44   979 102 44   979 102 44
         3619  +  979 102 44   979 102 44   979 102 44   979 102 49   979 102 49   979 102 49
         3620  +  979 102 49   979 102 49   979 102 56   979 102 56   979 102 56   979 102 56
         3621  +  979 102 56   979 102 56   979 102 56   979 102 62   979 102 62   979 102 62
         3622  +  979 102 62   979 102 62   979 102 62   979 102 75   979 102 75   979 102 75
         3623  +  979 102 75   979 102 75   979 102 75   979 102 75   979 102 75   979 102 75
         3624  +  979 102 75   979 102 75   979 102 75   979 102 75   979 102 83   979 102 83
         3625  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3626  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3627  +  979 113 25   979 113 25   979 113 25   979 113 25   979 113 25   979 113 25
         3628  +  979 113 25   979 113 25   979 113 25   979 113 33   979 113 33   979 113 33
         3629  +  979 113 33   979 113 33   979 113 33   979 113 33   979 113 33}
  3621   3630   
  3622   3631   do_execsql_test 5.1.2.2 {
  3623   3632     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  3624         -             rank() OVER win
         3633  +             rank() OVER win,
         3634  +             dense_rank() OVER win
  3625   3635         FROM t3
  3626   3636         WINDOW win AS (  ORDER BY a  
  3627   3637           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE NO OTHERS  )
  3628         -      ORDER BY 1 , 2
  3629         -} {2947 81   2947 81   2947 81   2947 81   2947 81   2947 81   2947 81
  3630         -  2947 81   2947 81   5287 74   5287 74   5287 74   5287 74   5287 74
  3631         -  5287 74   5287 74   8400 65   8400 65   8400 65   8400 65   8400 65
  3632         -  8400 65   8400 65   8400 65   8400 65   9664 57   9664 57   9664 57
  3633         -  9664 57   9664 57   9664 57   9664 57   9664 57   10626 46   10626 46
  3634         -  10626 46   10626 46   10626 46   10626 46   10626 46   10626 46   10626 46
  3635         -  10626 46   10626 46   12145 41   12145 41   12145 41   12145 41   12145 41
  3636         -  13949 34   13949 34   13949 34   13949 34   13949 34   13949 34   13949 34
  3637         -  15315 28   15315 28   15315 28   15315 28   15315 28   15315 28   18796 15
  3638         -  18796 15   18796 15   18796 15   18796 15   18796 15   18796 15   18796 15
  3639         -  18796 15   18796 15   18796 15   18796 15   18796 15   21105 7   21105 7
  3640         -  21105 7   21105 7   21105 7   21105 7   21105 7   21105 7   23155 1
  3641         -  23155 1   23155 1   23155 1   23155 1   23155 1}
         3638  +      ORDER BY 1 , 2 , 3
         3639  +} {2947 81 11   2947 81 11   2947 81 11   2947 81 11   2947 81 11   2947 81 11
         3640  +  2947 81 11   2947 81 11   2947 81 11   5287 74 10   5287 74 10   5287 74 10
         3641  +  5287 74 10   5287 74 10   5287 74 10   5287 74 10   8400 65 9   8400 65 9
         3642  +  8400 65 9   8400 65 9   8400 65 9   8400 65 9   8400 65 9   8400 65 9
         3643  +  8400 65 9   9664 57 8   9664 57 8   9664 57 8   9664 57 8   9664 57 8
         3644  +  9664 57 8   9664 57 8   9664 57 8   10626 46 7   10626 46 7   10626 46 7
         3645  +  10626 46 7   10626 46 7   10626 46 7   10626 46 7   10626 46 7   10626 46 7
         3646  +  10626 46 7   10626 46 7   12145 41 6   12145 41 6   12145 41 6   12145 41 6
         3647  +  12145 41 6   13949 34 5   13949 34 5   13949 34 5   13949 34 5   13949 34 5
         3648  +  13949 34 5   13949 34 5   15315 28 4   15315 28 4   15315 28 4   15315 28 4
         3649  +  15315 28 4   15315 28 4   18796 15 3   18796 15 3   18796 15 3   18796 15 3
         3650  +  18796 15 3   18796 15 3   18796 15 3   18796 15 3   18796 15 3   18796 15 3
         3651  +  18796 15 3   18796 15 3   18796 15 3   21105 7 2   21105 7 2   21105 7 2
         3652  +  21105 7 2   21105 7 2   21105 7 2   21105 7 2   21105 7 2   23155 1 1
         3653  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1}
  3642   3654   
  3643   3655   do_execsql_test 5.1.3.1 {
  3644   3656     SELECT max(c) OVER win,
  3645         -             min(c) OVER win
         3657  +             min(c) OVER win,
         3658  +             count(a) OVER win
  3646   3659         FROM t3
  3647   3660         WINDOW win AS (  PARTITION BY coalesce(a, '') 
  3648   3661           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE NO OTHERS  )
  3649         -      ORDER BY 1 , 2
  3650         -} {777 113   777 113   777 113   777 113   777 113   805 250   805 250
  3651         -  805 250   805 250   805 250   805 250   805 250   822 158   822 158
  3652         -  822 158   822 158   822 158   822 158   840 247   840 247   840 247
  3653         -  840 247   840 247   840 247   840 247   840 247   840 247   840 247
  3654         -  840 247   840 247   840 247   870 158   870 158   870 158   870 158
  3655         -  870 158   870 158   899 113   899 113   899 113   899 113   899 113
  3656         -  899 113   899 113   899 113   899 113   934 223   934 223   934 223
  3657         -  934 223   934 223   934 223   934 223   934 223   938 102   938 102
  3658         -  938 102   938 102   938 102   938 102   938 102   938 102   938 102
  3659         -  938 102   938 102   938 148   938 148   938 148   938 148   938 148
  3660         -  938 148   938 148   938 148   959 224   959 224   959 224   959 224
  3661         -  959 224   959 224   959 224   979 133   979 133   979 133   979 133
  3662         -  979 133   979 133   979 133   979 133   979 133}
         3662  +      ORDER BY 1 , 2 , 3
         3663  +} {777 113 5   777 113 5   777 113 5   777 113 5   777 113 5   805 250 7
         3664  +  805 250 7   805 250 7   805 250 7   805 250 7   805 250 7   805 250 7
         3665  +  822 158 6   822 158 6   822 158 6   822 158 6   822 158 6   822 158 6
         3666  +  840 247 13   840 247 13   840 247 13   840 247 13   840 247 13   840 247 13
         3667  +  840 247 13   840 247 13   840 247 13   840 247 13   840 247 13   840 247 13
         3668  +  840 247 13   870 158 0   870 158 0   870 158 0   870 158 0   870 158 0
         3669  +  870 158 0   899 113 9   899 113 9   899 113 9   899 113 9   899 113 9
         3670  +  899 113 9   899 113 9   899 113 9   899 113 9   934 223 8   934 223 8
         3671  +  934 223 8   934 223 8   934 223 8   934 223 8   934 223 8   934 223 8
         3672  +  938 102 11   938 102 11   938 102 11   938 102 11   938 102 11   938 102 11
         3673  +  938 102 11   938 102 11   938 102 11   938 102 11   938 102 11   938 148 8
         3674  +  938 148 8   938 148 8   938 148 8   938 148 8   938 148 8   938 148 8
         3675  +  938 148 8   959 224 7   959 224 7   959 224 7   959 224 7   959 224 7
         3676  +  959 224 7   959 224 7   979 133 9   979 133 9   979 133 9   979 133 9
         3677  +  979 133 9   979 133 9   979 133 9   979 133 9   979 133 9}
  3663   3678   
  3664   3679   do_execsql_test 5.1.3.2 {
  3665   3680     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  3666         -             rank() OVER win
         3681  +             rank() OVER win,
         3682  +             dense_rank() OVER win
  3667   3683         FROM t3
  3668   3684         WINDOW win AS (  PARTITION BY coalesce(a, '') 
  3669   3685           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE NO OTHERS  )
  3670         -      ORDER BY 1 , 2
  3671         -} {962 1   962 1   962 1   962 1   962 1   962 1   962 1   962 1   962 1
  3672         -  962 1   962 1   1264 1   1264 1   1264 1   1264 1   1264 1   1264 1
  3673         -  1264 1   1264 1   1366 1   1366 1   1366 1   1366 1   1366 1   1366 1
  3674         -  1519 1   1519 1   1519 1   1519 1   1519 1   1804 1   1804 1   1804 1
  3675         -  1804 1   1804 1   1804 1   1804 1   2050 1   2050 1   2050 1   2050 1
  3676         -  2050 1   2050 1   2309 1   2309 1   2309 1   2309 1   2309 1   2309 1
  3677         -  2309 1   2309 1   2340 1   2340 1   2340 1   2340 1   2340 1   2340 1
  3678         -  2340 1   2947 1   2947 1   2947 1   2947 1   2947 1   2947 1   2947 1
  3679         -  2947 1   2947 1   3113 1   3113 1   3113 1   3113 1   3113 1   3113 1
  3680         -  3113 1   3113 1   3113 1   3481 1   3481 1   3481 1   3481 1   3481 1
  3681         -  3481 1   3481 1   3481 1   3481 1   3481 1   3481 1   3481 1   3481 1}
         3686  +      ORDER BY 1 , 2 , 3
         3687  +} {962 1 1   962 1 1   962 1 1   962 1 1   962 1 1   962 1 1   962 1 1
         3688  +  962 1 1   962 1 1   962 1 1   962 1 1   1264 1 1   1264 1 1   1264 1 1
         3689  +  1264 1 1   1264 1 1   1264 1 1   1264 1 1   1264 1 1   1366 1 1   1366 1 1
         3690  +  1366 1 1   1366 1 1   1366 1 1   1366 1 1   1519 1 1   1519 1 1   1519 1 1
         3691  +  1519 1 1   1519 1 1   1804 1 1   1804 1 1   1804 1 1   1804 1 1   1804 1 1
         3692  +  1804 1 1   1804 1 1   2050 1 1   2050 1 1   2050 1 1   2050 1 1   2050 1 1
         3693  +  2050 1 1   2309 1 1   2309 1 1   2309 1 1   2309 1 1   2309 1 1   2309 1 1
         3694  +  2309 1 1   2309 1 1   2340 1 1   2340 1 1   2340 1 1   2340 1 1   2340 1 1
         3695  +  2340 1 1   2340 1 1   2947 1 1   2947 1 1   2947 1 1   2947 1 1   2947 1 1
         3696  +  2947 1 1   2947 1 1   2947 1 1   2947 1 1   3113 1 1   3113 1 1   3113 1 1
         3697  +  3113 1 1   3113 1 1   3113 1 1   3113 1 1   3113 1 1   3113 1 1   3481 1 1
         3698  +  3481 1 1   3481 1 1   3481 1 1   3481 1 1   3481 1 1   3481 1 1   3481 1 1
         3699  +  3481 1 1   3481 1 1   3481 1 1   3481 1 1   3481 1 1}
  3682   3700   
  3683   3701   do_execsql_test 5.1.4.1 {
  3684   3702     SELECT max(c) OVER win,
  3685         -             min(c) OVER win
         3703  +             min(c) OVER win,
         3704  +             count(a) OVER win
  3686   3705         FROM t3
  3687   3706         WINDOW win AS (  ORDER BY a  GROUPS 6 PRECEDING   EXCLUDE NO OTHERS  )
  3688         -      ORDER BY 1 , 2
  3689         -} {870 158   870 158   870 158   870 158   870 158   870 158   934 158
  3690         -  934 158   934 158   934 158   934 158   934 158   934 158   934 158
  3691         -  934 158   934 158   934 158   934 158   934 158   934 158   934 158
  3692         -  934 158   934 158   934 158   934 158   934 158   934 158   934 158
  3693         -  934 158   934 158   934 158   934 158   934 158   959 102   959 102
  3694         -  959 102   959 102   959 102   959 102   959 102   959 102   959 102
  3695         -  959 102   959 102   959 102   959 102   959 102   959 102   959 102
  3696         -  959 102   959 102   959 102   959 113   959 113   959 113   959 113
  3697         -  959 113   959 158   959 158   959 158   959 158   959 158   959 158
  3698         -  959 158   979 102   979 102   979 102   979 102   979 102   979 102
  3699         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3700         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3701         -  979 102   979 102   979 102   979 102   979 102}
         3707  +      ORDER BY 1 , 2 , 3
         3708  +} {870 158 0   870 158 0   870 158 0   870 158 0   870 158 0   870 158 0
         3709  +  934 158 8   934 158 8   934 158 8   934 158 8   934 158 8   934 158 8
         3710  +  934 158 8   934 158 8   934 158 21   934 158 21   934 158 21   934 158 21
         3711  +  934 158 21   934 158 21   934 158 21   934 158 21   934 158 21   934 158 21
         3712  +  934 158 21   934 158 21   934 158 21   934 158 27   934 158 27   934 158 27
         3713  +  934 158 27   934 158 27   934 158 27   959 102 50   959 102 50   959 102 50
         3714  +  959 102 50   959 102 50   959 102 50   959 102 50   959 102 50   959 102 50
         3715  +  959 102 50   959 102 50   959 102 58   959 102 58   959 102 58   959 102 58
         3716  +  959 102 58   959 102 58   959 102 58   959 102 58   959 113 39   959 113 39
         3717  +  959 113 39   959 113 39   959 113 39   959 158 34   959 158 34   959 158 34
         3718  +  959 158 34   959 158 34   959 158 34   959 158 34   979 102 53   979 102 53
         3719  +  979 102 53   979 102 53   979 102 53   979 102 53   979 102 53   979 102 56
         3720  +  979 102 56   979 102 56   979 102 56   979 102 56   979 102 56   979 102 56
         3721  +  979 102 56   979 102 56   979 102 59   979 102 59   979 102 59   979 102 59
         3722  +  979 102 59   979 102 59   979 102 59   979 102 59   979 102 59}
  3702   3723   
  3703   3724   do_execsql_test 5.1.4.2 {
  3704   3725     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  3705         -             rank() OVER win
         3726  +             rank() OVER win,
         3727  +             dense_rank() OVER win
  3706   3728         FROM t3
  3707   3729         WINDOW win AS (  ORDER BY a  GROUPS 6 PRECEDING   EXCLUDE NO OTHERS  )
  3708         -      ORDER BY 1 , 2
  3709         -} {2050 1   2050 1   2050 1   2050 1   2050 1   2050 1   4359 7   4359 7
  3710         -  4359 7   4359 7   4359 7   4359 7   4359 7   4359 7   7840 15   7840 15
  3711         -  7840 15   7840 15   7840 15   7840 15   7840 15   7840 15   7840 15
  3712         -  7840 15   7840 15   7840 15   7840 15   9206 28   9206 28   9206 28
  3713         -  9206 28   9206 28   9206 28   11010 34   11010 34   11010 34   11010 34
  3714         -  11010 34   11010 34   11010 34   12368 74   12368 74   12368 74   12368 74
  3715         -  12368 74   12368 74   12368 74   12529 41   12529 41   12529 41   12529 41
  3716         -  12529 41   12705 57   12705 57   12705 57   12705 57   12705 57   12705 57
  3717         -  12705 57   12705 57   13491 46   13491 46   13491 46   13491 46   13491 46
  3718         -  13491 46   13491 46   13491 46   13491 46   13491 46   13491 46   13509 65
  3719         -  13509 65   13509 65   13509 65   13509 65   13509 65   13509 65   13509 65
  3720         -  13509 65   13949 81   13949 81   13949 81   13949 81   13949 81   13949 81
  3721         -  13949 81   13949 81   13949 81}
         3730  +      ORDER BY 1 , 2 , 3
         3731  +} {2050 1 1   2050 1 1   2050 1 1   2050 1 1   2050 1 1   2050 1 1   4359 7 2
         3732  +  4359 7 2   4359 7 2   4359 7 2   4359 7 2   4359 7 2   4359 7 2   4359 7 2
         3733  +  7840 15 3   7840 15 3   7840 15 3   7840 15 3   7840 15 3   7840 15 3
         3734  +  7840 15 3   7840 15 3   7840 15 3   7840 15 3   7840 15 3   7840 15 3
         3735  +  7840 15 3   9206 28 4   9206 28 4   9206 28 4   9206 28 4   9206 28 4
         3736  +  9206 28 4   11010 34 5   11010 34 5   11010 34 5   11010 34 5   11010 34 5
         3737  +  11010 34 5   11010 34 5   12368 74 10   12368 74 10   12368 74 10
         3738  +  12368 74 10   12368 74 10   12368 74 10   12368 74 10   12529 41 6
         3739  +  12529 41 6   12529 41 6   12529 41 6   12529 41 6   12705 57 8   12705 57 8
         3740  +  12705 57 8   12705 57 8   12705 57 8   12705 57 8   12705 57 8   12705 57 8
         3741  +  13491 46 7   13491 46 7   13491 46 7   13491 46 7   13491 46 7   13491 46 7
         3742  +  13491 46 7   13491 46 7   13491 46 7   13491 46 7   13491 46 7   13509 65 9
         3743  +  13509 65 9   13509 65 9   13509 65 9   13509 65 9   13509 65 9   13509 65 9
         3744  +  13509 65 9   13509 65 9   13949 81 11   13949 81 11   13949 81 11
         3745  +  13949 81 11   13949 81 11   13949 81 11   13949 81 11   13949 81 11
         3746  +  13949 81 11}
  3722   3747   
  3723   3748   do_execsql_test 5.1.5.1 {
  3724   3749     SELECT max(c) OVER win,
  3725         -             min(c) OVER win
         3750  +             min(c) OVER win,
         3751  +             count(a) OVER win
  3726   3752         FROM t3
  3727   3753         WINDOW win AS (  ORDER BY c  RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING   EXCLUDE NO OTHERS  )
  3728         -      ORDER BY 1 , 2
  3729         -} {102 102   113 113   113 113   133 133   148 148   160 158   160 158
  3730         -  160 158   208 208   224 223   224 223   239 234   239 234   239 234
  3731         -  252 247   257 247   257 247   257 250   257 252   295 295   309 309
  3732         -  336 330   336 330   336 330   346 346   355 354   355 354   355 354
  3733         -  399 393   399 393   399 393   399 393   399 393   412 412   421 421
  3734         -  430 430   443 443   480 480   480 480   574 572   574 572   607 607
  3735         -  618 618   618 618   634 627   634 627   634 627   634 627   634 629
  3736         -  652 652   667 660   671 667   671 667   671 667   671 667   683 683
  3737         -  711 705   716 705   716 711   730 726   730 726   762 759   768 759
  3738         -  768 762   768 762   777 777   792 786   794 786   794 786   794 790
  3739         -  805 805   822 822   845 839   845 839   845 839   845 839   845 839
  3740         -  870 870   870 870   870 870   899 899   911 911   934 929   938 929
  3741         -  938 934   938 934   963 959   963 959   979 979}
         3754  +      ORDER BY 1 , 2 , 3
         3755  +} {102 102 1   113 113 2   113 113 2   133 133 1   148 148 1   160 158 2
         3756  +  160 158 2   160 158 2   208 208 1   224 223 2   224 223 2   239 234 3
         3757  +  239 234 3   239 234 3   252 247 3   257 247 5   257 247 5   257 250 4
         3758  +  257 252 3   295 295 1   309 309 1   336 330 3   336 330 3   336 330 3
         3759  +  346 346 1   355 354 2   355 354 2   355 354 2   399 393 4   399 393 4
         3760  +  399 393 4   399 393 4   399 393 4   412 412 1   421 421 1   430 430 1
         3761  +  443 443 1   480 480 2   480 480 2   574 572 2   574 572 2   607 607 1
         3762  +  618 618 2   618 618 2   634 627 4   634 627 4   634 627 4   634 627 4
         3763  +  634 629 3   652 652 1   667 660 2   671 667 3   671 667 3   671 667 3
         3764  +  671 667 3   683 683 1   711 705 2   716 705 3   716 711 2   730 726 2
         3765  +  730 726 2   762 759 2   768 759 4   768 762 3   768 762 3   777 777 1
         3766  +  792 786 3   794 786 4   794 786 4   794 790 3   805 805 1   822 822 1
         3767  +  845 839 5   845 839 5   845 839 5   845 839 5   845 839 5   870 870 2
         3768  +  870 870 2   870 870 2   899 899 1   911 911 1   934 929 2   938 929 4
         3769  +  938 934 3   938 934 3   963 959 2   963 959 2   979 979 1}
  3742   3770   
  3743   3771   do_execsql_test 5.1.5.2 {
  3744   3772     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  3745         -             rank() OVER win
         3773  +             rank() OVER win,
         3774  +             dense_rank() OVER win
  3746   3775         FROM t3
  3747   3776         WINDOW win AS (  ORDER BY c  RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING   EXCLUDE NO OTHERS  )
  3748         -      ORDER BY 1 , 2
  3749         -} {{} 1   {} 5   {} 6   {} 6   {} 8   {} 9   {} 25   {} 34   {} 36   {} 38
  3750         -  {} 38   {} 40   {} 41   {} 43   {} 43   {} 50   {} 60   {} 61   {} 64
  3751         -  {} 64   {} 67   {} 68   {} 69   {} 70   {} 72   {} 78   {} 78   {} 78
  3752         -  {} 85   {} 85   133 4   223 10   223 11   226 2   226 2   239 12   239 13
  3753         -  239 14   247 15   257 18   257 19   295 20   309 21   335 22   335 23
  3754         -  335 24   421 35   443 37   504 16   504 17   607 42   683 56   710 26
  3755         -  710 27   710 27   711 59   759 62   759 63   777 66   805 71   899 81
  3756         -  911 82   929 83   929 84   979 89   1334 51   1416 57   1416 58   1584 29
  3757         -  1584 29   1584 31   1584 32   1584 32   1891 49   1922 87   1922 88
  3758         -  2005 52   2005 52   2005 54   2005 55   2518 45   2518 46   2518 46
  3759         -  2518 48   2523 73   2523 73   2523 75   2523 76   2523 77}
         3777  +      ORDER BY 1 , 2 , 3
         3778  +} {{} 1 1   {} 5 4   {} 6 5   {} 6 5   {} 8 6   {} 9 7   {} 25 23   {} 34 29
         3779  +  {} 36 31   {} 38 33   {} 38 33   {} 40 34   {} 41 35   {} 43 37   {} 43 37
         3780  +  {} 50 42   {} 60 51   {} 61 52   {} 64 55   {} 64 55   {} 67 57   {} 68 58
         3781  +  {} 69 59   {} 70 60   {} 72 62   {} 78 67   {} 78 67   {} 78 67   {} 85 72
         3782  +  {} 85 72   133 4 3   223 10 8   223 11 9   226 2 2   226 2 2   239 12 10
         3783  +  239 13 11   239 14 12   247 15 13   257 18 16   257 19 17   295 20 18
         3784  +  309 21 19   335 22 20   335 23 21   335 24 22   421 35 30   443 37 32
         3785  +  504 16 14   504 17 15   607 42 36   683 56 47   710 26 24   710 27 25
         3786  +  710 27 25   711 59 50   759 62 53   759 63 54   777 66 56   805 71 61
         3787  +  899 81 68   911 82 69   929 83 70   929 84 71   979 89 75   1334 51 43
         3788  +  1416 57 48   1416 58 49   1584 29 26   1584 29 26   1584 31 27   1584 32 28
         3789  +  1584 32 28   1891 49 41   1922 87 73   1922 88 74   2005 52 44   2005 52 44
         3790  +  2005 54 45   2005 55 46   2518 45 38   2518 46 39   2518 46 39   2518 48 40
         3791  +  2523 73 63   2523 73 63   2523 75 64   2523 76 65   2523 77 66}
         3792  +
         3793  +do_execsql_test 5.1.6.1 {
         3794  +  SELECT max(c) OVER win,
         3795  +             min(c) OVER win,
         3796  +             count(a) OVER win
         3797  +      FROM t3
         3798  +      WINDOW win AS (  ORDER BY c  RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING   EXCLUDE NO OTHERS  )
         3799  +      ORDER BY 1 , 2 , 3
         3800  +} {102 102 1   113 113 2   113 113 2   133 133 1   148 148 1   158 158 1
         3801  +  158 158 1   160 160 1   208 208 1   223 223 1   224 224 1   234 234 1
         3802  +  238 238 1   239 239 1   247 247 1   250 250 1   252 252 1   256 256 1
         3803  +  257 257 1   295 295 1   309 309 1   330 330 1   335 335 1   336 336 1
         3804  +  346 346 1   354 354 1   355 355 1   355 355 1   393 393 2   393 393 2
         3805  +  398 398 1   399 399 1   399 399 1   412 412 1   421 421 1   430 430 1
         3806  +  443 443 1   480 480 2   480 480 2   572 572 1   574 574 1   607 607 1
         3807  +  618 618 2   618 618 2   627 627 1   629 629 1   629 629 1   633 633 1
         3808  +  634 634 1   652 652 1   660 660 1   667 667 1   667 667 1   670 670 1
         3809  +  671 671 1   683 683 1   705 705 1   711 711 1   716 716 1   726 726 1
         3810  +  730 730 1   759 759 1   762 762 1   768 768 2   768 768 2   777 777 1
         3811  +  786 786 1   790 790 1   792 792 1   794 794 1   805 805 1   822 822 1
         3812  +  839 839 2   839 839 2   840 840 1   844 844 1   845 845 1   870 870 2
         3813  +  870 870 2   870 870 2   899 899 1   911 911 1   929 929 1   934 934 1
         3814  +  938 938 2   938 938 2   959 959 1   963 963 1   979 979 1}
         3815  +
         3816  +do_execsql_test 5.1.6.2 {
         3817  +  SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
         3818  +             rank() OVER win,
         3819  +             dense_rank() OVER win
         3820  +      FROM t3
         3821  +      WINDOW win AS (  ORDER BY c  RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING   EXCLUDE NO OTHERS  )
         3822  +      ORDER BY 1 , 2 , 3
         3823  +} {{} 1 1   {} 5 4   {} 6 5   {} 6 5   {} 8 6   {} 9 7   {} 11 9   {} 12 10
         3824  +  {} 13 11   {} 16 14   {} 17 15   {} 18 16   {} 22 20   {} 24 22   {} 25 23
         3825  +  {} 26 24   {} 31 27   {} 34 29   {} 36 31   {} 38 33   {} 38 33   {} 40 34
         3826  +  {} 41 35   {} 43 37   {} 43 37   {} 49 41   {} 50 42   {} 51 43   {} 54 45
         3827  +  {} 59 50   {} 60 51   {} 61 52   {} 63 54   {} 64 55   {} 64 55   {} 67 57
         3828  +  {} 68 58   {} 69 59   {} 70 60   {} 72 62   {} 75 64   {} 76 65   {} 78 67
         3829  +  {} 78 67   {} 78 67   {} 84 71   {} 85 72   {} 85 72   133 4 3   223 10 8
         3830  +  226 2 2   226 2 2   239 14 12   247 15 13   257 19 17   295 20 18
         3831  +  309 21 19   335 23 21   421 35 30   443 37 32   607 42 36   627 45 38
         3832  +  633 48 40   671 55 46   683 56 47   705 57 48   710 27 25   710 27 25
         3833  +  711 58 49   759 62 53   777 66 56   786 29 26   786 29 26   798 32 28
         3834  +  798 32 28   805 71 61   845 77 66   899 81 68   911 82 69   929 83 70
         3835  +  959 87 73   963 88 74   979 89 75   1258 46 39   1258 46 39   1334 52 44
         3836  +  1334 52 44   1678 73 63   1678 73 63}
         3837  +
         3838  +do_execsql_test 5.1.7.1 {
         3839  +  SELECT max(c) OVER win,
         3840  +             min(c) OVER win,
         3841  +             count(a) OVER win
         3842  +      FROM t3
         3843  +      WINDOW win AS (  ORDER BY c , b , a 
         3844  +        ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE NO OTHERS  )
         3845  +      ORDER BY 1 , 2 , 3
         3846  +} {979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3847  +  979 102 83   979 113 81   979 113 82   979 133 80   979 148 79   979 158 77
         3848  +  979 158 78   979 160 77   979 208 76   979 223 75   979 224 74   979 234 73
         3849  +  979 238 72   979 239 71   979 247 70   979 250 69   979 252 68   979 256 67
         3850  +  979 257 66   979 295 65   979 309 64   979 330 63   979 335 62   979 336 61
         3851  +  979 346 60   979 354 59   979 355 58   979 355 58   979 393 56   979 393 57
         3852  +  979 398 55   979 399 54   979 399 54   979 412 53   979 421 52   979 430 51
         3853  +  979 443 50   979 480 48   979 480 49   979 572 47   979 574 46   979 607 45
         3854  +  979 618 43   979 618 44   979 627 42   979 629 41   979 629 41   979 633 40
         3855  +  979 634 39   979 652 38   979 660 37   979 667 36   979 667 36   979 670 35
         3856  +  979 671 34   979 683 33   979 705 32   979 711 31   979 716 30   979 726 29
         3857  +  979 730 28   979 759 27   979 762 26   979 768 24   979 768 25   979 777 23
         3858  +  979 786 22   979 790 21   979 792 20   979 794 19   979 805 18   979 822 17
         3859  +  979 839 15   979 839 16   979 840 14   979 844 13   979 845 12   979 870 10
         3860  +  979 870 11   979 870 11   979 899 9   979 911 8   979 929 7}
         3861  +
         3862  +do_execsql_test 5.1.7.2 {
         3863  +  SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
         3864  +             rank() OVER win,
         3865  +             dense_rank() OVER win
         3866  +      FROM t3
         3867  +      WINDOW win AS (  ORDER BY c , b , a 
         3868  +        ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE NO OTHERS  )
         3869  +      ORDER BY 1 , 2 , 3
         3870  +} {3830 89 89   4741 88 88   5640 84 84   5640 85 85   5640 86 86   5640 87 87
         3871  +  6485 81 81   6485 82 82   6485 83 83   7324 80 80   8163 78 78   8163 79 79
         3872  +  8968 73 73   8968 74 74   8968 75 75   8968 76 76   8968 77 77   9745 69 69
         3873  +  9745 70 70   9745 71 71   9745 72 72   10504 65 65   10504 66 66
         3874  +  10504 67 67   10504 68 68   11215 64 64   11920 63 63   12603 62 62
         3875  +  13274 60 60   13274 61 61   13941 59 59   14608 55 55   14608 56 56
         3876  +  14608 57 57   14608 58 58   15241 54 54   15870 53 53   16499 52 52
         3877  +  17126 49 49   17126 50 50   17126 51 51   17733 44 44   17733 45 45
         3878  +  17733 46 46   17733 47 47   17733 48 48   18176 42 42   18176 43 43
         3879  +  18597 40 40   18597 41 41   18996 39 39   19395 37 37   19395 38 38
         3880  +  19788 36 36   20181 35 35   20536 34 34   20891 30 30   20891 31 31
         3881  +  20891 32 32   20891 33 33   21226 28 28   21226 29 29   21535 27 27
         3882  +  21830 26 26   22087 22 22   22087 23 23   22087 24 24   22087 25 25
         3883  +  22334 21 21   22573 17 17   22573 18 18   22573 19 19   22573 20 20
         3884  +  22796 11 11   22796 12 12   22796 13 13   22796 14 14   22796 15 15
         3885  +  22796 16 16   22929 10 10   23042 9 9   23155 1 1   23155 2 2   23155 3 3
         3886  +  23155 4 4   23155 5 5   23155 6 6   23155 7 7   23155 8 8}
  3760   3887   
  3761   3888   do_execsql_test 5.2.1.1 {
  3762   3889     SELECT max(c) OVER win,
  3763         -             min(c) OVER win
         3890  +             min(c) OVER win,
         3891  +             count(a) OVER win
  3764   3892         FROM t3
  3765   3893         WINDOW win AS (  RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE CURRENT ROW  )
  3766         -      ORDER BY 1 , 2
  3767         -} {963 102   979 102   979 102   979 102   979 102   979 102   979 102
  3768         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3769         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3770         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3771         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3772         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3773         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3774         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3775         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3776         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3777         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3778         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3779         -  979 102   979 102   979 102   979 102   979 113}
         3894  +      ORDER BY 1 , 2 , 3
         3895  +} {963 102 82   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         3896  +  979 102 82   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         3897  +  979 102 82   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         3898  +  979 102 82   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         3899  +  979 102 82   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         3900  +  979 102 82   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         3901  +  979 102 82   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         3902  +  979 102 82   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         3903  +  979 102 82   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         3904  +  979 102 82   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         3905  +  979 102 82   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         3906  +  979 102 82   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         3907  +  979 102 82   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         3908  +  979 102 82   979 102 82   979 102 82   979 102 82   979 102 83   979 102 83
         3909  +  979 102 83   979 102 83   979 102 83   979 102 83   979 113 82}
  3780   3910   
  3781   3911   do_execsql_test 5.2.1.2 {
  3782   3912     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  3783         -             rank() OVER win
         3913  +             rank() OVER win,
         3914  +             dense_rank() OVER win
  3784   3915         FROM t3
  3785   3916         WINDOW win AS (  RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE CURRENT ROW  )
  3786         -      ORDER BY 1 , 2
  3787         -} {22176 1   22192 1   22196 1   22226 1   22244 1   22256 1   22310 1
  3788         -  22316 1   22316 1   22350 1   22378 1   22396 1   22444 1   22450 1
  3789         -  22472 1   22484 1   22488 1   22488 1   22522 1   22526 1   22526 1
  3790         -  22528 1   22548 1   22712 1   22734 1   22756 1   22756 1   22762 1
  3791         -  22762 1   22800 1   22800 1   22820 1   22846 1   22860 1   22898 1
  3792         -  22908 1   22916 1   22932 1   23022 1   23042 1   23042 1   23155 1
  3793         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3794         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3795         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3796         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3797         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3798         -  23155 1   23155 1   23155 1   23155 1   23155 1   23155 1   23155 1
  3799         -  23155 1   23155 1   23155 1   23155 1   23155 1}
         3917  +      ORDER BY 1 , 2 , 3
         3918  +} {22176 1 1   22192 1 1   22196 1 1   22226 1 1   22244 1 1   22256 1 1
         3919  +  22310 1 1   22316 1 1   22316 1 1   22350 1 1   22378 1 1   22396 1 1
         3920  +  22444 1 1   22450 1 1   22472 1 1   22484 1 1   22488 1 1   22488 1 1
         3921  +  22522 1 1   22526 1 1   22526 1 1   22528 1 1   22548 1 1   22712 1 1
         3922  +  22734 1 1   22756 1 1   22756 1 1   22762 1 1   22762 1 1   22800 1 1
         3923  +  22800 1 1   22820 1 1   22846 1 1   22860 1 1   22898 1 1   22908 1 1
         3924  +  22916 1 1   22932 1 1   23022 1 1   23042 1 1   23042 1 1   23155 1 1
         3925  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3926  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3927  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3928  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3929  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3930  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3931  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1
         3932  +  23155 1 1   23155 1 1   23155 1 1   23155 1 1   23155 1 1}
  3800   3933   
  3801   3934   do_execsql_test 5.2.2.1 {
  3802   3935     SELECT max(c) OVER win,
  3803         -             min(c) OVER win
         3936  +             min(c) OVER win,
         3937  +             count(a) OVER win
  3804   3938         FROM t3
  3805   3939         WINDOW win AS (  ORDER BY a  
  3806   3940           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE CURRENT ROW  )
  3807         -      ORDER BY 1 , 2
  3808         -} {839 113   899 113   899 113   899 113   899 113   899 113   899 113
  3809         -  899 113   899 113   899 113   899 113   899 113   899 113   899 113
  3810         -  899 113   899 234   963 113   979 102   979 102   979 102   979 102
  3811         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3812         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3813         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3814         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3815         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3816         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3817         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3818         -  979 102   979 102   979 113   979 113   979 113   979 113   979 113
  3819         -  979 113   979 113   979 113   979 113   979 113   979 113   979 113
  3820         -  979 113   979 113   979 113   979 113   979 113}
         3941  +      ORDER BY 1 , 2 , 3
         3942  +} {839 113 8   899 113 8   899 113 8   899 113 8   899 113 8   899 113 8
         3943  +  899 113 8   899 113 8   899 113 15   899 113 15   899 113 15   899 113 15
         3944  +  899 113 15   899 113 15   899 113 15   899 234 8   963 113 24   979 102 43
         3945  +  979 102 43   979 102 43   979 102 43   979 102 43   979 102 43   979 102 43
         3946  +  979 102 43   979 102 43   979 102 43   979 102 48   979 102 48   979 102 48
         3947  +  979 102 48   979 102 48   979 102 55   979 102 55   979 102 55   979 102 55
         3948  +  979 102 55   979 102 55   979 102 55   979 102 61   979 102 61   979 102 61
         3949  +  979 102 61   979 102 61   979 102 61   979 102 74   979 102 74   979 102 74
         3950  +  979 102 74   979 102 74   979 102 74   979 102 74   979 102 74   979 102 74
         3951  +  979 102 74   979 102 74   979 102 74   979 102 74   979 102 82   979 102 82
         3952  +  979 102 82   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         3953  +  979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         3954  +  979 113 24   979 113 24   979 113 24   979 113 24   979 113 24   979 113 24
         3955  +  979 113 24   979 113 24   979 113 32   979 113 32   979 113 32   979 113 32
         3956  +  979 113 32   979 113 32   979 113 32   979 113 32   979 113 43}
  3821   3957   
  3822   3958   do_execsql_test 5.2.2.2 {
  3823   3959     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  3824         -             rank() OVER win
         3960  +             rank() OVER win,
         3961  +             dense_rank() OVER win
  3825   3962         FROM t3
  3826   3963         WINDOW win AS (  ORDER BY a  
  3827   3964           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE CURRENT ROW  )
  3828         -      ORDER BY 1 , 2
  3829         -} {2048 81   2108 81   2108 81   2690 81   2834 81   2947 81   2947 81
  3830         -  2947 81   2947 81   4482 74   4616 74   4844 74   4866 74   5287 74
  3831         -  5287 74   5287 74   7421 65   7437 65   7717 65   8045 65   8267 65
  3832         -  8400 65   8400 65   8400 65   8400 65   8735 57   9329 57   9664 57
  3833         -  9664 57   9664 57   9664 57   9664 57   9664 57   9959 46   10331 46
  3834         -  10626 46   10626 46   10626 46   10626 46   10626 46   10626 46   10626 46
  3835         -  10626 46   10626 46   11368 41   11516 41   12032 41   12145 41   12145 41
  3836         -  12990 34   13104 34   13949 34   13949 34   13949 34   13949 34   13949 34
  3837         -  14556 28   14708 28   15315 28   15315 28   15315 28   15315 28   18085 15
  3838         -  18091 15   18163 15   18397 15   18403 15   18403 15   18549 15   18796 15
  3839         -  18796 15   18796 15   18796 15   18796 15   18796 15   20194 7   20478 7
  3840         -  20796 7   20866 7   20882 7   21105 7   21105 7   21105 7   22488 1
  3841         -  22526 1   22756 1   22800 1   23155 1   23155 1}
         3965  +      ORDER BY 1 , 2 , 3
         3966  +} {2048 81 11   2108 81 11   2108 81 11   2690 81 11   2834 81 11   2947 81 11
         3967  +  2947 81 11   2947 81 11   2947 81 11   4482 74 10   4616 74 10   4844 74 10
         3968  +  4866 74 10   5287 74 10   5287 74 10   5287 74 10   7421 65 9   7437 65 9
         3969  +  7717 65 9   8045 65 9   8267 65 9   8400 65 9   8400 65 9   8400 65 9
         3970  +  8400 65 9   8735 57 8   9329 57 8   9664 57 8   9664 57 8   9664 57 8
         3971  +  9664 57 8   9664 57 8   9664 57 8   9959 46 7   10331 46 7   10626 46 7
         3972  +  10626 46 7   10626 46 7   10626 46 7   10626 46 7   10626 46 7   10626 46 7
         3973  +  10626 46 7   10626 46 7   11368 41 6   11516 41 6   12032 41 6   12145 41 6
         3974  +  12145 41 6   12990 34 5   13104 34 5   13949 34 5   13949 34 5   13949 34 5
         3975  +  13949 34 5   13949 34 5   14556 28 4   14708 28 4   15315 28 4   15315 28 4
         3976  +  15315 28 4   15315 28 4   18085 15 3   18091 15 3   18163 15 3   18397 15 3
         3977  +  18403 15 3   18403 15 3   18549 15 3   18796 15 3   18796 15 3   18796 15 3
         3978  +  18796 15 3   18796 15 3   18796 15 3   20194 7 2   20478 7 2   20796 7 2
         3979  +  20866 7 2   20882 7 2   21105 7 2   21105 7 2   21105 7 2   22488 1 1
         3980  +  22526 1 1   22756 1 1   22800 1 1   23155 1 1   23155 1 1}
  3842   3981   
  3843   3982   do_execsql_test 5.2.3.1 {
  3844   3983     SELECT max(c) OVER win,
  3845         -             min(c) OVER win
         3984  +             min(c) OVER win,
         3985  +             count(a) OVER win
  3846   3986         FROM t3
  3847   3987         WINDOW win AS (  PARTITION BY coalesce(a, '') 
  3848   3988           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE CURRENT ROW  )
  3849         -      ORDER BY 1 , 2
  3850         -} {667 158   671 250   759 158   768 113   777 113   777 113   777 113
  3851         -  777 252   792 247   805 250   805 250   805 250   805 250   805 250
  3852         -  805 398   822 158   822 158   822 158   822 158   822 346   839 113
  3853         -  840 247   840 247   840 247   840 247   840 247   840 247   840 247
  3854         -  840 247   840 247   840 247   840 247   840 393   845 224   870 102
  3855         -  870 158   870 158   870 158   870 158   870 355   899 113   899 113
  3856         -  899 113   899 113   899 113   899 113   899 113   899 234   911 223
  3857         -  929 148   934 223   934 223   934 223   934 223   934 223   934 223
  3858         -  934 239   938 102   938 102   938 102   938 102   938 102   938 102
  3859         -  938 102   938 102   938 102   938 148   938 148   938 148   938 148
  3860         -  938 148   938 148   938 160   938 208   959 224   959 224   959 224
  3861         -  959 224   959 224   959 238   963 133   979 133   979 133   979 133
  3862         -  979 133   979 133   979 133   979 133   979 330}
         3989  +      ORDER BY 1 , 2 , 3
         3990  +} {667 158 0   671 250 6   759 158 5   768 113 4   777 113 4   777 113 4
         3991  +  777 113 4   777 252 4   792 247 12   805 250 6   805 250 6   805 250 6
         3992  +  805 250 6   805 250 6   805 398 6   822 158 5   822 158 5   822 158 5
         3993  +  822 158 5   822 346 5   839 113 8   840 247 12   840 247 12   840 247 12
         3994  +  840 247 12   840 247 12   840 247 12   840 247 12   840 247 12   840 247 12
         3995  +  840 247 12   840 247 12   840 393 12   845 224 6   870 102 10   870 158 0
         3996  +  870 158 0   870 158 0   870 158 0   870 355 0   899 113 8   899 113 8
         3997  +  899 113 8   899 113 8   899 113 8   899 113 8   899 113 8   899 234 8
         3998  +  911 223 7   929 148 7   934 223 7   934 223 7   934 223 7   934 223 7
         3999  +  934 223 7   934 223 7   934 239 7   938 102 10   938 102 10   938 102 10
         4000  +  938 102 10   938 102 10   938 102 10   938 102 10   938 102 10   938 102 10
         4001  +  938 148 7   938 148 7   938 148 7   938 148 7   938 148 7   938 148 7
         4002  +  938 160 7   938 208 10   959 224 6   959 224 6   959 224 6   959 224 6
         4003  +  959 224 6   959 238 6   963 133 8   979 133 8   979 133 8   979 133 8
         4004  +  979 133 8   979 133 8   979 133 8   979 133 8   979 330 8}
  3863   4005   
  3864   4006   do_execsql_test 5.2.3.2 {
  3865   4007     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  3866         -             rank() OVER win
         4008  +             rank() OVER win,
         4009  +             dense_rank() OVER win
  3867   4010         FROM t3
  3868   4011         WINDOW win AS (  PARTITION BY coalesce(a, '') 
  3869   4012           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE CURRENT ROW  )
  3870         -      ORDER BY 1 , 2
  3871         -} {295 1   335 1   607 1   667 1   742 1   759 1   845 1   890 1   929 1
  3872         -  959 1   962 1   962 1   962 1   962 1   962 1   962 1   962 1   962 1
  3873         -  962 1   1264 1   1264 1   1264 1   1264 1   1264 1   1264 1   1366 1
  3874         -  1366 1   1366 1   1366 1   1383 1   1398 1   1406 1   1421 1   1519 1
  3875         -  1519 1   1535 1   1651 1   1669 1   1682 1   1695 1   1804 1   1804 1
  3876         -  1804 1   1804 1   1804 1   1897 1   1919 1   2000 1   2048 1   2050 1
  3877         -  2050 1   2070 1   2086 1   2108 1   2108 1   2134 1   2150 1   2309 1
  3878         -  2309 1   2309 1   2340 1   2340 1   2340 1   2430 1   2690 1   2758 1
  3879         -  2770 1   2776 1   2834 1   2848 1   2947 1   2947 1   2947 1   2947 1
  3880         -  2980 1   3082 1   3088 1   3088 1   3113 1   3113 1   3113 1   3113 1
  3881         -  3234 1   3481 1   3481 1   3481 1   3481 1   3481 1   3481 1}
         4013  +      ORDER BY 1 , 2 , 3
         4014  +} {295 1 1   335 1 1   607 1 1   667 1 1   742 1 1   759 1 1   845 1 1
         4015  +  890 1 1   929 1 1   959 1 1   962 1 1   962 1 1   962 1 1   962 1 1
         4016  +  962 1 1   962 1 1   962 1 1   962 1 1   962 1 1   1264 1 1   1264 1 1
         4017  +  1264 1 1   1264 1 1   1264 1 1   1264 1 1   1366 1 1   1366 1 1   1366 1 1
         4018  +  1366 1 1   1383 1 1   1398 1 1   1406 1 1   1421 1 1   1519 1 1   1519 1 1
         4019  +  1535 1 1   1651 1 1   1669 1 1   1682 1 1   1695 1 1   1804 1 1   1804 1 1
         4020  +  1804 1 1   1804 1 1   1804 1 1   1897 1 1   1919 1 1   2000 1 1   2048 1 1
         4021  +  2050 1 1   2050 1 1   2070 1 1   2086 1 1   2108 1 1   2108 1 1   2134 1 1
         4022  +  2150 1 1   2309 1 1   2309 1 1   2309 1 1   2340 1 1   2340 1 1   2340 1 1
         4023  +  2430 1 1   2690 1 1   2758 1 1   2770 1 1   2776 1 1   2834 1 1   2848 1 1
         4024  +  2947 1 1   2947 1 1   2947 1 1   2947 1 1   2980 1 1   3082 1 1   3088 1 1
         4025  +  3088 1 1   3113 1 1   3113 1 1   3113 1 1   3113 1 1   3234 1 1   3481 1 1
         4026  +  3481 1 1   3481 1 1   3481 1 1   3481 1 1   3481 1 1}
  3882   4027   
  3883   4028   do_execsql_test 5.2.4.1 {
  3884   4029     SELECT max(c) OVER win,
  3885         -             min(c) OVER win
         4030  +             min(c) OVER win,
         4031  +             count(a) OVER win
  3886   4032         FROM t3
  3887   4033         WINDOW win AS (  ORDER BY a  GROUPS 6 PRECEDING   EXCLUDE CURRENT ROW  )
  3888         -      ORDER BY 1 , 2
  3889         -} {667 158   870 158   870 158   870 158   870 158   870 355   911 158
  3890         -  934 158   934 158   934 158   934 158   934 158   934 158   934 158
  3891         -  934 158   934 158   934 158   934 158   934 158   934 158   934 158
  3892         -  934 158   934 158   934 158   934 158   934 158   934 158   934 158
  3893         -  934 158   934 158   934 158   934 158   934 158   934 158   959 102
  3894         -  959 102   959 102   959 102   959 102   959 102   959 102   959 102
  3895         -  959 102   959 102   959 102   959 102   959 102   959 102   959 102
  3896         -  959 102   959 102   959 102   959 113   959 113   959 113   959 113
  3897         -  959 113   959 158   959 158   959 158   959 158   959 158   959 158
  3898         -  959 158   963 102   979 102   979 102   979 102   979 102   979 102
  3899         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3900         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  3901         -  979 102   979 102   979 102   979 102   979 102}
         4034  +      ORDER BY 1 , 2 , 3
         4035  +} {667 158 0   870 158 0   870 158 0   870 158 0   870 158 0   870 355 0
         4036  +  911 158 7   934 158 7   934 158 7   934 158 7   934 158 7   934 158 7
         4037  +  934 158 7   934 158 7   934 158 20   934 158 20   934 158 20   934 158 20
         4038  +  934 158 20   934 158 20   934 158 20   934 158 20   934 158 20   934 158 20
         4039  +  934 158 20   934 158 20   934 158 20   934 158 26   934 158 26   934 158 26
         4040  +  934 158 26   934 158 26   934 158 26   934 158 33   959 102 49   959 102 49
         4041  +  959 102 49   959 102 49   959 102 49   959 102 49   959 102 49   959 102 49
         4042  +  959 102 49   959 102 49   959 102 57   959 102 57   959 102 57   959 102 57
         4043  +  959 102 57   959 102 57   959 102 57   959 102 57   959 113 38   959 113 38
         4044  +  959 113 38   959 113 38   959 113 49   959 158 33   959 158 33   959 158 33
         4045  +  959 158 33   959 158 33   959 158 33   959 158 38   963 102 58   979 102 52
         4046  +  979 102 52   979 102 52   979 102 52   979 102 52   979 102 52   979 102 52
         4047  +  979 102 55   979 102 55   979 102 55   979 102 55   979 102 55   979 102 55
         4048  +  979 102 55   979 102 55   979 102 55   979 102 58   979 102 58   979 102 58
         4049  +  979 102 58   979 102 58   979 102 58   979 102 58   979 102 58}
  3902   4050   
  3903   4051   do_execsql_test 5.2.4.2 {
  3904   4052     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  3905         -             rank() OVER win
         4053  +             rank() OVER win,
         4054  +             dense_rank() OVER win
  3906   4055         FROM t3
  3907   4056         WINDOW win AS (  ORDER BY a  GROUPS 6 PRECEDING   EXCLUDE CURRENT ROW  )
  3908         -      ORDER BY 1 , 2
  3909         -} {1383 1   1421 1   1651 1   1695 1   2050 1   2050 1   3448 7   3732 7
  3910         -  4050 7   4120 7   4136 7   4359 7   4359 7   4359 7   7129 15   7135 15
  3911         -  7207 15   7441 15   7447 15   7447 15   7593 15   7840 15   7840 15
  3912         -  7840 15   7840 15   7840 15   7840 15   8447 28   8599 28   9206 28
  3913         -  9206 28   9206 28   9206 28   10051 34   10165 34   11010 34   11010 34
  3914         -  11010 34   11010 34   11010 34   11563 74   11697 74   11752 41   11776 57
  3915         -  11900 41   11925 74   11947 74   12368 74   12368 74   12368 74   12370 57
  3916         -  12416 41   12529 41   12529 41   12530 65   12546 65   12705 57   12705 57
  3917         -  12705 57   12705 57   12705 57   12705 57   12824 46   12826 65   13050 81
  3918         -  13110 81   13110 81   13154 65   13196 46   13376 65   13491 46   13491 46
  3919         -  13491 46   13491 46   13491 46   13491 46   13491 46   13491 46   13491 46
  3920         -  13509 65   13509 65   13509 65   13509 65   13692 81   13836 81   13949 81
  3921         -  13949 81   13949 81   13949 81}
         4057  +      ORDER BY 1 , 2 , 3
         4058  +} {1383 1 1   1421 1 1   1651 1 1   1695 1 1   2050 1 1   2050 1 1   3448 7 2
         4059  +  3732 7 2   4050 7 2   4120 7 2   4136 7 2   4359 7 2   4359 7 2   4359 7 2
         4060  +  7129 15 3   7135 15 3   7207 15 3   7441 15 3   7447 15 3   7447 15 3
         4061  +  7593 15 3   7840 15 3   7840 15 3   7840 15 3   7840 15 3   7840 15 3
         4062  +  7840 15 3   8447 28 4   8599 28 4   9206 28 4   9206 28 4   9206 28 4
         4063  +  9206 28 4   10051 34 5   10165 34 5   11010 34 5   11010 34 5   11010 34 5
         4064  +  11010 34 5   11010 34 5   11563 74 10   11697 74 10   11752 41 6
         4065  +  11776 57 8   11900 41 6   11925 74 10   11947 74 10   12368 74 10
         4066  +  12368 74 10   12368 74 10   12370 57 8   12416 41 6   12529 41 6
         4067  +  12529 41 6   12530 65 9   12546 65 9   12705 57 8   12705 57 8   12705 57 8
         4068  +  12705 57 8   12705 57 8   12705 57 8   12824 46 7   12826 65 9
         4069  +  13050 81 11   13110 81 11   13110 81 11   13154 65 9   13196 46 7
         4070  +  13376 65 9   13491 46 7   13491 46 7   13491 46 7   13491 46 7   13491 46 7
         4071  +  13491 46 7   13491 46 7   13491 46 7   13491 46 7   13509 65 9   13509 65 9
         4072  +  13509 65 9   13509 65 9   13692 81 11   13836 81 11   13949 81 11
         4073  +  13949 81 11   13949 81 11   13949 81 11}
  3922   4074   
  3923   4075   do_execsql_test 5.2.5.1 {
  3924   4076     SELECT max(c) OVER win,
  3925         -             min(c) OVER win
         4077  +             min(c) OVER win,
         4078  +             count(a) OVER win
  3926   4079         FROM t3
  3927   4080         WINDOW win AS (  ORDER BY c  RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING   EXCLUDE CURRENT ROW  )
  3928         -      ORDER BY 1 , 2
  3929         -} {{} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  3930         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  3931         -  {} {}   {} {}   113 113   113 113   158 158   160 158   160 158   223 223
  3932         -  224 224   238 234   239 234   239 238   252 250   256 252   257 247
  3933         -  257 247   257 250   335 330   336 330   336 335   355 354   355 354
  3934         -  355 355   399 393   399 393   399 393   399 393   399 393   480 480
  3935         -  480 480   572 572   574 574   618 618   618 618   633 629   634 627
  3936         -  634 627   634 627   634 629   667 667   670 667   671 667   671 667
  3937         -  671 667   711 711   711 711   716 705   726 726   730 730   762 762
  3938         -  768 759   768 762   768 762   792 790   792 790   794 786   794 786
  3939         -  844 839   845 839   845 839   845 839   845 839   870 870   870 870
  3940         -  870 870   934 934   938 929   938 934   938 934   959 959   963 963}
         4081  +      ORDER BY 1 , 2 , 3
         4082  +} {{} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4083  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4084  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   113 113 1
         4085  +  113 113 1   158 158 1   160 158 1   160 158 2   223 223 1   224 224 1
         4086  +  238 234 2   239 234 2   239 238 2   252 250 2   256 252 2   257 247 4
         4087  +  257 247 4   257 250 3   335 330 2   336 330 2   336 335 2   355 354 1
         4088  +  355 354 2   355 355 1   399 393 3   399 393 3   399 393 3   399 393 3
         4089  +  399 393 4   480 480 1   480 480 1   572 572 1   574 574 1   618 618 1
         4090  +  618 618 1   633 629 2   634 627 3   634 627 3   634 627 4   634 629 3
         4091  +  667 667 1   670 667 2   671 667 2   671 667 2   671 667 3   711 711 1
         4092  +  711 711 1   716 705 2   726 726 1   730 730 1   762 762 1   768 759 3
         4093  +  768 762 2   768 762 2   792 790 2   792 790 2   794 786 3   794 786 3
         4094  +  844 839 4   845 839 4   845 839 4   845 839 4   845 839 4   870 870 1
         4095  +  870 870 1   870 870 2   934 934 1   938 929 3   938 934 2   938 934 2
         4096  +  959 959 1   963 963 1}
  3941   4097   
  3942   4098   do_execsql_test 5.2.5.2 {
  3943   4099     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  3944         -             rank() OVER win
         4100  +             rank() OVER win,
         4101  +             dense_rank() OVER win
  3945   4102         FROM t3
  3946   4103         WINDOW win AS (  ORDER BY c  RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING   EXCLUDE CURRENT ROW  )
  3947         -      ORDER BY 1 , 2
  3948         -} {{} 1   {} 4   {} 5   {} 6   {} 6   {} 8   {} 9   {} 10   {} 14   {} 15
  3949         -  {} 19   {} 20   {} 21   {} 23   {} 25   {} 34   {} 35   {} 36   {} 37
  3950         -  {} 38   {} 38   {} 40   {} 41   {} 42   {} 43   {} 43   {} 50   {} 56
  3951         -  {} 60   {} 61   {} 62   {} 64   {} 64   {} 66   {} 67   {} 68   {} 69
  3952         -  {} 70   {} 71   {} 72   {} 78   {} 78   {} 78   {} 81   {} 82   {} 83
  3953         -  {} 85   {} 85   {} 89   113 2   113 2   223 11   239 12   239 13   257 18
  3954         -  335 22   335 24   355 27   355 27   504 16   504 17   705 58   710 26
  3955         -  711 57   711 59   759 63   929 84   959 88   963 87   1185 32   1185 32
  3956         -  1191 29   1191 29   1334 51   1334 55   1338 52   1338 52   1584 31
  3957         -  1678 77   1684 73   1684 73   1885 48   1889 46   1889 46   1891 45
  3958         -  1891 49   2005 54   2523 75   2523 76}
         4104  +      ORDER BY 1 , 2 , 3
         4105  +} {{} 1 1   {} 4 3   {} 5 4   {} 6 5   {} 6 5   {} 8 6   {} 9 7   {} 10 8
         4106  +  {} 14 12   {} 15 13   {} 19 17   {} 20 18   {} 21 19   {} 23 21   {} 25 23
         4107  +  {} 34 29   {} 35 30   {} 36 31   {} 37 32   {} 38 33   {} 38 33   {} 40 34
         4108  +  {} 41 35   {} 42 36   {} 43 37   {} 43 37   {} 50 42   {} 56 47   {} 60 51
         4109  +  {} 61 52   {} 62 53   {} 64 55   {} 64 55   {} 66 56   {} 67 57   {} 68 58
         4110  +  {} 69 59   {} 70 60   {} 71 61   {} 72 62   {} 78 67   {} 78 67   {} 78 67
         4111  +  {} 81 68   {} 82 69   {} 83 70   {} 85 72   {} 85 72   {} 89 75   113 2 2
         4112  +  113 2 2   223 11 9   239 12 10   239 13 11   257 18 16   335 22 20
         4113  +  335 24 22   355 27 25   355 27 25   504 16 14   504 17 15   705 58 49
         4114  +  710 26 24   711 57 48   711 59 50   759 63 54   929 84 71   959 88 74
         4115  +  963 87 73   1185 32 28   1185 32 28   1191 29 26   1191 29 26   1334 51 43
         4116  +  1334 55 46   1338 52 44   1338 52 44   1584 31 27   1678 77 66   1684 73 63
         4117  +  1684 73 63   1885 48 40   1889 46 39   1889 46 39   1891 45 38   1891 49 41
         4118  +  2005 54 45   2523 75 64   2523 76 65}
         4119  +
         4120  +do_execsql_test 5.2.6.1 {
         4121  +  SELECT max(c) OVER win,
         4122  +             min(c) OVER win,
         4123  +             count(a) OVER win
         4124  +      FROM t3
         4125  +      WINDOW win AS (  ORDER BY c  RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING   EXCLUDE CURRENT ROW  )
         4126  +      ORDER BY 1 , 2 , 3
         4127  +} {{} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4128  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4129  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4130  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4131  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4132  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4133  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4134  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4135  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   113 113 1
         4136  +  113 113 1   158 158 0   158 158 1   355 355 0   355 355 1   393 393 1
         4137  +  393 393 1   399 399 0   399 399 1   480 480 1   480 480 1   618 618 1
         4138  +  618 618 1   629 629 0   629 629 1   667 667 0   667 667 1   768 768 1
         4139  +  768 768 1   839 839 1   839 839 1   870 870 1   870 870 1   870 870 2
         4140  +  938 938 1   938 938 1}
         4141  +
         4142  +do_execsql_test 5.2.6.2 {
         4143  +  SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
         4144  +             rank() OVER win,
         4145  +             dense_rank() OVER win
         4146  +      FROM t3
         4147  +      WINDOW win AS (  ORDER BY c  RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING   EXCLUDE CURRENT ROW  )
         4148  +      ORDER BY 1 , 2 , 3
         4149  +} {{} 1 1   {} 4 3   {} 5 4   {} 6 5   {} 6 5   {} 8 6   {} 9 7   {} 10 8
         4150  +  {} 11 9   {} 12 10   {} 13 11   {} 14 12   {} 15 13   {} 16 14   {} 17 15
         4151  +  {} 18 16   {} 19 17   {} 20 18   {} 21 19   {} 22 20   {} 23 21   {} 24 22
         4152  +  {} 25 23   {} 26 24   {} 31 27   {} 34 29   {} 35 30   {} 36 31   {} 37 32
         4153  +  {} 38 33   {} 38 33   {} 40 34   {} 41 35   {} 42 36   {} 43 37   {} 43 37
         4154  +  {} 45 38   {} 48 40   {} 49 41   {} 50 42   {} 51 43   {} 54 45   {} 55 46
         4155  +  {} 56 47   {} 57 48   {} 58 49   {} 59 50   {} 60 51   {} 61 52   {} 62 53
         4156  +  {} 63 54   {} 64 55   {} 64 55   {} 66 56   {} 67 57   {} 68 58   {} 69 59
         4157  +  {} 70 60   {} 71 61   {} 72 62   {} 75 64   {} 76 65   {} 77 66   {} 78 67
         4158  +  {} 78 67   {} 78 67   {} 81 68   {} 82 69   {} 83 70   {} 84 71   {} 85 72
         4159  +  {} 85 72   {} 87 73   {} 88 74   {} 89 75   113 2 2   113 2 2   355 27 25
         4160  +  355 27 25   393 29 26   393 29 26   399 32 28   399 32 28   629 46 39
         4161  +  629 46 39   667 52 44   667 52 44   839 73 63   839 73 63}
         4162  +
         4163  +do_execsql_test 5.2.7.1 {
         4164  +  SELECT max(c) OVER win,
         4165  +             min(c) OVER win,
         4166  +             count(a) OVER win
         4167  +      FROM t3
         4168  +      WINDOW win AS (  ORDER BY c , b , a 
         4169  +        ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE CURRENT ROW  )
         4170  +      ORDER BY 1 , 2 , 3
         4171  +} {963 929 6   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         4172  +  979 102 83   979 113 80   979 113 81   979 113 82   979 133 79   979 148 78
         4173  +  979 158 76   979 158 77   979 160 76   979 208 75   979 223 74   979 224 73
         4174  +  979 234 72   979 238 71   979 239 70   979 247 69   979 250 68   979 252 67
         4175  +  979 256 66   979 257 65   979 295 64   979 309 64   979 330 62   979 335 61
         4176  +  979 336 60   979 346 59   979 354 59   979 355 57   979 355 57   979 393 55
         4177  +  979 393 56   979 398 54   979 399 53   979 399 53   979 412 52   979 421 51
         4178  +  979 430 50   979 443 49   979 480 47   979 480 48   979 572 47   979 574 45
         4179  +  979 607 44   979 618 42   979 618 43   979 627 41   979 629 40   979 629 41
         4180  +  979 633 39   979 634 38   979 652 37   979 660 36   979 667 35   979 667 35
         4181  +  979 670 34   979 671 33   979 683 32   979 705 31   979 711 30   979 716 29
         4182  +  979 726 28   979 730 27   979 759 26   979 762 25   979 768 23   979 768 24
         4183  +  979 777 22   979 786 21   979 790 20   979 792 19   979 794 18   979 805 17
         4184  +  979 822 17   979 839 14   979 839 15   979 840 13   979 844 12   979 845 11
         4185  +  979 870 9   979 870 10   979 870 10   979 899 8   979 911 7}
         4186  +
         4187  +do_execsql_test 5.2.7.2 {
         4188  +  SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
         4189  +             rank() OVER win,
         4190  +             dense_rank() OVER win
         4191  +      FROM t3
         4192  +      WINDOW win AS (  ORDER BY c , b , a 
         4193  +        ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE CURRENT ROW  )
         4194  +      ORDER BY 1 , 2 , 3
         4195  +} {2851 89 89   3778 88 88   4681 87 87   5556 83 83   5574 82 82   5586 81 81
         4196  +  5640 84 84   5640 85 85   5640 86 86   7324 80 80   8123 77 77   8129 73 73
         4197  +  8129 74 74   8163 78 78   8163 79 79   8940 71 71   8968 75 75   8968 76 76
         4198  +  9727 66 66   9745 69 69   9745 70 70   9745 72 72   10504 65 65
         4199  +  10504 67 67   10504 68 68   11215 64 64   11844 62 62   11920 63 63
         4200  +  13274 60 60   13274 61 61   13897 58 58   13903 57 57   13925 56 56
         4201  +  13937 55 55   13941 59 59   15203 53 53   15241 54 54   15832 52 52
         4202  +  17100 48 48   17104 46 46   17104 47 47   17106 45 45   17126 49 49
         4203  +  17126 50 50   17126 51 51   17569 42 42   17733 44 44   18176 43 43
         4204  +  18597 40 40   18597 41 41   18952 37 37   18996 39 39   19395 38 38
         4205  +  19760 35 35   19788 36 36   20492 32 32   20492 33 33   20498 30 30
         4206  +  20536 34 34   20833 29 29   20871 28 28   20891 31 31   21180 27 27
         4207  +  21752 23 23   21830 26 26   22025 21 21   22087 22 22   22087 24 24
         4208  +  22087 25 25   22278 20 20   22316 19 19   22549 15 15   22557 14 14
         4209  +  22573 17 17   22573 18 18   22706 10 10   22796 11 11   22796 12 12
         4210  +  22796 13 13   22796 16 16   23022 4 4   23042 2 2   23042 3 3   23042 9 9
         4211  +  23155 1 1   23155 5 5   23155 6 6   23155 7 7   23155 8 8}
  3959   4212   
  3960   4213   do_execsql_test 5.3.1.1 {
  3961   4214     SELECT max(c) OVER win,
  3962         -             min(c) OVER win
         4215  +             min(c) OVER win,
         4216  +             count(a) OVER win
  3963   4217         FROM t3
  3964   4218         WINDOW win AS (  RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE GROUP  )
  3965         -      ORDER BY 1 , 2
  3966         -} {{} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  3967         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  3968         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  3969         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  3970         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  3971         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  3972         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  3973         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  3974         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  3975         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}}
         4219  +      ORDER BY 1 , 2 , 3
         4220  +} {{} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4221  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4222  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4223  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4224  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4225  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4226  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4227  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4228  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4229  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4230  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4231  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4232  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0}
  3976   4233   
  3977   4234   do_execsql_test 5.3.1.2 {
  3978   4235     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  3979         -             rank() OVER win
         4236  +             rank() OVER win,
         4237  +             dense_rank() OVER win
  3980   4238         FROM t3
  3981   4239         WINDOW win AS (  RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE GROUP  )
  3982         -      ORDER BY 1 , 2
  3983         -} {{} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  3984         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  3985         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  3986         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  3987         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  3988         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  3989         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  3990         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  3991         -  {} 1}
         4240  +      ORDER BY 1 , 2 , 3
         4241  +} {{} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4242  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4243  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4244  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4245  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4246  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4247  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4248  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4249  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4250  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4251  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4252  +  {} 1 1}
  3992   4253   
  3993   4254   do_execsql_test 5.3.2.1 {
  3994   4255     SELECT max(c) OVER win,
  3995         -             min(c) OVER win
         4256  +             min(c) OVER win,
         4257  +             count(a) OVER win
  3996   4258         FROM t3
  3997   4259         WINDOW win AS (  ORDER BY a  
  3998   4260           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE GROUP  )
  3999         -      ORDER BY 1 , 2
  4000         -} {{} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  4001         -  899 113   899 113   899 113   899 113   899 113   899 113   899 113
  4002         -  899 113   899 113   899 113   899 113   899 113   899 113   899 113
  4003         -  899 113   899 113   979 102   979 102   979 102   979 102   979 102
  4004         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  4005         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  4006         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  4007         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  4008         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  4009         -  979 102   979 102   979 102   979 102   979 102   979 113   979 113
  4010         -  979 113   979 113   979 113   979 113   979 113   979 113   979 113
  4011         -  979 113   979 113   979 113   979 113   979 113   979 113   979 113
  4012         -  979 113   979 113   979 113}
         4261  +      ORDER BY 1 , 2 , 3
         4262  +} {{} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4263  +  {} {} 0   {} {} 0   899 113 9   899 113 9   899 113 9   899 113 9
         4264  +  899 113 9   899 113 9   899 113 9   899 113 16   899 113 16   899 113 16
         4265  +  899 113 16   899 113 16   899 113 16   899 113 16   899 113 16   899 113 16
         4266  +  979 102 44   979 102 44   979 102 44   979 102 44   979 102 44   979 102 49
         4267  +  979 102 49   979 102 49   979 102 49   979 102 49   979 102 49   979 102 49
         4268  +  979 102 56   979 102 56   979 102 56   979 102 56   979 102 56   979 102 56
         4269  +  979 102 62   979 102 62   979 102 62   979 102 62   979 102 62   979 102 62
         4270  +  979 102 62   979 102 62   979 102 62   979 102 62   979 102 62   979 102 62
         4271  +  979 102 62   979 102 75   979 102 75   979 102 75   979 102 75   979 102 75
         4272  +  979 102 75   979 102 75   979 102 75   979 102 83   979 102 83   979 102 83
         4273  +  979 102 83   979 102 83   979 102 83   979 113 25   979 113 25   979 113 25
         4274  +  979 113 25   979 113 25   979 113 25   979 113 25   979 113 25   979 113 33
         4275  +  979 113 33   979 113 33   979 113 33   979 113 33   979 113 33   979 113 33
         4276  +  979 113 33   979 113 33   979 113 33   979 113 33}
  4013   4277   
  4014   4278   do_execsql_test 5.3.2.2 {
  4015   4279     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  4016         -             rank() OVER win
         4280  +             rank() OVER win,
         4281  +             dense_rank() OVER win
  4017   4282         FROM t3
  4018   4283         WINDOW win AS (  ORDER BY a  
  4019   4284           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE GROUP  )
  4020         -      ORDER BY 1 , 2
  4021         -} {{} 81   {} 81   {} 81   {} 81   {} 81   {} 81   {} 81   {} 81   {} 81
  4022         -  2947 74   2947 74   2947 74   2947 74   2947 74   2947 74   2947 74
  4023         -  5287 65   5287 65   5287 65   5287 65   5287 65   5287 65   5287 65
  4024         -  5287 65   5287 65   8400 57   8400 57   8400 57   8400 57   8400 57
  4025         -  8400 57   8400 57   8400 57   9664 46   9664 46   9664 46   9664 46
  4026         -  9664 46   9664 46   9664 46   9664 46   9664 46   9664 46   9664 46
  4027         -  10626 41   10626 41   10626 41   10626 41   10626 41   12145 34   12145 34
  4028         -  12145 34   12145 34   12145 34   12145 34   12145 34   13949 28   13949 28
  4029         -  13949 28   13949 28   13949 28   13949 28   15315 15   15315 15   15315 15
  4030         -  15315 15   15315 15   15315 15   15315 15   15315 15   15315 15   15315 15
  4031         -  15315 15   15315 15   15315 15   18796 7   18796 7   18796 7   18796 7
  4032         -  18796 7   18796 7   18796 7   18796 7   21105 1   21105 1   21105 1
  4033         -  21105 1   21105 1   21105 1}
         4285  +      ORDER BY 1 , 2 , 3
         4286  +} {{} 81 11   {} 81 11   {} 81 11   {} 81 11   {} 81 11   {} 81 11   {} 81 11
         4287  +  {} 81 11   {} 81 11   2947 74 10   2947 74 10   2947 74 10   2947 74 10
         4288  +  2947 74 10   2947 74 10   2947 74 10   5287 65 9   5287 65 9   5287 65 9
         4289  +  5287 65 9   5287 65 9   5287 65 9   5287 65 9   5287 65 9   5287 65 9
         4290  +  8400 57 8   8400 57 8   8400 57 8   8400 57 8   8400 57 8   8400 57 8
         4291  +  8400 57 8   8400 57 8   9664 46 7   9664 46 7   9664 46 7   9664 46 7
         4292  +  9664 46 7   9664 46 7   9664 46 7   9664 46 7   9664 46 7   9664 46 7
         4293  +  9664 46 7   10626 41 6   10626 41 6   10626 41 6   10626 41 6   10626 41 6
         4294  +  12145 34 5   12145 34 5   12145 34 5   12145 34 5   12145 34 5   12145 34 5
         4295  +  12145 34 5   13949 28 4   13949 28 4   13949 28 4   13949 28 4   13949 28 4
         4296  +  13949 28 4   15315 15 3   15315 15 3   15315 15 3   15315 15 3   15315 15 3
         4297  +  15315 15 3   15315 15 3   15315 15 3   15315 15 3   15315 15 3   15315 15 3
         4298  +  15315 15 3   15315 15 3   18796 7 2   18796 7 2   18796 7 2   18796 7 2
         4299  +  18796 7 2   18796 7 2   18796 7 2   18796 7 2   21105 1 1   21105 1 1
         4300  +  21105 1 1   21105 1 1   21105 1 1   21105 1 1}
  4034   4301   
  4035   4302   do_execsql_test 5.3.3.1 {
  4036   4303     SELECT max(c) OVER win,
  4037         -             min(c) OVER win
         4304  +             min(c) OVER win,
         4305  +             count(a) OVER win
  4038   4306         FROM t3
  4039   4307         WINDOW win AS (  PARTITION BY coalesce(a, '') 
  4040   4308           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE GROUP  )
  4041         -      ORDER BY 1 , 2
  4042         -} {{} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  4043         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  4044         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  4045         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  4046         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  4047         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  4048         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  4049         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  4050         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  4051         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}}
         4309  +      ORDER BY 1 , 2 , 3
         4310  +} {{} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4311  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4312  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4313  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4314  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4315  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4316  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4317  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4318  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4319  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4320  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4321  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4322  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0}
  4052   4323   
  4053   4324   do_execsql_test 5.3.3.2 {
  4054   4325     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  4055         -             rank() OVER win
         4326  +             rank() OVER win,
         4327  +             dense_rank() OVER win
  4056   4328         FROM t3
  4057   4329         WINDOW win AS (  PARTITION BY coalesce(a, '') 
  4058   4330           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE GROUP  )
  4059         -      ORDER BY 1 , 2
  4060         -} {{} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4061         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4062         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4063         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4064         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4065         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4066         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4067         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4068         -  {} 1}
         4331  +      ORDER BY 1 , 2 , 3
         4332  +} {{} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4333  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4334  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4335  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4336  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4337  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4338  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4339  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4340  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4341  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4342  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4343  +  {} 1 1}
  4069   4344   
  4070   4345   do_execsql_test 5.3.4.1 {
  4071   4346     SELECT max(c) OVER win,
  4072         -             min(c) OVER win
         4347  +             min(c) OVER win,
         4348  +             count(a) OVER win
  4073   4349         FROM t3
  4074   4350         WINDOW win AS (  ORDER BY a  GROUPS 6 PRECEDING   EXCLUDE GROUP  )
  4075         -      ORDER BY 1 , 2
  4076         -} {{} {}   {} {}   {} {}   {} {}   {} {}   {} {}   870 158   870 158   870 158
  4077         -  870 158   870 158   870 158   870 158   870 158   934 158   934 158
  4078         -  934 158   934 158   934 158   934 158   934 158   934 158   934 158
  4079         -  934 158   934 158   934 158   934 158   934 158   934 158   934 158
  4080         -  934 158   934 158   934 158   934 158   934 158   934 158   934 158
  4081         -  934 158   934 158   934 158   959 102   959 102   959 102   959 102
  4082         -  959 102   959 102   959 102   959 102   959 102   959 102   959 102
  4083         -  959 102   959 102   959 102   959 102   959 102   959 102   959 113
  4084         -  959 113   959 113   959 113   959 113   959 113   959 113   959 113
  4085         -  959 113   959 113   959 113   959 158   959 158   959 158   959 158
  4086         -  959 158   979 102   979 102   979 102   979 102   979 102   979 102
  4087         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  4088         -  979 102   979 102   979 102}
         4351  +      ORDER BY 1 , 2 , 3
         4352  +} {{} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   870 158 0
         4353  +  870 158 0   870 158 0   870 158 0   870 158 0   870 158 0   870 158 0
         4354  +  870 158 0   934 158 8   934 158 8   934 158 8   934 158 8   934 158 8
         4355  +  934 158 8   934 158 8   934 158 8   934 158 8   934 158 8   934 158 8
         4356  +  934 158 8   934 158 8   934 158 21   934 158 21   934 158 21   934 158 21
         4357  +  934 158 21   934 158 21   934 158 27   934 158 27   934 158 27   934 158 27
         4358  +  934 158 27   934 158 27   934 158 27   959 102 50   959 102 50   959 102 50
         4359  +  959 102 50   959 102 50   959 102 50   959 102 50   959 102 50   959 102 50
         4360  +  959 102 50   959 102 50   959 102 50   959 102 50   959 102 50   959 102 50
         4361  +  959 102 50   959 102 50   959 113 39   959 113 39   959 113 39   959 113 39
         4362  +  959 113 39   959 113 39   959 113 39   959 113 39   959 113 39   959 113 39
         4363  +  959 113 39   959 158 34   959 158 34   959 158 34   959 158 34   959 158 34
         4364  +  979 102 46   979 102 46   979 102 46   979 102 46   979 102 46   979 102 46
         4365  +  979 102 46   979 102 47   979 102 47   979 102 47   979 102 47   979 102 47
         4366  +  979 102 47   979 102 47   979 102 47   979 102 47}
  4089   4367   
  4090   4368   do_execsql_test 5.3.4.2 {
  4091   4369     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  4092         -             rank() OVER win
         4370  +             rank() OVER win,
         4371  +             dense_rank() OVER win
  4093   4372         FROM t3
  4094   4373         WINDOW win AS (  ORDER BY a  GROUPS 6 PRECEDING   EXCLUDE GROUP  )
  4095         -      ORDER BY 1 , 2
  4096         -} {{} 1   {} 1   {} 1   {} 1   {} 1   {} 1   2050 7   2050 7   2050 7   2050 7
  4097         -  2050 7   2050 7   2050 7   2050 7   4359 15   4359 15   4359 15   4359 15
  4098         -  4359 15   4359 15   4359 15   4359 15   4359 15   4359 15   4359 15
  4099         -  4359 15   4359 15   7840 28   7840 28   7840 28   7840 28   7840 28
  4100         -  7840 28   9206 34   9206 34   9206 34   9206 34   9206 34   9206 34
  4101         -  9206 34   10028 74   10028 74   10028 74   10028 74   10028 74   10028 74
  4102         -  10028 74   10396 65   10396 65   10396 65   10396 65   10396 65   10396 65
  4103         -  10396 65   10396 65   10396 65   11002 81   11002 81   11002 81   11002 81
  4104         -  11002 81   11002 81   11002 81   11002 81   11002 81   11010 41   11010 41
  4105         -  11010 41   11010 41   11010 41   11441 57   11441 57   11441 57   11441 57
  4106         -  11441 57   11441 57   11441 57   11441 57   12529 46   12529 46   12529 46
  4107         -  12529 46   12529 46   12529 46   12529 46   12529 46   12529 46   12529 46
  4108         -  12529 46}
         4374  +      ORDER BY 1 , 2 , 3
         4375  +} {{} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   2050 7 2   2050 7 2
         4376  +  2050 7 2   2050 7 2   2050 7 2   2050 7 2   2050 7 2   2050 7 2   4359 15 3
         4377  +  4359 15 3   4359 15 3   4359 15 3   4359 15 3   4359 15 3   4359 15 3
         4378  +  4359 15 3   4359 15 3   4359 15 3   4359 15 3   4359 15 3   4359 15 3
         4379  +  7840 28 4   7840 28 4   7840 28 4   7840 28 4   7840 28 4   7840 28 4
         4380  +  9206 34 5   9206 34 5   9206 34 5   9206 34 5   9206 34 5   9206 34 5
         4381  +  9206 34 5   10028 74 10   10028 74 10   10028 74 10   10028 74 10
         4382  +  10028 74 10   10028 74 10   10028 74 10   10396 65 9   10396 65 9
         4383  +  10396 65 9   10396 65 9   10396 65 9   10396 65 9   10396 65 9   10396 65 9
         4384  +  10396 65 9   11002 81 11   11002 81 11   11002 81 11   11002 81 11
         4385  +  11002 81 11   11002 81 11   11002 81 11   11002 81 11   11002 81 11
         4386  +  11010 41 6   11010 41 6   11010 41 6   11010 41 6   11010 41 6   11441 57 8
         4387  +  11441 57 8   11441 57 8   11441 57 8   11441 57 8   11441 57 8   11441 57 8
         4388  +  11441 57 8   12529 46 7   12529 46 7   12529 46 7   12529 46 7   12529 46 7
         4389  +  12529 46 7   12529 46 7   12529 46 7   12529 46 7   12529 46 7   12529 46 7}
  4109   4390   
  4110   4391   do_execsql_test 5.3.5.1 {
  4111   4392     SELECT max(c) OVER win,
  4112         -             min(c) OVER win
         4393  +             min(c) OVER win,
         4394  +             count(a) OVER win
  4113   4395         FROM t3
  4114   4396         WINDOW win AS (  ORDER BY c  RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING   EXCLUDE GROUP  )
  4115         -      ORDER BY 1 , 2
  4116         -} {{} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  4117         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  4118         -  {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}   {} {}
  4119         -  {} {}   {} {}   158 158   160 160   160 160   223 223   224 224   238 234
  4120         -  239 234   239 238   252 250   256 252   257 247   257 247   257 250
  4121         -  335 330   336 330   336 335   354 354   354 354   355 355   398 393
  4122         -  398 393   399 393   399 398   399 398   572 572   574 574   633 629
  4123         -  634 627   634 627   634 627   634 629   667 667   670 667   671 667
  4124         -  671 670   671 670   711 711   711 711   716 705   726 726   730 730
  4125         -  762 762   762 762   762 762   768 759   792 790   792 790   794 786
  4126         -  794 786   844 839   845 839   845 839   845 840   845 840   934 934
  4127         -  934 934   934 934   938 929   959 959   963 963}
         4397  +      ORDER BY 1 , 2 , 3
         4398  +} {{} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4399  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4400  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4401  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4402  +  {} {} 0   158 158 1   160 160 1   160 160 1   223 223 1   224 224 1
         4403  +  238 234 2   239 234 2   239 238 2   252 250 2   256 252 2   257 247 4
         4404  +  257 247 4   257 250 3   335 330 2   336 330 2   336 335 2   354 354 1
         4405  +  354 354 1   355 355 1   398 393 3   398 393 3   399 393 3   399 398 2
         4406  +  399 398 2   572 572 1   574 574 1   633 629 2   634 627 3   634 627 3
         4407  +  634 627 3   634 629 3   667 667 1   670 667 2   671 667 2   671 670 2
         4408  +  671 670 2   711 711 1   711 711 1   716 705 2   726 726 1   730 730 1
         4409  +  762 762 1   762 762 1   762 762 1   768 759 3   792 790 2   792 790 2
         4410  +  794 786 3   794 786 3   844 839 4   845 839 4   845 839 4   845 840 3
         4411  +  845 840 3   934 934 1   934 934 1   934 934 1   938 929 3   959 959 1
         4412  +  963 963 1}
  4128   4413   
  4129   4414   do_execsql_test 5.3.5.2 {
  4130   4415     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  4131         -             rank() OVER win
         4416  +             rank() OVER win,
         4417  +             dense_rank() OVER win
  4132   4418         FROM t3
  4133   4419         WINDOW win AS (  ORDER BY c  RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING   EXCLUDE GROUP  )
  4134         -      ORDER BY 1 , 2
  4135         -} {{} 1   {} 2   {} 2   {} 4   {} 5   {} 6   {} 6   {} 8   {} 9   {} 10
  4136         -  {} 14   {} 15   {} 19   {} 20   {} 21   {} 23   {} 25   {} 27   {} 27
  4137         -  {} 34   {} 35   {} 36   {} 37   {} 38   {} 38   {} 40   {} 41   {} 42
  4138         -  {} 43   {} 43   {} 50   {} 56   {} 60   {} 61   {} 62   {} 64   {} 64
  4139         -  {} 66   {} 67   {} 68   {} 69   {} 70   {} 71   {} 72   {} 78   {} 78
  4140         -  {} 78   {} 81   {} 82   {} 83   {} 85   {} 85   {} 89   223 11   239 12
  4141         -  239 13   257 18   335 22   335 24   504 16   504 17   671 52   671 52
  4142         -  705 58   710 26   711 57   711 59   759 63   786 32   786 32   798 29
  4143         -  798 29   845 73   845 73   929 84   959 88   963 87   1260 46   1260 46
  4144         -  1334 51   1334 55   1584 31   1678 77   1885 48   1891 45   1891 49
  4145         -  2005 54   2523 75   2523 76}
         4420  +      ORDER BY 1 , 2 , 3
         4421  +} {{} 1 1   {} 2 2   {} 2 2   {} 4 3   {} 5 4   {} 6 5   {} 6 5   {} 8 6
         4422  +  {} 9 7   {} 10 8   {} 14 12   {} 15 13   {} 19 17   {} 20 18   {} 21 19
         4423  +  {} 23 21   {} 25 23   {} 27 25   {} 27 25   {} 34 29   {} 35 30   {} 36 31
         4424  +  {} 37 32   {} 38 33   {} 38 33   {} 40 34   {} 41 35   {} 42 36   {} 43 37
         4425  +  {} 43 37   {} 50 42   {} 56 47   {} 60 51   {} 61 52   {} 62 53   {} 64 55
         4426  +  {} 64 55   {} 66 56   {} 67 57   {} 68 58   {} 69 59   {} 70 60   {} 71 61
         4427  +  {} 72 62   {} 78 67   {} 78 67   {} 78 67   {} 81 68   {} 82 69   {} 83 70
         4428  +  {} 85 72   {} 85 72   {} 89 75   223 11 9   239 12 10   239 13 11
         4429  +  257 18 16   335 22 20   335 24 22   504 16 14   504 17 15   671 52 44
         4430  +  671 52 44   705 58 49   710 26 24   711 57 48   711 59 50   759 63 54
         4431  +  786 32 28   786 32 28   798 29 26   798 29 26   845 73 63   845 73 63
         4432  +  929 84 71   959 88 74   963 87 73   1260 46 39   1260 46 39   1334 51 43
         4433  +  1334 55 46   1584 31 27   1678 77 66   1885 48 40   1891 45 38   1891 49 41
         4434  +  2005 54 45   2523 75 64   2523 76 65}
         4435  +
         4436  +do_execsql_test 5.3.6.1 {
         4437  +  SELECT max(c) OVER win,
         4438  +             min(c) OVER win,
         4439  +             count(a) OVER win
         4440  +      FROM t3
         4441  +      WINDOW win AS (  ORDER BY c  RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING   EXCLUDE GROUP  )
         4442  +      ORDER BY 1 , 2 , 3
         4443  +} {{} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4444  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4445  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4446  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4447  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4448  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4449  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4450  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4451  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4452  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4453  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4454  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0
         4455  +  {} {} 0   {} {} 0   {} {} 0   {} {} 0   {} {} 0}
         4456  +
         4457  +do_execsql_test 5.3.6.2 {
         4458  +  SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
         4459  +             rank() OVER win,
         4460  +             dense_rank() OVER win
         4461  +      FROM t3
         4462  +      WINDOW win AS (  ORDER BY c  RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING   EXCLUDE GROUP  )
         4463  +      ORDER BY 1 , 2 , 3
         4464  +} {{} 1 1   {} 2 2   {} 2 2   {} 4 3   {} 5 4   {} 6 5   {} 6 5   {} 8 6
         4465  +  {} 9 7   {} 10 8   {} 11 9   {} 12 10   {} 13 11   {} 14 12   {} 15 13
         4466  +  {} 16 14   {} 17 15   {} 18 16   {} 19 17   {} 20 18   {} 21 19   {} 22 20
         4467  +  {} 23 21   {} 24 22   {} 25 23   {} 26 24   {} 27 25   {} 27 25   {} 29 26
         4468  +  {} 29 26   {} 31 27   {} 32 28   {} 32 28   {} 34 29   {} 35 30   {} 36 31
         4469  +  {} 37 32   {} 38 33   {} 38 33   {} 40 34   {} 41 35   {} 42 36   {} 43 37
         4470  +  {} 43 37   {} 45 38   {} 46 39   {} 46 39   {} 48 40   {} 49 41   {} 50 42
         4471  +  {} 51 43   {} 52 44   {} 52 44   {} 54 45   {} 55 46   {} 56 47   {} 57 48
         4472  +  {} 58 49   {} 59 50   {} 60 51   {} 61 52   {} 62 53   {} 63 54   {} 64 55
         4473  +  {} 64 55   {} 66 56   {} 67 57   {} 68 58   {} 69 59   {} 70 60   {} 71 61
         4474  +  {} 72 62   {} 73 63   {} 73 63   {} 75 64   {} 76 65   {} 77 66   {} 78 67
         4475  +  {} 78 67   {} 78 67   {} 81 68   {} 82 69   {} 83 70   {} 84 71   {} 85 72
         4476  +  {} 85 72   {} 87 73   {} 88 74   {} 89 75}
         4477  +
         4478  +do_execsql_test 5.3.7.1 {
         4479  +  SELECT max(c) OVER win,
         4480  +             min(c) OVER win,
         4481  +             count(a) OVER win
         4482  +      FROM t3
         4483  +      WINDOW win AS (  ORDER BY c , b , a 
         4484  +        ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE GROUP  )
         4485  +      ORDER BY 1 , 2 , 3
         4486  +} {963 929 6   979 102 82   979 102 82   979 102 82   979 102 82   979 102 82
         4487  +  979 102 83   979 113 80   979 113 81   979 113 82   979 133 79   979 148 78
         4488  +  979 158 76   979 158 77   979 160 76   979 208 75   979 223 74   979 224 73
         4489  +  979 234 72   979 238 71   979 239 70   979 247 69   979 250 68   979 252 67
         4490  +  979 256 66   979 257 65   979 295 64   979 309 64   979 330 62   979 335 61
         4491  +  979 336 60   979 346 59   979 354 59   979 355 57   979 355 57   979 393 55
         4492  +  979 393 56   979 398 54   979 399 53   979 399 53   979 412 52   979 421 51
         4493  +  979 430 50   979 443 49   979 480 47   979 480 48   979 572 47   979 574 45
         4494  +  979 607 44   979 618 42   979 618 43   979 627 41   979 629 40   979 629 41
         4495  +  979 633 39   979 634 38   979 652 37   979 660 36   979 667 35   979 667 35
         4496  +  979 670 34   979 671 33   979 683 32   979 705 31   979 711 30   979 716 29
         4497  +  979 726 28   979 730 27   979 759 26   979 762 25   979 768 23   979 768 24
         4498  +  979 777 22   979 786 21   979 790 20   979 792 19   979 794 18   979 805 17
         4499  +  979 822 17   979 839 14   979 839 15   979 840 13   979 844 12   979 845 11
         4500  +  979 870 9   979 870 10   979 870 10   979 899 8   979 911 7}
         4501  +
         4502  +do_execsql_test 5.3.7.2 {
         4503  +  SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
         4504  +             rank() OVER win,
         4505  +             dense_rank() OVER win
         4506  +      FROM t3
         4507  +      WINDOW win AS (  ORDER BY c , b , a 
         4508  +        ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE GROUP  )
         4509  +      ORDER BY 1 , 2 , 3
         4510  +} {2851 89 89   3778 88 88   4681 87 87   5556 83 83   5574 82 82   5586 81 81
         4511  +  5640 84 84   5640 85 85   5640 86 86   7324 80 80   8123 77 77   8129 73 73
         4512  +  8129 74 74   8163 78 78   8163 79 79   8940 71 71   8968 75 75   8968 76 76
         4513  +  9727 66 66   9745 69 69   9745 70 70   9745 72 72   10504 65 65
         4514  +  10504 67 67   10504 68 68   11215 64 64   11844 62 62   11920 63 63
         4515  +  13274 60 60   13274 61 61   13897 58 58   13903 57 57   13925 56 56
         4516  +  13937 55 55   13941 59 59   15203 53 53   15241 54 54   15832 52 52
         4517  +  17100 48 48   17104 46 46   17104 47 47   17106 45 45   17126 49 49
         4518  +  17126 50 50   17126 51 51   17569 42 42   17733 44 44   18176 43 43
         4519  +  18597 40 40   18597 41 41   18952 37 37   18996 39 39   19395 38 38
         4520  +  19760 35 35   19788 36 36   20492 32 32   20492 33 33   20498 30 30
         4521  +  20536 34 34   20833 29 29   20871 28 28   20891 31 31   21180 27 27
         4522  +  21752 23 23   21830 26 26   22025 21 21   22087 22 22   22087 24 24
         4523  +  22087 25 25   22278 20 20   22316 19 19   22549 15 15   22557 14 14
         4524  +  22573 17 17   22573 18 18   22706 10 10   22796 11 11   22796 12 12
         4525  +  22796 13 13   22796 16 16   23022 4 4   23042 2 2   23042 3 3   23042 9 9
         4526  +  23155 1 1   23155 5 5   23155 6 6   23155 7 7   23155 8 8}
  4146   4527   
  4147   4528   do_execsql_test 5.4.1.1 {
  4148   4529     SELECT max(c) OVER win,
  4149         -             min(c) OVER win
         4530  +             min(c) OVER win,
         4531  +             count(a) OVER win
  4150   4532         FROM t3
  4151   4533         WINDOW win AS (  RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE TIES  )
  4152         -      ORDER BY 1 , 2
  4153         -} {102 102   113 113   113 113   133 133   148 148   158 158   158 158
  4154         -  160 160   208 208   223 223   224 224   234 234   238 238   239 239
  4155         -  247 247   250 250   252 252   256 256   257 257   295 295   309 309
  4156         -  330 330   335 335   336 336   346 346   354 354   355 355   355 355
  4157         -  393 393   393 393   398 398   399 399   399 399   412 412   421 421
  4158         -  430 430   443 443   480 480   480 480   572 572   574 574   607 607
  4159         -  618 618   618 618   627 627   629 629   629 629   633 633   634 634
  4160         -  652 652   660 660   667 667   667 667   670 670   671 671   683 683
  4161         -  705 705   711 711   716 716   726 726   730 730   759 759   762 762
  4162         -  768 768   768 768   777 777   786 786   790 790   792 792   794 794
  4163         -  805 805   822 822   839 839   839 839   840 840   844 844   845 845
  4164         -  870 870   870 870   870 870   899 899   911 911   929 929   934 934
  4165         -  938 938   938 938   959 959   963 963   979 979}
         4534  +      ORDER BY 1 , 2 , 3
         4535  +} {102 102 1   113 113 1   113 113 1   133 133 1   148 148 1   158 158 0
         4536  +  158 158 1   160 160 1   208 208 1   223 223 1   224 224 1   234 234 1
         4537  +  238 238 1   239 239 1   247 247 1   250 250 1   252 252 1   256 256 1
         4538  +  257 257 1   295 295 1   309 309 1   330 330 1   335 335 1   336 336 1
         4539  +  346 346 1   354 354 1   355 355 0   355 355 1   393 393 1   393 393 1
         4540  +  398 398 1   399 399 0   399 399 1   412 412 1   421 421 1   430 430 1
         4541  +  443 443 1   480 480 1   480 480 1   572 572 1   574 574 1   607 607 1
         4542  +  618 618 1   618 618 1   627 627 1   629 629 0   629 629 1   633 633 1
         4543  +  634 634 1   652 652 1   660 660 1   667 667 0   667 667 1   670 670 1
         4544  +  671 671 1   683 683 1   705 705 1   711 711 1   716 716 1   726 726 1
         4545  +  730 730 1   759 759 1   762 762 1   768 768 1   768 768 1   777 777 1
         4546  +  786 786 1   790 790 1   792 792 1   794 794 1   805 805 1   822 822 1
         4547  +  839 839 1   839 839 1   840 840 1   844 844 1   845 845 1   870 870 0
         4548  +  870 870 1   870 870 1   899 899 1   911 911 1   929 929 1   934 934 1
         4549  +  938 938 1   938 938 1   959 959 1   963 963 1   979 979 1}
  4166   4550   
  4167   4551   do_execsql_test 5.4.1.2 {
  4168   4552     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  4169         -             rank() OVER win
         4553  +             rank() OVER win,
         4554  +             dense_rank() OVER win
  4170   4555         FROM t3
  4171   4556         WINDOW win AS (  RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE TIES  )
  4172         -      ORDER BY 1 , 2
  4173         -} {{} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4174         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4175         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4176         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4177         -  {} 1   {} 1   {} 1   {} 1   113 1   113 1   133 1   223 1   239 1   247 1
  4178         -  257 1   295 1   309 1   335 1   355 1   355 1   393 1   393 1   399 1
  4179         -  399 1   421 1   443 1   607 1   627 1   629 1   629 1   633 1   667 1
  4180         -  667 1   671 1   683 1   705 1   711 1   759 1   777 1   805 1   839 1
  4181         -  839 1   845 1   899 1   911 1   929 1   959 1   963 1   979 1}
         4557  +      ORDER BY 1 , 2 , 3
         4558  +} {{} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4559  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4560  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4561  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4562  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4563  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4564  +  113 1 1   113 1 1   133 1 1   223 1 1   239 1 1   247 1 1   257 1 1
         4565  +  295 1 1   309 1 1   335 1 1   355 1 1   355 1 1   393 1 1   393 1 1
         4566  +  399 1 1   399 1 1   421 1 1   443 1 1   607 1 1   627 1 1   629 1 1
         4567  +  629 1 1   633 1 1   667 1 1   667 1 1   671 1 1   683 1 1   705 1 1
         4568  +  711 1 1   759 1 1   777 1 1   805 1 1   839 1 1   839 1 1   845 1 1
         4569  +  899 1 1   911 1 1   929 1 1   959 1 1   963 1 1   979 1 1}
  4182   4570   
  4183   4571   do_execsql_test 5.4.2.1 {
  4184   4572     SELECT max(c) OVER win,
  4185         -             min(c) OVER win
         4573  +             min(c) OVER win,
         4574  +             count(a) OVER win
  4186   4575         FROM t3
  4187   4576         WINDOW win AS (  ORDER BY a  
  4188   4577           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE TIES  )
  4189         -      ORDER BY 1 , 2
  4190         -} {113 113   234 234   257 257   336 336   354 354   768 768   839 839
  4191         -  839 839   899 113   899 113   899 113   899 113   899 113   899 113
  4192         -  899 113   899 113   899 113   899 113   899 113   899 113   899 113
  4193         -  899 113   899 899   963 113   979 102   979 102   979 102   979 102
  4194         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  4195         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  4196         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  4197         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  4198         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  4199         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  4200         -  979 113   979 113   979 113   979 113   979 113   979 113   979 113
  4201         -  979 113   979 113   979 113   979 113   979 113   979 113   979 113
  4202         -  979 113   979 113   979 113   979 113   979 113}
         4578  +      ORDER BY 1 , 2 , 3
         4579  +} {113 113 1   234 234 1   257 257 1   336 336 1   354 354 1   768 768 1
         4580  +  839 839 1   839 839 1   899 113 10   899 113 10   899 113 10   899 113 10
         4581  +  899 113 10   899 113 10   899 113 10   899 113 17   899 113 17   899 113 17
         4582  +  899 113 17   899 113 17   899 113 17   899 113 17   899 899 1   963 113 17
         4583  +  979 102 34   979 102 45   979 102 45   979 102 45   979 102 45   979 102 45
         4584  +  979 102 50   979 102 50   979 102 50   979 102 50   979 102 50   979 102 50
         4585  +  979 102 50   979 102 57   979 102 57   979 102 57   979 102 57   979 102 57
         4586  +  979 102 57   979 102 63   979 102 63   979 102 63   979 102 63   979 102 63
         4587  +  979 102 63   979 102 63   979 102 63   979 102 63   979 102 63   979 102 63
         4588  +  979 102 63   979 102 63   979 102 76   979 102 76   979 102 76   979 102 76
         4589  +  979 102 76   979 102 76   979 102 76   979 102 76   979 102 83   979 102 83
         4590  +  979 102 83   979 102 83   979 102 83   979 102 83   979 113 17   979 113 26
         4591  +  979 113 26   979 113 26   979 113 26   979 113 26   979 113 26   979 113 26
         4592  +  979 113 26   979 113 34   979 113 34   979 113 34   979 113 34   979 113 34
         4593  +  979 113 34   979 113 34   979 113 34   979 113 34   979 113 34}
  4203   4594   
  4204   4595   do_execsql_test 5.4.2.2 {
  4205   4596     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  4206         -             rank() OVER win
         4597  +             rank() OVER win,
         4598  +             dense_rank() OVER win
  4207   4599         FROM t3
  4208   4600         WINDOW win AS (  ORDER BY a  
  4209   4601           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE TIES  )
  4210         -      ORDER BY 1 , 2
  4211         -} {{} 81   {} 81   {} 81   {} 81   113 81   257 81   839 81   839 81   899 81
  4212         -  2947 74   2947 74   2947 74   3368 74   3390 74   3618 74   3752 74
  4213         -  5287 65   5287 65   5287 65   5287 65   5420 65   5642 65   5970 65
  4214         -  6250 65   6266 65   8400 57   8400 57   8400 57   8400 57   8400 57
  4215         -  8400 57   8735 57   9329 57   9664 46   9664 46   9664 46   9664 46
  4216         -  9664 46   9664 46   9664 46   9664 46   9664 46   9959 46   10331 46
  4217         -  10626 41   10626 41   10739 41   11255 41   11403 41   12145 34   12145 34
  4218         -  12145 34   12145 34   12145 34   12990 34   13104 34   13949 28   13949 28
  4219         -  13949 28   13949 28   14556 28   14708 28   15315 15   15315 15   15315 15
  4220         -  15315 15   15315 15   15315 15   15562 15   15708 15   15708 15   15714 15
  4221         -  15948 15   16020 15   16026 15   18796 7   18796 7   18796 7   19019 7
  4222         -  19035 7   19105 7   19423 7   19707 7   21105 1   21105 1   21460 1
  4223         -  21504 1   21734 1   21772 1}
         4602  +      ORDER BY 1 , 2 , 3
         4603  +} {{} 81 11   {} 81 11   {} 81 11   {} 81 11   113 81 11   257 81 11
         4604  +  839 81 11   839 81 11   899 81 11   2947 74 10   2947 74 10   2947 74 10
         4605  +  3368 74 10   3390 74 10   3618 74 10   3752 74 10   5287 65 9   5287 65 9
         4606  +  5287 65 9   5287 65 9   5420 65 9   5642 65 9   5970 65 9   6250 65 9
         4607  +  6266 65 9   8400 57 8   8400 57 8   8400 57 8   8400 57 8   8400 57 8
         4608  +  8400 57 8   8735 57 8   9329 57 8   9664 46 7   9664 46 7   9664 46 7
         4609  +  9664 46 7   9664 46 7   9664 46 7   9664 46 7   9664 46 7   9664 46 7
         4610  +  9959 46 7   10331 46 7   10626 41 6   10626 41 6   10739 41 6   11255 41 6
         4611  +  11403 41 6   12145 34 5   12145 34 5   12145 34 5   12145 34 5   12145 34 5
         4612  +  12990 34 5   13104 34 5   13949 28 4   13949 28 4   13949 28 4   13949 28 4
         4613  +  14556 28 4   14708 28 4   15315 15 3   15315 15 3   15315 15 3   15315 15 3
         4614  +  15315 15 3   15315 15 3   15562 15 3   15708 15 3   15708 15 3   15714 15 3
         4615  +  15948 15 3   16020 15 3   16026 15 3   18796 7 2   18796 7 2   18796 7 2
         4616  +  19019 7 2   19035 7 2   19105 7 2   19423 7 2   19707 7 2   21105 1 1
         4617  +  21105 1 1   21460 1 1   21504 1 1   21734 1 1   21772 1 1}
  4224   4618   
  4225   4619   do_execsql_test 5.4.3.1 {
  4226   4620     SELECT max(c) OVER win,
  4227         -             min(c) OVER win
         4621  +             min(c) OVER win,
         4622  +             count(a) OVER win
  4228   4623         FROM t3
  4229   4624         WINDOW win AS (  PARTITION BY coalesce(a, '') 
  4230   4625           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE TIES  )
  4231         -      ORDER BY 1 , 2
  4232         -} {102 102   113 113   113 113   133 133   148 148   158 158   158 158
  4233         -  160 160   208 208   223 223   224 224   234 234   238 238   239 239
  4234         -  247 247   250 250   252 252   256 256   257 257   295 295   309 309
  4235         -  330 330   335 335   336 336   346 346   354 354   355 355   355 355
  4236         -  393 393   393 393   398 398   399 399   399 399   412 412   421 421
  4237         -  430 430   443 443   480 480   480 480   572 572   574 574   607 607
  4238         -  618 618   618 618   627 627   629 629   629 629   633 633   634 634
  4239         -  652 652   660 660   667 667   667 667   670 670   671 671   683 683
  4240         -  705 705   711 711   716 716   726 726   730 730   759 759   762 762
  4241         -  768 768   768 768   777 777   786 786   790 790   792 792   794 794
  4242         -  805 805   822 822   839 839   839 839   840 840   844 844   845 845
  4243         -  870 870   870 870   870 870   899 899   911 911   929 929   934 934
  4244         -  938 938   938 938   959 959   963 963   979 979}
         4626  +      ORDER BY 1 , 2 , 3
         4627  +} {102 102 1   113 113 1   113 113 1   133 133 1   148 148 1   158 158 0
         4628  +  158 158 1   160 160 1   208 208 1   223 223 1   224 224 1   234 234 1
         4629  +  238 238 1   239 239 1   247 247 1   250 250 1   252 252 1   256 256 1
         4630  +  257 257 1   295 295 1   309 309 1   330 330 1   335 335 1   336 336 1
         4631  +  346 346 1   354 354 1   355 355 0   355 355 1   393 393 1   393 393 1
         4632  +  398 398 1   399 399 0   399 399 1   412 412 1   421 421 1   430 430 1
         4633  +  443 443 1   480 480 1   480 480 1   572 572 1   574 574 1   607 607 1
         4634  +  618 618 1   618 618 1   627 627 1   629 629 0   629 629 1   633 633 1
         4635  +  634 634 1   652 652 1   660 660 1   667 667 0   667 667 1   670 670 1
         4636  +  671 671 1   683 683 1   705 705 1   711 711 1   716 716 1   726 726 1
         4637  +  730 730 1   759 759 1   762 762 1   768 768 1   768 768 1   777 777 1
         4638  +  786 786 1   790 790 1   792 792 1   794 794 1   805 805 1   822 822 1
         4639  +  839 839 1   839 839 1   840 840 1   844 844 1   845 845 1   870 870 0
         4640  +  870 870 1   870 870 1   899 899 1   911 911 1   929 929 1   934 934 1
         4641  +  938 938 1   938 938 1   959 959 1   963 963 1   979 979 1}
  4245   4642   
  4246   4643   do_execsql_test 5.4.3.2 {
  4247   4644     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  4248         -             rank() OVER win
         4645  +             rank() OVER win,
         4646  +             dense_rank() OVER win
  4249   4647         FROM t3
  4250   4648         WINDOW win AS (  PARTITION BY coalesce(a, '') 
  4251   4649           RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING   EXCLUDE TIES  )
  4252         -      ORDER BY 1 , 2
  4253         -} {{} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4254         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4255         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4256         -  {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1   {} 1
  4257         -  {} 1   {} 1   {} 1   {} 1   113 1   113 1   133 1   223 1   239 1   247 1
  4258         -  257 1   295 1   309 1   335 1   355 1   355 1   393 1   393 1   399 1
  4259         -  399 1   421 1   443 1   607 1   627 1   629 1   629 1   633 1   667 1
  4260         -  667 1   671 1   683 1   705 1   711 1   759 1   777 1   805 1   839 1
  4261         -  839 1   845 1   899 1   911 1   929 1   959 1   963 1   979 1}
         4650  +      ORDER BY 1 , 2 , 3
         4651  +} {{} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4652  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4653  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4654  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4655  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4656  +  {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1   {} 1 1
         4657  +  113 1 1   113 1 1   133 1 1   223 1 1   239 1 1   247 1 1   257 1 1
         4658  +  295 1 1   309 1 1   335 1 1   355 1 1   355 1 1   393 1 1   393 1 1
         4659  +  399 1 1   399 1 1   421 1 1   443 1 1   607 1 1   627 1 1   629 1 1
         4660  +  629 1 1   633 1 1   667 1 1   667 1 1   671 1 1   683 1 1   705 1 1
         4661  +  711 1 1   759 1 1   777 1 1   805 1 1   839 1 1   839 1 1   845 1 1
         4662  +  899 1 1   911 1 1   929 1 1   959 1 1   963 1 1   979 1 1}
  4262   4663   
  4263   4664   do_execsql_test 5.4.4.1 {
  4264   4665     SELECT max(c) OVER win,
  4265         -             min(c) OVER win
         4666  +             min(c) OVER win,
         4667  +             count(a) OVER win
  4266   4668         FROM t3
  4267   4669         WINDOW win AS (  ORDER BY a  GROUPS 6 PRECEDING   EXCLUDE TIES  )
  4268         -      ORDER BY 1 , 2
  4269         -} {158 158   355 355   399 399   629 629   667 667   870 158   870 158
  4270         -  870 158   870 158   870 158   870 158   870 870   911 158   934 158
  4271         -  934 158   934 158   934 158   934 158   934 158   934 158   934 158
  4272         -  934 158   934 158   934 158   934 158   934 158   934 158   934 158
  4273         -  934 158   934 158   934 158   934 158   934 158   934 158   934 158
  4274         -  934 158   934 158   934 158   934 158   959 102   959 102   959 102
  4275         -  959 102   959 102   959 102   959 102   959 102   959 102   959 102
  4276         -  959 102   959 102   959 102   959 102   959 102   959 102   959 113
  4277         -  959 113   959 113   959 113   959 113   959 113   959 113   959 113
  4278         -  959 113   959 113   959 113   959 158   959 158   959 158   959 158
  4279         -  959 158   963 102   979 102   979 102   979 102   979 102   979 102
  4280         -  979 102   979 102   979 102   979 102   979 102   979 102   979 102
  4281         -  979 102   979 102   979 102   979 102   979 102}
         4670  +      ORDER BY 1 , 2 , 3
         4671  +} {158 158 0   355 355 0   399 399 0   629 629 0   667 667 0   870 158 1
         4672  +  870 158 1   870 158 1   870 158 1   870 158 1   870 158 1   870 870 0
         4673  +  911 158 1   934 158 1   934 158 9   934 158 9   934 158 9   934 158 9
         4674  +  934 158 9   934 158 9   934 158 9   934 158 9   934 158 9   934 158 9
         4675  +  934 158 9   934 158 9   934 158 9   934 158 22   934 158 22   934 158 22
         4676  +  934 158 22   934 158 22   934 158 22   934 158 28   934 158 28   934 158 28
         4677  +  934 158 28   934 158 28   934 158 28   959 102 40   959 102 51   959 102 51
         4678  +  959 102 51   959 102 51   959 102 51   959 102 51   959 102 51   959 102 51
         4679  +  959 102 51   959 102 51   959 102 51   959 102 51   959 102 51   959 102 51
         4680  +  959 102 51   959 113 35   959 113 40   959 113 40   959 113 40   959 113 40
         4681  +  959 113 40   959 113 40   959 113 40   959 113 40   959 113 40   959 113 40
         4682  +  959 158 28   959 158 35   959 158 35   959 158 35   959 158 35   963 102 51
         4683  +  979 102 47   979 102 47   979 102 47   979 102 47   979 102 47   979 102 47
         4684  +  979 102 47   979 102 48   979 102 48   979 102 48   979 102 48   979 102 48
         4685  +  979 102 48   979 102 48   979 102 48   979 102 48   979 102 51}
  4282   4686   
  4283   4687   do_execsql_test 5.4.4.2 {
  4284   4688     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  4285         -             rank() OVER win
         4689  +             rank() OVER win,
         4690  +             dense_rank() OVER win
  4286   4691         FROM t3
  4287   4692         WINDOW win AS (  ORDER BY a  GROUPS 6 PRECEDING   EXCLUDE TIES  )
  4288         -      ORDER BY 1 , 2
  4289         -} {{} 1   {} 1   355 1   399 1   629 1   667 1   2050 7   2050 7   2050 7
  4290         -  2273 7   2289 7   2359 7   2677 7   2961 7   4359 15   4359 15   4359 15
  4291         -  4359 15   4359 15   4359 15   4606 15   4752 15   4752 15   4758 15
  4292         -  4992 15   5064 15   5070 15   7840 28   7840 28   7840 28   7840 28
  4293         -  8447 28   8599 28   9206 34   9206 34   9206 34   9206 34   9206 34
  4294         -  10028 74   10028 74   10028 74   10051 34   10165 34   10396 65   10396 65
  4295         -  10396 65   10396 65   10449 74   10471 74   10529 65   10699 74   10751 65
  4296         -  10833 74   11002 81   11002 81   11002 81   11002 81   11010 41   11010 41
  4297         -  11079 65   11115 81   11123 41   11259 81   11359 65   11375 65   11441 57
  4298         -  11441 57   11441 57   11441 57   11441 57   11441 57   11639 41   11776 57
  4299         -  11787 41   11841 81   11841 81   11901 81   12370 57   12529 46   12529 46
  4300         -  12529 46   12529 46   12529 46   12529 46   12529 46   12529 46   12529 46
  4301         -  12824 46   13196 46}
         4693  +      ORDER BY 1 , 2 , 3
         4694  +} {{} 1 1   {} 1 1   355 1 1   399 1 1   629 1 1   667 1 1   2050 7 2
         4695  +  2050 7 2   2050 7 2   2273 7 2   2289 7 2   2359 7 2   2677 7 2   2961 7 2
         4696  +  4359 15 3   4359 15 3   4359 15 3   4359 15 3   4359 15 3   4359 15 3
         4697  +  4606 15 3   4752 15 3   4752 15 3   4758 15 3   4992 15 3   5064 15 3
         4698  +  5070 15 3   7840 28 4   7840 28 4   7840 28 4   7840 28 4   8447 28 4
         4699  +  8599 28 4   9206 34 5   9206 34 5   9206 34 5   9206 34 5   9206 34 5
         4700  +  10028 74 10   10028 74 10   10028 74 10   10051 34 5   10165 34 5
         4701  +  10396 65 9   10396 65 9   10396 65 9   10396 65 9   10449 74 10
         4702  +  10471 74 10   10529 65 9   10699 74 10   10751 65 9   10833 74 10
         4703  +  11002 81 11   11002 81 11   11002 81 11   11002 81 11   11010 41 6
         4704  +  11010 41 6   11079 65 9   11115 81 11   11123 41 6   11259 81 11
         4705  +  11359 65 9   11375 65 9   11441 57 8   11441 57 8   11441 57 8   11441 57 8
         4706  +  11441 57 8   11441 57 8   11639 41 6   11776 57 8   11787 41 6
         4707  +  11841 81 11   11841 81 11   11901 81 11   12370 57 8   12529 46 7
         4708  +  12529 46 7   12529 46 7   12529 46 7   12529 46 7   12529 46 7   12529 46 7
         4709  +  12529 46 7   12529 46 7   12824 46 7   13196 46 7}
  4302   4710   
  4303   4711   do_execsql_test 5.4.5.1 {
  4304   4712     SELECT max(c) OVER win,
  4305         -             min(c) OVER win
         4713  +             min(c) OVER win,
         4714  +             count(a) OVER win
  4306   4715         FROM t3
  4307   4716         WINDOW win AS (  ORDER BY c  RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING   EXCLUDE TIES  )
  4308         -      ORDER BY 1 , 2
  4309         -} {102 102   113 113   113 113   133 133   148 148   160 158   160 158
  4310         -  160 158   208 208   224 223   224 223   239 234   239 234   239 234
  4311         -  252 247   257 247   257 247   257 250   257 252   295 295   309 309
  4312         -  336 330   336 330   336 330   346 346   355 354   355 354   355 354
  4313         -  399 393   399 393   399 393   399 393   399 393   412 412   421 421
  4314         -  430 430   443 443   480 480   480 480   574 572   574 572   607 607
  4315         -  618 618   618 618   634 627   634 627   634 627   634 627   634 629
  4316         -  652 652   667 660   671 667   671 667   671 667   671 667   683 683
  4317         -  711 705   716 705   716 711   730 726   730 726   762 759   768 759
  4318         -  768 762   768 762   777 777   792 786   794 786   794 786   794 790
  4319         -  805 805   822 822   845 839   845 839   845 839   845 839   845 839
  4320         -  870 870   870 870   870 870   899 899   911 911   934 929   938 929
  4321         -  938 934   938 934   963 959   963 959   979 979}
         4717  +      ORDER BY 1 , 2 , 3
         4718  +} {102 102 1   113 113 1   113 113 1   133 133 1   148 148 1   160 158 1
         4719  +  160 158 2   160 158 2   208 208 1   224 223 2   224 223 2   239 234 3
         4720  +  239 234 3   239 234 3   252 247 3   257 247 5   257 247 5   257 250 4
         4721  +  257 252 3   295 295 1   309 309 1   336 330 3   336 330 3   336 330 3
         4722  +  346 346 1   355 354 1   355 354 2   355 354 2   399 393 3   399 393 3
         4723  +  399 393 3   399 393 4   399 393 4   412 412 1   421 421 1   430 430 1
         4724  +  443 443 1   480 480 1   480 480 1   574 572 2   574 572 2   607 607 1
         4725  +  618 618 1   618 618 1   634 627 3   634 627 4   634 627 4   634 627 4
         4726  +  634 629 3   652 652 1   667 660 2   671 667 2   671 667 3   671 667 3
         4727  +  671 667 3   683 683 1   711 705 2   716 705 3   716 711 2   730 726 2
         4728  +  730 726 2   762 759 2   768 759 4   768 762 2   768 762 2   777 777 1
         4729  +  792 786 3   794 786 4   794 786 4   794 790 3   805 805 1   822 822 1
         4730  +  845 839 4   845 839 4   845 839 5   845 839 5   845 839 5   870 870 0
         4731  +  870 870 1   870 870 1   899 899 1   911 911 1   934 929 2   938 929 4
         4732  +  938 934 2   938 934 2   963 959 2   963 959 2   979 979 1}
  4322   4733   
  4323   4734   do_execsql_test 5.4.5.2 {
  4324   4735     SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
  4325         -             rank() OVER win
         4736  +             rank() OVER win,
         4737  +             dense_rank() OVER win
  4326   4738         FROM t3
  4327   4739         WINDOW win AS (  ORDER BY c  RANGE BETWEEN 6 PRECEDING AND 7 FOLLOWING   EXCLUDE TIES  )
  4328         -      ORDER BY 1 , 2
  4329         -} {{} 1   {} 5   {} 6   {} 6   {} 8   {} 9   {} 25   {} 34   {} 36   {} 38
  4330         -  {} 38   {} 40   {} 41   {} 43   {} 43   {} 50   {} 60   {} 61   {} 64
  4331         -  {} 64   {} 67   {} 68   {} 69   {} 70   {} 72   {} 78   {} 78   {} 78
  4332         -  {} 85   {} 85   113 2   113 2   133 4   223 10   223 11   239 12   239 13
  4333         -  239 14   247 15   257 18   257 19   295 20   309 21   335 22   335 23
  4334         -  335 24   355 27   355 27   421 35   443 37   504 16   504 17   607 42
  4335         -  683 56   710 26   711 59   759 62   759 63   777 66   805 71   899 81
  4336         -  911 82   929 83   929 84   979 89   1185 32   1185 32   1191 29   1191 29
  4337         -  1334 51   1338 52   1338 52   1416 57   1416 58   1584 31   1684 73
  4338         -  1684 73   1889 46   1889 46   1891 49   1922 87   1922 88   2005 54
  4339         -  2005 55   2518 45   2518 48   2523 75   2523 76   2523 77}
         4740  +      ORDER BY 1 , 2 , 3
         4741  +} {{} 1 1   {} 5 4   {} 6 5   {} 6 5   {} 8 6   {} 9 7   {} 25 23   {} 34 29
         4742  +  {} 36 31   {} 38 33   {} 38 33   {} 40 34   {} 41 35   {} 43 37   {} 43 37
         4743  +  {} 50 42   {} 60 51   {} 61 52   {} 64 55   {} 64 55   {} 67 57   {} 68 58
         4744  +  {} 69 59   {} 70 60   {} 72 62   {} 78 67   {} 78 67   {} 78 67   {} 85 72
         4745  +  {} 85 72   113 2 2   113 2 2   133 4 3   223 10 8   223 11 9   239 12 10
         4746  +  239 13 11   239 14 12   247 15 13   257 18 16   257 19 17   295 20 18
         4747  +  309 21 19   335 22 20   335 23 21   335 24 22   355 27 25   355 27 25
         4748  +  421 35 30   443 37 32   504 16 14   504 17 15   607 42 36   683 56 47
         4749  +  710 26 24   711 59 50   759 62 53   759 63 54   777 66 56   805 71 61
         4750  +  899 81 68   911 82 69   929 83 70   929 84 71   979 89 75   1185 32 28
         4751  +  1185 32 28   1191 29 26   1191 29 26   1334 51 43   1338 52 44   1338 52 44
         4752  +  1416 57 48   1416 58 49   1584 31 27   1684 73 63   1684 73 63   1889 46 39
         4753  +  1889 46 39   1891 49 41   1922 87 73   1922 88 74   2005 54 45   2005 55 46
         4754  +  2518 45 38   2518 48 40   2523 75 64   2523 76 65   2523 77 66}
         4755  +
         4756  +do_execsql_test 5.4.6.1 {
         4757  +  SELECT max(c) OVER win,
         4758  +             min(c) OVER win,
         4759  +             count(a) OVER win
         4760  +      FROM t3
         4761  +      WINDOW win AS (  ORDER BY c  RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING   EXCLUDE TIES  )
         4762  +      ORDER BY 1 , 2 , 3
         4763  +} {102 102 1   113 113 1   113 113 1   133 133 1   148 148 1   158 158 0
         4764  +  158 158 1   160 160 1   208 208 1   223 223 1   224 224 1   234 234 1
         4765  +  238 238 1   239 239 1   247 247 1   250 250 1   252 252 1   256 256 1
         4766  +  257 257 1   295 295 1   309 309 1   330 330 1   335 335 1   336 336 1
         4767  +  346 346 1   354 354 1   355 355 0   355 355 1   393 393 1   393 393 1
         4768  +  398 398 1   399 399 0   399 399 1   412 412 1   421 421 1   430 430 1
         4769  +  443 443 1   480 480 1   480 480 1   572 572 1   574 574 1   607 607 1
         4770  +  618 618 1   618 618 1   627 627 1   629 629 0   629 629 1   633 633 1
         4771  +  634 634 1   652 652 1   660 660 1   667 667 0   667 667 1   670 670 1
         4772  +  671 671 1   683 683 1   705 705 1   711 711 1   716 716 1   726 726 1
         4773  +  730 730 1   759 759 1   762 762 1   768 768 1   768 768 1   777 777 1
         4774  +  786 786 1   790 790 1   792 792 1   794 794 1   805 805 1   822 822 1
         4775  +  839 839 1   839 839 1   840 840 1   844 844 1   845 845 1   870 870 0
         4776  +  870 870 1   870 870 1   899 899 1   911 911 1   929 929 1   934 934 1
         4777  +  938 938 1   938 938 1   959 959 1   963 963 1   979 979 1}
         4778  +
         4779  +do_execsql_test 5.4.6.2 {
         4780  +  SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
         4781  +             rank() OVER win,
         4782  +             dense_rank() OVER win
         4783  +      FROM t3
         4784  +      WINDOW win AS (  ORDER BY c  RANGE BETWEEN 0 PRECEDING AND 0 FOLLOWING   EXCLUDE TIES  )
         4785  +      ORDER BY 1 , 2 , 3
         4786  +} {{} 1 1   {} 5 4   {} 6 5   {} 6 5   {} 8 6   {} 9 7   {} 11 9   {} 12 10
         4787  +  {} 13 11   {} 16 14   {} 17 15   {} 18 16   {} 22 20   {} 24 22   {} 25 23
         4788  +  {} 26 24   {} 31 27   {} 34 29   {} 36 31   {} 38 33   {} 38 33   {} 40 34
         4789  +  {} 41 35   {} 43 37   {} 43 37   {} 49 41   {} 50 42   {} 51 43   {} 54 45
         4790  +  {} 59 50   {} 60 51   {} 61 52   {} 63 54   {} 64 55   {} 64 55   {} 67 57
         4791  +  {} 68 58   {} 69 59   {} 70 60   {} 72 62   {} 75 64   {} 76 65   {} 78 67
         4792  +  {} 78 67   {} 78 67   {} 84 71   {} 85 72   {} 85 72   113 2 2   113 2 2
         4793  +  133 4 3   223 10 8   239 14 12   247 15 13   257 19 17   295 20 18
         4794  +  309 21 19   335 23 21   355 27 25   355 27 25   393 29 26   393 29 26
         4795  +  399 32 28   399 32 28   421 35 30   443 37 32   607 42 36   627 45 38
         4796  +  629 46 39   629 46 39   633 48 40   667 52 44   667 52 44   671 55 46
         4797  +  683 56 47   705 57 48   711 58 49   759 62 53   777 66 56   805 71 61
         4798  +  839 73 63   839 73 63   845 77 66   899 81 68   911 82 69   929 83 70
         4799  +  959 87 73   963 88 74   979 89 75}
         4800  +
         4801  +do_execsql_test 5.4.7.1 {
         4802  +  SELECT max(c) OVER win,
         4803  +             min(c) OVER win,
         4804  +             count(a) OVER win
         4805  +      FROM t3
         4806  +      WINDOW win AS (  ORDER BY c , b , a 
         4807  +        ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE TIES  )
         4808  +      ORDER BY 1 , 2 , 3
         4809  +} {979 102 83   979 102 83   979 102 83   979 102 83   979 102 83   979 102 83
         4810  +  979 102 83   979 113 81   979 113 82   979 133 80   979 148 79   979 158 77
         4811  +  979 158 78   979 160 77   979 208 76   979 223 75   979 224 74   979 234 73
         4812  +  979 238 72   979 239 71   979 247 70   979 250 69   979 252 68   979 256 67
         4813  +  979 257 66   979 295 65   979 309 64   979 330 63   979 335 62   979 336 61
         4814  +  979 346 60   979 354 59   979 355 58   979 355 58   979 393 56   979 393 57
         4815  +  979 398 55   979 399 54   979 399 54   979 412 53   979 421 52   979 430 51
         4816  +  979 443 50   979 480 48   979 480 49   979 572 47   979 574 46   979 607 45
         4817  +  979 618 43   979 618 44   979 627 42   979 629 41   979 629 41   979 633 40
         4818  +  979 634 39   979 652 38   979 660 37   979 667 36   979 667 36   979 670 35
         4819  +  979 671 34   979 683 33   979 705 32   979 711 31   979 716 30   979 726 29
         4820  +  979 730 28   979 759 27   979 762 26   979 768 24   979 768 25   979 777 23
         4821  +  979 786 22   979 790 21   979 792 20   979 794 19   979 805 18   979 822 17
         4822  +  979 839 15   979 839 16   979 840 14   979 844 13   979 845 12   979 870 10
         4823  +  979 870 11   979 870 11   979 899 9   979 911 8   979 929 7}
         4824  +
         4825  +do_execsql_test 5.4.7.2 {
         4826  +  SELECT sum(c) FILTER (WHERE (c%2)!=0) OVER win,
         4827  +             rank() OVER win,
         4828  +             dense_rank() OVER win
         4829  +      FROM t3
         4830  +      WINDOW win AS (  ORDER BY c , b , a 
         4831  +        ROWS BETWEEN 6 PRECEDING AND UNBOUNDED FOLLOWING  EXCLUDE TIES  )
         4832  +      ORDER BY 1 , 2 , 3
         4833  +} {3830 89 89   4741 88 88   5640 84 84   5640 85 85   5640 86 86   5640 87 87
         4834  +  6485 81 81   6485 82 82   6485 83 83   7324 80 80   8163 78 78   8163 79 79
         4835  +  8968 73 73   8968 74 74   8968 75 75   8968 76 76   8968 77 77   9745 69 69
         4836  +  9745 70 70   9745 71 71   9745 72 72   10504 65 65   10504 66 66
         4837  +  10504 67 67   10504 68 68   11215 64 64   11920 63 63   12603 62 62
         4838  +  13274 60 60   13274 61 61   13941 59 59   14608 55 55   14608 56 56
         4839  +  14608 57 57   14608 58 58   15241 54 54   15870 53 53   16499 52 52
         4840  +  17126 49 49   17126 50 50   17126 51 51   17733 44 44   17733 45 45
         4841  +  17733 46 46   17733 47 47   17733 48 48   18176 42 42   18176 43 43
         4842  +  18597 40 40   18597 41 41   18996 39 39   19395 37 37   19395 38 38
         4843  +  19788 36 36   20181 35 35   20536 34 34   20891 30 30   20891 31 31
         4844  +  20891 32 32   20891 33 33   21226 28 28   21226 29 29   21535 27 27
         4845  +  21830 26 26   22087 22 22   22087 23 23   22087 24 24   22087 25 25
         4846  +  22334 21 21   22573 17 17   22573 18 18   22573 19 19   22573 20 20
         4847  +  22796 11 11   22796 12 12   22796 13 13   22796 14 14   22796 15 15
         4848  +  22796 16 16   22929 10 10   23042 9 9   23155 1 1   23155 2 2   23155 3 3
         4849  +  23155 4 4   23155 5 5   23155 6 6   23155 7 7   23155 8 8}
  4340   4850   
  4341   4851   finish_test