mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-02 23:54:12 +01:00
Optimized the setup (not only), shortened to 37s (used to be 120s)
- DBObject::DBInsert(Tracked)NoReload() must be used when it is not required to use the object - MetaModel::GetObject() has a cache, the operation is 5 times faster - Changes tracking do not store the initial value, but only value changes Reworked the CSV import to have it rely on the bulk change API Bulk change to check the external keys (DB integrity) Replaced trigger_error (Core only!) by the use of Exceptions (still, some new Exception classes should be defined) Unit tests do display the call stack in a user friendly format SVN:code[52]
This commit is contained in:
@@ -46,7 +46,7 @@ class SQLQuery
|
||||
{
|
||||
if (!CMDBSource::IsTable($sTable))
|
||||
{
|
||||
trigger_error("Unknown table '$sTable'", E_USER_ERROR);
|
||||
throw new CoreException("Unknown table '$sTable'");
|
||||
}
|
||||
// $aFields must be an array of "alias"=>"expr"
|
||||
// $oConditionExpr must be a condition tree
|
||||
@@ -137,7 +137,7 @@ class SQLQuery
|
||||
assert((get_class($oSQLQuery) == __CLASS__) || is_subclass_of($oSQLQuery, __CLASS__));
|
||||
if (!CMDBSource::IsField($this->m_sTable, $sLeftField))
|
||||
{
|
||||
trigger_error("Unknown field '$sLeftField' in table '".$this->m_sTable, E_USER_ERROR);
|
||||
throw new CoreException("Unknown field '$sLeftField' in table '".$this->m_sTable);
|
||||
}
|
||||
if (empty($sRightTableAlias))
|
||||
{
|
||||
@@ -147,7 +147,7 @@ class SQLQuery
|
||||
//
|
||||
// if (!CMDBSource::IsField($sRightTable, $sRightField))
|
||||
// {
|
||||
// trigger_error("Unknown field '$sRightField' in table '".$sRightTable."'", E_USER_ERROR);
|
||||
// throw new CoreException("Unknown field '$sRightField' in table '".$sRightTable."'");
|
||||
// }
|
||||
|
||||
$this->m_aJoinSelects[] = array(
|
||||
@@ -187,7 +187,7 @@ class SQLQuery
|
||||
if ($this->m_oConditionExpr->IsAny())
|
||||
-- if (count($aConditions) == 0) --
|
||||
{
|
||||
trigger_error("Building a request wich will delete every object of a given table -looks suspicious- please use truncate instead...", E_USER_ERROR);
|
||||
throw new CoreException("Building a request wich will delete every object of a given table -looks suspicious- please use truncate instead...");
|
||||
}
|
||||
*/
|
||||
$sWhere = self::ClauseWhere($oCondition);
|
||||
@@ -277,7 +277,7 @@ class SQLQuery
|
||||
$sFrom .= ") ON ".$aJoinInfo["joincondition"];
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unknown jointype: '".$aJoinInfo["jointype"]."'");
|
||||
throw new CoreException("Unknown jointype: '".$aJoinInfo["jointype"]."'");
|
||||
}
|
||||
}
|
||||
return $sFrom;
|
||||
|
||||
Reference in New Issue
Block a user