@@ -30,6 +30,13 @@ PERFORMANCE OF THIS SOFTWARE.
30
30
#include "mysql.h"
31
31
#include "mysqld_error.h"
32
32
33
+ #ifdef HAVE_WCSCOLL
34
+ #undef HAVE_WCSCOLL
35
+ #endif
36
+ #ifdef SIZEOF_SIZE_T
37
+ #undef SIZEOF_SIZE_T
38
+ #endif
39
+
33
40
#include "Python.h"
34
41
#if PY_MAJOR_VERSION >= 3
35
42
#define IS_PY3K
@@ -1352,9 +1359,9 @@ _mysql_field_to_python(
1352
1359
unsigned long length ,
1353
1360
MYSQL_FIELD * field )
1354
1361
{
1355
- int field_type = field -> type ;
1356
1362
PyObject * v ;
1357
1363
#ifdef IS_PY3K
1364
+ int field_type = field -> type ;
1358
1365
// Return bytes for binary and string types.
1359
1366
int binary = 0 ;
1360
1367
if (field_type == FIELD_TYPE_TINY_BLOB ||
@@ -1368,7 +1375,6 @@ _mysql_field_to_python(
1368
1375
#endif
1369
1376
if (rowitem ) {
1370
1377
if (converter != Py_None ) {
1371
- const char * fmt = "s#" ;
1372
1378
v = PyObject_CallFunction (converter ,
1373
1379
#ifdef IS_PY3K
1374
1380
binary ? "y#" : "s#" ,
@@ -1569,7 +1575,7 @@ _mysql_ResultObject_fetch_row(
1569
1575
& maxrows , & how ))
1570
1576
return NULL ;
1571
1577
check_result_connection (self );
1572
- if (how < 0 || how >= sizeof (row_converters )) {
1578
+ if (how >= sizeof (row_converters )) {
1573
1579
PyErr_SetString (PyExc_ValueError , "how out of range" );
1574
1580
return NULL ;
1575
1581
}
@@ -1974,7 +1980,6 @@ _mysql_ConnectionObject_query(
1974
1980
{
1975
1981
char * query ;
1976
1982
int len , r ;
1977
- MYSQL * mysql = & (self -> connection );
1978
1983
if (!PyArg_ParseTuple (args , "s#:query" , & query , & len )) return NULL ;
1979
1984
check_connection (self );
1980
1985
@@ -2018,8 +2023,7 @@ static PyObject *
2018
2023
_mysql_ConnectionObject_read_query_result (
2019
2024
_mysql_ConnectionObject * self )
2020
2025
{
2021
- char * query ;
2022
- int len , r ;
2026
+ int r ;
2023
2027
MYSQL * mysql = & (self -> connection );
2024
2028
check_connection (self );
2025
2029
@@ -2663,7 +2667,7 @@ _mysql_ConnectionObject_getattro(
2663
2667
if (strcmp (cname , "closed" ) == 0 )
2664
2668
return PyInt_FromLong ((long )!(self -> open ));
2665
2669
2666
- return PyObject_GenericGetAttr (self , name );
2670
+ return PyObject_GenericGetAttr (( PyObject * ) self , name );
2667
2671
}
2668
2672
2669
2673
static int
@@ -2677,7 +2681,7 @@ _mysql_ConnectionObject_setattro(
2677
2681
"can't delete connection attributes" );
2678
2682
return -1 ;
2679
2683
}
2680
- return PyObject_GenericSetAttr (self , name , v );
2684
+ return PyObject_GenericSetAttr (( PyObject * ) self , name , v );
2681
2685
}
2682
2686
2683
2687
static int
@@ -2691,7 +2695,7 @@ _mysql_ResultObject_setattro(
2691
2695
"can't delete connection attributes" );
2692
2696
return -1 ;
2693
2697
}
2694
- return PyObject_GenericSetAttr (self , name , v );
2698
+ return PyObject_GenericSetAttr (( PyObject * ) self , name , v );
2695
2699
}
2696
2700
2697
2701
PyTypeObject _mysql_ConnectionObject_Type = {
0 commit comments