You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Datetime fields with microsecond shows as None (SF bug #325)Β #24
When SELECT datatime field which contained microseconds from DB(MariaDB 5.5 and MySQL 5.6). Result can not be converted to datetime.datetime and data in that field shows as None. I use MariaDB 5.5.27.
For example:
Make table in DB and fill its
importMySQLdbdb=MySQLdb.connect(host="localhost",user="test",passwd="test",db="test")
c=db.cursor()
c.execure("""DROP TABLE IF EXISTS `t1`""")
c.execure("""CREATE TABLE `t1` ( `id` int(11) `date` datatime(6) NOT NULL, PRIMARY KEY (`id`),) ENGINE=InnoDB DEFAULT CHARSET=utf8""")
c.execure("""INSERT INTO t1 VALUES(1,now(6)), VALUES(2,NOW(6)), VALUES(3,NOW(6))""")
Activity
Merge pull request #25 from tyzhnenko/microsecond-bug-fix
lfyzjck commentedon Jun 29, 2016
Sorry, i still have the issue on version 1.2.5
MySQL Server: 5.6.24 Homebrew
MySQL-python: 1.2.5
Here is my table schema:
Test Code:
Output:
And the datetime value shows well in mysql shell.
methane commentedon Jun 29, 2016
@lfyzjck
https://pypi.python.org/pypi/mysqlclient fixed this issue long ago.
lfyzjck commentedon Jun 30, 2016
@methane It works, thank you very much!
But why MySQLdb don't fix this issue? it seems very critical.
methane commentedon Jun 30, 2016
The author is inactive for these years.
Look commit log.