Skip to content

func (c *canal.Canal) GetMasterPos() always errors when using the mariadb flavor on latest mariadb v11 #1029

Closed
@alarbada

Description

@alarbada

When running func (c *canal.Canal) GetMasterPos() with a cfg.Flavor = "mariadb", the method always fails with the following error:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LOG STATUS' at line 1

It always fails because these lines assume only mysql versions, excluding mariadb.

The proper way to get the master position is either using SHOW MASTER STATUS for mariadb version previous than 10.5.2 or the more recent SHOW BINLOG STATUS. Here's the source.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions