#216 mysql_timestamp_converter fails on "YYYY-MM-DD HH:MM:SS"

ZMySQLDA-2.0.9
closed
Andy Dustman
MySQLdb (285)
5
2012-09-19
2006-10-19
Jo Meder
No

mysql_timestamp_converter assumes that the timestamp
string doesn't have any formatting but my MySQL-server
(Version 4.1.20) gives timestamps as "YYYY-MM-DD HH:MM:SS".

Quick'n'dirty solution: insert

elif len(s) == 19:
s = s.replace("-","").replace(":","").replace(" ","")

after the 14-char check.

This bug is present in MySQLdb and ZMySQLDA since they
both use the same code.

Discussion

  • Andy Dustman
    Andy Dustman
    2006-10-19

    Logged In: YES
    user_id=71372

    What exact version of MySQLdb are you using?

     
  • Jo Meder
    Jo Meder
    2006-10-19

    Logged In: YES
    user_id=13575

    Sorry to not have included this info from the beginning.
    We're using MySQL-python-1.2.1_p2 and ZMySQLDA-2.0.8 just
    downloaded today.

    Thanks for answering!

    Jo (jo@meder.de)

     
  • Andy Dustman
    Andy Dustman
    2006-10-19

    Logged In: YES
    user_id=71372

    You need to use ZMySQLDA-2.0.9b3 with MySQL-4.1.