1mariadb_get_infov(3) MariaDB Connector/C mariadb_get_infov(3)
2
3
4
5 Name
6 mariadb_get_infov - retrieves generic or connection releated informa‐
7 tion
8
9 Synopsis
10 #include <mysql.h>
11
12 int mariadb_get_infov(MYSQL * mysql,
13 enum mariadb_value value,
14 void * arg,
15 ...);
16
18 Retrieves generic or connection specific information. arg (and further
19 arguments) must be a pointer to a variable of the type appropriate for
20 the value argument. The following table shows which variable type to
21 use for each value.
22
23 Variable Type Values
24 ──────────────────────────────────────────────────────────────────────────
25 unsigned int MARIADB_CLIENT_VERSION_ID, MARI‐
26 ADB_CONNECTION_ASYNC_TIMEOUT, MARI‐
27 ADB_CONNECTION_ASYNC_TIMEOUT_MS,
28 MARIADB_CONNECTION_ERROR_ID, MARI‐
29 ADB_CONNECTION_PORT, MARIADB_CON‐
30 NECTION_PROTOCOL_VERSION_ID, MARI‐
31 ADB_CONNECTION_PVIO_TYPE, MARI‐
32 ADB_CONNECTION_SERVER_STATUS, MARI‐
33 ADB_CONNECTION_SERVER_VERSION_ID,
34 MARIADB_CONNECTION_TLS_VERSION_ID
35 unsigned long MARIADB_CONNECTION_CLIENT_CAPABILI‐
36 TIES, MARIADB_CONNECTION_EXTEND‐
37 ED_SERVER_CAPABILITIES, MARI‐
38 ADB_CONNECTION_SERVER_CAPABILITIES
39 size_t MARIADB_MAX_ALLOWED_PACKET, MARI‐
40 ADB_NET_BUFFER_LENGTH
41 const char * MARIADB_CLIENT_VERSION, MARI‐
42 ADB_TLS_VERSION, MARIADB_CONNEC‐
43 TION_ERROR, MARIADB_CONNEC‐
44 TION_HOST, MARIADB_CONNECTION_INFO,
45 MARIADB_CONNECTION_SCHEMA, MARI‐
46 ADB_CONNECTION_SERVER_TYPE, MARI‐
47 ADB_CONNECTION_SERVER_VERSION,
48 MARIADB_CONNECTION_SQLSTATE, MARI‐
49 ADB_CONNECTION_SSL_CIPHER, MARI‐
50 ADB_CONNECTION_TLS_VERSION, MARI‐
51 ADB_CONNECTUION_UNIX_SOCKET, MARI‐
52 ADB_CONNECTION_USER,
53 const char ** MARIADB_CLIENT_ERRORS
54 const *MY_CHARSET_INFO MARIADB_CHARSET_NAME, MARIADB_CON‐
55 NECTION_CHARSET_INFO
56 my_socket MARIADB_CONNECTION_SOCKET
57
58 Value types
59 Generic information
60 For these information types parameter mysql needs to be set to NULL.
61
62 • MARIADB_CHARSET_NAME
63 Retrieves the charset information for a character set by it’s literal
64 representation.
65
66 • MARIADB_CLIENT_ERRORS
67 Retrieve array of client errors. This can be used in plugins to set
68 global error messages (which are not exported by MariaDB Connector/C).
69
70 • MARIADB_CLIENT_VERSION
71 The client version in literal representation.
72
73 • MARIADB_CLIENT_VERSION_ID
74 The client version in numeric format.
75
76 • MARIADB_MAX_ALLOWED_PACKET
77 Retrieves value of maximum allowed packet size.
78
79 • MARIADB_NET_BUFFER_LENGTH
80 Retrieves the length of net buffer.
81
82 • MARIADB_SSL_LIBRARY
83 The TLS library MariaDB Connector/C is compiled against.
84
85 Connection related information
86 For these information types parameter mysql must be represent a valid
87 connection handle which was allocated by mysql_init(3).
88
89 • MARIADB_CONNECTION_ASYNC_TIMEOUT
90 Retrieves the timeout for non blocking calls in seconds.
91
92 • MARIADB_CONNECTION_ASYNC_TIMEOUT_MS
93 Retrieves the timeout for non blocking calls in milliseconds.
94
95 • MARIADB_CONNECTION_CHARSET_INFO
96 Retrieves character set information for given connection.
97
98 • MARIADB_CONNECTION_CLIENT_CAPABILITIES
99 Returns the handshak capability flags] of the client.
100
101 • MARIADB_CONNECTION_ERROR
102 Retrieves error message for last used command.
103
104 • MARIADB_CONNECTION_ERROR_ID
105 Retrieves error number for last used command. *MARIADB_CONNECTION_EX‐
106 TENDED_SERVER_CAPABILITIES
107 Returns the extended capability flags of the connected MariaDB server
108
109 • MARIADB_CONNECTION_HOST
110 Returns host name of the connected MariaDB server
111
112 • MARIADB_CONNECTION_INFO
113 Retrieves generic info for last used command.
114
115 • MARIADB_CONNECTION_PORT
116 Retrieves the port number of server host.
117
118 • MARIADB_CONNECTION_PROTOCOL_VERSION_ID
119 Retrieves the protocol version number.
120
121 • MARIADB_CONNECTION_PVIO_TYPE
122 Retrieves the pvio plugin used for specified connection.
123
124 • MARIADB_CONNECTION_SCHEMA
125 Retrieves the current schema.
126
127 • MARIADB_CONNECTION_SERVER_CAPABILITIES
128 Retrievrs the capability flags of the connected server.
129
130 • MARIADB_CONNECTION_SERVER_STATUS
131 Returns server status after last operation.
132
133 • MARIADB_CONNECTION_SERVER_TYPE
134 Retrieves the type of the server.
135
136 • MARIADB_CONNECTION_SERVER_VERSION
137 Retrieves the server version in literal format.
138
139 • MARIADB_CONNECTION_SERVER_VERSION_ID
140 Retrieves the server version in numeric format.
141
142 • MARIADB_CONNECTION_SOCKET
143 Retrieves the handle (socket) for given connection.
144
145 • MARIADB_CONNECTION_SQLSTATE
146 Retrieves current sqlstate information for last used command.
147
148 • MARIADB_CONNECTION_SSL_CIPHER
149 Retrieves the TLS/SSL cipher in use.
150
151 • MARIADB_CONNECTION_TLS_VERSION
152 Retrieves the TLS protocol version used in literal format.
153
154 • MARIADB_CONNECTION_TLS_VERSION_ID
155 Retrieves the TLS protocol version used in numeric format.
156
157 • MARIADB_CONNECTION_UNIX_SOCKET
158 Retrieves the file name of the unix socket
159
160 • MARIADB_CONNECTION_USER
161 Retrieves connection’s user name.
162
163 Returns
164 Returns zero on success, non zero if an error occurred (e.g. if an in‐
165 valid option was specified),
166
167 Source file
168 ## History
169 This function was added in MariaDB Connector/C 3.0,
170
171 ## Examples
172
173 /* get server port for current connection / unsigned int port; mari‐
174 adb_get_infov(mysql, MARIADB_CONNECTION_PORT, (void )&port);
175
176 /* get user name for current connection / const char user; mari‐
177 adb_get_infov(mysql, MARIADB_CONNECTION_USER, (void )&user); ``` ## See
178 also mysql_get_optionv(3)
179
180
181
182Version 3.3.1 mariadb_get_infov(3)