N°2490 Setup/toolkit : no longer generates useless ALTER TABLE queries on MariaDB >= 10.2

* case insensitive SQL data type comparison
* some options have also case differences (example 'int(11) unsigned')
* DEFAULT 'NULL' added by MariaDB on all nullable fields
* default values are always surrounded with single quotes on MariaDB

This is a Combodo implementation of PR #91
This commit is contained in:
Pierre Goiffon
2019-11-20 18:39:29 +01:00
parent 2f431a0d14
commit 675221a15e
3 changed files with 194 additions and 2 deletions

View File

@@ -5514,7 +5514,7 @@ abstract class MetaModel
//
$bToBeChanged = false;
$sActualFieldSpec = CMDBSource::GetFieldSpec($sTable, $sField);
if (strcasecmp($sDBFieldSpec, $sActualFieldSpec) != 0)
if (!CMDBSource::IsSameFieldTypes($sDBFieldSpec, $sActualFieldSpec))
{
$bToBeChanged = true;
$aErrors[$sClass][$sAttCode][] = "field '$sField' in table '$sTable' has a wrong type: found '$sActualFieldSpec' while expecting '$sDBFieldSpec'";