Esempio n. 1
0
    def getPayload(self):
        payload = bytearray()

        payload.extend(Proto.build_byte(Flags.ERR))
        payload.extend(Proto.build_fixed_int(2, self.errorCode))
        payload.extend(Proto.build_byte(ord('#')))
        payload.extend(Proto.build_fixed_str(5, self.sqlState))
        payload.extend(Proto.build_eop_str(self.errorMessage))

        return payload
Esempio n. 2
0
    def getPayload(self):
        payload = bytearray()

        payload.extend(Proto.build_byte(Flags.COM_QUERY))
        payload.extend(Proto.build_eop_str(self.query))

        return payload
Esempio n. 3
0
    def getPayload(self):

        # 1 0xef kPacketMagicNum
        # 8 log_pos
        # n binlog_filename

        payload = bytearray()
        payload.extend(Proto.build_byte(0xef))
        payload.extend(Proto.build_fixed_int(8, self.binlog_pos))
        payload.extend(Proto.build_eop_str(self.binlog_filename))

        return payload