Parsing of ISO 8601 durations accepts invalid representations
sciascid opened this issue · 0 comments
sciascid commented
This issue was originally raised in the context of this mariadb issue: https://jira.mariadb.org/browse/MDEV-30140
It is possible to set period type of galera parameters with bogus values.
For example: "Panyvalue" will be parsed and accepted as "P", meaning a "zero" duration.
It turns out that any value starting with "P" is accepted:
gu::datetime::Period("Pwhatever").get_nsecs(); // returns 0, instead of throwing an exception