Download this Manual
PDF (US Ltr) - 1.4Mb
PDF (A4) - 1.4Mb


MySQL 9.5 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, seeSection 5.2, “C API Basic Data Structures”.

  • enum connect_stage

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

    Enumeration Stage ValueDescription
    CONNECT_STAGE_INVALID = 0MYSQL not valid or an unknown state
    CONNECT_STAGE_NOT_STARTEDNot connected
    CONNECT_STAGE_NET_BEGIN_CONNECTBegin connection to the server
    CONNECT_STAGE_NET_WAIT_CONNECTWait for connection to be established
    CONNECT_STAGE_NET_COMPLETE_CONNECTInitialize the local data structures post connect
    CONNECT_STAGE_READ_GREETINGRead the first packet
    CONNECT_STAGE_PARSE_HANDSHAKEParse the first packet
    CONNECT_STAGE_ESTABLISH_SSLTLS establishment
    CONNECT_STAGE_AUTHENTICATEAuthentication phase
    CONNECT_STAGE_AUTH_BEGINDetermine the plugin to use
    CONNECT_STAGE_AUTH_RUN_FIRST_AUTHENTICATE_USERRun first auth plugin
    CONNECT_STAGE_AUTH_HANDLE_FIRST_AUTHENTICATE_USERHandle the result of the first authentication plugin run
    CONNECT_STAGE_AUTH_READ_CHANGE_USER_RESULTRead the implied changed user authentication (if any)
    CONNECT_STAGE_AUTH_HANDLE_CHANGE_USER_REQUESTCheck if server asked to use a different authentication plugin
    CONNECT_STAGE_AUTH_RUN_SECOND_AUTHENTICATE_USERStart the authentication process again with the plugin requested by the server
    CONNECT_STAGE_AUTH_INIT_MULTI_AUTHStart multifactor authentication
    CONNECT_STAGE_AUTH_FINISH_AUTHFinal cleanup
    CONNECT_STAGE_AUTH_HANDLE_SECOND_AUTHENTICATE_USERNow read the results of the second plugin run
    CONNECT_STAGE_AUTH_DO_MULTI_PLUGIN_AUTHInvoke client plugins multi-auth authentication method
    CONNECT_STAGE_AUTH_HANDLE_MULTI_AUTH_RESPONSEHandle response from client plugins authentication method
    CONNECT_STAGE_PREP_SELECT_DATABASEAuthenticated, set initial database if specified
    CONNECT_STAGE_PREP_INIT_COMMANDSPrepare to send a sequence ofinit commands
    CONNECT_STAGE_SEND_ONE_INIT_COMMANDSend aninit command, which is called once for eachinit command until they all run (or a failure occurs)
    CONNECT_STAGE_COMPLETEConnected 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 ValueDescription
    NET_ASYNC_COMPLETEAsynchronous operation is complete
    NET_ASYNC_NOT_READYAsynchronous operation is still in progress
    NET_ASYNC_ERRORAsynchronous operation terminated in error
    NET_ASYNC_COMPLETE_NO_MORE_RESULTSFormysql_next_result_nonblocking(); indicates no more results available

    For more information, seeChapter 7,C API Asynchronous Interface.