Skip to content

Commit

Permalink
MySQL 8.4 (#18571)
Browse files Browse the repository at this point in the history
  • Loading branch information
sethsamuel authored Sep 12, 2024
1 parent f90915c commit f70bcfa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions mysql/changelog.d/18571.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug in MySQL 8.4 where `SHOW MASTER STATUS` would fail
6 changes: 5 additions & 1 deletion mysql/datadog_checks/mysql/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,11 @@ def _get_replica_stats(self, db, is_mariadb, replication_channel):

try:
with closing(db.cursor(CommenterDictCursor)) as cursor:
cursor.execute("SHOW MASTER STATUS;")
if not self.is_mariadb and self.version.version_compatible((8, 4, 0)):
cursor.execute("SHOW BINARY LOG STATUS;")
else:
cursor.execute("SHOW MASTER STATUS;")

binlog_results = cursor.fetchone()
if binlog_results:
replica_results.update({'Binlog_enabled': True})
Expand Down
3 changes: 3 additions & 0 deletions mysql/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ python = ["3.11"]
version = [
"5.7", # EOL October 21, 2023
"8.0.36", # EOL April, 2026
"8.4.0",
]

[[envs.default.matrix]]
Expand All @@ -40,11 +41,13 @@ version = [
[envs.default.overrides]
matrix.version.env-vars = [
{ key = "COMPOSE_FILE", value = "mysql8.yaml", if = ["8.0.36"] },
{ key = "COMPOSE_FILE", value = "mysql8.yaml", if = ["8.4.0"] },
]
name."8.0-group".env-vars = [
{ key = "COMPOSE_FILE", value = "mysql8-group.yaml" },
]


[envs.default.env-vars]
COMPOSE_FILE = "{matrix:flavor:mysql}.yaml"
MYSQL_FLAVOR = "{matrix:flavor:mysql}"
Expand Down

0 comments on commit f70bcfa

Please sign in to comment.