1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00
Files
mariadb/plugin
Alexey (Holyfoot) Botchkov a601069172 MDEV-40394 XML schema fails on self-referencing type.
A schema type that refers to itself, directly or through other types or
groups, was validated with a single shared compositor state per type.
A nested use of the type reset the state of the outer one, so
XMLISVALID() gave wrong results for recursive schemas.

Now every recursion level of an XMLSchema_user_type gets its own copy
of the type's content (get_copy()/copy_tags()). Copies are kept on a
per-type stack while validating, and released copies are put in
m_c_free and reused, so memory doesn't grow with each validated row.
reset_types() unwinds any state left by a validation that aborted.

Other changes:
- XMLSchema_item::is_validate_done() is replaced with
  ::end_validation(st). It is no longer a pure check: it pops the
  compositor stack and must be paired with validate_prepare().
- validate_prepare() can now fail, and the failure is propagated.
- A recursion depth limit (MAX_RECURSION_DEPTH, 1024) is added, counted
  per type. When it is hit, or on OOM during validation, XMLISVALID()
  returns errors/warnings.
- XMLSchema_group_def now derives from XMLSchema_user_type, so groups
  get the same copy mechanism. As a side effect <xs:group final=...>
  is accepted.
- XMLSchema_group_reference now counts occurrences, so minOccurs and
  maxOccurs of a group reference are enforced.
- XMLSchema_group_def::check_type() checks for circular groups, and
  XMLSchema_attribute::check_type() is removed (named types and groups
  are checked globally).
- The circular-reference error names the construct:
  "complexType B has bad circular references" instead of
  "type B has ...". The affected .result lines are re-recorded.
- Hook chains (m_next_tag) are replaced with List<> because tags are
  now copied.
2026-10-20 10:49:37 +04:00
..
2026-05-26 21:15:58 +02:00
2026-07-06 13:44:56 +02:00
2024-12-02 17:51:17 +02:00
2025-08-03 15:01:09 +02:00
2026-07-20 13:23:00 +03:00
2024-05-27 12:39:02 +02:00
2026-01-31 14:08:54 +01:00
2026-08-19 11:28:01 +02:00
2025-04-22 16:26:36 -04:00
2026-07-20 13:23:00 +03:00
2025-04-18 17:11:01 +02:00
2026-08-20 08:27:14 +02:00