def __init__(self, connection): self.connection = connection self.__position = 0 self.__recv_packet() is_error = self.__data[0] == (0xff if PYTHON3 else b'\xff') if is_error: self.__position += 1 # field_count == error (we already know that) errno = unpack_uint16(self._read(2)) raise_mysql_exception(self.__data)
def __init__(self, connection): self.connection = connection self._socket = connection.socket self._charset = connection.charset self._use_unicode = connection.use_unicode self.__position = 0 self.__recv_packet() is_error = self.__data[0] == (0xff if PYTHON3 else b'\xff') if is_error: self.__position += 1 # field_count == error (we already know that) self.errno = unpack_uint16(self._read(2)) raise_mysql_exception(self.__data)
def __init__(self, connection): self.connection = connection self.__position = 0 self.__recv_packet() if PYTHON3: is_error = self.__data[0] == 0xff else: is_error = self.__data[0] == b'\xff' if is_error: self.advance(1) # field_count == error (we already know that) errno = unpack_uint16(self._read(2)) raise_mysql_exception(self.__data)
def __init__(self, connection): self.connection = connection self._socket = connection.socket self._charset = connection.charset self._encoding = connection.encoding self._use_unicode = connection.use_unicode self.__position = 0 self.__recv_packet() is_error = self.__data[0] == (0xff if PYTHON3 else b'\xff') if is_error: self.__position += 1 # field_count == error (we already know that) unpack_uint16(self._read(2)) # errno raise_mysql_exception(self.__data)