mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-10 19:16:34 +03:00
Fixed problem in microseconds conversion.
This commit is contained in:
parent
f4fee20b3b
commit
03c0a258a2
|
@ -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.
|
||||
|
|
13
INSTALL
13
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:
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -137,6 +139,11 @@ typecast_parse_time(char* s, char** t, int* len,
|
|||
|
||||
*tz = tzs * tzhh*60 + tzmm;
|
||||
|
||||
if (*us != 0.0) {
|
||||
while (usd < 6)
|
||||
*us *= (*us)*10.0;
|
||||
}
|
||||
|
||||
return cz;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user