@@ -92,12 +92,6 @@ typedef struct {
92
92
extern PyTypeObject _mysql_ResultObject_Type ;
93
93
94
94
95
- /* According to https://dev.mysql.com/doc/refman/5.1/en/mysql-options.html
96
- The MYSQL_OPT_READ_TIMEOUT appear in the version 5.1.12 */
97
- #if MYSQL_VERSION_ID > 50112
98
- #define HAVE_MYSQL_OPT_TIMEOUTS 1
99
- #endif
100
-
101
95
PyObject *
102
96
_mysql_Exception (_mysql_ConnectionObject * c )
103
97
{
@@ -382,16 +376,11 @@ _mysql_ConnectionObject_Initialize(
382
376
"read_default_file" , "read_default_group" ,
383
377
"client_flag" , "ssl" ,
384
378
"local_infile" ,
385
- #ifdef HAVE_MYSQL_OPT_TIMEOUTS
386
- "read_timeout" ,
387
- "write_timeout" ,
388
- #endif
379
+ "read_timeout" , "write_timeout" ,
389
380
NULL } ;
390
381
int connect_timeout = 0 ;
391
- #ifdef HAVE_MYSQL_OPT_TIMEOUTS
392
382
int read_timeout = 0 ;
393
383
int write_timeout = 0 ;
394
- #endif
395
384
int compress = -1 , named_pipe = -1 , local_infile = -1 ;
396
385
char * init_command = NULL ,
397
386
* read_default_file = NULL ,
@@ -401,11 +390,7 @@ _mysql_ConnectionObject_Initialize(
401
390
self -> open = 0 ;
402
391
403
392
if (!PyArg_ParseTupleAndKeywords (args , kwargs ,
404
- #ifdef HAVE_MYSQL_OPT_TIMEOUTS
405
393
"|ssssisOiiisssiOiii:connect" ,
406
- #else
407
- "|ssssisOiiisssiOi:connect" ,
408
- #endif
409
394
kwlist ,
410
395
& host , & user , & passwd , & db ,
411
396
& port , & unix_socket , & conv ,
@@ -414,11 +399,9 @@ _mysql_ConnectionObject_Initialize(
414
399
& init_command , & read_default_file ,
415
400
& read_default_group ,
416
401
& client_flag , & ssl ,
417
- & local_infile
418
- #ifdef HAVE_MYSQL_OPT_TIMEOUTS
419
- , & read_timeout
420
- , & write_timeout
421
- #endif
402
+ & local_infile ,
403
+ & read_timeout ,
404
+ & write_timeout
422
405
))
423
406
return -1 ;
424
407
@@ -448,7 +431,6 @@ _mysql_ConnectionObject_Initialize(
448
431
mysql_options (& (self -> connection ), MYSQL_OPT_CONNECT_TIMEOUT ,
449
432
(char * )& timeout );
450
433
}
451
- #ifdef HAVE_MYSQL_OPT_TIMEOUTS
452
434
if (read_timeout ) {
453
435
unsigned int timeout = read_timeout ;
454
436
mysql_options (& (self -> connection ), MYSQL_OPT_READ_TIMEOUT ,
@@ -459,7 +441,6 @@ _mysql_ConnectionObject_Initialize(
459
441
mysql_options (& (self -> connection ), MYSQL_OPT_WRITE_TIMEOUT ,
460
442
(char * )& timeout );
461
443
}
462
- #endif
463
444
if (compress != -1 ) {
464
445
mysql_options (& (self -> connection ), MYSQL_OPT_COMPRESS , 0 );
465
446
client_flag |= CLIENT_COMPRESS ;
0 commit comments