Skip to content

Commit e03b778

Browse files
committed
Skip connectAttrs test if performance_schema is disabled
1 parent 05f15c1 commit e03b778

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

driver_test.go

+8-5
Original file line numberDiff line numberDiff line change
@@ -2086,17 +2086,20 @@ func TestConnectAttrs(t *testing.T) {
20862086
defer db.Close()
20872087
dbt := &DBTest{t, db}
20882088

2089-
// performance_schema seems to be updated with a delay in some conditions, so first see if we are in list:
2090-
rows := dbt.mustQuery("SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST where ID=CONNECTION_ID()")
2089+
rows := dbt.mustQuery("SHOW VARIABLES LIKE 'performance_schema'")
20912090
if rows.Next() {
2091+
var var_name, value string
2092+
rows.Scan(&var_name, &value)
2093+
if value != "ON" {
2094+
t.Skip("performance_schema is disabled")
2095+
}
20922096
} else {
2093-
dbt.Error("no data in processlist")
2097+
t.Skip("no performance_schema variable in mysql")
20942098
}
20952099

20962100
rows, err = dbt.db.Query("select attr_value from performance_schema.session_connect_attrs where processlist_id=CONNECTION_ID() and attr_name='program_name'")
20972101
if err != nil {
2098-
fmt.Println(err)
2099-
dbt.Skip("server probably does not support performance_schema.session_connect_attrs")
2102+
dbt.Skipf("server probably does not support performance_schema.session_connect_attrs: %s", err)
21002103
}
21012104

21022105
if rows.Next() {

0 commit comments

Comments
 (0)