Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ require (
github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.1.15
github.com/aws/aws-sdk-go-v2/service/s3 v1.99.0
github.com/aws/smithy-go v1.24.3
github.com/block/mysql v0.0.0-20260906201522-a3178f8dca69
github.com/bndr/gotabulate v1.1.2
github.com/brianvoe/gofakeit/v7 v7.14.1
github.com/dustin/go-humanize v1.0.1
Expand All @@ -121,7 +122,7 @@ require (
)

require (
filippo.io/edwards25519 v1.1.1 // indirect
filippo.io/edwards25519 v1.2.0 // indirect
github.com/DataDog/datadog-agent/comp/core/tagger/origindetection v0.77.3 // indirect
github.com/DataDog/datadog-agent/pkg/opentelemetry-mapping-go/otlp/attributes v0.77.3 // indirect
github.com/DataDog/datadog-agent/pkg/proto v0.77.3 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ cloud.google.com/go/storage v1.62.1 h1:Os0G3XbUbjZumkpDUf2Y0rLoXJTCF1kU2kWUujKYX
cloud.google.com/go/storage v1.62.1/go.mod h1:cpYz/kRVZ+UQAF1uHeea10/9ewcRbxGoGNKsS9daSXA=
cloud.google.com/go/trace v1.13.0 h1:RfqsqPOiSCG8ql50UZt5F65KrVa1zbY9mJrO7xvZfbE=
cloud.google.com/go/trace v1.13.0/go.mod h1:r+bdAn16dKLSV1G2D5v3e58IlQlizfxWrUfjx7kM7X0=
filippo.io/edwards25519 v1.1.1 h1:YpjwWWlNmGIDyXOn8zLzqiD+9TyIlPhGFG96P39uBpw=
filippo.io/edwards25519 v1.1.1/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo=
filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
github.com/Azure/azure-pipeline-go v0.2.3 h1:7U9HBg1JFK3jHl5qmo4CTZKFTVgMwdFHMVtCdfBE21U=
Expand Down Expand Up @@ -156,6 +156,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CDsnE=
github.com/bitfield/gotestdox v0.2.2/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY=
github.com/block/mysql v0.0.0-20260906201522-a3178f8dca69 h1:rCWVZKT5PdrdfosvMavnnfUBAdtaM3iepvADt5pMSJI=
github.com/block/mysql v0.0.0-20260906201522-a3178f8dca69/go.mod h1:KEo73lbxXs9cFlq+x3Z35UqGg3MTxAPfjDOR/ob/iik=
github.com/bndr/gotabulate v1.1.2 h1:yC9izuZEphojb9r+KYL4W9IJKO/ceIO8HDwxMA24U4c=
github.com/bndr/gotabulate v1.1.2/go.mod h1:0+8yUgaPTtLRTjf49E8oju7ojpU11YmXyvq1LbPAb3U=
github.com/brianvoe/gofakeit/v7 v7.14.1 h1:a7fe3fonbj0cW3wgl5VwIKfZtiH9C3cLnwcIXWT7sow=
Expand Down
4 changes: 2 additions & 2 deletions go/vt/topo/mysqltopo/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"path"
"testing"

"github.com/go-sql-driver/mysql"
"github.com/block/mysql"
"github.com/stretchr/testify/require"
"go.uber.org/goleak"

Expand Down Expand Up @@ -125,7 +125,7 @@ func createTestServer(t *testing.T, schemaName string) (*Server, string, func())
schemaName = generateRandomSchemaName()
}
cfg.DBName = "" // to create schema
baseDB, err := sql.Open("mysql", cfg.FormatDSN())
baseDB, err := sql.Open("block-mysql", cfg.FormatDSN())
require.NoError(t, err)

_, err = baseDB.Exec(fmt.Sprintf("CREATE DATABASE IF NOT EXISTS `%s`", schemaName))
Expand Down
6 changes: 3 additions & 3 deletions go/vt/topo/mysqltopo/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"sync/atomic"
"time"

mysqldriver "github.com/go-sql-driver/mysql"
mysqldriver "github.com/block/mysql"

"vitess.io/vitess/go/mysql"
"vitess.io/vitess/go/mysql/replication"
Expand Down Expand Up @@ -209,7 +209,7 @@ func newNotificationSystem(schemaName, serverAddr string) (*notificationSystem,
cfg.TLSConfig = "rds-topo"
}

db, err := sql.Open("mysql", cfg.FormatDSN())
db, err := sql.Open("block-mysql", cfg.FormatDSN())
if err != nil {
return nil, fmt.Errorf("failed to connect to MySQL: %v", err)
}
Expand All @@ -236,7 +236,7 @@ func newNotificationSystem(schemaName, serverAddr string) (*notificationSystem,
// Create connection parameters for binlog streaming
cfg.DBName = schemaName

// Parse host and port from cfg.Addr. The go-sql-driver/mysql DSN allows
// Parse host and port from cfg.Addr. The driver's DSN format allows
// addresses without a port (e.g. `tcp(localhost)/db`); fall back to the
// default MySQL port in that case.
host, portStr, err := net.SplitHostPort(cfg.Addr)
Expand Down
4 changes: 2 additions & 2 deletions go/vt/topo/mysqltopo/notification_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import (
"testing"
"time"

"github.com/go-sql-driver/mysql"
"github.com/block/mysql"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -765,7 +765,7 @@ func TestNotificationSystemReconnection(t *testing.T) {
require.Equal(t, initialData, current.Contents)

// Create a separate connection to monitor and kill connections
monitorDB, err := sql.Open("mysql", mySQLTopoTestAddr)
monitorDB, err := sql.Open("block-mysql", mySQLTopoTestAddr)
require.NoError(t, err)
defer monitorDB.Close()

Expand Down
8 changes: 6 additions & 2 deletions go/vt/topo/mysqltopo/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ import (
"sync"
"time"

"github.com/go-sql-driver/mysql"
// Block's fork of go-sql-driver/mysql, registered as "block-mysql". strata
// links the fork for capabilities upstream does not carry; using it here
// too keeps one driver — and so one *mysql.MySQLError type — in the binary,
// which is what convertError below depends on.
"github.com/block/mysql"
"github.com/spf13/pflag"

"vitess.io/vitess/go/mysql/sqlerror"
Expand Down Expand Up @@ -269,7 +273,7 @@ func connect(cfg *mysql.Config) (*sql.DB, error) {
cfg.TLSConfig = "rds-topo"
}

db, err := sql.Open("mysql", cfg.FormatDSN())
db, err := sql.Open("block-mysql", cfg.FormatDSN())
if err != nil {
return nil, fmt.Errorf("failed to connect to MySQL topo at %s (schema %q, user %q): %v", cfg.Addr, cfg.DBName, cfg.User, err)
}
Expand Down
2 changes: 1 addition & 1 deletion go/vt/topo/mysqltopo/server_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"sync"
"testing"

"github.com/go-sql-driver/mysql"
"github.com/block/mysql"
"github.com/stretchr/testify/require"

"vitess.io/vitess/go/vt/topo"
Expand Down
4 changes: 2 additions & 2 deletions go/vt/topo/mysqltopo/server_resolve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"net"
"testing"

"github.com/go-sql-driver/mysql"
"github.com/block/mysql"
"github.com/stretchr/testify/require"
)

Expand All @@ -36,7 +36,7 @@ func newRawSchema(t *testing.T) (baseDB *sql.DB, schemaDSN, schemaName string, c

schemaName = generateRandomSchemaName()
cfg.DBName = ""
baseDB, err = sql.Open("mysql", cfg.FormatDSN())
baseDB, err = sql.Open("block-mysql", cfg.FormatDSN())
require.NoError(t, err)
_, err = baseDB.Exec(fmt.Sprintf("CREATE DATABASE IF NOT EXISTS `%s`", schemaName))
require.NoError(t, err)
Expand Down
Loading