Skip to content

Commit 7fb6db3

Browse files
committed
fix ut
1 parent 205ab40 commit 7fb6db3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

replication/row_event_test.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -699,40 +699,40 @@ func (_ *testDecodeSuite) TestJsonCompatibility(c *C) {
699699
rows.Rows = nil
700700
err = rows.Decode(data)
701701
c.Assert(err, IsNil)
702-
c.Assert(rows.Rows[0][2], DeepEquals, []uint8("{}"))
702+
c.Assert(rows.Rows[0][2], DeepEquals, "{}")
703703

704704
// after MySQL 5.7.22
705705
data = []byte("l\x00\x00\x00\x00\x00\x01\x00\x02\x00\x04\xff\xff\xf8\x01\x00\x00\x00\x02{}\x05\x00\x00\x00\x00\x00\x00\x04\x00\xf8\x01\x00\x00\x00\n{\"a\":1234}\r\x00\x00\x00\x00\x01\x00\x0c\x00\x0b\x00\x01\x00\x05\xd2\x04a")
706706
rows.Rows = nil
707707
err = rows.Decode(data)
708708
c.Assert(err, IsNil)
709-
c.Assert(rows.Rows[1][2], DeepEquals, []uint8("{}"))
710-
c.Assert(rows.Rows[2][2], DeepEquals, []uint8("{\"a\":1234}"))
709+
c.Assert(rows.Rows[1][2], DeepEquals, "{}")
710+
c.Assert(rows.Rows[2][2], DeepEquals, "{\"a\":1234}")
711711

712712
data = []byte("l\x00\x00\x00\x00\x00\x01\x00\x02\x00\x04\xff\xff\xf8\x01\x00\x00\x00\n{\"a\":1234}\r\x00\x00\x00\x00\x01\x00\x0c\x00\x0b\x00\x01\x00\x05\xd2\x04a\xf8\x01\x00\x00\x00\x02{}\x05\x00\x00\x00\x00\x00\x00\x04\x00")
713713
rows.Rows = nil
714714
err = rows.Decode(data)
715715
c.Assert(err, IsNil)
716-
c.Assert(rows.Rows[1][2], DeepEquals, []uint8("{\"a\":1234}"))
717-
c.Assert(rows.Rows[2][2], DeepEquals, []uint8("{}"))
716+
c.Assert(rows.Rows[1][2], DeepEquals, "{\"a\":1234}")
717+
c.Assert(rows.Rows[2][2], DeepEquals, "{}")
718718

719719
// before MySQL 5.7.22
720720
rows.ignoreJSONDecodeErr = true
721721
data = []byte("l\x00\x00\x00\x00\x00\x01\x00\x02\x00\x04\xff\xff\xf8\x01\x00\x00\x00\x02{}\x05\x00\x00\x00\x00\x01\x00\x0c\x00\xf8\x01\x00\x00\x00\n{\"a\":1234}\r\x00\x00\x00\x00\x01\x00\x0c\x00\x0b\x00\x01\x00\x05\xd2\x04a")
722722
rows.Rows = nil
723723
err = rows.Decode(data)
724724
c.Assert(err, IsNil)
725-
c.Assert(rows.Rows[1][2], DeepEquals, []uint8("null"))
726-
c.Assert(rows.Rows[2][2], DeepEquals, []uint8("{\"a\":1234}"))
725+
c.Assert(rows.Rows[1][2], DeepEquals, "null")
726+
c.Assert(rows.Rows[2][2], DeepEquals, "{\"a\":1234}")
727727

728728
rows.ignoreJSONDecodeErr = false
729729
data = []byte("l\x00\x00\x00\x00\x00\x01\x00\x02\x00\x04\xff\xff\xf8\x01\x00\x00\x00\n{\"a\":1234}\r\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x00\x05\xd2\x04a\xf8\x01\x00\x00\x00\x02{}\x05\x00\x00\x00\x00\x00\x00\x04\x00")
730730
rows.Rows = nil
731731
err = rows.Decode(data)
732732
c.Assert(err, IsNil)
733733
// this value is wrong in binlog, but can be parsed without error
734-
c.Assert(rows.Rows[1][2], DeepEquals, []uint8("{}"))
735-
c.Assert(rows.Rows[2][2], DeepEquals, []uint8("{}"))
734+
c.Assert(rows.Rows[1][2], DeepEquals, "{}")
735+
c.Assert(rows.Rows[2][2], DeepEquals, "{}")
736736
}
737737

738738
func (_ *testDecodeSuite) TestDecodeDatetime2(c *C) {

0 commit comments

Comments
 (0)