Skip to content

Commit

Permalink
cherry pick pingcap#1382 to release-2.0 (pingcap#1387)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-srebot authored Jan 18, 2021
1 parent d82f29a commit b4265f1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/binlog/event/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ func statusVarsToKV(statusVars []byte) (map[byte][]byte, error) {
}
buf = append(buf, b)
}
b = byte(1) // reset to any non-zero value
}
value = append(value, buf...)
default:
Expand Down
12 changes: 12 additions & 0 deletions pkg/binlog/event/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ func (t *testUtilSuite) TestStatusVarsToKV(c *C) {
},
nil,
},
{
[]byte{0, 0, 0, 0, 0, 1, 0, 0, 32, 80, 0, 0, 0, 0, 6, 3, 115, 116, 100, 4, 33, 0, 33, 0, 33, 0, 11, 4, 114, 111, 111, 116, 9, 108, 111, 99, 97, 108, 104, 111, 115, 116, 12, 2, 109, 121, 115, 113, 108, 0, 97, 117, 116, 104, 111, 114, 105, 122, 101, 0},
map[byte][]byte{
0: {0, 0, 0, 0},
1: {0, 0, 32, 80, 0, 0, 0, 0},
6: {3, 115, 116, 100},
4: {33, 0, 33, 0, 33, 0},
11: {4, 114, 111, 111, 116, 9, 108, 111, 99, 97, 108, 104, 111, 115, 116},
12: {2, 109, 121, 115, 113, 108, 0, 97, 117, 116, 104, 111, 114, 105, 122, 101, 0},
},
nil,
},
}

for _, t := range testCases {
Expand Down

0 comments on commit b4265f1

Please sign in to comment.