1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
|
'\" t
.\" Automatically generated by Pandoc 3.5
.\"
.TH "mariadb_get_infov" "3" "" "Version 3.4" "MariaDB Connector/C"
.SS Name
mariadb_get_infov \- retrieves generic or connection related information
.SS Synopsis
.IP
.EX
#include \f[B]<mysql.h>\f[R]
int mariadb_get_infov(MYSQL * mysql,
\f[B]enum\f[R] mariadb_value value,
void * arg,
...);
.EE
.SH Description
Retrieves generic or connection specific information.
\f[CR]arg\f[R] (and further arguments) must be a pointer to a variable
of the type appropriate for the \f[CR]value\f[R] argument.
The following table shows which variable type to use for each value.
.PP
.TS
tab(@);
lw(35.0n) lw(35.0n).
T{
Variable Type
T}@T{
Values
T}
_
T{
\f[CR]unsigned int\f[R]
T}@T{
\f[CR]MARIADB_CLIENT_VERSION_ID\f[R],
\f[CR]MARIADB_CONNECTION_ASYNC_TIMEOUT\f[R],
\f[CR]MARIADB_CONNECTION_ASYNC_TIMEOUT_MS\f[R],
\f[CR]MARIADB_CONNECTION_ERROR_ID\f[R],
\f[CR]MARIADB_CONNECTION_PORT\f[R],
\f[CR]MARIADB_CONNECTION_PROTOCOL_VERSION_ID\f[R],
\f[CR]MARIADB_CONNECTION_PVIO_TYPE\f[R],
\f[CR]MARIADB_CONNECTION_SERVER_STATUS\f[R],
\f[CR]MARIADB_CONNECTION_SERVER_VERSION_ID\f[R],
\f[CR]MARIADB_CONNECTION_TLS_VERSION_ID\f[R]
T}
T{
\f[CR]unsigned long\f[R]
T}@T{
\f[CR]MARIADB_CONNECTION_CLIENT_CAPABILITIES\f[R],
\f[CR]MARIADB_CONNECTION_EXTENDED_SERVER_CAPABILITIES\f[R],
\f[CR]MARIADB_CONNECTION_SERVER_CAPABILITIES\f[R]
T}
T{
\f[CR]size_t\f[R]
T}@T{
\f[CR]MARIADB_MAX_ALLOWED_PACKET\f[R],
\f[CR]MARIADB_NET_BUFFER_LENGTH\f[R]
T}
T{
\f[CR]const char *\f[R]
T}@T{
\f[CR]MARIADB_CLIENT_VERSION\f[R], \f[CR]MARIADB_TLS_LIBRARY\f[R],
\f[CR]MARIADB_CONNECTION_ERROR\f[R], \f[CR]MARIADB_CONNECTION_HOST\f[R],
\f[CR]MARIADB_CONNECTION_INFO\f[R],
\f[CR]MARIADB_CONNECTION_SCHEMA\f[R],
\f[CR]MARIADB_CONNECTION_SERVER_TYPE\f[R],
\f[CR]MARIADB_CONNECTION_SERVER_VERSION\f[R],
\f[CR]MARIADB_CONNECTION_SQLSTATE\f[R],
\f[CR]MARIADB_CONNECTION_SSL_CIPHER\f[R],
\f[CR]MARIADB_CONNECTION_TLS_VERSION\f[R],
\f[CR]MARIADB_CONNECTUION_UNIX_SOCKET\f[R],
\f[CR]MARIADB_CONNECTION_USER\f[R],
T}
T{
\f[CR]const char **\f[R]
T}@T{
\f[CR]MARIADB_CLIENT_ERRORS\f[R]
T}
T{
\f[CR]const *MY_CHARSET_INFO\f[R]
T}@T{
\f[CR]MARIADB_CHARSET_NAME\f[R],
\f[CR]MARIADB_CONNECTION_CHARSET_INFO\f[R]
T}
T{
\f[CR]my_socket\f[R]
T}@T{
\f[CR]MARIADB_CONNECTION_SOCKET\f[R]
T}
T{
\f[CR]MARIADB_X509_INFO *\f[R]
T}@T{
\f[CR]MARIADB_TLS_PEER_CERT_INFO\f[R]
T}
.TE
.SS Value types
.SS Generic information
For these information types parameter \f[CR]mysql\f[R] needs to be set
to NULL.
.IP \[bu] 2
\f[CR]MARIADB_CHARSET_NAME\f[R]
.PD 0
.P
.PD
Retrieves the charset information for a character set by it\[cq]s
literal representation.
.IP \[bu] 2
\f[CR]MARIADB_CLIENT_ERRORS\f[R]
.PD 0
.P
.PD
Retrieve array of client errors.
This can be used in plugins to set global error messages (which are not
exported by MariaDB Connector/C).
.IP \[bu] 2
\f[CR]MARIADB_CLIENT_VERSION\f[R]
.PD 0
.P
.PD
The client version in literal representation.
.IP \[bu] 2
\f[CR]MARIADB_CLIENT_VERSION_ID\f[R]
.PD 0
.P
.PD
The client version in numeric format.
.IP \[bu] 2
\f[CR]MARIADB_MAX_ALLOWED_PACKET\f[R]
.PD 0
.P
.PD
Retrieves value of maximum allowed packet size.
.IP \[bu] 2
\f[CR]MARIADB_NET_BUFFER_LENGTH\f[R]
.PD 0
.P
.PD
Retrieves the length of net buffer.
.SS Connection and TLS related information
For these information types parameter mysql must be represent a valid
connection handle which was allocated by \f[B]mysql_init(3)\f[R].
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_ASYNC_TIMEOUT\f[R]
.PD 0
.P
.PD
Retrieves the timeout for non blocking calls in seconds.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_ASYNC_TIMEOUT_MS\f[R]
.PD 0
.P
.PD
Retrieves the timeout for non blocking calls in milliseconds.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_CHARSET_INFO\f[R]
.PD 0
.P
.PD
Retrieves character set information for given connection.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_CLIENT_CAPABILITIES\f[R]
.PD 0
.P
.PD
Returns the capability flags of the client.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_ERROR\f[R]
.PD 0
.P
.PD
Retrieves error message for last used command.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_ERROR_ID\f[R]
.PD 0
.P
.PD
Retrieves error number for last used command.
*\f[CR]MARIADB_CONNECTION_EXTENDED_SERVER_CAPABILITIES\f[R]
.PD 0
.P
.PD
Returns the extended capability flags of the connected MariaDB server
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_HOST\f[R]
.PD 0
.P
.PD
Returns host name of the connected MariaDB server
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_INFO\f[R]
.PD 0
.P
.PD
Retrieves generic info for last used command.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_PORT\f[R]
.PD 0
.P
.PD
Retrieves the port number of server host.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_PROTOCOL_VERSION_ID\f[R]
.PD 0
.P
.PD
Retrieves the protocol version number.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_PVIO_TYPE\f[R]
.PD 0
.P
.PD
Retrieves the pvio plugin used for specified connection.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_SCHEMA\f[R]
.PD 0
.P
.PD
Retrieves the current schema.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_SERVER_CAPABILITIES\f[R]
.PD 0
.P
.PD
Retrievrs the capability flags of the connected server.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_SERVER_STATUS\f[R]
.PD 0
.P
.PD
Returns server status after last operation.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_SERVER_TYPE\f[R]
.PD 0
.P
.PD
Retrieves the type of the server.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_SERVER_VERSION\f[R]
.PD 0
.P
.PD
Retrieves the server version in literal format.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_SERVER_VERSION_ID\f[R]
.PD 0
.P
.PD
Retrieves the server version in numeric format.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_SOCKET\f[R]
.PD 0
.P
.PD
Retrieves the handle (socket) for given connection.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_SQLSTATE\f[R]
.PD 0
.P
.PD
Retrieves current sqlstate information for last used command.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_SSL_CIPHER\f[R]
.PD 0
.P
.PD
Retrieves the TLS/SSL cipher in use.
.IP \[bu] 2
\f[CR]MARIADB_TLS_LIBRARY\f[R]
.PD 0
.P
.PD
Retrieves the name of TLS library.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_TLS_VERSION\f[R]
.PD 0
.P
.PD
Retrieves the TLS protocol version used in literal format.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_TLS_VERSION_ID\f[R]
.PD 0
.P
.PD
Retrieves the TLS protocol version used in numeric format.
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_UNIX_SOCKET\f[R]
.PD 0
.P
.PD
Retrieves the file name of the unix socket
.IP \[bu] 2
\f[CR]MARIADB_CONNECTION_USER\f[R]
.PD 0
.P
.PD
Retrieves connection\[cq]s user name.
.IP \[bu] 2
\f[CR]MARIADB_TLS_PEER_CERT_INFO\f[R] Retrieves peer certificate
information for TLS connections.
The returned pointer to a MARIADB_X509_INFO structure becomes invalid
after the connection has been closed.
(Added in version 3.4.0)
.IP \[bu] 2
\f[CR]MARIADB_TLS_VERIFY_STATUS\f[R] Retrieves the status of a previous
peer certificate verification.
The status is represented as a combination of TLS verification flags.
This option was added in version 3.4.1
.SS Returns
Returns zero on success, non zero if an error occurred (e.g.\ if an
invalid option was specified),
.SS Source file
\f[CR]libmariadb/mariadb_lib.c\f[R]
.SS History
This function was added in MariaDB Connector/C 3.0,
.SS Examples
.IP
.EX
/* get server port for current connection */
unsigned int port;
mariadb_get_infov(mysql, MARIADB_CONNECTION_PORT, (void *)&port);
.EE
.IP
.EX
/* get user name for current connection */
const char *user;
mariadb_get_infov(mysql, MARIADB_CONNECTION_USER, (void *)&user);
.EE
.SS See also
.IP \[bu] 2
\f[B]mysql_get_optionv(3)\f[R]
|