MySQL :: MySQL 8.4 C API Developer Guide :: 7.4.8 mysql_store_result_nonblocking() (original) (raw)
7.4.8 mysql_store_result_nonblocking()
enum net_async_status
mysql_store_result_nonblocking(MYSQL *mysql,
MYSQL_RES **result)
Description
Note
mysql_store_result_nonblocking() is an asynchronous function. It is the counterpart of themysql_store_result() synchronous function, for use by applications that require asynchronous communication with the server. For general information about writing asynchronous C API applications, see Chapter 7, C API Asynchronous Interface.
mysql_store_result_nonblocking() is used similarly tomysql_store_result(). For details about the latter, seeSection 5.4.84, “mysql_store_result()”. The two functions differ as follows:
- mysql_store_result() returns a pointer to a
MYSQL_RESULT
value that contains the result set, orNULL
if there is no result set or an error occurred. - mysql_store_result_nonblocking() returns an
enum net_async_status
status indicator and takes a secondresult
argument that is the address of a pointer to aMYSQL_RESULT
into which to store the result set. When the return status isNET_ASYNC_COMPLETE
, theresult
argument isNULL
if there is no result set or an error occurred.
mysql_store_result_nonblocking() was added in MySQL 8.0.16.
Return Values
Returns an enum net_async_status
value. See the description inSection 7.2, “C API Asynchronous Interface Data Structures”. ANET_ASYNC_ERROR
return status indicates an error.
When the return status isNET_ASYNC_COMPLETE
, theresult
argument is NULL
if there is no result set or an error occurred. To determine whether an error occurred, check whethermysql_error() returns a nonempty string, mysql_errno() returns nonzero, ormysql_field_count() returns zero.