From: Alvaro Herrera <alvherre@kurilemu.de>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Евгений Горбанев <gorbanyoves@basealt.ru>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Assert failure in base_yyparse
Date: Fri, 9 May 2025 11:44:24 +0200
Message-ID: <202505090944.r3xezoufcxcg@alvherre.pgsql> (raw)
In-Reply-To: <CAMbWs48aLC3-Z8x=i6qVCc3+=OVebyCVv+HdFS82HOtBH-8kxw@mail.gmail.com>
On 2025-Apr-14, Richard Guo wrote:
> It seems what happens is that internally in gram.y (~line 14274), the
> DefElem for the not-null option is assigned the name "is_not_null".
> As a result, this allows users to explicitly use "is_not_null" as the
> option name. However, the value provided for the is_not_null option
> in this way might not be a Boolean as expected, which triggers the
> assertion.
>
> I kind of doubt we should allow the use of the "is_not_null" keyword
> in the xmltable function.
>
> Hi Álvaro, what do you think about this?
Hello Richard, sorry that I failed to notice this earlier.
I agree that blocking the index from using the option name that xmltable
parsing uses internally is okay. Maybe we can rename it to something
like "__pg__is_not_null" or something like that, which would reduce the
chances of troubling people; the existing name sounds too much like a
valid name that users could want to use.
Also, maybe rather than just "syntax error" we could say something like
"option name XYZ cannot be used in XMLTABLE".
I wonder if we have any other names used by the parser that can cause
this kind of problem. In a quick look through gram.y I didn't find any
other place that would fabricate a name and also accept arbitrary
user-specified names to use, so this seems to be the only place affected
by this particular bug.
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
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@kurilemu.de, guofenglinux@gmail.com, gorbanyoves@basealt.ru, pgsql-hackers@lists.postgresql.org
Subject: Re: Assert failure in base_yyparse
In-Reply-To: <202505090944.r3xezoufcxcg@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox