Author Joakim.Sernbrant
Recipients Joakim.Sernbrant
Date 2012-04-13.22:09:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1334354952.88.0.487562486207.issue14572@psf.upfronthosting.co.za>
In-reply-to
Content
Python-2.7.3/Modules/_sqlite/connection.c: In function ‘_pysqlite_set_result’:
Python-2.7.3/Modules/_sqlite/connection.c:552: error: ‘sqlite3_int64’ undeclared (first use in this function)

The centos 5 version of sqlite3 (sqlite-devel-3.3.6-5) does not export the type sqlite3_int64. 2.7.0 did build without problems.

Newer versions declare both sqlite3_int64 and sqlite_int64: http://www.sqlite.org/c3ref/int64.html

Patch:

diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 26678c7..a646513 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -549,7 +549,7 @@ void _pysqlite_set_result(sqlite3_context* context, PyObject* py_val)
     } else if (py_val == Py_None) {
         sqlite3_result_null(context);
     } else if (PyInt_Check(py_val)) {
-        sqlite3_result_int64(context, (sqlite3_int64)PyInt_AsLong(py_val));
+        sqlite3_result_int64(context, (sqlite_int64)PyInt_AsLong(py_val));
     } else if (PyLong_Check(py_val)) {
         sqlite3_result_int64(context, PyLong_AsLongLong(py_val));
     } else if (PyFloat_Check(py_val)) {
@@ -580,7 +580,7 @@ PyObject* _pysqlite_build_py_params(sqlite3_context *context, int argc, sqlite3_
     sqlite3_value* cur_value;
     PyObject* cur_py_value;
     const char* val_str;
-    sqlite3_int64 val_int;
+    sqlite_int64 val_int;
     Py_ssize_t buflen;
     void* raw_buffer;
History
Date User Action Args
2012-04-13 22:09:12Joakim.Sernbrantsetrecipients: + Joakim.Sernbrant
2012-04-13 22:09:12Joakim.Sernbrantsetmessageid: <1334354952.88.0.487562486207.issue14572@psf.upfronthosting.co.za>
2012-04-13 22:09:11Joakim.Sernbrantlinkissue14572 messages
2012-04-13 22:09:11Joakim.Sernbrantcreate