Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Both replicated and not replicated icon shown #19073

Open
M393 opened this issue Mar 21, 2024 · 1 comment
Open

Both replicated and not replicated icon shown #19073

M393 opened this issue Mar 21, 2024 · 1 comment
Labels
affects/5.2 This issue or pull-request affects 5.2.x releases (and maybe further versions) affects/6.0 This issue or pull-request affects 6.0.x releases (and maybe further versions) Bug A problem or regression with an existing feature confirmed/5.2 This issue is confirmed to be reproduced on 5.2 at the time this label was set confirmed/6.0 This issue is confirmed to be reproduced on 6.0 at the time this label was set

Comments

@M393
Copy link
Contributor

M393 commented Mar 21, 2024

Describe the bug

When connecting to a replica mysql server which has tables that are no longer replicated, two icons are shown.
One with tooltip Not replicated and the other with tooltip Replicated, which is a bit confusing.

{% if server_replica_status %}
<td class="text-center">
{{ ignored ? get_image('s_cancel', 'Not replicated'|trans) }}
{{ do ? get_image('s_success', 'Replicated'|trans) }}
</td>
{% endif %}

To Reproduce

Steps to reproduce the behavior:

  1. Go to Database Structure page on a replica server that has tables that are no longer replicated.
  2. See error

Expected behavior

I'd say in this case it would make sense to show only the Not replicated icon.

Additional Info

($nbServReplicaDoDb == 0 && $nbServReplicaIgnoreDb == 0) is true here

private function getReplicationStatus(array $replicaInfo, string $table): array
{
$do = $ignored = false;
if ($replicaInfo['status']) {
$nbServReplicaDoDb = count($replicaInfo['Do_DB']);
$nbServReplicaIgnoreDb = count($replicaInfo['Ignore_DB']);
$searchDoDBInTruename = array_search($table, $replicaInfo['Do_DB']);
$searchDoDBInDB = array_search(Current::$database, $replicaInfo['Do_DB']);
$do = (is_string($searchDoDBInTruename) && $searchDoDBInTruename !== '')
|| (is_string($searchDoDBInDB) && $searchDoDBInDB !== '')
|| ($nbServReplicaDoDb == 0 && $nbServReplicaIgnoreDb == 0)
|| $this->hasTable($replicaInfo['Wild_Do_Table'], $table);

with this json_encode($replicaInfo):

{
    "Do_DB": [],
    "Do_Table": [],
    "Ignore_DB": [],
    "Ignore_Table": [
         "[some unrelated tables]"
    ],
    "status": true,
    "Wild_Do_Table": [],
    "Wild_Ignore_Table": [
        "phpmyadmin.%"
    ]
}

Screenshots

image

Server configuration

  • Database version: MySQl 5.7.44
  • phpMyAdmin version: 5.2.1 / master
@williamdes williamdes added Bug A problem or regression with an existing feature affects/5.2 This issue or pull-request affects 5.2.x releases (and maybe further versions) affects/6.0 This issue or pull-request affects 6.0.x releases (and maybe further versions) confirmed/5.2 This issue is confirmed to be reproduced on 5.2 at the time this label was set confirmed/6.0 This issue is confirmed to be reproduced on 6.0 at the time this label was set labels Mar 25, 2024
@williamdes
Copy link
Member

Thank you for reporting this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/5.2 This issue or pull-request affects 5.2.x releases (and maybe further versions) affects/6.0 This issue or pull-request affects 6.0.x releases (and maybe further versions) Bug A problem or regression with an existing feature confirmed/5.2 This issue is confirmed to be reproduced on 5.2 at the time this label was set confirmed/6.0 This issue is confirmed to be reproduced on 6.0 at the time this label was set
Projects
None yet
Development

No branches or pull requests

2 participants