Re: BUG #15262: "unexpected end of tuplestore" error when using new GROUPS window function clause

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: lukas(dot)eder(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15262: "unexpected end of tuplestore" error when using new GROUPS window function clause
Date: 2018-07-09 22:29:34
Message-ID: 13420.1531175374@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

=?utf-8?q?PG_Bug_reporting_form?= <noreply(at)postgresql(dot)org> writes:
> This error can be reproduced easily as follows

> postgres=# SELECT count(*) OVER (GROUPS 1 PRECEDING) FROM (VALUES (1),
> (2), (2)) t(v);
> ERROR: unexpected end of tuplestore

In an assert-enabled build I get an assert failure from this. I think
this is the same problem Masahiko Sawada noted in

https://www.postgresql.org/message-id/CAD21AoDrWqycq-w_+Bx1cjc+YUhZ11XTj9rfxNiNDojjBx8Fjw@mail.gmail.com

and as in that thread, I think what we really should be doing here is
giving a parse error. What would you expect GROUPS mode to do without
an ORDER BY to define the grouping?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrew Dunstan 2018-07-10 00:06:00 Re: cannot restore schema with is not distinct from on hstore since PG 9.6.8
Previous Message Peter Geoghegan 2018-07-09 19:06:21 Re: could not read block 0 in file : read only 0 of 8192 bytes when doing nasty on immutable index function