My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 293 attachment: pyodbc-3.0.6-python24.patch (2.2 KB)

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
--- src/pyodbccompat.h~ 2012-01-13 13:24:56.000000000 +0100
+++ src/pyodbccompat.h 2012-10-24 11:40:52.000000000 +0200
@@ -140,4 +140,15 @@
#endif
}

+#if (PY_VERSION_HEX < 0x02050000)
+typedef int Py_ssize_t;
+#define PyInt_FromSsize_t PyInt_FromLong
+#define PyNumber_AsSsize_t(ob, exc) PyInt_AsLong(ob)
+#define PyIndex_Check(ob) PyInt_Check(ob)
+typedef Py_ssize_t (*readbufferproc)(PyObject *, Py_ssize_t, void **);
+typedef Py_ssize_t (*writebufferproc)(PyObject *, Py_ssize_t, void **);
+typedef Py_ssize_t (*segcountproc)(PyObject *, Py_ssize_t *);
+typedef Py_ssize_t (*charbufferproc)(PyObject *, Py_ssize_t, char **);
+#endif
+
#endif // PYODBCCOMPAT_H
--- src/cursor.cpp~ 2012-06-24 17:49:34.000000000 +0200
+++ src/cursor.cpp 2012-10-24 11:49:29.000000000 +0200
@@ -1874,7 +1874,7 @@
Py_RETURN_NONE;
}

-static const char* commit_doc =
+static char* commit_doc =
"Commits any pending transaction to the database on the current connection,\n"
"including those from other cursors.\n";

@@ -1985,7 +1985,7 @@
return -1;
}

- uintptr_t noscan = PyObject_IsTrue(value) ? SQL_NOSCAN_ON : SQL_NOSCAN_OFF;
+ SQLUINTEGER noscan = PyObject_IsTrue(value) ? SQL_NOSCAN_ON : SQL_NOSCAN_OFF;
SQLRETURN ret;
Py_BEGIN_ALLOW_THREADS
ret = SQLSetStmtAttr(cursor->hstmt, SQL_ATTR_NOSCAN, (SQLPOINTER)noscan, 0);
--- src/connection.h~ 2012-06-24 17:49:34.000000000 +0200
+++ src/connection.h 2012-10-24 11:56:03.000000000 +0200
@@ -24,7 +24,7 @@
HDBC hdbc;

// Will be SQL_AUTOCOMMIT_ON or SQL_AUTOCOMMIT_OFF.
- uintptr_t nAutoCommit;
+ SQLUINTEGER nAutoCommit;

// The ODBC version the driver supports, from SQLGetInfo(DRIVER_ODBC_VER). This is set after connecting.
char odbc_major;
--- src/connection.cpp~ 2012-06-24 17:49:34.000000000 +0200
+++ src/connection.cpp 2012-10-24 12:43:23.000000000 +0200
@@ -715,7 +715,7 @@
return -1;
}

- uintptr_t nAutoCommit = PyObject_IsTrue(value) ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF;
+ SQLUINTEGER nAutoCommit = PyObject_IsTrue(value) ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF;
SQLRETURN ret;
Py_BEGIN_ALLOW_THREADS
ret = SQLSetConnectAttr(cnxn->hdbc, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)nAutoCommit, SQL_IS_UINTEGER);
Powered by Google Project Hosting