From 5fcc33f1f82f9a08464ae638fee65ae2d91180cf Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 5 Jul 2012 00:11:54 -0400 Subject: [PATCH] UDAs - UDA definitions that have the same name as a core attribute are not permitted. --- src/columns/Column.cpp | 3 +++ src/en-US.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/columns/Column.cpp b/src/columns/Column.cpp index 599116e28..a00d4ba4d 100644 --- a/src/columns/Column.cpp +++ b/src/columns/Column.cpp @@ -173,6 +173,9 @@ void Column::uda (std::map & all) std::map ::iterator uda; for (uda = udas.begin (); uda != udas.end (); ++uda) { + if (all.find (uda->first) != all.end ()) + throw format (STRING_UDA_COLLISION, uda->first); + Column* c = Column::uda (uda->first); all[c->_name] = c; } diff --git a/src/en-US.h b/src/en-US.h index 41a0ee016..172d2e6fd 100644 --- a/src/en-US.h +++ b/src/en-US.h @@ -687,6 +687,7 @@ #define STRING_INFINITE_LOOP "Terminated substitution because more than {1} changes were made - infinite loop protection." #define STRING_UDA_TYPE "User defined attributes may only be of type 'string', 'date', 'duration' or 'numeric'." #define STRING_UDA_NUMERIC "The value '{1}' is not a valid numeric value." +#define STRING_UDA_COLLISION "The UDA named '{1}' is the same as a core attribute, and is not permitted." #define STRING_INVALID_MOD "The '{1}' attribute does not allow a value of '{2}'." // Feedback