diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-02-04 11:43:41 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-02-04 11:43:41 +0000 |
commit | 11300a8104238529425a7b6651499bf195bf1839 (patch) | |
tree | a73a3301af6da67fcd2244874edaa434ce3a3367 /dev-db/postgresql/files | |
parent | 355555b18ef39d8b98821fb28be5a0577f24acab (diff) |
gentoo auto-resync : 04:02:2024 - 11:43:41
Diffstat (limited to 'dev-db/postgresql/files')
5 files changed, 415 insertions, 0 deletions
diff --git a/dev-db/postgresql/files/postgresql-12-xml-2.12.patch b/dev-db/postgresql/files/postgresql-12-xml-2.12.patch new file mode 100644 index 000000000000..2929eb7302e2 --- /dev/null +++ b/dev-db/postgresql/files/postgresql-12-xml-2.12.patch @@ -0,0 +1,83 @@ +From b2fd1dab90240ebb9017cd2fddd731c3641ba434 Mon Sep 17 00:00:00 2001 +From: Tom Lane <tgl@sss.pgh.pa.us> +Date: Mon, 29 Jan 2024 12:06:08 -0500 +Subject: [PATCH] Fix incompatibilities with libxml2 >= 2.12.0. + +libxml2 changed the required signature of error handler callbacks +to make the passed xmlError struct "const". This is causing build +failures on buildfarm member caiman, and no doubt will start showing +up in the field quite soon. Add a version check to adjust the +declaration of xml_errorHandler() according to LIBXML_VERSION. + +2.12.x also produces deprecation warnings for contrib/xml2/xpath.c's +assignment to xmlLoadExtDtdDefaultValue. I see no good reason for +that to still be there, seeing that we disabled external DTDs (at a +lower level) years ago for security reasons. Let's just remove it. + +Back-patch to all supported branches, since they might all get built +with newer libxml2 once it gets a bit more popular. (The back +branches produce another deprecation warning about xpath.c's use of +xmlSubstituteEntitiesDefault(). We ought to consider whether to +back-patch all or part of commit 65c5864d7 to silence that. It's +less urgent though, since it won't break the buildfarm.) + +Discussion: https://postgr.es/m/1389505.1706382262@sss.pgh.pa.us +--- + contrib/xml2/xpath.c | 1 - + src/backend/utils/adt/xml.c | 14 ++++++++++++-- + 2 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c +index 1e5b71d9a0..f44caf0020 100644 +--- a/contrib/xml2/xpath.c ++++ b/contrib/xml2/xpath.c +@@ -75,7 +75,6 @@ pgxml_parser_init(PgXmlStrictness strictness) + xmlInitParser(); + + xmlSubstituteEntitiesDefault(1); +- xmlLoadExtDtdDefaultValue = 1; + + return xmlerrcxt; + } +diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c +index 9f319077cb..51b16f2b73 100644 +--- a/src/backend/utils/adt/xml.c ++++ b/src/backend/utils/adt/xml.c +@@ -65,6 +65,16 @@ + #if LIBXML_VERSION >= 20704 + #define HAVE_XMLSTRUCTUREDERRORCONTEXT 1 + #endif ++ ++/* ++ * libxml2 2.12 decided to insert "const" into the error handler API. ++ */ ++#if LIBXML_VERSION >= 21200 ++#define PgXmlErrorPtr const xmlError * ++#else ++#define PgXmlErrorPtr xmlErrorPtr ++#endif ++ + #endif /* USE_LIBXML */ + + #include "access/htup_details.h" +@@ -119,7 +129,7 @@ struct PgXmlErrorContext + + static xmlParserInputPtr xmlPgEntityLoader(const char *URL, const char *ID, + xmlParserCtxtPtr ctxt); +-static void xml_errorHandler(void *data, xmlErrorPtr error); ++static void xml_errorHandler(void *data, PgXmlErrorPtr error); + static void xml_ereport_by_code(int level, int sqlcode, + const char *msg, int errcode); + static void chopStringInfoNewlines(StringInfo str); +@@ -1752,7 +1762,7 @@ xml_ereport(PgXmlErrorContext *errcxt, int level, int sqlcode, const char *msg) + * Error handler for libxml errors and warnings + */ + static void +-xml_errorHandler(void *data, xmlErrorPtr error) ++xml_errorHandler(void *data, PgXmlErrorPtr error) + { + PgXmlErrorContext *xmlerrcxt = (PgXmlErrorContext *) data; + xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) error->ctxt; +-- +2.30.2 + diff --git a/dev-db/postgresql/files/postgresql-13-xml-2.12.patch b/dev-db/postgresql/files/postgresql-13-xml-2.12.patch new file mode 100644 index 000000000000..a8daa6e7ce2f --- /dev/null +++ b/dev-db/postgresql/files/postgresql-13-xml-2.12.patch @@ -0,0 +1,83 @@ +From 7c53b1977ba6bed81deca3164c17e61f10725226 Mon Sep 17 00:00:00 2001 +From: Tom Lane <tgl@sss.pgh.pa.us> +Date: Mon, 29 Jan 2024 12:06:08 -0500 +Subject: [PATCH] Fix incompatibilities with libxml2 >= 2.12.0. + +libxml2 changed the required signature of error handler callbacks +to make the passed xmlError struct "const". This is causing build +failures on buildfarm member caiman, and no doubt will start showing +up in the field quite soon. Add a version check to adjust the +declaration of xml_errorHandler() according to LIBXML_VERSION. + +2.12.x also produces deprecation warnings for contrib/xml2/xpath.c's +assignment to xmlLoadExtDtdDefaultValue. I see no good reason for +that to still be there, seeing that we disabled external DTDs (at a +lower level) years ago for security reasons. Let's just remove it. + +Back-patch to all supported branches, since they might all get built +with newer libxml2 once it gets a bit more popular. (The back +branches produce another deprecation warning about xpath.c's use of +xmlSubstituteEntitiesDefault(). We ought to consider whether to +back-patch all or part of commit 65c5864d7 to silence that. It's +less urgent though, since it won't break the buildfarm.) + +Discussion: https://postgr.es/m/1389505.1706382262@sss.pgh.pa.us +--- + contrib/xml2/xpath.c | 1 - + src/backend/utils/adt/xml.c | 14 ++++++++++++-- + 2 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c +index 1e5b71d9a0..f44caf0020 100644 +--- a/contrib/xml2/xpath.c ++++ b/contrib/xml2/xpath.c +@@ -75,7 +75,6 @@ pgxml_parser_init(PgXmlStrictness strictness) + xmlInitParser(); + + xmlSubstituteEntitiesDefault(1); +- xmlLoadExtDtdDefaultValue = 1; + + return xmlerrcxt; + } +diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c +index 7fc9669fb0..febe0a6220 100644 +--- a/src/backend/utils/adt/xml.c ++++ b/src/backend/utils/adt/xml.c +@@ -65,6 +65,16 @@ + #if LIBXML_VERSION >= 20704 + #define HAVE_XMLSTRUCTUREDERRORCONTEXT 1 + #endif ++ ++/* ++ * libxml2 2.12 decided to insert "const" into the error handler API. ++ */ ++#if LIBXML_VERSION >= 21200 ++#define PgXmlErrorPtr const xmlError * ++#else ++#define PgXmlErrorPtr xmlErrorPtr ++#endif ++ + #endif /* USE_LIBXML */ + + #include "access/htup_details.h" +@@ -119,7 +129,7 @@ struct PgXmlErrorContext + + static xmlParserInputPtr xmlPgEntityLoader(const char *URL, const char *ID, + xmlParserCtxtPtr ctxt); +-static void xml_errorHandler(void *data, xmlErrorPtr error); ++static void xml_errorHandler(void *data, PgXmlErrorPtr error); + static void xml_ereport_by_code(int level, int sqlcode, + const char *msg, int errcode); + static void chopStringInfoNewlines(StringInfo str); +@@ -1750,7 +1760,7 @@ xml_ereport(PgXmlErrorContext *errcxt, int level, int sqlcode, const char *msg) + * Error handler for libxml errors and warnings + */ + static void +-xml_errorHandler(void *data, xmlErrorPtr error) ++xml_errorHandler(void *data, PgXmlErrorPtr error) + { + PgXmlErrorContext *xmlerrcxt = (PgXmlErrorContext *) data; + xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) error->ctxt; +-- +2.30.2 + diff --git a/dev-db/postgresql/files/postgresql-14-xml-2.12.patch b/dev-db/postgresql/files/postgresql-14-xml-2.12.patch new file mode 100644 index 000000000000..2b1d6b1b3448 --- /dev/null +++ b/dev-db/postgresql/files/postgresql-14-xml-2.12.patch @@ -0,0 +1,83 @@ +From 29e25a6b1eb1b77ecfdbcb5b8dc07c8a6cdcf089 Mon Sep 17 00:00:00 2001 +From: Tom Lane <tgl@sss.pgh.pa.us> +Date: Mon, 29 Jan 2024 12:06:08 -0500 +Subject: [PATCH] Fix incompatibilities with libxml2 >= 2.12.0. + +libxml2 changed the required signature of error handler callbacks +to make the passed xmlError struct "const". This is causing build +failures on buildfarm member caiman, and no doubt will start showing +up in the field quite soon. Add a version check to adjust the +declaration of xml_errorHandler() according to LIBXML_VERSION. + +2.12.x also produces deprecation warnings for contrib/xml2/xpath.c's +assignment to xmlLoadExtDtdDefaultValue. I see no good reason for +that to still be there, seeing that we disabled external DTDs (at a +lower level) years ago for security reasons. Let's just remove it. + +Back-patch to all supported branches, since they might all get built +with newer libxml2 once it gets a bit more popular. (The back +branches produce another deprecation warning about xpath.c's use of +xmlSubstituteEntitiesDefault(). We ought to consider whether to +back-patch all or part of commit 65c5864d7 to silence that. It's +less urgent though, since it won't break the buildfarm.) + +Discussion: https://postgr.es/m/1389505.1706382262@sss.pgh.pa.us +--- + contrib/xml2/xpath.c | 1 - + src/backend/utils/adt/xml.c | 14 ++++++++++++-- + 2 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c +index 1e5b71d9a0..f44caf0020 100644 +--- a/contrib/xml2/xpath.c ++++ b/contrib/xml2/xpath.c +@@ -75,7 +75,6 @@ pgxml_parser_init(PgXmlStrictness strictness) + xmlInitParser(); + + xmlSubstituteEntitiesDefault(1); +- xmlLoadExtDtdDefaultValue = 1; + + return xmlerrcxt; + } +diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c +index df7a1b6c40..d7caaaaca0 100644 +--- a/src/backend/utils/adt/xml.c ++++ b/src/backend/utils/adt/xml.c +@@ -65,6 +65,16 @@ + #if LIBXML_VERSION >= 20704 + #define HAVE_XMLSTRUCTUREDERRORCONTEXT 1 + #endif ++ ++/* ++ * libxml2 2.12 decided to insert "const" into the error handler API. ++ */ ++#if LIBXML_VERSION >= 21200 ++#define PgXmlErrorPtr const xmlError * ++#else ++#define PgXmlErrorPtr xmlErrorPtr ++#endif ++ + #endif /* USE_LIBXML */ + + #include "access/htup_details.h" +@@ -119,7 +129,7 @@ struct PgXmlErrorContext + + static xmlParserInputPtr xmlPgEntityLoader(const char *URL, const char *ID, + xmlParserCtxtPtr ctxt); +-static void xml_errorHandler(void *data, xmlErrorPtr error); ++static void xml_errorHandler(void *data, PgXmlErrorPtr error); + static void xml_ereport_by_code(int level, int sqlcode, + const char *msg, int errcode); + static void chopStringInfoNewlines(StringInfo str); +@@ -1750,7 +1760,7 @@ xml_ereport(PgXmlErrorContext *errcxt, int level, int sqlcode, const char *msg) + * Error handler for libxml errors and warnings + */ + static void +-xml_errorHandler(void *data, xmlErrorPtr error) ++xml_errorHandler(void *data, PgXmlErrorPtr error) + { + PgXmlErrorContext *xmlerrcxt = (PgXmlErrorContext *) data; + xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) error->ctxt; +-- +2.30.2 + diff --git a/dev-db/postgresql/files/postgresql-15-xml-2.12.patch b/dev-db/postgresql/files/postgresql-15-xml-2.12.patch new file mode 100644 index 000000000000..fd8b963f9381 --- /dev/null +++ b/dev-db/postgresql/files/postgresql-15-xml-2.12.patch @@ -0,0 +1,83 @@ +From 3f8ac13b19764e3a485772d3cbb3ae6c4047eef2 Mon Sep 17 00:00:00 2001 +From: Tom Lane <tgl@sss.pgh.pa.us> +Date: Mon, 29 Jan 2024 12:06:07 -0500 +Subject: [PATCH] Fix incompatibilities with libxml2 >= 2.12.0. + +libxml2 changed the required signature of error handler callbacks +to make the passed xmlError struct "const". This is causing build +failures on buildfarm member caiman, and no doubt will start showing +up in the field quite soon. Add a version check to adjust the +declaration of xml_errorHandler() according to LIBXML_VERSION. + +2.12.x also produces deprecation warnings for contrib/xml2/xpath.c's +assignment to xmlLoadExtDtdDefaultValue. I see no good reason for +that to still be there, seeing that we disabled external DTDs (at a +lower level) years ago for security reasons. Let's just remove it. + +Back-patch to all supported branches, since they might all get built +with newer libxml2 once it gets a bit more popular. (The back +branches produce another deprecation warning about xpath.c's use of +xmlSubstituteEntitiesDefault(). We ought to consider whether to +back-patch all or part of commit 65c5864d7 to silence that. It's +less urgent though, since it won't break the buildfarm.) + +Discussion: https://postgr.es/m/1389505.1706382262@sss.pgh.pa.us +--- + contrib/xml2/xpath.c | 1 - + src/backend/utils/adt/xml.c | 14 ++++++++++++-- + 2 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c +index a692dc6be8..94641930f7 100644 +--- a/contrib/xml2/xpath.c ++++ b/contrib/xml2/xpath.c +@@ -75,7 +75,6 @@ pgxml_parser_init(PgXmlStrictness strictness) + xmlInitParser(); + + xmlSubstituteEntitiesDefault(1); +- xmlLoadExtDtdDefaultValue = 1; + + return xmlerrcxt; + } +diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c +index 6411f56b99..aae0692586 100644 +--- a/src/backend/utils/adt/xml.c ++++ b/src/backend/utils/adt/xml.c +@@ -65,6 +65,16 @@ + #if LIBXML_VERSION >= 20704 + #define HAVE_XMLSTRUCTUREDERRORCONTEXT 1 + #endif ++ ++/* ++ * libxml2 2.12 decided to insert "const" into the error handler API. ++ */ ++#if LIBXML_VERSION >= 21200 ++#define PgXmlErrorPtr const xmlError * ++#else ++#define PgXmlErrorPtr xmlErrorPtr ++#endif ++ + #endif /* USE_LIBXML */ + + #include "access/htup_details.h" +@@ -119,7 +129,7 @@ struct PgXmlErrorContext + + static xmlParserInputPtr xmlPgEntityLoader(const char *URL, const char *ID, + xmlParserCtxtPtr ctxt); +-static void xml_errorHandler(void *data, xmlErrorPtr error); ++static void xml_errorHandler(void *data, PgXmlErrorPtr error); + static void xml_ereport_by_code(int level, int sqlcode, + const char *msg, int errcode); + static void chopStringInfoNewlines(StringInfo str); +@@ -1749,7 +1759,7 @@ xml_ereport(PgXmlErrorContext *errcxt, int level, int sqlcode, const char *msg) + * Error handler for libxml errors and warnings + */ + static void +-xml_errorHandler(void *data, xmlErrorPtr error) ++xml_errorHandler(void *data, PgXmlErrorPtr error) + { + PgXmlErrorContext *xmlerrcxt = (PgXmlErrorContext *) data; + xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) error->ctxt; +-- +2.30.2 + diff --git a/dev-db/postgresql/files/postgresql-16-xml-2.12.patch b/dev-db/postgresql/files/postgresql-16-xml-2.12.patch new file mode 100644 index 000000000000..aac072c67393 --- /dev/null +++ b/dev-db/postgresql/files/postgresql-16-xml-2.12.patch @@ -0,0 +1,83 @@ +From e02fea093ebb7ff5093c4cd9827710000bb31146 Mon Sep 17 00:00:00 2001 +From: Tom Lane <tgl@sss.pgh.pa.us> +Date: Mon, 29 Jan 2024 12:06:07 -0500 +Subject: [PATCH] Fix incompatibilities with libxml2 >= 2.12.0. + +libxml2 changed the required signature of error handler callbacks +to make the passed xmlError struct "const". This is causing build +failures on buildfarm member caiman, and no doubt will start showing +up in the field quite soon. Add a version check to adjust the +declaration of xml_errorHandler() according to LIBXML_VERSION. + +2.12.x also produces deprecation warnings for contrib/xml2/xpath.c's +assignment to xmlLoadExtDtdDefaultValue. I see no good reason for +that to still be there, seeing that we disabled external DTDs (at a +lower level) years ago for security reasons. Let's just remove it. + +Back-patch to all supported branches, since they might all get built +with newer libxml2 once it gets a bit more popular. (The back +branches produce another deprecation warning about xpath.c's use of +xmlSubstituteEntitiesDefault(). We ought to consider whether to +back-patch all or part of commit 65c5864d7 to silence that. It's +less urgent though, since it won't break the buildfarm.) + +Discussion: https://postgr.es/m/1389505.1706382262@sss.pgh.pa.us +--- + contrib/xml2/xpath.c | 1 - + src/backend/utils/adt/xml.c | 14 ++++++++++++-- + 2 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c +index a692dc6be8..94641930f7 100644 +--- a/contrib/xml2/xpath.c ++++ b/contrib/xml2/xpath.c +@@ -75,7 +75,6 @@ pgxml_parser_init(PgXmlStrictness strictness) + xmlInitParser(); + + xmlSubstituteEntitiesDefault(1); +- xmlLoadExtDtdDefaultValue = 1; + + return xmlerrcxt; + } +diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c +index 2300c7ebf3..9f4e775003 100644 +--- a/src/backend/utils/adt/xml.c ++++ b/src/backend/utils/adt/xml.c +@@ -66,6 +66,16 @@ + #if LIBXML_VERSION >= 20704 + #define HAVE_XMLSTRUCTUREDERRORCONTEXT 1 + #endif ++ ++/* ++ * libxml2 2.12 decided to insert "const" into the error handler API. ++ */ ++#if LIBXML_VERSION >= 21200 ++#define PgXmlErrorPtr const xmlError * ++#else ++#define PgXmlErrorPtr xmlErrorPtr ++#endif ++ + #endif /* USE_LIBXML */ + + #include "access/htup_details.h" +@@ -123,7 +133,7 @@ static xmlParserInputPtr xmlPgEntityLoader(const char *URL, const char *ID, + xmlParserCtxtPtr ctxt); + static void xml_errsave(Node *escontext, PgXmlErrorContext *errcxt, + int sqlcode, const char *msg); +-static void xml_errorHandler(void *data, xmlErrorPtr error); ++static void xml_errorHandler(void *data, PgXmlErrorPtr error); + static int errdetail_for_xml_code(int code); + static void chopStringInfoNewlines(StringInfo str); + static void appendStringInfoLineSeparator(StringInfo str); +@@ -2002,7 +2012,7 @@ xml_errsave(Node *escontext, PgXmlErrorContext *errcxt, + * Error handler for libxml errors and warnings + */ + static void +-xml_errorHandler(void *data, xmlErrorPtr error) ++xml_errorHandler(void *data, PgXmlErrorPtr error) + { + PgXmlErrorContext *xmlerrcxt = (PgXmlErrorContext *) data; + xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) error->ctxt; +-- +2.30.2 + |