Skip to content

replication - just return an error not logging it #764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

atercattus
Copy link
Member

A successfully passed test with output

[2023/01/28 12:32:53] [error] row_event.go:910 parse rows event panic runtime error: index out of range [7] with length 7, data "@\x01\x00\x00\x00\x00\x01\x00\x02\xff\xfc\x01\x00\x00\x00\x00B\x14U\x16\x8ew", parsed rows &replication.RowsEvent{Version:1, tableIDSize:6, tables:map[uint64]*replication.TableMapEvent{0x140:(*replication.TableMapEvent)(0xc000242200)}, needBitmap2:false, Table:(*replication.TableMapEvent)(0xc000242200), TableID:0x140, Flags:0x1, ExtraData:[]uint8(nil), ColumnCount:0x2, ColumnBitmap1:[]uint8{0xff}, ColumnBitmap2:[]uint8(nil), Rows:[][]interface {}{}, SkippedColumns:[][]int{}, parseTime:false, timestampStringLocation:(*time.Location)(nil), useDecimal:false, ignoreJSONDecodeErr:false}, table map &replication.TableMapEvent{flavor:"", tableIDSize:6, TableID:0x140, Flags:0x1, Schema:[]uint8{0x74, 0x65, 0x73, 0x74}, Table:[]uint8{0x74}, ColumnCount:0x2, ColumnType:[]uint8{0x3, 0xc}, ColumnMeta:[]uint16{0x0, 0x0}, NullBitmap:[]uint8{0x2}, SignednessBitmap:[]uint8(nil), DefaultCharset:[]uint64(nil), ColumnCharset:[]uint64(nil), SetStrValue:[][][]uint8(nil), setStrValueString:[][]string(nil), EnumStrValue:[][][]uint8(nil), enumStrValueString:[][]string(nil), ColumnName:[][]uint8(nil), columnNameString:[]string(nil), GeometryType:[]uint64(nil), PrimaryKey:[]uint64(nil), PrimaryKeyPrefix:[]uint64(nil), EnumSetDefaultCharset:[]uint64(nil), EnumSetColumnCharset:[]uint64(nil)}
goroutine 124 [running]:
github.com/go-mysql-org/go-mysql/mysql.Pstack(...)
	.../go-mysql/mysql/util.go:22
github.com/go-mysql-org/go-mysql/replication.(*RowsEvent).DecodeData.func1()
	.../go-mysql/replication/row_event.go:910 +0x17c
panic({0x9cdf40, 0xc00021a078})
	.../go/src/runtime/panic.go:890 +0x262
encoding/binary.littleEndian.Uint64(...)
	.../go/src/encoding/binary/binary.go:102
github.com/go-mysql-org/go-mysql/replication.(*RowsEvent).decodeValue(0xc00023b110, {0xc00021a06f, 0x7, 0x9}, 0xc, 0x0)
	.../go-mysql/replication/row_event.go:1088 +0x1731
github.com/go-mysql-org/go-mysql/replication.(*RowsEvent).decodeRows(0xc00023b110, {0xc00021a06a, 0xc, 0xe}, 0xc000242200, {0xc00021a069, 0x1, 0x3?})
	.../go-mysql/replication/row_event.go:988 +0x556
github.com/go-mysql-org/go-mysql/replication.(*RowsEvent).DecodeData(0xc00023b110, 0xa, {0xc00021a060, 0x16, 0x18})
	
PASS: row_event_test.go:1188: testDecodeSuite.TestInvalidEvent	0.001s

doesn't look very friendly :)

This change doesn't break testDecodeSuite.TestInvalidEvent()

@atercattus atercattus requested a review from lance6716 January 28, 2023 08:37
@atercattus atercattus merged commit a139a3f into master Jan 30, 2023
@atercattus atercattus deleted the atercattus/remove-error-logging branch January 30, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants