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
For some reason, fActiveRecord is choosing to interpret and reimplement default values defined in the database.
For example, inserting a new record into a table with a TIMESTAMP column, where the default value for the column is declared as CURRENT_TIMESTAMP, through some mechanism, fTimestamp is getting involved in the transaction and replacing the default value with the current value of time().
This is problematic for two reasons:
TIMESTAMPS are accurate to the microsecond. At the least, microtime() should be called rather than time().
Time differences between one (or several) web front ends, and a single backend database, will result in incorrect timestamps -- timestamps that exist in the schema and have a default value precisely to avoid this issue, by always stamping with the (consistent) DB server time regardless of what time the client thinks it is.
Some way of disabling this behavior and allowing the DB to perform it's normal function WRT column defaults is desirable.
The text was updated successfully, but these errors were encountered:
Investigating this problem, the changes required are wide in scope, and not easily addressed. The use of date() and strtotime(), as well as time() instead of microtime(true) are prolific throughout the code.
In "fixing" these issues I ended up gutting a lot of functional (but useless to me) code, too much to bother commiting to github or sending a pull request.
I'm updating the ticket just to point out the additional problems discovered, and give some idea of the scope involved in fixing them. I replaced fTime, fDate, and fTimestamp, deleted fORMValidation and had to make modifications to.fActiveRecord, fDatabase, fFile, fORM, fORMDate, fRequest, and fValidation.
I consider the behavior of overriding the DB default values, and not supporting the full scope of a Timestamp field to be actual bugs, and am leaving the ticket open. I suppose it could be closed and marked "won't fix", but I'll leave that to you to decide.
For some reason, fActiveRecord is choosing to interpret and reimplement default values defined in the database.
For example, inserting a new record into a table with a TIMESTAMP column, where the default value for the column is declared as CURRENT_TIMESTAMP, through some mechanism, fTimestamp is getting involved in the transaction and replacing the default value with the current value of time().
This is problematic for two reasons:
Some way of disabling this behavior and allowing the DB to perform it's normal function WRT column defaults is desirable.
The text was updated successfully, but these errors were encountered: