On Jul 10, 2012, at 2:08 PM, James wrote: > > I have not made any changes, have only proposed some hypothetical changes for > the 0.7 series. I don't have this newest version of MySQL installed, so I > was asking you to test the workaround I gave and/or the patch, to ensure it > solves all the problems fully. This testing would also establish that the > MySQL DBAPI is properly receiving/returning the microseconds field. > > If the workarounds I gave solve your problem fully, then I can commit the > patch to SQLAlchemy and resolve that we are doing all that's needed for > fractional time support. > > > I have tried implementing your suggestions. Unfortunately, your workaround > did not solve my problem fully. I successfully created the FracTime type > which extends Time and that shows a field for fractional seconds. However, > when I try to insert values into the FracTime column, I am still unable to to > specify the fractional seconds part. Even after modifying Time's process > method in lib/sqlalchemy/dialects/mysql/base.py to accept microseconds, I was > still unable to get it to work. > > To ensure that it was not a problem with sqlalchemy, I turned on logging to > look at was being passed to the DBAPI. What I see is: > > ... > INFO:sqlalchemy.engine.base.Engine.0x...a3d0:(4L, 7.48, 0.27, > datetime.timedelta > (0, 8, 26), 93, 0, 0, 62032, 0, 0, 19, 15573, 0) > ... > > It looks like datetime.timedelta is holding the microseconds correctly (that > is 0 minutes, 8 seconds and 26 microseconds). It looks to me that sqlalchemy > is correctly passing the microsecond value onto the DBAPI. After your > workaround, this seems to have confirmed that I am having a problem with my > DBAPI's (which I think is MySQLdb) communication with the db. > > Please let me know if you have anymore ideas. Thank you for your suggestions.
Yeah, I kind of suspected MySQLdb might have problems here. You need to file a bug report with the DBAPI's bug tracker: http://sourceforge.net/tracker/?group_id=22307&atid=374932 poke around there and see if someone's already requested this feature. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.