[MDEV-32188] make TIMESTAMP use whole 32-bit unsigned range Created: 2023-09-16 Updated: 2024-02-07 |
|
| Status: | In Testing |
| Project: | MariaDB Server |
| Component/s: | Temporal Types |
| Fix Version/s: | 11.4 |
| Type: | New Feature | Priority: | Critical |
| Reporter: | Sergei Golubchik | Assignee: | Elena Stepanova |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | Preview_11.4 | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Currently timestamp is 32-bit signed, although negative values are rejected, so it is de facto 31-bit, allowing values from 1970 to 2038. We can make it 32-bit unsigned extending timestamp range to 2106, and it won't require many changes to the storage. Storage of timestamp is not affected but the change. |
| Comments |
| Comment by Michael Widenius [ 2023-09-19 ] | |||||
|
Bar, please review bb-11.3-monty | |||||
| Comment by Alexander Barkov [ 2023-10-23 ] | |||||
|
monty, there is a summary of my review comments (previously discussed on slack):
| |||||
| Comment by Alexander Barkov [ 2023-10-24 ] | |||||
|
The patches in bb-11.3-monty are Ok to push. | |||||
| Comment by Elena Stepanova [ 2024-01-07 ] | |||||
|
The branch is now bb-11.4-timestamp. | |||||
| Comment by Marko Mäkelä [ 2024-01-30 ] | |||||
|
I encountered the changeset Updated ALTER TABLE to convert old row_end timestamps to new timestamp range that is related to this task. I think that a change of a data type (from unsigned 31-bit timestamps to unsigned 32-bit) needs to be signaled to the storage engines by setting the ALTER_STORED_COLUMN_TYPE flag. In that way, InnoDB will refuse to perform any native ALTER TABLE operation just fine, and any fixup attempts like this one should be unnecessary. The idea of handler::check_if_supported_inplace_alter() is to let the storage engine choose the most efficient algorithm, unless the user has instructed otherwise, by specifying ALGORITHM=COPY or setting the parameters old_alter_table=1 or (ever since | |||||
| Comment by Marko Mäkelä [ 2024-01-30 ] | |||||
|
The ALTER TABLE attribute FORCE was originally introduced in MySQL 5.6.17 by the following bug fix, to allow the MySQL 5.6.8 WL#6255 online table rebuild to work on OPTIMIZE TABLE: I do not know which was the first GA release of MariaDB Server 10.0, but I think that this change was part of that release series from rather early on. |