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 338 attachment: fix2.diff (503 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/getdata.cpp b/src/getdata.cpp
index bd4232a..f3b1693 100644
--- a/src/getdata.cpp
+++ b/src/getdata.cpp
@@ -501,6 +501,11 @@ static PyObject* GetDataDecimal(Cursor* cur, Py_ssize_t iCol)
if (!str)
return 0;

+ // Some database (Netezza - I'm looking at you :) return empty string for 0
+ // NUMERIC
+ if (PyString_Size(str.Get()) == 0) {
+ str.Attach(PyString_FromString("0"));
+ }
return PyObject_CallFunction(decimal_type, "O", str.Get());
}

Powered by Google Project Hosting