| 175 | |
| 176 | |
| 177 | void DataTypeFactory::registerDataType(const String & family_name, Value creator, CaseSensitiveness case_sensitiveness) |
| 178 | { |
| 179 | if (creator == nullptr) |
| 180 | throw Exception("DataTypeFactory: the data type family " + family_name + " has been provided " |
| 181 | " a null constructor", ErrorCodes::LOGICAL_ERROR); |
| 182 | |
| 183 | String family_name_lowercase = Poco::toLower(family_name); |
| 184 | |
| 185 | if (isAlias(family_name) || isAlias(family_name_lowercase)) |
| 186 | throw Exception("DataTypeFactory: the data type family name '" + family_name + "' is already registered as alias", |
| 187 | ErrorCodes::LOGICAL_ERROR); |
| 188 | |
| 189 | if (!data_types.emplace(family_name, creator).second) |
| 190 | throw Exception("DataTypeFactory: the data type family name '" + family_name + "' is not unique", |
| 191 | ErrorCodes::LOGICAL_ERROR); |
| 192 | |
| 193 | |
| 194 | if (case_sensitiveness == CaseInsensitive |
| 195 | && !case_insensitive_data_types.emplace(family_name_lowercase, creator).second) |
| 196 | throw Exception("DataTypeFactory: the case insensitive data type family name '" + family_name + "' is not unique", |
| 197 | ErrorCodes::LOGICAL_ERROR); |
| 198 | } |
| 199 | |
| 200 | void DataTypeFactory::registerSimpleDataType(const String & name, SimpleCreator creator, CaseSensitiveness case_sensitiveness) |
| 201 | { |
no test coverage detected