← Back to team overview

maria-discuss team mailing list archive

partitioning by timestamp field

 

Hello,
  I am trying to setup a range partitioned table using 5.5.27-MariaDB-log MariaDB Server using a timestamp field. According to the documents, I should be able to use  unix_timestamp(ts) as my partitioning function ( http://dev.mysql.com/doc/refman/5.5/en/partitioning-range.html ) . I find, however, that it is not possible to use unix_timestamp using mariadb because with mariadb the unix_timestamp function returns an floating point value:

mariadb> select unix_timestamp('2012-12-01');
+------------------------------+
| unix_timestamp('2012-12-01') |
+------------------------------+
|            1354320000.000000 |
+------------------------------+
1 row in set (0.00 sec)



However the MySQL version of unix_timestamp returns an int value:

myqsl> select unix_timestamp('2012-12-01');
+------------------------------+
| unix_timestamp('2012-12-01') |
+------------------------------+
|                   1354320000 |
+------------------------------+
1 row in set (0.06 sec)



How have people worked around this issue? What other ways can I partition by a timestamp in MariaDB ?
  Thanks,
 -Said


Follow ups