Fixup some StringInfo usages

Started by David Rowleyabout 2 years ago4 messageshackers
Jump to latest
#1David Rowley
dgrowleyml@gmail.com

Similar to f736e188c, I've attached a patch that fixes up a few
misusages of the StringInfo functions. These just swap one function
call for another function that is more suited to the use case.

I've also attached the patch that I used to find these. That's not
intended for commit.

I feel like it's a good idea to fix these soon while they're new
rather than wait N years and make backpatching bug fixes possibly
harder.

I've attached a file with git blame commands to identify where all of
these were introduced. All are new to PG17.

Any objections?

David

Attachments:

v1-0001-Fixup-various-StringInfo-function-usages.patchtext/plain; charset=US-ASCII; name=v1-0001-Fixup-various-StringInfo-function-usages.patchDownload+18-19
v1-0001-Adjust-code-to-highlight-appendStringInfo-misusag.patch.txttext/plain; charset=US-ASCII; name=v1-0001-Adjust-code-to-highlight-appendStringInfo-misusag.patch.txtDownload+49-28
git_blame.txttext/plain; charset=US-ASCII; name=git_blame.txtDownload
#2Nathan Bossart
nathandbossart@gmail.com
In reply to: David Rowley (#1)
Re: Fixup some StringInfo usages

On Tue, Apr 09, 2024 at 12:53:21PM +1200, David Rowley wrote:

Similar to f736e188c, I've attached a patch that fixes up a few
misusages of the StringInfo functions. These just swap one function
call for another function that is more suited to the use case.

I've also attached the patch that I used to find these. That's not
intended for commit.

I feel like it's a good idea to fix these soon while they're new
rather than wait N years and make backpatching bug fixes possibly
harder.

I've attached a file with git blame commands to identify where all of
these were introduced. All are new to PG17.

Any objections?

Looks reasonable to me.

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: David Rowley (#1)
Re: Fixup some StringInfo usages

David Rowley <dgrowleyml@gmail.com> writes:

Similar to f736e188c, I've attached a patch that fixes up a few
misusages of the StringInfo functions. These just swap one function
call for another function that is more suited to the use case.

I feel like it's a good idea to fix these soon while they're new
rather than wait N years and make backpatching bug fixes possibly
harder.

+1. Looks good in a quick eyeball scan.

regards, tom lane

#4David Rowley
dgrowleyml@gmail.com
In reply to: Tom Lane (#3)
Re: Fixup some StringInfo usages

On Tue, 9 Apr 2024 at 14:27, Tom Lane <tgl@sss.pgh.pa.us> wrote:

David Rowley <dgrowleyml@gmail.com> writes:

Similar to f736e188c, I've attached a patch that fixes up a few
misusages of the StringInfo functions. These just swap one function
call for another function that is more suited to the use case.

I feel like it's a good idea to fix these soon while they're new
rather than wait N years and make backpatching bug fixes possibly
harder.

+1. Looks good in a quick eyeball scan.

Thank you to both of you for having a look. Pushed.

David