'Handle the response to our attempt to prepare a statement.
If it succeeded, run the original query again against the same host.'

def _execute_after_prepare(self, host, connection, pool, response):

    if pool:
        pool.return_connection(connection)
    if self._final_exception:
        return
    if isinstance(response, ResultMessage):
        if (response.kind == RESULT_KIND_PREPARED):
            if self.prepared_statement:
                (_, _, _, result_metadata) = response.results
                self.prepared_statement.result_metadata = result_metadata
            request_id = self._query(host)
            if (request_id is None):
                self.send_request()
        else:
            self._set_final_exception(ConnectionException(('Got    unexpected    response    when    preparing    statement    on    host    %s:    %s' % (host, response))))
    elif isinstance(response, ErrorMessage):
        if hasattr(response, 'to_exception'):
            self._set_final_exception(response.to_exception())
        else:
            self._set_final_exception(response)
    elif isinstance(response, ConnectionException):
        log.debug('Connection    error    when    preparing    statement    on    host    %s:    %s', host, response)
        self._errors[host] = response
        self.send_request()
    else:
        self._set_final_exception(ConnectionException(('Got    unexpected    response    type    when    preparing    statement    on    host    %s:    %s' % (host, response))))
