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
|
.\"t
.\" Automatically generated by Pandoc 2.5
.\"
.TH "mariadb_get_infov" "3" "" "Version 3.3.1" "MariaDB Connector/C"
.hy
.SS Name
.PP
mariadb_get_infov \- retrieves generic or connection releated
information
.SS Synopsis
.IP
.nf
\f[C]
#include <mysql.h>
int mariadb_get_infov(MYSQL * mysql,
enum mariadb_value value,
void * arg,
...);
\f[R]
.fi
.SH Description
.PP
Retrieves generic or connection specific information.
\f[C]arg\f[R] (and further arguments) must be a pointer to a variable of
the type appropriate for the \f[C]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[C]unsigned int\f[R]
T}@T{
\f[C]MARIADB_CLIENT_VERSION_ID\f[R],
\f[C]MARIADB_CONNECTION_ASYNC_TIMEOUT\f[R],
\f[C]MARIADB_CONNECTION_ASYNC_TIMEOUT_MS\f[R],
\f[C]MARIADB_CONNECTION_ERROR_ID\f[R],
\f[C]MARIADB_CONNECTION_PORT\f[R],
\f[C]MARIADB_CONNECTION_PROTOCOL_VERSION_ID\f[R],
\f[C]MARIADB_CONNECTION_PVIO_TYPE\f[R],
\f[C]MARIADB_CONNECTION_SERVER_STATUS\f[R],
\f[C]MARIADB_CONNECTION_SERVER_VERSION_ID\f[R],
\f[C]MARIADB_CONNECTION_TLS_VERSION_ID\f[R]
T}
T{
\f[C]unsigned long\f[R]
T}@T{
\f[C]MARIADB_CONNECTION_CLIENT_CAPABILITIES\f[R],
\f[C]MARIADB_CONNECTION_EXTENDED_SERVER_CAPABILITIES\f[R],
\f[C]MARIADB_CONNECTION_SERVER_CAPABILITIES\f[R]
T}
T{
\f[C]size_t\f[R]
T}@T{
\f[C]MARIADB_MAX_ALLOWED_PACKET\f[R],
\f[C]MARIADB_NET_BUFFER_LENGTH\f[R]
T}
T{
\f[C]const char *\f[R]
T}@T{
\f[C]MARIADB_CLIENT_VERSION\f[R], \f[C]MARIADB_TLS_VERSION\f[R],
\f[C]MARIADB_CONNECTION_ERROR\f[R], \f[C]MARIADB_CONNECTION_HOST\f[R],
\f[C]MARIADB_CONNECTION_INFO\f[R], \f[C]MARIADB_CONNECTION_SCHEMA\f[R],
\f[C]MARIADB_CONNECTION_SERVER_TYPE\f[R],
\f[C]MARIADB_CONNECTION_SERVER_VERSION\f[R],
\f[C]MARIADB_CONNECTION_SQLSTATE\f[R],
\f[C]MARIADB_CONNECTION_SSL_CIPHER\f[R],
\f[C]MARIADB_CONNECTION_TLS_VERSION\f[R],
\f[C]MARIADB_CONNECTUION_UNIX_SOCKET\f[R],
\f[C]MARIADB_CONNECTION_USER\f[R],
T}
T{
\f[C]const char **\f[R]
T}@T{
\f[C]MARIADB_CLIENT_ERRORS\f[R]
T}
T{
\f[C]const *MY_CHARSET_INFO\f[R]
T}@T{
\f[C]MARIADB_CHARSET_NAME\f[R],
\f[C]MARIADB_CONNECTION_CHARSET_INFO\f[R]
T}
T{
\f[C]my_socket\f[R]
T}@T{
\f[C]MARIADB_CONNECTION_SOCKET\f[R]
T}
.TE
.SS Value types
.SS Generic information
.PP
For these information types parameter \f[C]mysql\f[R] needs to be set to
NULL.
.IP \[bu] 2
\f[C]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[C]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[C]MARIADB_CLIENT_VERSION\f[R]
.PD 0
.P
.PD
The client version in literal representation.
.IP \[bu] 2
\f[C]MARIADB_CLIENT_VERSION_ID\f[R]
.PD 0
.P
.PD
The client version in numeric format.
.IP \[bu] 2
\f[C]MARIADB_MAX_ALLOWED_PACKET\f[R]
.PD 0
.P
.PD
Retrieves value of maximum allowed packet size.
.IP \[bu] 2
\f[C]MARIADB_NET_BUFFER_LENGTH\f[R]
.PD 0
.P
.PD
Retrieves the length of net buffer.
.IP \[bu] 2
\f[C]MARIADB_SSL_LIBRARY\f[R]
.PD 0
.P
.PD
The TLS library MariaDB Connector/C is compiled against.
.SS Connection related information
.PP
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[C]MARIADB_CONNECTION_ASYNC_TIMEOUT\f[R]
.PD 0
.P
.PD
Retrieves the timeout for non blocking calls in seconds.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_ASYNC_TIMEOUT_MS\f[R]
.PD 0
.P
.PD
Retrieves the timeout for non blocking calls in milliseconds.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_CHARSET_INFO\f[R]
.PD 0
.P
.PD
Retrieves character set information for given connection.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_CLIENT_CAPABILITIES\f[R]
.PD 0
.P
.PD
Returns the handshak capability flags] of the client.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_ERROR\f[R]
.PD 0
.P
.PD
Retrieves error message for last used command.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_ERROR_ID\f[R]
.PD 0
.P
.PD
Retrieves error number for last used command.
*\f[C]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[C]MARIADB_CONNECTION_HOST\f[R]
.PD 0
.P
.PD
Returns host name of the connected MariaDB server
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_INFO\f[R]
.PD 0
.P
.PD
Retrieves generic info for last used command.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_PORT\f[R]
.PD 0
.P
.PD
Retrieves the port number of server host.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_PROTOCOL_VERSION_ID\f[R]
.PD 0
.P
.PD
Retrieves the protocol version number.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_PVIO_TYPE\f[R]
.PD 0
.P
.PD
Retrieves the pvio plugin used for specified connection.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_SCHEMA\f[R]
.PD 0
.P
.PD
Retrieves the current schema.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_SERVER_CAPABILITIES\f[R]
.PD 0
.P
.PD
Retrievrs the capability flags of the connected server.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_SERVER_STATUS\f[R]
.PD 0
.P
.PD
Returns server status after last operation.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_SERVER_TYPE\f[R]
.PD 0
.P
.PD
Retrieves the type of the server.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_SERVER_VERSION\f[R]
.PD 0
.P
.PD
Retrieves the server version in literal format.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_SERVER_VERSION_ID\f[R]
.PD 0
.P
.PD
Retrieves the server version in numeric format.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_SOCKET\f[R]
.PD 0
.P
.PD
Retrieves the handle (socket) for given connection.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_SQLSTATE\f[R]
.PD 0
.P
.PD
Retrieves current sqlstate information for last used command.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_SSL_CIPHER\f[R]
.PD 0
.P
.PD
Retrieves the TLS/SSL cipher in use.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_TLS_VERSION\f[R]
.PD 0
.P
.PD
Retrieves the TLS protocol version used in literal format.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_TLS_VERSION_ID\f[R]
.PD 0
.P
.PD
Retrieves the TLS protocol version used in numeric format.
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_UNIX_SOCKET\f[R]
.PD 0
.P
.PD
Retrieves the file name of the unix socket
.IP \[bu] 2
\f[C]MARIADB_CONNECTION_USER\f[R]
.PD 0
.P
.PD
Retrieves connection\[cq]s user name.
.SS Returns
.PP
Returns zero on success, non zero if an error occurred (e.g.\ if an
invalid option was specified),
.SS Source file
.IP
.nf
\f[C]
## History
This function was added in MariaDB Connector/C 3.0,
## Examples
\f[R]
.fi
.PP
/* get server port for current connection \f[I]/ unsigned int port;
mariadb_get_infov(mysql, MARIADB_CONNECTION_PORT, (void \f[R])&port);
.IP
.nf
\f[C]
\f[R]
.fi
.PP
/* get user name for current connection \f[I]/ const char \f[R]user;
mariadb_get_infov(mysql, MARIADB_CONNECTION_USER, (void \f[I])&user);
\[ga]\[ga]\[ga] ## See also \f[R] \f[B]mysql_get_optionv(3)\f[R]
|