@@ -15,6 +15,7 @@ import (
1515 chproto "github.com/ClickHouse/ch-go/proto"
1616 "github.com/ClickHouse/clickhouse-go/v2"
1717 "github.com/go-mysql-org/go-mysql/mysql"
18+ "github.com/go-mysql-org/go-mysql/replication"
1819 "github.com/jackc/pgerrcode"
1920 "github.com/jackc/pgx/v5"
2021 "github.com/jackc/pgx/v5/pgconn"
@@ -907,6 +908,17 @@ func TestMySQLBinlogEventExceededMaxAllowedPacket(t *testing.T) {
907908 }, errInfo , "Unexpected error info" )
908909}
909910
911+ func TestMySQLBinlogChecksumMismatch (t * testing.T ) {
912+ err := exceptions .NewMySQLExecuteError (
913+ fmt .Errorf ("failed checksum for WriteRowsEventV2, log pos 12345: %v" , replication .ErrChecksumMismatch ))
914+ errorClass , errInfo := GetErrorClass (t .Context (), fmt .Errorf ("failed in pull records: %w" , err ))
915+ assert .Equal (t , ErrorNotifyBinlogInvalid , errorClass , "Unexpected error class" )
916+ assert .Equal (t , ErrorInfo {
917+ Source : ErrorSourceMySQL ,
918+ Code : "BINLOG_CHECKSUM_MISMATCH" ,
919+ }, errInfo , "Unexpected error info" )
920+ }
921+
910922func TestMySQLExecuteError (t * testing.T ) {
911923 err := exceptions .NewMySQLExecuteError (
912924 tls.RecordHeaderError {Msg : "first record does not look like a TLS handshake" })
0 commit comments