2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

[481-er-foreign-duplicate-key-with-child-info] Completed duplicate foreign key errors

This commit is contained in:
Francis Dupont
2019-03-17 10:16:42 +01:00
parent 0abbcf182b
commit 4265d38fbd

View File

@@ -479,10 +479,14 @@ public:
if (status != 0) { if (status != 0) {
// Failure: check for the special case of duplicate entry. // Failure: check for the special case of duplicate entry.
if ((mysql_errno(mysql_) == ER_DUP_ENTRY) if ((mysql_errno(mysql_) == ER_DUP_ENTRY)
#if defined(ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO) && \ #ifdef ER_FOREIGN_DUPLICATE_KEY
(ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO != ER_DUP_ENTRY) || (mysql_errno(mysql_) == ER_FOREIGN_DUPLICATE_KEY)
#endif
#ifdef ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO
|| (mysql_errno(mysql_) == ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO) || (mysql_errno(mysql_) == ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO)
#endif
#ifdef ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO
|| (mysql_errno(mysql_) == ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO)
#endif #endif
) { ) {
isc_throw(DuplicateEntry, "Database duplicate entry error"); isc_throw(DuplicateEntry, "Database duplicate entry error");