def advance(self, length):
        """Advance the cursor in data buffer 'length' bytes."""
        new_position = self._position + length
        if new_position < 0 or new_position > len(self._data):
            raise Exception(
                f"Invalid advance amount ({length}) for cursor.  Position={new_position}"
            )
        self._position = new_position
Advance the cursor in data buffer 'length' bytes.
pymysql/protocol.py