Skip to content

Commit

Permalink
Merge pull request #1058 from cebe/1000-cdbcommand-profiling-params
Browse files Browse the repository at this point in the history
added params to profiling token, on paramlogging
  • Loading branch information
qiangxue committed Jul 29, 2012
2 parents 30b1d6e + 691550b commit 53b1ab4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -36,6 +36,7 @@ Version 1.1.11 work in progress
- Bug #865: CLogRoute called processLogs() even if log array was empty and caused empty emails and log files (cebe)
- Bug #879: Fixed a possible PHP error caused by CWebUser::restoreFromCookie() in combination with CHttpRequest.enableCookieValidation (kidol)
- Bug #901: Fixed possible encoding problem on exception (mdomba, samdark, cebe)
- Bug #1000: Added params to profiling token in CDbCommand::execute() to be consitent with CDbCommand::queryInternal() (cebe)
- Bug #1045: Building a query with empty array as parameter will not result in a broken sql-string anymore(suralc)
- Bug: Fixed CMenu::isItemActive() to work properly when there is a hash in the item's url (SlKelevro)
- Bug: Added missing return statement to CAuthItem->revoke() (mdomba)
Expand Down
6 changes: 3 additions & 3 deletions framework/db/CDbCommand.php
Expand Up @@ -327,7 +327,7 @@ public function execute($params=array())
try
{
if($this->_connection->enableProfiling)
Yii::beginProfile('system.db.CDbCommand.execute('.$this->getText().')','system.db.CDbCommand.execute');
Yii::beginProfile('system.db.CDbCommand.execute('.$this->getText().$par.')','system.db.CDbCommand.execute');

$this->prepare();
if($params===array())
Expand All @@ -337,14 +337,14 @@ public function execute($params=array())
$n=$this->_statement->rowCount();

if($this->_connection->enableProfiling)
Yii::endProfile('system.db.CDbCommand.execute('.$this->getText().')','system.db.CDbCommand.execute');
Yii::endProfile('system.db.CDbCommand.execute('.$this->getText().$par.')','system.db.CDbCommand.execute');

return $n;
}
catch(Exception $e)
{
if($this->_connection->enableProfiling)
Yii::endProfile('system.db.CDbCommand.execute('.$this->getText().')','system.db.CDbCommand.execute');
Yii::endProfile('system.db.CDbCommand.execute('.$this->getText().$par.')','system.db.CDbCommand.execute');
$errorInfo = $e instanceof PDOException ? $e->errorInfo : null;
$message = $e->getMessage();
Yii::log(Yii::t('yii','CDbCommand::execute() failed: {error}. The SQL statement executed was: {sql}.',
Expand Down

0 comments on commit 53b1ab4

Please sign in to comment.