<
10000
react-app
app-name="commits"
initial-path="/postgres/postgres/commit/e7192486dded0ca82824fef95eb88b4231bdd4d2"
style="display: block; min-height: calc(100vh - 64px);"
data-attempted-ssr="true"
data-ssr="true"
data-lazy="false"
data-alternate="false"
data-data-router-enabled="false"
data-react-profiling="false"
>
File tree Expand file tree Collapse file tree 5 files changed +81
-12
lines changed Expand file tree Collapse file tree 5 files changed +81
-12
lines changed Original file line number Diff line number Diff line change @@ -2114,6 +2114,19 @@ xml_errorHandler(void *data, PgXmlErrorPtr error)
2114
2114
switch (domain )
2115
2115
{
2116
2116
case XML_FROM_PARSER :
2117
+
2118
+ /*
2119
+ * XML_ERR_NOT_WELL_BALANCED is typically reported after some
2120
+ * other, more on-point error. Furthermore, libxml2 2.13 reports
2121
+ * it under a completely different set of rules than prior
2122
+ * versions. To avoid cross-version behavioral differences,
2123
+ * suppress it so long as we already logged some error.
2124
+ */
2125
+ if (error -> code == XML_ERR_NOT_WELL_BALANCED &&
2126
+ xmlerrcxt -> err_occurred )
2127
+ return ;
2128
+ /* fall through */
2129
+
2117
2130
case XML_FROM_NONE :
2118
2131
case XML_FROM_MEMORY :
2119
2132
case XML_FROM_IO :
Original file line number Diff line number Diff line change @@ -254,17 +254,11 @@ ERROR: invalid XML content
254
254
DETAIL: line 1: xmlParseEntityRef: no name
255
255
<invalidentity>&</invalidentity>
256
256
^
257
- line 1: chunk is not well balanced
258
- <invalidentity>&</invalidentity>
259
- ^
260
257
SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
261
258
ERROR: invalid XML content
262
259
DETAIL: line 1: Entity 'idontexist' not defined
263
260
<undefinedentity>&idontexist;</undefinedentity>
264
261
^
265
- line 1: chunk is not well balanced
266
- <undefinedentity>&idontexist;</undefinedentity>
267
- ^
268
262
SELECT xmlparse(content '<invalidns xmlns=''<''/>');
269
263
xmlparse
270
264
---------------------------
@@ -283,9 +277,6 @@ DETAIL: line 1: Entity 'idontexist' not defined
283
277
<twoerrors>&idontexist;</unbalanced>
284
278
^
285
279
line 1: Opening and ending tag mismatch: twoerrors line 1 and unbalanced
286
- <twoerrors>&idontexist;</unbalanced>
287
- ^
288
- line 1: chunk is not well balanced
289
280
<twoerrors>&idontexist;</unbalanced>
290
281
^
291
282
SELECT xmlparse(content '<nosuchprefix:tag/>');
@@ -294,6 +285,19 @@ SELECT xmlparse(content '<nosuchprefix:tag/>');
294
285
<nosuchprefix:tag/>
295
286
(1 row)
296
287
288
+ SELECT xmlparse(content '<unclosed>');
289
+ ERROR: invalid XML content
290
+ DETAIL: line 1: Premature end of data in tag unclosed line 1
291
+ <unclosed>
292
+ ^
293
+ SELECT xmlparse(content '<parent><child></parent></child>');
294
+ ERROR: invalid XML content
295
+ DETAIL: line 1: Opening and ending tag mismatch: child line 1 and parent
296
+ <parent><child></parent></child>
297
+ ^
298
+ line 1: Opening and ending tag mismatch: parent line 1 and child
299
+ <parent><child></parent></child>
300
+ ^
297
301
SELECT xmlparse(document ' ');
298
302
ERROR: invalid XML document
299
303
DETAIL: line 1: Start tag expected, '<' not found
@@ -352,6 +356,19 @@ SELECT xmlparse(document '<nosuchprefix:tag/>');
352
356
<nosuchprefix:tag/>
353
357
(1 row)
354
358
359
+ SELECT xmlparse(document '<unclosed>');
360
+ ERROR: invalid XML document
361
+ DETAIL: line 1: Premature end of data in tag unclosed line 1
362
+ <unclosed>
363
+ ^
364
+ SELECT xmlparse(document '<parent><child></parent></child>');
365
+ ERROR: invalid XML document
366
+ DETAIL: line 1: Opening and ending tag mismatch: child line 1 and parent
367
+ <parent><child></parent></child>
368
+ ^
369
+ line 1: Opening and ending tag mismatch: parent line 1 and child
370
+ <parent><child></parent></child>
371
+ ^
355
372
SELECT xmlpi(name foo);
356
373
xmlpi
357
374
---------
Original file line number Diff line number Diff line change @@ -180,6 +180,12 @@ DETAIL: This functionality requires the server to be built with libxml support.
180
180
SELECT xmlparse(content '<nosuchprefix:tag/>');
181
181
ERROR: unsupported XML feature
182
182
DETAIL: This functionality requires the server to be built with libxml support.
183
+ SELECT xmlparse(content '<unclosed>');
184
+ ERROR: unsupported XML feature
185
+ DETAIL: This functionality requires the server to be built with libxml support.
186
+ SELECT xmlparse(content '<parent><child></parent></child>');
187
+ ERROR: unsupported XML feature
188
+ DETAIL: This functionality requires the server to be built with libxml support.
183
189
SELECT xmlparse(document ' ');
184
190
ERROR: unsupported XML feature
185
191
DETAIL: This functionality requires the server to be built with libxml support.
@@ -207,6 +213,12 @@ DETAIL: This functionality requires the server to be built with libxml support.
207
213
SELECT xmlparse(document '<nosuchprefix:tag/>');
208
214
ERROR: unsupported XML feature
209
215
DETAIL: This functionality requires the server to be built with libxml support.
216
+ SELECT xmlparse(document '<unclosed>');
217
+ ERROR: unsupported XML feature
218
+ DETAIL: This functionality requires the server to be built with libxml support.
219
+ SELECT xmlparse(document '<parent><child></parent></child>');
220
+ ERROR: unsupported XML feature
221
+ DETAIL: This functionality requires the server to be built with libxml support.
210
222
SELECT xmlpi(name foo);
211
223
ERROR: unsupported XML feature
212
224
DETAIL: This functionality requires the server to be built with libxml support.
Original file line number Diff line number Diff line change @@ -250,13 +250,11 @@ ERROR: invalid XML content
250
250
DETAIL: line 1: xmlParseEntityRef: no name
251
251
<invalidentity>&</invalidentity>
252
252
^
253
- line 1: chunk is not well balanced
254
253
SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
255
254
ERROR: invalid XML content
256
255
DETAIL: line 1: Entity 'idontexist' not defined
257
256
<undefinedentity>&idontexist;</undefinedentity>
258
257
^
259
- line 1: chunk is not well balanced
260
258
SELECT xmlparse(content '<invalidns xmlns=''<''/>');
261
259
xmlparse
262
260
---------------------------
@@ -275,13 +273,25 @@ DETAIL: line 1: Entity 'idontexist' not defined
275
273
<twoerrors>&idontexist;</unbalanced>
276
274
^
277
275
line 1: Opening and ending tag mismatch: twoerrors line 1 and unbalanced
278
- line 1: chunk is not well balanced
279
276
SELECT xmlparse(content '<nosuchprefix:tag/>');
280
277
xmlparse
281
278
---------------------
282
279
<nosuchprefix:tag/>
283
280
(1 row)
284
281
282
+ SELECT xmlparse(content '<unclosed>');
283
+ ERROR: invalid XML content
284
+ DETAIL: line 1: Premature end of data in tag unclosed line 1
285
+ <unclosed>
286
+ ^
287
+ SELECT xmlparse(content '<parent><child></parent></child>');
288
+ ERROR: invalid XML content
289
+ DETAIL: line 1: Opening and ending tag mismatch: child line 1 and parent
290
+ <parent><child></parent></child>
291
+ ^
292
+ line 1: Opening and ending tag mismatch: parent line 1 and child
293
+ <parent><child></parent></child>
294
+ ^
285
295
SELECT xmlparse(document ' ');
286
296
ERROR: invalid XML document
287
297
DETAIL: line 1: Start tag expected, '<' not found
@@ -332,6 +342,19 @@ SELECT xmlparse(document '<nosuchprefix:tag/>');
332
342
<nosuchprefix:tag/>
333
343
(1 row)
334
344
345
+ SELECT xmlparse(document '<unclosed>');
346
+ ERROR: invalid XML document
347
+ DETAIL: line 1: Premature end of data in tag unclosed line 1
348
+ <unclosed>
349
+ ^
350
+ SELECT xmlparse(document '<parent><child></parent></child>');
351
+ ERROR: invalid XML document
352
+ DETAIL: line 1: Opening and ending tag mismatch: child line 1 and parent
353
+ <parent><child></parent></child>
354
+ ^
355
+ line 1: Opening and ending tag mismatch: parent line 1 and child
356
+ <parent><child></parent></child>
357
+ ^
335
358
SELECT xmlpi(name foo);
336
359
xmlpi
337
360
---------
Original file line number Diff line number Diff line change @@ -77,6 +77,8 @@ SELECT xmlparse(content '<invalidns xmlns=''<''/>');
77
77
SELECT xmlparse(content ' <relativens xmlns=' ' relative' ' />' );
78
78
SELECT xmlparse(content ' <twoerrors>&idontexist;</unbalanced>' );
79
79
SELECT xmlparse(content ' <nosuchprefix:tag/>' );
80
+ SELECT xmlparse(content ' <unclosed>' );
81
+ SELECT xmlparse(content ' <parent><child></parent></child>' );
80
82
81
83
SELECT xmlparse(document ' ' );
82
84
SELECT xmlparse(document ' abc' );
@@ -87,6 +89,8 @@ SELECT xmlparse(document '<invalidns xmlns=''<''/>');
87
89
SELECT xmlparse(document ' <relativens xmlns=' ' relative' ' />' );
88
90
SELECT xmlparse(document ' <twoerrors>&idontexist;</unbalanced>' );
89
91
SELECT xmlparse(document ' <nosuchprefix:tag/>' );
92
+ SELECT xmlparse(document ' <unclosed>' );
93
+ SELECT xmlparse(document ' <parent><child></parent></child>' );
90
94
91
95
92
96
SELECT xmlpi(name foo);
0 commit comments