[issue14572] 2.7.3: sqlite module does not build on centos 5

Joakim Sernbrant report at bugs.python.org
Sat Apr 14 00:09:12 CEST 2012


New submission from Joakim Sernbrant <serbaut at gmail.com>:

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;

----------
components: Build
messages: 158238
nosy: Joakim.Sernbrant
priority: normal
severity: normal
status: open
title: 2.7.3: sqlite module does not build on centos 5
type: compile error
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14572>
_______________________________________


More information about the Python-bugs-list mailing list