-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Year 2038 bug - in use of timestamp in mySQL tables #952
Comments
This issue as stated is not valid. The information linked to refers to the mysql timestamp data type and mysql methods for working with that data type. The timestamp data type is never used by webwork. The issue does not apply to a column in a database that has the name "timestamp" but is of type "INT" or "BIGINT" which the columns that are referred to are. Note that the "INT" type is 4 bytes and will have the year 2038 issue if it holds a value that represents a timestamp, but that only applies to the timestamp column in the past answers table. This would be very easy to fix. |
Currently this column is of `INT` type. The `INT` type is a 4 bit integer, and so a timestamp stored in this column that is after the year 2038 will not work. A `BIGINT` is large enough for my lifetime at least (and then another 292 billion years or so). There is no need to update databases since the INT and BIGINT types are compatible. However, at some point you will need to make sure that the type of the column in all courses is updated. You can run the `upgrade-database-to-utf8mb4.pl` script to do this. For example, running `upgrade-database-to-utf8mb4.pl -c courseId` will update the past answer table for the named course. This fixes issue openwebwork#952.
Currently this column is of `INT` type. The `INT` type is a 4 bit integer, and so a timestamp stored in this column that is after the year 2038 will not work. A `BIGINT` is large enough for my lifetime at least (and then another 292 billion years or so). There is no need to update databases since the INT and BIGINT types are compatible. However, at some point you will need to make sure that the type of the column in all courses is updated. You can run the `upgrade-database-to-utf8mb4.pl` script to do this. For example, running `upgrade-database-to-utf8mb4.pl -c courseId` will update the past answer table for the named course. This fixes issue openwebwork#952.
Sorry. You are certainly correct. I was still pretty new to WeBWorK back then, and messed up. Your #2648 will fix the one column where the 4 byte INT column will run into the issue. |
mySQL's
timestamp
is apparently still a 32-bit integer, so apparently suffers from the year 2038 bug:timestamp
is used incourse_key
table (I think for the expiration time of the login key "cookie"), andcourse_past_answer
table (I think as the timestamp when the answer was submitted).We have some time, but eventually unless mySQL/MariaDB fix this issue, these columns will need to be changed.
Background:
The text was updated successfully, but these errors were encountered: