From: Nathan Bossart <nathandbossart@gmail.com>
To: Bruce Momjian <bruce@momjian.us>
Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: adam@labkey.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18711: Attempting a connection with a database name longer than 63 characters now fails
Date: Thu, 21 Nov 2024 12:14:47 -0600
Message-ID: <Zz94l3LHsML0V9eu@nathan> (raw)
In-Reply-To: <Zz92cka2VlBDsat3@momjian.us>
References: <Zz4TcYSNWW1_Vj--@nathan>
<Zz5kfP7fIuoY8I45@nathan>
<Zz7g2s0GSBelWmpg@ip-10-97-1-34.eu-west-3.compute.internal>
<Zz9B3KQGXFCGVPXy@momjian.us>
<Zz9FRrwJRlyGBFPN@ip-10-97-1-34.eu-west-3.compute.internal>
<Zz9IHPBf-z8MsLdw@momjian.us>
<Zz9OTyWAvATeeHev@nathan>
<Zz9jfOkVmlYcYHSy@momjian.us>
<Zz9pOi3pGF-DnJTp@nathan>
<Zz92cka2VlBDsat3@momjian.us>
On Thu, Nov 21, 2024 at 01:05:38PM -0500, Bruce Momjian wrote:
> On Thu, Nov 21, 2024 at 11:09:14AM -0600, Nathan Bossart wrote:
>> Yes, we still need to do that if it's possible the truncation wiped out
>> part of a multi-byte character. But it's not possible that we truncated
>> part of a multi-byte character if the NAMEDATALEN-1'th or NAMEDATALEN-2'th
>> byte is ASCII, in which case we can avoid doing extra lookups.
>
> Why would you check for two characters at the end rather than just a
> normal check in the main loop?
It might be possible to integrate this check into the loop, which could
potentially be cleaner. The reason I didn't at first is because it
requires checking a byte that we will have already truncated away. We have
to look at the original, non-truncated string for that. I'll give it a try
(unless Bertrand beats me to it).
>> What more do you think is required?
>
> I think the IS_HIGHBIT_SET needs to be integrated into the 'for' loop
> more clearly; the 'if' check plus the comment above it is just
> confusing.
Got it. Thank you for reviewing.
--
nathan
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-bugs@postgresql.org
Cc: nathandbossart@gmail.com, bruce@momjian.us, bertranddrouvot.pg@gmail.com, tgl@sss.pgh.pa.us, adam@labkey.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18711: Attempting a connection with a database name longer than 63 characters now fails
In-Reply-To: <Zz94l3LHsML0V9eu@nathan>
* 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