Skip to content

Commit 065d6d6

Browse files
committed
Merge branch 'QA_5_2'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2 parents 11e34a6 + 3412fb2 commit 065d6d6

7 files changed

Lines changed: 50 additions & 27 deletions

File tree

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ phpMyAdmin - ChangeLog
1111
- issue #17496 Fix error in table operation page when partitions are broken
1212
- issue #17386 Fix system memory and system swap values on Windows
1313
- issue #17517 Fix Database Server panel not getting hidden by ShowServerInfo configuration directive
14+
- issue #17271 Fix database names not showing on Processes tab
1415

1516
5.2.0 (2022-05-10)
1617
- issue #16521 Upgrade Bootstrap to version 5

libraries/classes/Server/Status/Processes.php

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,26 +70,21 @@ public function getList(array $params): array
7070
while ($process = $result->fetchAssoc()) {
7171
// Array keys need to modify due to the way it has used
7272
// to display column values
73-
if (
74-
(! empty($params['order_by_field']) && ! empty($params['sort_order']))
75-
|| ! empty($params['showExecuting'])
76-
) {
77-
foreach (array_keys($process) as $key) {
78-
$newKey = ucfirst(mb_strtolower($key));
79-
if ($newKey === $key) {
80-
continue;
81-
}
82-
83-
$process[$newKey] = $process[$key];
84-
unset($process[$key]);
73+
foreach (array_keys($process) as $key) {
74+
$newKey = ucfirst(mb_strtolower($key));
75+
if ($newKey === $key) {
76+
continue;
8577
}
78+
79+
$process[$newKey] = $process[$key];
80+
unset($process[$key]);
8681
}
8782

8883
$rows[] = [
8984
'id' => $process['Id'],
9085
'user' => $process['User'],
9186
'host' => $process['Host'],
92-
'db' => ! isset($process['db']) || strlen($process['db']) === 0 ? '' : $process['db'],
87+
'db' => ! isset($process['Db']) || strlen($process['Db']) === 0 ? '' : $process['Db'],
9388
'command' => $process['Command'],
9489
'time' => $process['Time'],
9590
'state' => ! empty($process['State']) ? $process['State'] : '---',
@@ -124,7 +119,7 @@ private function getSortableColumnsForProcessList(bool $showFullSql, array $para
124119
],
125120
[
126121
'column_name' => __('Database'),
127-
'order_by_field' => 'db',
122+
'order_by_field' => 'Db',
128123
],
129124
[
130125
'column_name' => __('Command'),
@@ -138,14 +133,18 @@ private function getSortableColumnsForProcessList(bool $showFullSql, array $para
138133
'column_name' => __('Status'),
139134
'order_by_field' => 'State',
140135
],
141-
[
136+
];
137+
138+
if ($this->dbi->isMariaDB()) {
139+
$sortableColumns[] = [
142140
'column_name' => __('Progress'),
143141
'order_by_field' => 'Progress',
144-
],
145-
[
146-
'column_name' => __('SQL query'),
147-
'order_by_field' => 'Info',
148-
],
142+
];
143+
}
144+
145+
$sortableColumns[] = [
146+
'column_name' => __('SQL query'),
147+
'order_by_field' => 'Info',
149148
];
150149

151150
$sortableColCount = count($sortableColumns);

psalm-baseline.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12783,6 +12783,9 @@
1278312783
<MixedOperand occurrences="1">
1278412784
<code>$params['sort_order']</code>
1278512785
</MixedOperand>
12786+
<RedundantCondition occurrences="1">
12787+
<code>0 !== --$sortableColCount</code>
12788+
</RedundantCondition>
1278612789
</file>
1278712790
<file src="libraries/classes/Session.php">
1278812791
<MixedArgument occurrences="3">

templates/server/status/processes/list.twig

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,39 @@
4545
</a>
4646
</td>
4747
<td class="font-monospace text-end">{{ row.id }}</td>
48-
<td>{{ row.user }}</td>
48+
<td>
49+
{% if row.user != 'system user' %}
50+
<a href="{{ url('/server/privileges', {
51+
'username': row.user,
52+
'hostname': row.host,
53+
'dbname': row.db,
54+
'tablename': '',
55+
'routinename': '',
56+
}) }}">
57+
{{ row.user }}
58+
</a>
59+
{% else %}
60+
{{ row.user }}
61+
{% endif %}
62+
</td>
4963
<td>{{ row.host }}</td>
5064
<td>
5165
{% if row.db != '' %}
52-
{{ row.db }}
66+
<a href="{{ url('/database/structure', {
67+
'db': row.db,
68+
}) }}">
69+
{{ row.db }}
70+
</a>
5371
{% else %}
5472
<em>{% trans 'None' %}</em>
5573
{% endif %}
5674
</td>
5775
<td>{{ row.command }}</td>
5876
<td class="font-monospace text-end">{{ row.time }}</td>
5977
<td>{{ row.state }}</td>
60-
<td>{{ row.progress }}</td>
78+
{% if is_mariadb %}
79+
<td>{{ row.progress }}</td>
80+
{% endif %}
6181
<td>{{ row.info|raw }}</td>
6282
{% endfor %}
6383
</tbody>

test/classes/Controllers/Server/Status/Processes/RefreshControllerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testRefresh(): void
4646
'User' => 'User1',
4747
'Host' => 'Host1',
4848
'Id' => 'Id1',
49-
'db' => 'db1',
49+
'Db' => 'db1',
5050
'Command' => 'Command1',
5151
'Info' => 'Info1',
5252
'State' => 'State1',
@@ -95,7 +95,7 @@ public function testRefresh(): void
9595

9696
//validate 4: $process['db']
9797
$this->assertStringContainsString(
98-
__('None'),
98+
$process['Db'],
9999
$html
100100
);
101101

test/classes/Controllers/Server/Status/ProcessesControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function testIndex(): void
7777

7878
$_POST['full'] = '1';
7979
$_POST['column_name'] = 'Database';
80-
$_POST['order_by_field'] = 'db';
80+
$_POST['order_by_field'] = 'Db';
8181
$_POST['sort_order'] = 'ASC';
8282

8383
$this->dummyDbi->addSelectDb('mysql');

test/classes/Stubs/DbiDummy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2334,7 +2334,7 @@ private function init(): void
23342334
'result' => [['Id1', 'User1', 'Host1', 'db1', 'Command1', 'Time1', 'State1', 'Info1']],
23352335
],
23362336
[
2337-
'query' => 'SELECT * FROM `INFORMATION_SCHEMA`.`PROCESSLIST` ORDER BY `db` ASC',
2337+
'query' => 'SELECT * FROM `INFORMATION_SCHEMA`.`PROCESSLIST` ORDER BY `Db` ASC',
23382338
'columns' => ['Id', 'User', 'Host', 'db', 'Command', 'Time', 'State', 'Info'],
23392339
'result' => [['Id1', 'User1', 'Host1', 'db1', 'Command1', 'Time1', 'State1', 'Info1']],
23402340
],

0 commit comments

Comments
 (0)