-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Running sql statement with datetime format gives error Warning: (1292, "Incorrect date value: '2019/04/29:12:28:18' for column 'dateAdded' at row 1") #792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please paste it too. I never tried ":" between date and time. I didn't know it is allowed by MySQL or not. |
Sure |
Please paste it's output too. The output contains "Warning: 0"? Note that PyMySQL only "warn", not raise an exception. |
I'm raising an exception in my code - this is what I get:
That's all I get. |
It is warning. It doesn't stop your application. It only show warning. |
And I removed the show warning from MySQL in #774, because:
|
Sure - it's weird how MySQL warns through PyMySQL and not execute, but executes with no warning or error on the mysql command line. If you're annoyed, then apologies. It's very difficult to work out what is going on between the application level and the database. However, I think this isn't the place to air feelings, as there is nothing I can do about that. |
Really? You only paste what you input in mysql cmdline. You didn't paste what mysql shows. |
No. PyMySQL just translate MySQL warning to Python warning. |
@methane wrote:
I applaud this move, but alas, 0.9.3 is still the most recent version of |
@methane I think it's a shame this feature was removed, but from this issue the reasoning is clear... Would you accept a PR to re-add the functionality but make it opt-in? |
I don't want to ressurect it. It was too hard to maintain. Especially, it caused many bugs for multiple resultset case. You can use |
SQL to recreate the database:
Insert a new row:
So, when I run this, I get the sql statement:
insert into media (name, platform, dateadded, type) values ("games", "steam", "2019/04/29:12:28:18", "Game");
which works in the mysql command line client, but gives the error:
when run from python.
There's a possibly related issue at:
https://stackoverflow.com/questions/55073124/pymysql-select-maxtimestamp-results-in-incorrect-datetime-value-0000-00-00
The text was updated successfully, but these errors were encountered: