[Zope] ZMySQLDA 2.0.0 and Time fields

Peter Bengtsson peter@grenna.net
Fri, 2 Mar 2001 01:53:22 -0000


Got it! Hacked it :)

In ZMySQLDA 2.0.0 there is a bug when using a time field.
What happened was that when I select-query a table with TIME (not datetime
or timestamp or date or anything normal like that)
The ZMySQLDA tried to convert that using DateTime. That failed.
>>> print DateTime('00:00:01')
Traceback (innermost last):
  File "<pyshell#4>", line 1, in ?
    print DateTime('00:00:01')
  File "C:\Program Files\Zopesite\lib\python\DateTime\DateTime.py", line
711, in __init__
    yr,mo,dy,hr,mn,sc,tz=self._parse(arg)
  File "C:\Program Files\Zopesite\lib\python\DateTime\DateTime.py", line
1050, in _parse
    raise self.SyntaxError, string
Invalid Date-Time String: 00:00:01


Solution:
Somewhere in db.py search for DateTime from bottom and up. The first line
there can be removed from the conv {}-dict. Let it be.

Peter