Skip to content

Commit

Permalink
PMM-12375 use a different syntax for checking the version
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Tymchuk committed Aug 30, 2023
1 parent 911b14d commit 64715ae
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions agent/connectionchecker/connection_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,16 +290,10 @@ func (cc *ConnectionChecker) checkProxySQLConnection(ctx context.Context, dsn st
}

var version string
if err := db.QueryRowContext(
ctx,
"SELECT /* agent='connectionchecker' */ variable_value FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name = 'admin-version'").Scan(&version); err != nil {
err := db.QueryRowContext(
ctx,
"SELECT /* agent='connectionchecker' */ variable_value FROM PERFORMANCE_SCHEMA.GLOBAL_VARIABLES WHERE variable_name = 'admin-version'").Scan(&version)
if err != nil {
res.Error = err.Error()
return &res
}
//nolint:lll
if err := db.QueryRowContext(ctx, "SELECT /* agent='connectionchecker' */ @@GLOBAL.admin-version").Scan(&version); err != nil {
res.Error = err.Error()
return &res
}

res.Stats = &agentpb.CheckConnectionResponse_Stats{
Expand Down

0 comments on commit 64715ae

Please sign in to comment.