MySQL version 5.7 issue with ClientJobsDAO.py DATETIME DEFAULT 0 #2983
Comments
@vitaly-krugl @oxtopus Does this concern you at all? Outlier or should we update docs? @Ww36 Thank you for the note about this, it is helpful. |
Looking into it to make sure the 0 doesn't have special meaning in the logic. Also, trying it out on my own system. |
This is related to mysql’s wishy-washy position on the NO_ZERO_DATE flag that has gone and come again starting with 5.7.4. See "SQL Mode Changes in MySQL 5.7" http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-changes. Apparently, as of mysql 5.7.8, NO_ZERO_DATE is back in the default mode set. Apparently, you can get rid of the mentioned error by removing NO_ZERO_DATE from mysql’s config file (my.ini?). According to this note, "The long term plan is still to have the three affected modes be included in strict SQL mode and to remove them as explicit modes in a future MySQL release. ", but they keep going back and forth to give affected apps additional time to modify their schema. I think that we need to modify the affected schema to use datetime column attributes that are compatible with mysql 5.6 and 5.7.8+ and don’t break the application logic (update affected logic, if needed), in case something in the logic relies on the original default value. |
Thanks a lot, @vitaly-krugl. I will create an internal ticket for this and link it to this issue. |
A temporary workaround is to suppress This may be done either via I installed mysql 5.7.10 via homebrew, and this is how I start mysql without # exclude NO_ZERO_DATE
mysql_modes="ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
mysql.server start --sql-mode=${mysql_modes} |
For search reference, this is the error I get when I run into this problem:
|
Note that |
|
Thanks to @vitaly-krugl for fixing. I'll need to schedule a release before this fix gets into the binaries. Will try to release soon. |
Just installed nupic on OSX 10.9.
Found MySQL version 5.7 (latest) didn't like like the DATETIME DEFAULT 0 usage in
python/site-packages/nupic/database/ClientJobsDAO.py
Solution used: changed all instances of
DATETIME DEFAULT 0
to
DATETIME DEFAULT CURRENT_TIMESTAMP
... and MySQL was happy again.
Hope this is useful.
Andy
The text was updated successfully, but these errors were encountered: