Skip to content

Commit

Permalink
PMM-12375 use performance_schema for higher versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Tymchuk committed Aug 30, 2023
1 parent fb745dd commit 911b14d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions agent/connectionchecker/connection_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,17 @@ func (cc *ConnectionChecker) checkProxySQLConnection(ctx context.Context, dsn st
res.Error = err.Error()
}

// if _, err := db.ExecContext(ctx, "USE mysql"); err != nil {
// res.Error = err.Error()
// return &res
// }

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 {
res.Error = err.Error()
return &res
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
}
}

res.Stats = &agentpb.CheckConnectionResponse_Stats{
Expand Down

0 comments on commit 911b14d

Please sign in to comment.