Skip to content

Commit 5a4af02

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 5a4a3e7 + 7034681 commit 5a4af02

6 files changed

Lines changed: 100 additions & 114 deletions

File tree

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ phpMyAdmin - ChangeLog
3939
- issue #12144 Fixed parsing of some AS clauses
4040
- issue #12205 Fixed parsing of FULL OUTER JOIN queries
4141
- issue #12171 Fixed editing of VIEW structure
42+
- issue #12208 Avoid printing executed queries on import
4243

4344
4.6.0.0 (2016-03-22)
4445
+ issue #11456 Disabled storage engines

doc/config.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2962,6 +2962,14 @@ Developer
29622962
Enable logging queries and execution times to be
29632963
displayed in the console's Debug SQL tab.
29642964

2965+
.. config:option:: $cfg['DBG']['sqllog']
2966+
2967+
:type: boolean
2968+
:default: false
2969+
2970+
Enable logging of queries and execution times to the syslog.
2971+
Requires :config:option:`$cfg['DBG']['sql']` to be enabled.
2972+
29652973
.. config:option:: $cfg['DBG']['demo']
29662974
29672975
:type: boolean

libraries/DatabaseInterface.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ private function _dbgQuery($query, $link, $result, $time)
235235
public function tryQuery($query, $link = null, $options = 0,
236236
$cache_affected_rows = true
237237
) {
238-
$debug = isset($GLOBALS['cfg']['DBG']['sql']) && $GLOBALS['cfg']['DBG']['sql'];
238+
$debug = $GLOBALS['cfg']['DBG']['sql'];
239239
$link = $this->getLink($link);
240240
if ($link === false) {
241241
return false;
@@ -254,7 +254,14 @@ public function tryQuery($query, $link = null, $options = 0,
254254
if ($debug) {
255255
$time = microtime(true) - $time;
256256
$this->_dbgQuery($query, $link, $result, $time);
257-
syslog(LOG_WARNING, 'SQL: ' . sprintf('%0.3f', $time) . ' > ' . $query);
257+
if ($GLOBALS['cfg']['DBG']['sqllog']) {
258+
openlog('phpMyAdmin', LOG_NDELAY | LOG_PID, LOG_USER);
259+
syslog(
260+
LOG_INFO,
261+
'SQL[' . basename($_SERVER['SCRIPT_NAME']) . ']: '
262+
. sprintf('%0.3f', $time) . ' > ' . $query
263+
);
264+
}
258265
}
259266

260267
if ((!empty($result)) && (Tracker::isActive())) {

libraries/Menu.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ private function _getMenu()
127127
*/
128128
private function _getAllowedTabs($level)
129129
{
130+
$cache_key = 'menu-levels-' . $level;
131+
if (Util::cacheExists($cache_key)) {
132+
return Util::cacheGet($cache_key);
133+
}
130134
$allowedTabs = Util::getMenuTabList($level);
131135
$cfgRelation = PMA_getRelationsParam();
132136
if ($cfgRelation['menuswork']) {
@@ -154,6 +158,7 @@ private function _getAllowedTabs($level)
154158
}
155159
}
156160
}
161+
Util::cacheSet($cache_key, $allowedTabs);
157162
return $allowedTabs;
158163
}
159164

libraries/config.default.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3071,6 +3071,13 @@
30713071
*/
30723072
$cfg['DBG']['sql'] = false;
30733073

3074+
/**
3075+
* Log executed queries and their execution times to syslog
3076+
*
3077+
* @global boolean $cfg['DBG']['sql']
3078+
*/
3079+
$cfg['DBG']['sqllog'] = false;
3080+
30743081
/**
30753082
* Enable to let server present itself as demo server.
30763083
*

0 commit comments

Comments
 (0)