(c *C)
| 83 | } |
| 84 | |
| 85 | func (s *QueryEventSuite) Test55Query(c *C) { |
| 86 | s.WriteEvent( |
| 87 | mysql_proto.LogEventType_QUERY_EVENT, |
| 88 | uint16(0), |
| 89 | []byte{ |
| 90 | // thread id |
| 91 | 179, 208, 22, 0, |
| 92 | // duration |
| 93 | 0, 0, 0, 0, |
| 94 | // db name length |
| 95 | 6, |
| 96 | // error code |
| 97 | 0, 0, |
| 98 | // status length |
| 99 | 26, 0, |
| 100 | // status block |
| 101 | 0, 0, 0, 0, 0, |
| 102 | 1, 0, 0, 0, 0, 0, 0, 0, 0, |
| 103 | 6, 3, 115, 116, 100, |
| 104 | 4, 33, 0, 33, 0, 192, 0, |
| 105 | // db name |
| 106 | 103, 108, 111, 98, 97, 108, 0, |
| 107 | // query |
| 108 | 66, 69, 71, 73, 78}) |
| 109 | |
| 110 | event, err := s.NextEvent() |
| 111 | c.Assert(err, IsNil) |
| 112 | |
| 113 | c.Assert(event, NotNil) |
| 114 | q, ok := event.(*QueryEvent) |
| 115 | c.Assert(ok, IsTrue) |
| 116 | c.Check(q.ThreadId(), Equals, uint32(0x0016d0b3)) |
| 117 | c.Check(q.Duration(), Equals, uint32(0)) |
| 118 | c.Check(q.ErrorCode(), Equals, mysql_proto.ErrorCode_OK) |
| 119 | c.Check( |
| 120 | q.StatusBytes(), |
| 121 | DeepEquals, |
| 122 | []byte{ |
| 123 | 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, |
| 124 | 0, 0, 0, 0, 6, 3, 115, 116, 100, 4, |
| 125 | 33, 0, 33, 0, 192, 0}) |
| 126 | // TODO check parsed status |
| 127 | c.Check(string(q.DatabaseName()), Equals, "global") |
| 128 | c.Check(string(q.Query()), Equals, "BEGIN") |
| 129 | |
| 130 | c.Assert(q.Flags2(), NotNil) |
| 131 | c.Check(*q.Flags2(), Equals, uint32(0)) |
| 132 | c.Assert(q.SqlMode(), NotNil) |
| 133 | c.Check(*q.SqlMode(), Equals, uint64(0)) |
| 134 | c.Check(string(q.Catalog()), Equals, "std") |
| 135 | c.Check(q.Charset(), DeepEquals, []byte{33, 0, 33, 0, 192, 0}) |
| 136 | } |
| 137 | |
| 138 | func (s *QueryEventSuite) Test56Query(c *C) { |
| 139 | s.SetChecksumSize(4) |
nothing calls this directly
no test coverage detected