Bug #67145 | Is is not possible to partition on TIMESTAMP fields. It really should be, | ||
---|---|---|---|
Submitted: | 9 Oct 2012 12:55 | Modified: | 2 Feb 2013 10:07 |
Reporter: | Ben Clewett | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: Partitions | Severity: | S4 (Feature request) |
Version: | 5.5.27 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | Cannot partition on TIMESTAMP |
[9 Oct 2012 12:55]
Ben Clewett
[28 Dec 2012 18:31]
Sveta Smirnova
Thank you for the reasonable feature request. See http://dev.mysql.com/doc/refman/5.5/en/partitioning-range.html and bug #42849 for reasons why this currently not supported.
[29 Dec 2012 13:37]
Mattias Jonsson
What you are seeking is UNIX_TIMESTAMP(timestamp_col) which will use the internal stored UTC timestamp without any timezone conversions for partitioning. For more background see bug#42849 (and bug#28928). Also see: http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations-functions.html
[2 Jan 2013 10:07]
Mattias Jonsson
Mr Clewlett, Can you please confirm if PARTITION BY RANGE(UNIX_TIMESTAMP(joined)) works for you?
[3 Feb 2013 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[29 Jan 2019 0:17]
Alex Barker
`PARTITION BY RANGE(UNIX_TIMESTAMP(YEAR(created_at)))` does not appear to work around this issue.
[29 Jan 2019 0:35]
Alex Barker
For the record, this doesn't work either: ALTER TABLE `hematrix`.`buyer_ping_history` PARTITION BY RANGE(UNIX_TIMESTAMP(created_at)) ( PARTITION part0 VALUES LESS THAN (UNIX_TIMESTAMP('2018-12-31 23:59:59')), PARTITION part1 VALUES LESS THAN (UNIX_TIMESTAMP('2019-12-31 23:59:59')) ) Also bug #66958