pgsql: Be more careful to avoid including system headers after perl.h

2022-08-27 Thread John Naylor
Be more careful to avoid including system headers after perl.h Commit 121d2d3d70 included simd.h into pg_wchar.h. This caused a problem on Windows, since Perl has "#define free" (referring to globals), which breaks the Windows' header. To fix, move the static inline function definitions from plper

Re: pgsql: Remove unnecessary casts in free() and pfree()

2022-08-27 Thread Justin Pryzby
On Fri, Aug 26, 2022 at 02:02:33PM +, Peter Eisentraut wrote: > Remove unnecessary casts in free() and pfree() This seems to be breaking cfbot's "warnings" test. [07:49:48.983] label.c:665:10: error: passing argument 1 of ‘pfree’ discards ‘const’ qualifier from pointer target type [-Werror=d

pgsql: Fix typo in comment for writetuple() function

2022-08-27 Thread Alexander Korotkov
Fix typo in comment for writetuple() function Reported-by: David Rowley Discussion: https://postgr.es/m/CAApHDvrZ9Ky2LcWwcKsbdYChA850JE5qS%3DkGJiTNWS8mbBXZHw%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/924954c670355f2a0ca1dd4173574a28fc0eedec

Re: pgsql: Move memory management away from writetup() and tuplesort_put*()

2022-08-27 Thread Alexander Korotkov
Hi, David! On Fri, Aug 26, 2022 at 3:53 AM David Rowley wrote: > > On Wed, 27 Jul 2022 at 17:29, Alexander Korotkov > wrote: > > src/backend/utils/sort/tuplesort.c | 78 > > -- > > I was wondering about the following comment that this commit added: > > +/* > +

Re: pgsql: Remove unnecessary casts in free() and pfree()

2022-08-27 Thread Tom Lane
Justin Pryzby writes: > On Fri, Aug 26, 2022 at 02:02:33PM +, Peter Eisentraut wrote: >> Remove unnecessary casts in free() and pfree() > This seems to be breaking cfbot's "warnings" test. > [07:49:48.983] label.c:665:10: error: passing argument 1 of ‘pfree’ discards > ‘const’ qualifier fro

Re: pgsql: Remove unnecessary casts in free() and pfree()

2022-08-27 Thread Tom Lane
I wrote: > Justin Pryzby writes: >> This seems to be breaking cfbot's "warnings" test. > Hmm, well, casting away const is certainly not within pfree's remit, > so I'm glad we changed this. Oh, I see: sepgsql's quote_object_name() is doing const char *temp; temp = quote_identifi

pgsql: Repair rare failure of MULTIEXPR_SUBLINK subplans in inherited u

2022-08-27 Thread Tom Lane
Repair rare failure of MULTIEXPR_SUBLINK subplans in inherited updates. Prior to v14, if we have a MULTIEXPR SubPlan (that is, use of the syntax UPDATE ... SET (c1, ...) = (SELECT ...)) in an UPDATE with an inherited or partitioned target table, inheritance_planner() will clone the targetlist and

pgsql: Repair rare failure of MULTIEXPR_SUBLINK subplans in inherited u

2022-08-27 Thread Tom Lane
Repair rare failure of MULTIEXPR_SUBLINK subplans in inherited updates. Prior to v14, if we have a MULTIEXPR SubPlan (that is, use of the syntax UPDATE ... SET (c1, ...) = (SELECT ...)) in an UPDATE with an inherited or partitioned target table, inheritance_planner() will clone the targetlist and

pgsql: Repair rare failure of MULTIEXPR_SUBLINK subplans in inherited u

2022-08-27 Thread Tom Lane
Repair rare failure of MULTIEXPR_SUBLINK subplans in inherited updates. Prior to v14, if we have a MULTIEXPR SubPlan (that is, use of the syntax UPDATE ... SET (c1, ...) = (SELECT ...)) in an UPDATE with an inherited or partitioned target table, inheritance_planner() will clone the targetlist and

pgsql: Repair rare failure of MULTIEXPR_SUBLINK subplans in inherited u

2022-08-27 Thread Tom Lane
Repair rare failure of MULTIEXPR_SUBLINK subplans in inherited updates. Prior to v14, if we have a MULTIEXPR SubPlan (that is, use of the syntax UPDATE ... SET (c1, ...) = (SELECT ...)) in an UPDATE with an inherited or partitioned target table, inheritance_planner() will clone the targetlist and

pgsql: Doc: add comment about bug fixed in back branches as of 3f7323cb

2022-08-27 Thread Tom Lane
Doc: add comment about bug fixed in back branches as of 3f7323cbb. While the bug I just fixed in the back branches doesn't exist in HEAD, the requirement that MULTIEXPR SubPlans not share output parameters still does. Add a comment to memorialize that, because perhaps it could be an issue again s

pgsql: Avoid casting away const in sepgsql's quote_object_name.

2022-08-27 Thread Tom Lane
Avoid casting away const in sepgsql's quote_object_name. quote_identifier's API is designed on the assumption that it's not worth worrying about a short-term memory leak when we have to produce a quoted version of the given identifier. Whoever wrote quote_object_name took it on themselves to over