← Back to team overview

maria-developers team mailing list archive

Thoughts on a variable to control high resolution temporal type format and rounding behavior?

 

Sergei,

In the process of working through the bugs I've reported re. time formats
and InnoDB storage formats we noted that there isn't currently any way to
cause MariaDB to create a *new* Oracle MySQL 5.6-format
TIMESTAMP/TIME/DATETIME field, and thus there's not really very good test
coverage of them. Additionally the existence of this difference relative to
Oracle MySQL is not really desirable.

I would propose adding a new sysvar to control the temporal time format
e.g. temporal_microsecond_format={mysql|mariadb} which controls whether
newly created columns are created as Field_*_hires or Field_*f. This would
especially allow:

   1. Tests to be run in both Oracle MySQL and MariaDB modes.
   2. A single test to create a column in one format and request conversion
   to the other.
   3. A user to convert the format of their existing tables for
   compatibility.

Additionally I would suggest a new sysvar to control the rounding behavior
of the same temporal types, e.g.
temporal_microsecond_rounding={round|truncate} which controls whether to
round (as Oracle MySQL 5.6 does) or to truncate (as MariaDB does) when
faced with fitting a larger number of decimals in a value into a smaller
number decimals in a field. (This of course assumes that the current
MariaDB behavior and divergence from Oracle MySQL behavior is intentional,
and not a bug. Even if it is considered a bug it could probably not be
changed outright at this point and the sysvar would still be needed.)

Any thoughts on either of these? We would of course be willing to do the
work and provide the patches for them. I just wanted to get your general
feelings on the ideas.

Regards,

Jeremy

Follow ups