summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--INSTALL13
-rw-r--r--psycopg/typecast.c9
3 files changed, 26 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e59fe2e..9b2affa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
+2005-11-20 Federico Di Gregorio <fog@initd.org>
+
+ * psycopg/typecast.c: fixed problem with microseconds conversion by
+ applying slightly modified patch from Ronnie Mackay.
+
2005-11-19 Federico Di Gregorio <fog@initd.org>
* lib/extensions.py: COMMITED -> COMMITTED. (Closes: #73)
+
* doc/extensions.rst: included Daniele's work after minor cosmetic changes
like using the new constants instead of numbers for transaction isolation
levels.
diff --git a/INSTALL b/INSTALL
index 512bd18..b45ce51 100644
--- a/INSTALL
+++ b/INSTALL
@@ -16,8 +16,19 @@ to build in the local directory; and:
to install system-wide.
+Using setuptools and EasyInstall
+================================
+
+If setuptools are installed on your system you can easily create an egg for
+psycopg and install it. Download the source distribution (if you're reading
+this file you probably already have) and then edit setup.cfg to your taste
+and build from the source distribution top-level directory using:
+
+ easy_install .
+
+
Compiling under Windows with mingw32
-************************************
+====================================
You can compile psycopg under Windows platform with mingw32 compiler. The
software required is:
diff --git a/psycopg/typecast.c b/psycopg/typecast.c
index 3ab5163..f351bfa 100644
--- a/psycopg/typecast.c
+++ b/psycopg/typecast.c
@@ -88,6 +88,7 @@ typecast_parse_time(char* s, char** t, int* len,
{
int acc = -1, cz = 0;
int tzs = 1, tzhh = 0, tzmm = 0;
+ int usd = 0;
/* sets microseconds and timezone to 0 because they may be missing */
*us = *tz = 0;
@@ -121,6 +122,7 @@ typecast_parse_time(char* s, char** t, int* len,
break;
default:
acc = (acc == -1 ? 0 : acc*10) + ((int)*s - (int)'0');
+ if (cz == 3) usd += 1;
break;
}
@@ -136,7 +138,12 @@ typecast_parse_time(char* s, char** t, int* len,
if (t != NULL) *t = s;
*tz = tzs * tzhh*60 + tzmm;
-
+
+ if (*us != 0.0) {
+ while (usd < 6)
+ *us *= (*us)*10.0;
+ }
+
return cz;
}