Re: Underscore in positional parameters?

From: Erik Wienhold <ewie(at)ewie(dot)name>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Underscore in positional parameters?
Date: 2024-05-18 01:31:49
Message-ID: ae58cb4d-0db9-47eb-be76-b2667fff0fd6@ewie.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2024-05-17 02:06 +0200, Michael Paquier wrote:
> On Thu, May 16, 2024 at 08:41:11AM +0200, Peter Eisentraut wrote:
> > On this specific patch, maybe reword "parameter too large" to "parameter
> > number too large".
>
> WFM here.

Done in v3.

I noticed this compiler warning with my previous patch:

scan.l:997:41: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
997 | ErrorSaveContext escontext = {T_ErrorSaveContext};
| ^~~~~~~~~~~~~~~~

I thought that I had to factor this out into a function similar to
process_integer_literal (which also uses ErrorSaveContext). But moving
that declaration to the start of the {param} action was enough in the
end.

While trying out the refactoring, I noticed two small things that can be
fixed as well in scan.l:

* Prototype and definition of addunicode do not match. The prototype
uses yyscan_t while the definition uses core_yyscan_t.

* Parameter base of process_integer_literal is unused.

But those should be one a separate thread, right, even for minor fixes?

--
Erik

Attachment Content-Type Size
v3-0001-Fix-overflow-in-parsing-of-positional-parameter.patch text/x-diff 2.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Erik Wienhold 2024-05-18 01:56:36 Re: CREATE TABLE creates a composite type corresponding to the table row, which is and is not there
Previous Message David G. Johnston 2024-05-18 01:27:25 Re: CREATE TABLE creates a composite type corresponding to the table row, which is and is not there