-
Notifications
You must be signed in to change notification settings - Fork 193
Description
The problem might not be specific to datetime formatting, but that's where I'm stuck.
Consider the following query that executes fine directly on mysql:
mysql> SELECT STR_TO_DATE('01:35 PM', '%h:%i %p') as t;
+----------+
| t |
+----------+
| 13:35:00 |
+----------+
However, when I run the exact same query in torndb:
row = conn.get("SELECT STR_TO_DATE('01:35 PM', '%%h:%%i %%p') as t")
print ">>", row.t
I get the following warning (conn is correctly constructed using torndb.Connection):
/Library/Python/2.7/site-packages/torndb.py:226: Warning: Incorrect datetime value: '01:35 PM' for function str_to_date
return cursor.execute(query, kwparameters or parameters)
None
I looked at the mysqld logs, and it seems that both queries are identical in the server, only using torndb I see the following:
290 Query SELECT STR_TO_DATE('01:35 PM', '%h:%i %p') as t
290 Query SHOW WARNINGS
whereas when I run it from mysql, I only see the first line:
46 Query SELECT STR_TO_DATE('01:35 PM', '%h:%i %p') as t
What is going on here?