Commit 20f6f336 authored by Carsten  Rose's avatar Carsten Rose

Revert implementation of #8851.

parent 61c76099
Pipeline #3110 passed with stages
in 1 minute and 59 seconds
......@@ -783,7 +783,6 @@ const RANDOM_LENGTH = 32;
// SQL logging Modes
const SQL_LOG_MODE_ALL = 'all';
const SQL_LOG_MODE_MODIFY = 'modify';
const SQL_LOG_MODE_MODIFY_ALL = 'modifyAll';
const SQL_LOG_MODE_NONE = 'none';
const SQL_LOG_MODE_ERROR = 'error';
......
......@@ -50,7 +50,7 @@ class Database {
/**
* @var array
*/
private $sqlLogModePrio = [SQL_LOG_MODE_NONE => 1, SQL_LOG_MODE_ERROR => 2, SQL_LOG_MODE_MODIFY => 3, SQL_LOG_MODE_MODIFY_ALL => 4, SQL_LOG_MODE_ALL => 5];
private $sqlLogModePrio = [SQL_LOG_MODE_NONE => 1, SQL_LOG_MODE_ERROR => 2, SQL_LOG_MODE_MODIFY => 3, SQL_LOG_MODE_ALL => 4];
private $dbName = '';
......@@ -358,9 +358,7 @@ class Database {
*/
private function prepareExecute($sql, array $parameterArray, &$queryType, array &$stat, $specificMessage = '', array $skipErrno = array()) {
// Only log a modify type statement here if sqlLogMode is (at least) modifyAll
// If sqlLogMode is modify, log the statement after it has been executed and we know if there are affected rows.
$sqlLogMode = $this->isSqlModify($sql) ? SQL_LOG_MODE_MODIFY_ALL : SQL_LOG_MODE_ALL;
$sqlLogMode = $this->isSqlModify($sql) ? SQL_LOG_MODE_MODIFY : SQL_LOG_MODE_ALL;
$errno = 0;
$result = 0;
......@@ -489,18 +487,7 @@ class Database {
$this->store->setVar(SYSTEM_SQL_COUNT, $count, STORE_SYSTEM);
}
// Logfile
$pageContentSqlLogMode = $this->store->getVar(SYSTEM_SQL_LOG_MODE, STORE_SYSTEM);
if ($pageContentSqlLogMode == SQL_LOG_MODE_MODIFY && $sqlLogMode == SQL_LOG_MODE_MODIFY_ALL) {
// sqlLogMode modify: need to log query and query result (if count > 0)
if ($count > 0) {
$this->dbLog(SQL_LOG_MODE_MODIFY, $sql, $parameterArray);
$this->dbLog(SQL_LOG_MODE_MODIFY, $msg);
}
} else {
// Query result
$this->dbLog($sqlLogMode, $msg);
}
$this->dbLog($sqlLogMode, $msg);
return $count;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment