N°3065 - Failed enum comparison when values contains parenthesis : add a warning

This commit is contained in:
odain
2021-03-02 07:33:36 +01:00
parent 5c0e92d51a
commit d4607ee815
2 changed files with 7 additions and 0 deletions

View File

@@ -1268,6 +1268,7 @@ class CMDBSource
return self::GetEnumOptions($sDataType, $sCompleteFieldType);
}catch(CoreException $e){
//do nothing ; especially do not block setup.
IssueLog::Warning("enum was not parsed properly: $sCompleteFieldType. it should not happen during setup.");
}
}

View File

@@ -21,6 +21,7 @@ class CMDBSourceTest extends ItopTestCase
{
protected function setUp()
{
parent::setUp();
require_once(APPROOT.'/core/cmdbsource.class.inc.php');
}
@@ -112,6 +113,11 @@ class CMDBSourceTest extends ItopTestCase
"ENUM('value 1 (with parenthesis)','value 2') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci",
"enum('value 1 (with parenthesis)','value 3') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci",
),
'ENUM with different values, containing parenthesis' => array(
false,
"ENUM('value 1 ) with parenthesis)','value 2') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci",
"enum('value 1 (with parenthesis)','value 3') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci",
),
);
}
}