Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7c53b19

Browse files
committed
Fix incompatibilities with libxml2 >= 2.12.0.
libxml2 changed the required signature of error handler callbacksto make the passed xmlError struct "const". This is causing buildfailures on buildfarm member caiman, and no doubt will start showingup in the field quite soon. Add a version check to adjust thedeclaration of xml_errorHandler() according to LIBXML_VERSION.2.12.x also produces deprecation warnings for contrib/xml2/xpath.c'sassignment to xmlLoadExtDtdDefaultValue. I see no good reason forthat to still be there, seeing that we disabled external DTDs (at alower level) years ago for security reasons. Let's just remove it.Back-patch to all supported branches, since they might all get builtwith newer libxml2 once it gets a bit more popular. (The backbranches produce another deprecation warning about xpath.c's use ofxmlSubstituteEntitiesDefault(). We ought to consider whether toback-patch all or part of commit65c5864 to silence that. It'sless urgent though, since it won't break the buildfarm.)Discussion:https://postgr.es/m/1389505.1706382262@sss.pgh.pa.us
1 parente74c916 commit7c53b19

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

‎contrib/xml2/xpath.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ pgxml_parser_init(PgXmlStrictness strictness)
7575
xmlInitParser();
7676

7777
xmlSubstituteEntitiesDefault(1);
78-
xmlLoadExtDtdDefaultValue=1;
7978

8079
returnxmlerrcxt;
8180
}

‎src/backend/utils/adt/xml.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@
6565
#ifLIBXML_VERSION >=20704
6666
#defineHAVE_XMLSTRUCTUREDERRORCONTEXT 1
6767
#endif
68+
69+
/*
70+
* libxml2 2.12 decided to insert "const" into the error handler API.
71+
*/
72+
#ifLIBXML_VERSION >=21200
73+
#definePgXmlErrorPtr const xmlError *
74+
#else
75+
#definePgXmlErrorPtr xmlErrorPtr
76+
#endif
77+
6878
#endif/* USE_LIBXML */
6979

7080
#include"access/htup_details.h"
@@ -119,7 +129,7 @@ struct PgXmlErrorContext
119129

120130
staticxmlParserInputPtrxmlPgEntityLoader(constchar*URL,constchar*ID,
121131
xmlParserCtxtPtrctxt);
122-
staticvoidxml_errorHandler(void*data,xmlErrorPtrerror);
132+
staticvoidxml_errorHandler(void*data,PgXmlErrorPtrerror);
123133
staticvoidxml_ereport_by_code(intlevel,intsqlcode,
124134
constchar*msg,interrcode);
125135
staticvoidchopStringInfoNewlines(StringInfostr);
@@ -1750,7 +1760,7 @@ xml_ereport(PgXmlErrorContext *errcxt, int level, int sqlcode, const char *msg)
17501760
* Error handler for libxml errors and warnings
17511761
*/
17521762
staticvoid
1753-
xml_errorHandler(void*data,xmlErrorPtrerror)
1763+
xml_errorHandler(void*data,PgXmlErrorPtrerror)
17541764
{
17551765
PgXmlErrorContext*xmlerrcxt= (PgXmlErrorContext*)data;
17561766
xmlParserCtxtPtrctxt= (xmlParserCtxtPtr)error->ctxt;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp