From 7017e54930eb58d416eec77c2c13b728379c053c Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 24 Jan 2022 12:25:57 -0600 Subject: [PATCH] Allow more char's in breaktable names --- documentation/RELEASE_NOTES.md | 8 ++++++++ modules/database/src/tools/DBD/Breaktable.pm | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/documentation/RELEASE_NOTES.md b/documentation/RELEASE_NOTES.md index 4ab2c3224..554d1292b 100644 --- a/documentation/RELEASE_NOTES.md +++ b/documentation/RELEASE_NOTES.md @@ -16,6 +16,14 @@ should also be read to understand what has changed since earlier releases. + +### Breakpoint Table Names + +The names of breakpoint tables were made unnecessarily strict when DBD file +processing was moved to Perl for the 3.15 release series. Table names may now +contain the special characters `_` `-` `:` `;` `.` `[` `]` `<` `>` in addition +to letters and digits. + ### Fix for `undefined` in configure/RELEASE files Prevents `Use of uninitialized value` warnings from convertRelease.pl. diff --git a/modules/database/src/tools/DBD/Breaktable.pm b/modules/database/src/tools/DBD/Breaktable.pm index 54e699131..4b972dcd1 100644 --- a/modules/database/src/tools/DBD/Breaktable.pm +++ b/modules/database/src/tools/DBD/Breaktable.pm @@ -20,6 +20,20 @@ sub init { return $this; } +# Override, breaktable names don't have to be strict +sub identifier { + my ($this, $id, $what) = @_; + confess "DBD::Breaktable::identifier: $what undefined!" + unless defined $id; + if ($id !~ m/^$RXname$/) { + my @message; + push @message, "A $what should contain only letters, digits and these", + "special characters: _ - : . [ ] < > ;" unless $warned++; + warnContext("Deprecated $what '$id'", @message); + } + return $id; +} + sub add_point { my ($this, $raw, $eng) = @_; confess "DBD::Breaktable::add_point: Raw value undefined!"