You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* mysqltopo: use the block-mysql driver
strata links github.com/block/mysql — Block's fork of go-sql-driver/mysql —
for capabilities upstream does not carry. That fork is moving from a `replace`
directive to its own module path (block/mysql#3), because `replace` is not
inherited across module boundaries and so cannot reach consumers of a library.
Once the path differs, a binary linking both packages gets two distinct
`*mysql.MySQLError` types, and `errors.As` across that boundary silently
returns false. convertError here depends on exactly that assertion to map 1062
to NodeExists and 1213/1205 to Timeout, and strata's own test helpers assert on
the errors this package returns — so mysqltopo and strata must agree on which
package the type comes from.
Scope is deliberately mysqltopo only: it is Block-added, so editing it costs
nothing when merging upstream vitess. The remaining go-sql-driver imports live
in upstream-owned endtoend tests, which keep using upstream — the module stays
in go.mod and both can coexist.
The dependency is pinned to the block/mysql PR branch and must be re-pointed at
its master commit before this merges.
Verified: go/vt/topo/mysqltopo tests pass against MySQL 8.0.44.
* go mod tidy: block/mysql is a direct dependency now
* Pin block/mysql at merged master (block/mysql#3)
* mysqltopo: state the driver invariant this package actually holds
The import comment claimed one driver in the binary; eight end-to-end test
files still import go-sql-driver, so that is false. The local invariant is
both true and sufficient: every *sql.DB this package opens uses the driver
whose *mysql.MySQLError convertError asserts on.
Add a package const for the name and use it at all five sql.Open sites, so
that invariant is one grep rather than five, and fix the convertError comment
to credit block-mysql.
0 commit comments