From a2d511b6e9ac450014263688d234f8f7429a7471 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 27 Jul 2014 23:55:47 -0500 Subject: [PATCH] DBD parser accepts record type declarations Record types are the only DBD entries for which the parser will not accept redefinitions. This change lets it accept a record type declaration any number of times. However once a record type declaration has been parsed the full record type definition cannot be loaded, an error will be raised if the full definition is seen. The parser will still not accept a full record type definition more than once either, any later copies of the record type must be declarations. --- src/tools/DBD/Recordtype.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tools/DBD/Recordtype.pm b/src/tools/DBD/Recordtype.pm index f730777a3..d0d76a5a0 100644 --- a/src/tools/DBD/Recordtype.pm +++ b/src/tools/DBD/Recordtype.pm @@ -83,7 +83,9 @@ sub toCdefs { } sub equals { - my ($a, $b) = @_; + my ($new, $known) = @_; + return 0 if ! $known->fields; + return 1 if ! $new->fields; dieContext("Duplicate definition of record type '$a->{NAME}'"); }