Skip to content

Commit c32c655

Browse files
author
Guillem
committed
improve docs
1 parent dcabb57 commit c32c655

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

canal/sync.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,17 +324,21 @@ func (c *Canal) WaitUntilPos(pos mysql.Position, timeout time.Duration) error {
324324
}
325325
}
326326

327+
// getShowBinaryLogQuery returns the correct SQL statement to query binlog status
328+
// for the given database flavor and server version.
329+
//
330+
// Sources:
331+
//
332+
// MySQL: https://dev.mysql.com/doc/relnotes/mysql/8.4/en/news-8-4-0.html
333+
// MariaDB: https://mariadb.com/kb/en/show-binlog-status
327334
func getShowBinaryLogQuery(flavor, serverVersion string) string {
328335
switch flavor {
329336
case mysql.MariaDBFlavor:
330-
// Source: https://mariadb.com/kb/en/show-binlog-status/#:~:text=SHOW%20BINLOG%20STATUS%20%2D%2D-,From%20MariaDB%2010.5.2,-Description
331-
332337
eq, err := mysql.CompareServerVersions(serverVersion, "10.5.2")
333338
if (err == nil) && (eq >= 0) {
334339
return "SHOW BINLOG STATUS"
335340
}
336341
case mysql.MySQLFlavor:
337-
// Source: https://dev.mysql.com/doc/relnotes/mysql/8.4/en/news-8-4-0.html#:~:text=AND%20GTIDS)%3B-,SHOW%20MASTER%20STATUS,-(SHOW%20BINARY
338342
eq, err := mysql.CompareServerVersions(serverVersion, "8.4.0")
339343
if (err == nil) && (eq >= 0) {
340344
return "SHOW BINARY LOG STATUS"

0 commit comments

Comments
 (0)