agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedFrom: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Surafel Temesgen <surafel3000@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>
Subject: Re: FETCH FIRST clause WITH TIES option
Date: Mon, 6 Apr 2020 20:49:25 -0400
Message-ID: <20200407004925.GA23627@alvherre.pgsql> (raw)
In-Reply-To: <20200407003502.GA20914@alvherre.pgsql>
Some ruleutils.c code added by this patch is not covered by tests:
5246 : /* Add the LIMIT clause if given */
5247 1115 : if (query->limitOffset != NULL)
5248 : {
5249 0 : appendContextKeyword(context, " OFFSET ",
5250 : -PRETTYINDENT_STD, PRETTYINDENT_STD, 0);
5251 0 : get_rule_expr(query->limitOffset, context, false);
5252 : }
5253 1115 : if (query->limitOption == LIMIT_OPTION_WITH_TIES)
5254 : {
5255 0 : appendContextKeyword(context, " FETCH FIRST ",
5256 : -PRETTYINDENT_STD, PRETTYINDENT_STD, 0);
5257 0 : get_rule_expr(query->limitCount, context, false);
5258 0 : appendContextKeyword(context, " ROWS WITH TIES ",
5259 : -PRETTYINDENT_STD, PRETTYINDENT_STD, 0);
5260 : }
5261 1115 : if (query->limitCount != NULL && query->limitOption != LIMIT_OPTION_WITH_TIES)
5262 : {
5263 2 : appendContextKeyword(context, " LIMIT ",
5264 : -PRETTYINDENT_STD, PRETTYINDENT_STD, 0);
5265 2 : if (IsA(query->limitCount, Const) &&
5266 0 : ((Const *) query->limitCount)->constisnull)
5267 0 : appendStringInfoString(buf, "ALL");
5268 : else
5269 2 : get_rule_expr(query->limitCount, context, false);
5270 : }
Other than that, the patch seems good to go to me, so unless there are
objections, I intend to get this pushed tomorrow.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
view thread (61+ messages) latest in thread
Message-ID: <20200407004925.GA23627@alvherre.pgsql>
Permalink: ../20200407004925.GA23627@alvherre.pgsql/
Also on: postgresql.org/message-id/20200407004925.GA23627@alvherre.pgsql
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@2ndquadrant.com, surafel3000@gmail.com, tomas.vondra@2ndquadrant.com, andrew@tao11.riddles.org.uk
Subject: Re: FETCH FIRST clause WITH TIES option
In-Reply-To: <20200407004925.GA23627@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox