How to use the mindsdb.proxies.mysql.data_types.mysql_datum.Datum function in MindsDB

To help you get started, we’ve selected a few MindsDB examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mindsdb / mindsdb / mindsdb / proxies / mysql / data_types / mysql_datum.py View on Github external
def test():


    import pprint

    log.basicConfig(level=10)
    u = Datum('int<8>',DEFAULT_CAPABILITIES >> 16)
    pprint.pprint(u.toStringPacket())
github mindsdb / mindsdb / mindsdb / proxies / mysql / data_types / mysql_packets / handshake_packet.py View on Github external
self.protocol_version = Datum('int<1>', 10)
        self.server_version = Datum('string', '5.7.1-MindsDB-1.0')
        self.connection_id = Datum('int<4>', self.proxy.connection_id)
        self.scramble_1st_part = Datum('string<8>', self.proxy.salt[:8])
        self.reserved_byte = Datum('string<1>', '')
        self.server_capabilities_1st_part = Datum(
            'int<2>', DEFAULT_CAPABILITIES)
        self.server_default_collation = Datum('int<1>', DEFAULT_COALLITION_ID)
        self.status_flags = Datum('int<2>', SERVER_STATUS_AUTOCOMMIT)
        self.server_capabilities_2nd_part = Datum(
            'int<2>', DEFAULT_CAPABILITIES >> 16)
        self.wireshark_filler = Datum('int<1>', FILLER_FOR_WIRESHARK_DUMP)
        self.reserved_filler1 = Datum('string<6>', '')
        self.reserved_filler2 = Datum('string<4>', '')
        self.scramble_2nd_part = Datum('string', self.proxy.salt[8:])
        self.null_close = Datum('string', 'mysql_native_password')
github mindsdb / mindsdb / mindsdb / proxies / mysql / data_types / mysql_packets / handshake_packet.py View on Github external
def setup(self):

        self.protocol_version = Datum('int<1>', 10)
        self.server_version = Datum('string', '5.7.1-MindsDB-1.0')
        self.connection_id = Datum('int<4>', self.proxy.connection_id)
        self.scramble_1st_part = Datum('string<8>', self.proxy.salt[:8])
        self.reserved_byte = Datum('string<1>', '')
        self.server_capabilities_1st_part = Datum(
            'int<2>', DEFAULT_CAPABILITIES)
        self.server_default_collation = Datum('int<1>', DEFAULT_COALLITION_ID)
        self.status_flags = Datum('int<2>', SERVER_STATUS_AUTOCOMMIT)
        self.server_capabilities_2nd_part = Datum(
            'int<2>', DEFAULT_CAPABILITIES >> 16)
        self.wireshark_filler = Datum('int<1>', FILLER_FOR_WIRESHARK_DUMP)
        self.reserved_filler1 = Datum('string<6>', '')
        self.reserved_filler2 = Datum('string<4>', '')
        self.scramble_2nd_part = Datum('string', self.proxy.salt[8:])
        self.null_close = Datum('string', 'mysql_native_password')
github mindsdb / mindsdb / mindsdb / proxies / mysql / data_types / mysql_packets / switch_auth_packet.py View on Github external
def setup(self):
        status = 0 if 'status' not in self._kwargs else self._kwargs['status']
        seed = self._kwargs['seed']
        self.eof_header = Datum('int<1>', int('0xfe',0))
        self.authentication_plugin_name = Datum('string', 'mysql_native_password')
        self.seed = Datum('string', seed)
github mindsdb / mindsdb / mindsdb / proxies / mysql / data_types / mysql_packets / handshake_packet.py View on Github external
def setup(self):

        self.protocol_version = Datum('int<1>', 10)
        self.server_version = Datum('string', '5.7.1-MindsDB-1.0')
        self.connection_id = Datum('int<4>', self.proxy.connection_id)
        self.scramble_1st_part = Datum('string<8>', self.proxy.salt[:8])
        self.reserved_byte = Datum('string<1>', '')
        self.server_capabilities_1st_part = Datum(
            'int<2>', DEFAULT_CAPABILITIES)
        self.server_default_collation = Datum('int<1>', DEFAULT_COALLITION_ID)
        self.status_flags = Datum('int<2>', SERVER_STATUS_AUTOCOMMIT)
        self.server_capabilities_2nd_part = Datum(
            'int<2>', DEFAULT_CAPABILITIES >> 16)
        self.wireshark_filler = Datum('int<1>', FILLER_FOR_WIRESHARK_DUMP)
        self.reserved_filler1 = Datum('string<6>', '')
        self.reserved_filler2 = Datum('string<4>', '')
        self.scramble_2nd_part = Datum('string', self.proxy.salt[8:])
        self.null_close = Datum('string', 'mysql_native_password')
github mindsdb / mindsdb / mindsdb / proxies / mysql / data_types / mysql_packets / handshake_response_packet.py View on Github external
self._length = length
        self._seq = count_header
        self._body = body

        if length < 30:
            reserved_type = 'string<1>'
            enc_pass_type = 'string'
            self.scramble_func = scramble_323
        else:
            reserved_type = 'string<28>'
            enc_pass_type = 'string'
            self.scramble_func = scramble

        self.capabilities = Datum('int<4>')
        self.reserved = Datum(reserved_type)
        self.username = Datum('string')
        self.enc_password = Datum(enc_pass_type)
        self.database = Datum('string')

        buffer = body
        buffer = self.capabilities.setFromBuff(buffer)
        buffer = self.reserved.setFromBuff(buffer)
        buffer = self.username.setFromBuff(buffer)
        buffer = self.enc_password.setFromBuff(buffer)

        #if len(buffer) > 0:
        #    self.database.setFromBuff(buffer)



        self.session.username = self.username.value
github mindsdb / mindsdb / mindsdb / proxies / mysql / data_types / mysql_packets / handshake_response_packet.py View on Github external
self.salt = self.proxy.salt

        self._length = length
        self._seq = count_header
        self._body = body

        if length < 30:
            reserved_type = 'string<1>'
            enc_pass_type = 'string'
            self.scramble_func = scramble_323
        else:
            reserved_type = 'string<28>'
            enc_pass_type = 'string'
            self.scramble_func = scramble

        self.capabilities = Datum('int<4>')
        self.reserved = Datum(reserved_type)
        self.username = Datum('string')
        self.enc_password = Datum(enc_pass_type)
        self.database = Datum('string')

        buffer = body
        buffer = self.capabilities.setFromBuff(buffer)
        buffer = self.reserved.setFromBuff(buffer)
        buffer = self.username.setFromBuff(buffer)
        buffer = self.enc_password.setFromBuff(buffer)

        #if len(buffer) > 0:
        #    self.database.setFromBuff(buffer)
github mindsdb / mindsdb / mindsdb / proxies / mysql / data_types / mysql_packets / handshake_packet.py View on Github external
def setup(self):

        self.protocol_version = Datum('int<1>', 10)
        self.server_version = Datum('string', '5.7.1-MindsDB-1.0')
        self.connection_id = Datum('int<4>', self.proxy.connection_id)
        self.scramble_1st_part = Datum('string<8>', self.proxy.salt[:8])
        self.reserved_byte = Datum('string<1>', '')
        self.server_capabilities_1st_part = Datum(
            'int<2>', DEFAULT_CAPABILITIES)
        self.server_default_collation = Datum('int<1>', DEFAULT_COALLITION_ID)
        self.status_flags = Datum('int<2>', SERVER_STATUS_AUTOCOMMIT)
        self.server_capabilities_2nd_part = Datum(
            'int<2>', DEFAULT_CAPABILITIES >> 16)
        self.wireshark_filler = Datum('int<1>', FILLER_FOR_WIRESHARK_DUMP)
        self.reserved_filler1 = Datum('string<6>', '')
        self.reserved_filler2 = Datum('string<4>', '')
        self.scramble_2nd_part = Datum('string', self.proxy.salt[8:])
        self.null_close = Datum('string', 'mysql_native_password')
github mindsdb / mindsdb / mindsdb / proxies / mysql / data_types / mysql_packets / handshake_response_packet.py View on Github external
self._body = body

        if length < 30:
            reserved_type = 'string<1>'
            enc_pass_type = 'string'
            self.scramble_func = scramble_323
        else:
            reserved_type = 'string<28>'
            enc_pass_type = 'string'
            self.scramble_func = scramble

        self.capabilities = Datum('int<4>')
        self.reserved = Datum(reserved_type)
        self.username = Datum('string')
        self.enc_password = Datum(enc_pass_type)
        self.database = Datum('string')

        buffer = body
        buffer = self.capabilities.setFromBuff(buffer)
        buffer = self.reserved.setFromBuff(buffer)
        buffer = self.username.setFromBuff(buffer)
        buffer = self.enc_password.setFromBuff(buffer)

        #if len(buffer) > 0:
        #    self.database.setFromBuff(buffer)



        self.session.username = self.username.value
github mindsdb / mindsdb / mindsdb / proxies / mysql / data_types / mysql_packets / eof_packet.py View on Github external
def setup(self):
        status = 0 if 'status' not in self._kwargs else self._kwargs['status']
        self.eof_header = Datum('int<1>', int('0xfe',0))
        self.warning_count = Datum('int<2>', 0)
        self.server_status = Datum('int<2>', status)