Skip to content

Commit b4f5399

Browse files
committed
ProxySQL can failed to check ExistAsWriterOrOffline only affecting 2.2
1 parent 6e25bbe commit b4f5399

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

router/proxysql/proxysql.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (psql *ProxySQL) SetOffline(host string, port string) error {
123123

124124
func (psql *ProxySQL) ExistAsWriterOrOffline(host string, port string) bool {
125125
var exist int
126-
sql := fmt.Sprintf("SELECT 1 FROM mysql_servers WHERE srv_host='%s' AND srv_port='%s' AND hostgroup_id in (666,'%s')", host, port, psql.WriterHG)
126+
sql := fmt.Sprintf("SELECT 1 FROM mysql_servers WHERE hostname='%s' AND port='%s' AND hostgroup_id in (666,'%s')", host, port, psql.WriterHG)
127127
row := psql.Connection.QueryRow(sql)
128128
err := row.Scan(&exist)
129129
if err == nil {

0 commit comments

Comments
 (0)