JJakub PliszkaForce migration key for composite chunk boundaries
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Force migration key for composite chunk boundaries | 1 个月前 | |
Force migration key for composite chunk boundaries | 1 个月前 | |
support gbk encoding | 8 年前 | |
Update golangci-lint to v2.11 (#1657) | 5 个月前 | |
Switch all unit tests to use `stretchr/testify` for assertions. | 1 年前 | |
Update golangci-lint to v2.11 (#1657) | 5 个月前 | |
Fix Warning 1300 for varbinary columns with bytes invalid as utf8mb4 (#1661) * Fix Warning 1300 for varbinary columns with bytes invalid as utf8mb4 When gh-ost replays a binlog DML event, the go-mysql library returns varbinary column values as a Go `string` (not `[]byte`). In convertArg, the existing code only converted string → []byte when the column had a non-empty Charset (e.g. utf8mb4 for varchar). varbinary columns have no character set, so Charset is always "", and the string fell through unconverted. The Go MySQL driver sends `string` args as MYSQL_TYPE_VAR_STRING with the connection's utf8mb4 charset metadata attached, causing MySQL to validate the bytes. If a varbinary value (e.g. a binary UUID) contains byte sequences that are invalid utf8mb4, MySQL emits Warning 1300. With gh-ost's panic-on-warnings enabled, this aborts the migration. Fix: add an else-if branch that detects binary storage types by MySQLType (binary, varbinary, *blob) and returns []byte, so the driver sends MYSQL_TYPE_BLOB (binary data) with no charset validation. MySQLType is used rather than Charset == "" alone because test Column objects built via NewColumnList leave MySQLType unset, which would have changed the return type for all no-charset columns in existing tests. In production, inspect.go always populates MySQLType from information_schema.data_type. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Address PR review feedback on varbinary Warning 1300 fix - Use MySQLType "varbinary(16)" in tests instead of bare "varbinary", matching the real value produced by information_schema COLUMN_TYPE (which includes length). Guards against future refactors that might switch from substring matching to exact matching. - Correct test comment: MySQLType is populated from COLUMN_TYPE, not data_type. - Broaden types.go comment to say "the connection's charset/collation metadata (often utf8mb4)" since gh-ost's connection charset is configurable via --charset. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * appease linter --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: meiji163 <meiji163@github.com> | 5 个月前 |