MySQL 8.3 C API Developer Guide  /  C API Asynchronous Interface  /  C API Asynchronous Interface Data Structures

7.2 C API Asynchronous Interface Data Structures

This section describes data structures specific to asynchronous C API functions. For information about general-purpose C API data structures, see Section 5.2, “C API Basic Data Structures”.

  • enum connect_stage

    Stage of an asynchronous connection. The value may be one of the CONNECT_STAGE_ symbols shown in the following table.

    Enumeration Stage Value Description
    CONNECT_STAGE_INVALID = 0 MYSQL not valid or an unknown state
    CONNECT_STAGE_NOT_STARTED Not connected
    CONNECT_STAGE_NET_BEGIN_CONNECT Begin connection to the server
    CONNECT_STAGE_NET_WAIT_CONNECT Wait for connection to be established
    CONNECT_STAGE_NET_COMPLETE_CONNECT Initialize the local data structures post connect
    CONNECT_STAGE_READ_GREETING Read the first packet
    CONNECT_STAGE_PARSE_HANDSHAKE Parse the first packet
    CONNECT_STAGE_ESTABLISH_SSL TLS establishment
    CONNECT_STAGE_AUTHENTICATE Authentication phase
    CONNECT_STAGE_AUTH_BEGIN Determine the plugin to use
    CONNECT_STAGE_AUTH_RUN_FIRST_AUTHENTICATE_USER Run first auth plugin
    CONNECT_STAGE_AUTH_HANDLE_FIRST_AUTHENTICATE_USER Handle the result of the first authentication plugin run
    CONNECT_STAGE_AUTH_READ_CHANGE_USER_RESULT Read the implied changed user authentication (if any)
    CONNECT_STAGE_AUTH_HANDLE_CHANGE_USER_REQUEST Check if server asked to use a different authentication plugin
    CONNECT_STAGE_AUTH_RUN_SECOND_AUTHENTICATE_USER Start the authentication process again with the plugin requested by the server
    CONNECT_STAGE_AUTH_INIT_MULTI_AUTH Start multifactor authentication
    CONNECT_STAGE_AUTH_FINISH_AUTH Final cleanup
    CONNECT_STAGE_AUTH_HANDLE_SECOND_AUTHENTICATE_USER Now read the results of the second plugin run
    CONNECT_STAGE_AUTH_DO_MULTI_PLUGIN_AUTH Invoke client plugins multi-auth authentication method
    CONNECT_STAGE_AUTH_HANDLE_MULTI_AUTH_RESPONSE Handle response from client plugins authentication method
    CONNECT_STAGE_PREP_SELECT_DATABASE Authenticated, set initial database if specified
    CONNECT_STAGE_PREP_INIT_COMMANDS Prepare to send a sequence of init commands
    CONNECT_STAGE_SEND_ONE_INIT_COMMAND Send an init command, which is called once for each init command until they all run (or a failure occurs)
    CONNECT_STAGE_COMPLETE Connected or no asynchronous connect is in progress
  • enum net_async_status

    The enumeration type used to express the return status of asynchronous C API functions. The following table shows the permitted status values.

    Enumeration Status Value Description
    NET_ASYNC_COMPLETE Asynchronous operation is complete
    NET_ASYNC_NOT_READY Asynchronous operation is still in progress
    NET_ASYNC_ERROR Asynchronous operation terminated in error
    NET_ASYNC_COMPLETE_NO_MORE_RESULTS For mysql_next_result_nonblocking(); indicates no more results available

    For more information, see Chapter 7, C API Asynchronous Interface.