| Home | Libraries | People | FAQ | More

###### connection::async_read_resultset_head (1 of 2 overloads)

Reads metadata for subsequent resultsets in a multi-resultset operation.

###### Synopsis

    template<
        class ExecutionStateType,
        class CompletionToken>
    auto
    async_read_resultset_head(
        ExecutionStateType& st,
        CompletionToken&& token);

###### Description

If `st.should_read_head() == true`, this function will read the next resultset's initial response message and metadata, if any. If the resultset indicates a failure (e.g. the query associated to this resultset contained an error), this function will fail with that error.

If `st.should_read_head() == false`, this function is a no-op.

`st` may be either an `execution_state` or `static_execution_state` object.

This function is only relevant when using multi-function operations with statements that return more than one resultset.

When using the static interface, this function will detect schema mismatches for the resultset currently being read. Further errors may be detected by subsequent invocations of this function and by `read_some_rows`.

###### Handler signature

The handler signature for this operation is `void(boost::mysql::error_code)`.

###### Executor

Intermediate completion handlers, as well as the final handler, are executed using `token`'s associated executor, or `this->get_executor()` if the token doesn't have an associated executor.

If the final handler has an associated immediate executor, and the operation completes immediately, the final handler is dispatched to it. Otherwise, the final handler is called as if it was submitted using `asio::post`, and is never be called inline from within this function.