Bug: could not use mysql reserved words for table names (e.g. 'Change')

SVN:trunk[547]
This commit is contained in:
Romain Quetiez
2010-07-04 16:37:17 +00:00
parent db277c8539
commit b368209631

View File

@@ -790,7 +790,7 @@ abstract class DBObject
if (count($aValuesToWrite) == 0) return false;
$sTable = MetaModel::DBGetTable($sTableClass);
$sInsertSQL = "INSERT INTO $sTable (".join(",", $aFieldsToWrite).") VALUES (".join(", ", $aValuesToWrite).")";
$sInsertSQL = "INSERT INTO `$sTable` (".join(",", $aFieldsToWrite).") VALUES (".join(", ", $aValuesToWrite).")";
$iNewKey = CMDBSource::InsertInto($sInsertSQL);
// Note that it is possible to have a key defined here, and the autoincrement expected, this is acceptable in a non root class