feat: adds support for mariadb show binlog status statement

This commit is contained in:
Dennis Urtubia 2024-05-30 09:33:53 -03:00
parent dddce3f55f
commit 351e031d42
2 changed files with 6 additions and 2 deletions

View file

@ -1,4 +1,4 @@
---
minor_changes:
- mysql_replication - Adds support for `SHOW BINARY LOG STATUS` on getprimary mode.
- mysql_replication - Adds support for `SHOW BINARY LOG STATUS` and `SHOW BINLOG STATUS` on getprimary mode.

View file

@ -316,9 +316,13 @@ def get_primary_status(cursor):
term = "MASTER"
version = get_server_version(cursor)
if get_server_implementation(cursor) == "mysql" and LooseVersion(version) >= LooseVersion("8.2.0"):
server_implementation = get_server_implementation(cursor)
if server_implementation == "mysql" and LooseVersion(version) >= LooseVersion("8.2.0"):
term = "BINARY LOG"
if server_implementation == "mariadb" and LooseVersion(version) >= LooseVersion("10.5.2"):
term = "BINLOG"
cursor.execute("SHOW %s STATUS" % term)
primarystatus = cursor.fetchone()