MCPcopy
hub / github.com/dropbox/godropbox / TestRealWriteRowsV1

Method TestRealWriteRowsV1

database/binlog/rows_event_test.go:497–587  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

495}
496
497func (s *RowsEventSuite) TestRealWriteRowsV1(c *C) {
498 s.WriteEvent(
499 mysql_proto.LogEventType_TABLE_MAP_EVENT,
500 uint16(0),
501 []byte{
502 // table id + flags
503 35, 0, 0, 0, 0, 0,
504 1, 0,
505 // db length + name
506 8,
507 115, 104, 97, 114, 100, 55, 54, 54, 0,
508 // table length + name
509 22,
510 100, 101, 114, 105, 118, 101, 100, 95, 109, 101, 116,
511 97, 100, 97, 116, 97, 95, 115, 116, 111, 114, 101, 0,
512 // # columns + column types
513 7,
514 3, 254, 1, 252, 1, 1, 252,
515 // metadata
516 4,
517 254, 45, 2, 3,
518 // null bits
519 8})
520
521 s.WriteEvent(
522 mysql_proto.LogEventType_WRITE_ROWS_EVENT_V1,
523 uint16(0),
524 []byte{
525 // table id + row flags
526 35, 0, 0, 0, 0, 0,
527 1, 0,
528 // # columns + used columns bit map
529 7, 255,
530 // rows data
531 136,
532 // col 0
533 41, 215, 45, 12,
534 // col 1
535 43,
536 56, 97, 115, 99, 87, 73, 95, 66, 106, 57,
537 99, 73, 118, 107, 116, 69, 89, 79, 85, 102,
538 48, 48, 49, 110, 98, 90, 77, 79, 103, 89,
539 54, 84, 107, 87, 101, 79, 88, 109, 80, 75,
540 48, 122, 115,
541 29, 1, 1,
542 // col 6
543 0, 0, 0})
544
545 c.Log(s.src.Bytes())
546
547 event, err := s.NextEvent()
548 c.Log(err)
549 c.Assert(err, IsNil)
550
551 context, ok := event.(*TableMapEvent)
552 c.Assert(ok, IsTrue)
553
554 // sanity check

Callers

nothing calls this directly

Calls 13

RowsFlagsMethod · 0.80
ExtraRowInfoBytesMethod · 0.80
InsertedRowsMethod · 0.80
BytesMethod · 0.65
NextEventMethod · 0.65
DatabaseNameMethod · 0.65
TableNameMethod · 0.65
SetTableContextMethod · 0.65
VersionMethod · 0.65
TableIdMethod · 0.65
NumColumnsMethod · 0.65
WriteEventMethod · 0.45

Tested by

no test coverage detected