diff --git a/internal/mysql/data.go b/internal/mysql/data.go index 6fca0c68..8f480073 100644 --- a/internal/mysql/data.go +++ b/internal/mysql/data.go @@ -29,7 +29,7 @@ type readOnlyResult struct { } type ServerUUIDResult struct { - ServerUUID string `db:"@@server_uuid"` + ServerUUID string `db:"server_uuid"` } // CascadeNodeConfiguration is a dcs node configuration for cascade mysql replica diff --git a/internal/mysql/node.go b/internal/mysql/node.go index a373a9af..0ac26ca9 100644 --- a/internal/mysql/node.go +++ b/internal/mysql/node.go @@ -607,7 +607,7 @@ func (n *Node) GetBinlogs() ([]Binlog, error) { // UUID returns server_uuid func (n *Node) UUID() (uuid.UUID, error) { var r ServerUUIDResult - err := n.queryRow(queryIsReadOnly, nil, &r) + err := n.queryRow(queryGetUUID, nil, &r) if err != nil { return uuid.UUID{}, err } diff --git a/internal/mysql/queries.go b/internal/mysql/queries.go index 558ca352..f5c596ba 100644 --- a/internal/mysql/queries.go +++ b/internal/mysql/queries.go @@ -54,7 +54,7 @@ var DefaultQueries = map[string]string{ queryReplicaStatus: `SHOW REPLICA STATUS FOR CHANNEL :channel`, queryGetVersion: `SELECT sys.version_major() AS MajorVersion, sys.version_minor() AS MinorVersion, sys.version_patch() AS PatchVersion`, queryGTIDExecuted: `SELECT @@GLOBAL.gtid_executed as Executed_Gtid_Set`, - queryGetUUID: `SELECT @@server_uuid`, + queryGetUUID: `SELECT @@server_uuid as server_uuid`, queryShowBinaryLogs: `SHOW BINARY LOGS`, querySlaveHosts: `SHOW SLAVE HOSTS`, queryReplicationLag: ``,