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
Looking into a problem with processqueue I noticed that the modified column of the sendprocess table was null.
The column definition was different to expected. It allowed a null value, didn't have the default value of current_timestamp, and didn't have the on update current_timestamp that it does have in other databases.
This line from admin/structure.php is the column definition, nothing about default or on update.
'modified' => array('timestamp', 'Modified'),
It turns out that a mysql variable explicit_defaults_for_timestamp affects that.
When set to OFF, that adds a default and on update of current_timestamp to the first timestamp field within a table. I think that is what has been relied on for all the timestamp fields in the database (no tables have more than one timestamp field).
At some point the default value for explicit_defaults_for_timestamp has been changed to ON
user
list
listuser
message
listmessage
sendprocess
user_message_bounce
user_message_forward
admin
linktrack
The user table might be the one most affected. Adding a subscriber manually seems to set the modified field explicitly, whereas a simple import, copy/paste of email addresses, doesn't. This affects exporting because there is a "When the record was changed " option.
The time field in the user_message_forward table seems to be populated explicitly, but the time field in the user_message_bounce table is sometimes populated and sometimes not.
The linktrack table is read-only I think for old link tracking data.
Looking into a problem with processqueue I noticed that the
modified
column of thesendprocess
table was null.The column definition was different to expected. It allowed a null value, didn't have the default value of
current_timestamp
, and didn't have theon update current_timestamp
that it does have in other databases.This line from admin/structure.php is the column definition, nothing about default or on update.
It turns out that a mysql variable
explicit_defaults_for_timestamp
affects that.https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_explicit_defaults_for_timestamp and for mariadb https://mariadb.com/docs/server/ref/mdb/system-variables/explicit_defaults_for_timestamp/
When set to OFF, that adds a default and on update of
current_timestamp
to the first timestamp field within a table. I think that is what has been relied on for all the timestamp fields in the database (no tables have more than one timestamp field).At some point the default value for
explicit_defaults_for_timestamp
has been changed to ONSince Mysql 8 https://dev.mysql.com/blog-archive/new-defaults-in-mysql-8-0/ and Mariadb in community release 10.5
It is simple to fix the column definitions for timestamp fields
and something similar to update the definition of timestamp columns in existing databases.
But it's not clear how to populate sensibly the ten occurrences of timestamp fields that now have null values.
The text was updated successfully, but these errors were encountered: