diff --git a/agent/runner/actions/mysql_explain_action_test.go b/agent/runner/actions/mysql_explain_action_test.go index ecc628fbe4..1d381b6ece 100644 --- a/agent/runner/actions/mysql_explain_action_test.go +++ b/agent/runner/actions/mysql_explain_action_test.go @@ -161,9 +161,9 @@ func TestMySQLExplain(t *testing.T) { assert.Contains(t, actual[0], "Extra") // Checks some stable values - assert.Equal(t, actual[1][0], "1") // id - assert.Equal(t, actual[1][1], "SIMPLE") // select_type - assert.Equal(t, actual[1][2], "city") // table + assert.Equal(t, float64(1), actual[1][0]) // id + assert.Equal(t, "SIMPLE", actual[1][1]) // select_type + assert.Equal(t, "city", actual[1][2]) // table }) t.Run("Error", func(t *testing.T) { diff --git a/agent/runner/actions/mysql_show_index_action_test.go b/agent/runner/actions/mysql_show_index_action_test.go index 00fdbf83b9..25fd424d1e 100644 --- a/agent/runner/actions/mysql_show_index_action_test.go +++ b/agent/runner/actions/mysql_show_index_action_test.go @@ -70,32 +70,32 @@ func TestMySQLShowIndex(t *testing.T) { "Table", "Non_unique", "Key_name", "Seq_in_index", "Column_name", "Collation", "Cardinality", "Sub_part", "Packed", "Null", "Index_type", "Comment", "Index_comment", "Ignored", }, actual[0]) - assert.Equal(t, []interface{}{"city", "0", "PRIMARY", "1", "ID", "A", "CARDINALITY", nil, nil, "", "BTREE", "", "", "NO"}, actual[1]) - assert.Equal(t, []interface{}{"city", "1", "CountryCode", "1", "CountryCode", "A", "CARDINALITY", nil, nil, "", "BTREE", "", "", "NO"}, actual[2]) + assert.Equal(t, []interface{}{"city", float64(0), "PRIMARY", float64(1), "ID", "A", "CARDINALITY", nil, nil, "", "BTREE", "", "", "NO"}, actual[1]) + assert.Equal(t, []interface{}{"city", float64(1), "CountryCode", float64(1), "CountryCode", "A", "CARDINALITY", nil, nil, "", "BTREE", "", "", "NO"}, actual[2]) case mySQLVersion.String() == "5.6" || mySQLVendor == version.MariaDBVendor: assert.Equal(t, []interface{}{ "Table", "Non_unique", "Key_name", "Seq_in_index", "Column_name", "Collation", "Cardinality", "Sub_part", "Packed", "Null", "Index_type", "Comment", "Index_comment", }, actual[0]) - assert.Equal(t, []interface{}{"city", "0", "PRIMARY", "1", "ID", "A", "CARDINALITY", nil, nil, "", "BTREE", "", ""}, actual[1]) - assert.Equal(t, []interface{}{"city", "1", "CountryCode", "1", "CountryCode", "A", "CARDINALITY", nil, nil, "", "BTREE", "", ""}, actual[2]) + assert.Equal(t, []interface{}{"city", float64(0), "PRIMARY", float64(1), "ID", "A", "CARDINALITY", nil, nil, "", "BTREE", "", ""}, actual[1]) + assert.Equal(t, []interface{}{"city", float64(1), "CountryCode", float64(1), "CountryCode", "A", "CARDINALITY", nil, nil, "", "BTREE", "", ""}, actual[2]) case mySQLVersion.String() == "5.7": assert.Equal(t, []interface{}{ "Table", "Non_unique", "Key_name", "Seq_in_index", "Column_name", "Collation", "Cardinality", "Sub_part", "Packed", "Null", "Index_type", "Comment", "Index_comment", }, actual[0]) - assert.Equal(t, []interface{}{"city", "0", "PRIMARY", "1", "ID", "A", "CARDINALITY", nil, nil, "", "BTREE", "", ""}, actual[1]) - assert.Equal(t, []interface{}{"city", "1", "CountryCode", "1", "CountryCode", "A", "CARDINALITY", nil, nil, "", "BTREE", "", ""}, actual[2]) + assert.Equal(t, []interface{}{"city", float64(0), "PRIMARY", float64(1), "ID", "A", "CARDINALITY", nil, nil, "", "BTREE", "", ""}, actual[1]) + assert.Equal(t, []interface{}{"city", float64(1), "CountryCode", float64(1), "CountryCode", "A", "CARDINALITY", nil, nil, "", "BTREE", "", ""}, actual[2]) case mySQLVersion.String() == "8.0": assert.Equal(t, []interface{}{ "Table", "Non_unique", "Key_name", "Seq_in_index", "Column_name", "Collation", "Cardinality", "Sub_part", "Packed", "Null", "Index_type", "Comment", "Index_comment", "Visible", "Expression", }, actual[0]) - assert.Equal(t, []interface{}{"city", "0", "PRIMARY", "1", "ID", "A", "CARDINALITY", nil, nil, "", "BTREE", "", "", "YES", nil}, actual[1]) - assert.Equal(t, []interface{}{"city", "1", "CountryCode", "1", "CountryCode", "A", "CARDINALITY", nil, nil, "", "BTREE", "", "", "YES", nil}, actual[2]) + assert.Equal(t, []interface{}{"city", float64(0), "PRIMARY", float64(1), "ID", "A", "CARDINALITY", nil, nil, "", "BTREE", "", "", "YES", nil}, actual[1]) + assert.Equal(t, []interface{}{"city", float64(1), "CountryCode", float64(1), "CountryCode", "A", "CARDINALITY", nil, nil, "", "BTREE", "", "", "YES", nil}, actual[2]) default: t.Fatal("Unhandled version.") diff --git a/go.mod b/go.mod index acdeaaa28d..83990675c6 100644 --- a/go.mod +++ b/go.mod @@ -39,7 +39,7 @@ require ( github.com/go-openapi/strfmt v0.23.0 github.com/go-openapi/swag v0.23.0 github.com/go-openapi/validate v0.24.0 - github.com/go-sql-driver/mysql v1.7.1 + github.com/go-sql-driver/mysql v1.8.1 github.com/golang-migrate/migrate/v4 v4.17.0 github.com/google/uuid v1.6.0 github.com/grafana/grafana-api-golang-client v0.27.0 @@ -97,6 +97,7 @@ require ( ) require ( + filippo.io/edwards25519 v1.1.0 // indirect github.com/Azure/azure-pipeline-go v0.2.3 // indirect github.com/Azure/azure-storage-blob-go v0.14.0 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect diff --git a/go.sum b/go.sum index ba1e91dbed..54c2bbefae 100644 --- a/go.sum +++ b/go.sum @@ -31,6 +31,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/3rf/mongo-lint v0.0.0-20140604191638-3550fdcf1f43/go.mod h1:ggh9ZlgUveoGPv/xlt2+6f/bGVEl/h+WlV4LX/dyxEI= github.com/AlekSi/pointer v1.1.0/go.mod h1:y7BvfRI3wXPWKXEBhU71nbnIEEZX0QTSB2Bj48UJIZE= github.com/AlekSi/pointer v1.2.0 h1:glcy/gc4h8HnG2Z3ZECSzZ1IX1x2JxRVuDzaJwQE0+w= @@ -283,8 +285,8 @@ github.com/go-openapi/validate v0.24.0/go.mod h1:iyeX1sEufmv3nPbBdX3ieNviWnOZaJ1 github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= -github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= +github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=