Re: FETCH FIRST clause WITH TIES option

Surafel Temsgen <surafel3000@gmail.com>

From: Surafel Temesgen <surafel3000@gmail.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Andrew Gierth <andrew@tao11.riddles.org.uk>
Date: 2020-01-22T06:19:46Z
Lists: pgsql-hackers

Attachments

On Thu, Nov 28, 2019 at 5:49 PM Alvaro Herrera <alvherre@2ndquadrant.com>
wrote:

> On 2019-Nov-28, Surafel Temesgen wrote:
>
> > On Thu, Nov 28, 2019 at 12:36 AM Alvaro Herrera <
> alvherre@2ndquadrant.com>
> > wrote:
> >
> > > I think you should add a /* fall-though */ comment after changing
> state.
> > > Like this (this flow seems clearer; also DRY):
> > >
> > >                 if (!node->noCount &&
> > >                     node->position - node->offset >= node->count)
> > >                 {
> > >                     if (node->limitOption == LIMIT_OPTION_COUNT)
> > >                     {
> > >                         node->lstate = LIMIT_WINDOWEND;
> > >                         return NULL;
> > >                     }
> > >                     else
> > >                     {
> > >                         node->lstate = LIMIT_WINDOWEND_TIES;
> > >                         /* fall-through */
> > >                     }
> > >                 }
> > >                 else
> > >                     ...
> >
> > changed
>
> But you did not read my code snippet, did you ...?
>

I don't see it. changed to it and rebased to current master

regards
Surafel

Commits

  1. Support FETCH FIRST WITH TIES