Pre-General Availability Draft: 2017-09-22
int mysql_get_option(MYSQL *mysql, enum mysql_option
option, const void *arg)
Returns the current value of an option settable using
mysql_options(). The value
should be treated as read only.
option argument is the option for which
you want its value. The
arg argument is a
pointer to a variable in which to store the option value.
arg must be a pointer to a variable of the
type appropriate for the
The following table shows which variable type to use for each
|cannot be queried (error is returned)|
Zero for success. Nonzero if an error occurred; this occurs
option values that cannot be queried.
The following call tests the
MYSQL_OPT_RECONNECT option. After the call
returns successfully, the value of
reconnect is true or false to indicate
whether automatic reconnection is enabled.
bool reconnect; if (mysql_get_option(mysql, MYSQL_OPT_RECONNECT, &reconnect)) fprintf(stderr, "mysql_get_options() failed\n");