Thank you for the responses. I was aware this is a MySQL issue, however there are some very smart people on this forum and I thought perhaps someone may have the magic settings for my.ini allowing my code to function without change. I've done a lot of tedious reading about the MYSql timestamp changes, but no matter what I tried, I get an insert sql error in 5.7.9 stating that the field cannot be null.
So although the MYSQL documentation for 5.7 (and older) states a timestamp field set to null on an insert or update statement sets a timestamp, and this worked until at least 5.6.12, my easiest solution for now is to change my code:
from
timestamp_field=NULL
to
timestamp_field=NOW()
This works in 5.6.12, 5.7.9 and hopefully all future and prior releases. It also requires no database structure changes, but does involve going through a lot of 8 year old code.
.
This a Mysql bug report about this issue
[
bugs.mysql.com]
From [
dev.mysql.com]
"In addition, you can initialize or update any TIMESTAMP column to the current date and time by assigning it a NULL value, unless it has been defined with the NULL attribute to permit NULL values."
Update
Tested much of my code and although most of the other tables have an identical timestamp structure (added and last update) to the original failing table, inserts worked normally with 5.7.9
Edited 1 time(s). Last edit at 04/09/2016 08:10PM by arnb.