@@ -150,100 +150,24 @@ MrdbConnection_Methods[] =
150
150
static struct
151
151
PyMemberDef MrdbConnection_Members [] =
152
152
{
153
- {"character_set " ,
154
- T_STRING ,
155
- offsetof(MrdbConnection , charset ),
153
+ {"connection_id " ,
154
+ T_LONG ,
155
+ offsetof(MrdbConnection , thread_id ),
156
156
READONLY ,
157
- "Client character set " },
157
+ "Id of current connection. " },
158
158
{"converter" ,
159
159
T_OBJECT ,
160
160
offsetof(MrdbConnection , converter ),
161
161
READONLY ,
162
162
"Conversion dictionary" },
163
- {"connection_id" ,
164
- T_ULONG ,
165
- offsetof(MrdbConnection , thread_id ),
166
- READONLY ,
167
- "Id of current connection" },
168
- {"collation" ,
169
- T_STRING ,
170
- offsetof(MrdbConnection , collation ),
171
- READONLY ,
172
- "Client character set collation" },
173
163
{"dsn" ,
174
164
T_OBJECT ,
175
165
offsetof(MrdbConnection , dsn ),
176
166
READONLY ,
177
167
"Data source name (dsn)" },
178
- {"server_port" ,
179
- T_INT ,
180
- offsetof(MrdbConnection , port ),
181
- READONLY ,
182
- "Database server TCP/IP port. This value will be 0 in case of a unix socket connection" },
183
- {"server_version" ,
184
- T_ULONG ,
185
- offsetof(MrdbConnection , server_version ),
186
- READONLY ,
187
- "Server version in numerical format:\n\nThe form of the version number is VERSION_MAJOR * 10000 + VERSION_MINOR * 100 + VERSION_PATCH" },
188
- {"server_info" ,
189
- T_STRING ,
190
- offsetof(MrdbConnection , server_info ),
191
- READONLY ,
192
- "Server info" },
193
- {"unix_socket" ,
194
- T_STRING ,
195
- offsetof(MrdbConnection , unix_socket ),
196
- READONLY ,
197
- "Unix socket name" },
198
- {"server_name" ,
199
- T_STRING ,
200
- offsetof(MrdbConnection , host ),
201
- READONLY ,
202
- "Name or address of database server" },
203
- {"tls_cipher" ,
204
- T_STRING ,
205
- offsetof(MrdbConnection , tls_cipher ),
206
- READONLY ,
207
- "TLS cipher suite used by connection" },
208
- {"tls_version" ,
209
- T_STRING ,
210
- offsetof(MrdbConnection , tls_version ),
211
- READONLY ,
212
- "TLS protocol version used by connection" },
213
- {"client_capabilities" ,
214
- T_ULONG ,
215
- offsetof(MrdbConnection , client_capabilities ),
216
- READONLY ,
217
- "Client capabilities" },
218
- {"server_capabilities" ,
219
- T_ULONG ,
220
- offsetof(MrdbConnection , server_capabilities ),
221
- READONLY ,
222
- "Server capabilities" },
223
168
{NULL } /* always last */
224
169
};
225
170
226
- static void MrdbConnection_GetCapabilities (MrdbConnection * self )
227
- {
228
- mariadb_get_infov (self -> mysql , MARIADB_CONNECTION_SERVER_CAPABILITIES ,
229
- & self -> server_capabilities );
230
- mariadb_get_infov (self -> mysql , MARIADB_CONNECTION_EXTENDED_SERVER_CAPABILITIES ,
231
- & self -> extended_server_capabilities );
232
- mariadb_get_infov (self -> mysql , MARIADB_CONNECTION_CLIENT_CAPABILITIES ,
233
- & self -> client_capabilities );
234
- }
235
-
236
- void MrdbConnection_SetAttributes (MrdbConnection * self )
237
- {
238
- mariadb_get_infov (self -> mysql , MARIADB_CONNECTION_HOST , & self -> host );
239
- mariadb_get_infov (self -> mysql , MARIADB_CONNECTION_SSL_CIPHER , & self -> tls_cipher );
240
- mariadb_get_infov (self -> mysql , MARIADB_CONNECTION_TLS_VERSION , & self -> tls_version );
241
- mariadb_get_infov (self -> mysql , MARIADB_CONNECTION_UNIX_SOCKET , & self -> unix_socket );
242
- mariadb_get_infov (self -> mysql , MARIADB_CONNECTION_PORT , & self -> port );
243
- self -> charset = mariadb_default_charset ;
244
- self -> collation = mariadb_default_collation ;
245
- }
246
-
247
171
static int
248
172
MrdbConnection_Initialize (MrdbConnection * self ,
249
173
PyObject * args ,
@@ -402,10 +326,6 @@ MrdbConnection_Initialize(MrdbConnection *self,
402
326
403
327
self -> thread_id = mysql_thread_id (self -> mysql );
404
328
405
- /* CONPY-129: server_version_info */
406
- self -> server_version = mysql_get_server_version (self -> mysql );
407
- self -> server_info = mysql_get_server_info (self -> mysql );
408
-
409
329
has_error = 0 ;
410
330
end :
411
331
Py_END_ALLOW_THREADS ;
@@ -419,11 +339,6 @@ MrdbConnection_Initialize(MrdbConnection *self,
419
339
if (PyErr_Occurred ())
420
340
return -1 ;
421
341
422
- /* set connection attributes */
423
- MrdbConnection_SetAttributes (self );
424
- /* get capabilities */
425
- MrdbConnection_GetCapabilities (self );
426
-
427
342
return 0 ;
428
343
}
429
344
@@ -740,7 +655,6 @@ PyObject *MrdbConnection_reconnect(MrdbConnection *self)
740
655
}
741
656
/* get capabilities */
742
657
self -> thread_id = mysql_thread_id (self -> mysql );
743
- MrdbConnection_GetCapabilities (self );
744
658
Py_RETURN_NONE ;
745
659
}
746
660
/* }}} */
0 commit comments