Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
MDEV-16991 will integrate nanosecond rounding functionality as methods into class Temporal (and its descendants Time, Datetime and Temporal_hybrid). There will be no rounding functionality for pure MYSQL_TIME.
To reuse rounding easier in these functions:
- str_to_datetime_with_warn()
- double_to_datetime_with_warn()
- decimal_to_datetime_with_warn()
we need to remove direct calls for functions like str_to_datetime(), which operate on pure MYSQL_TIME, and add Temporal_hybrid constructors instead. So nanoseconds rounding will automatically start working in xxx_to_datetime_with_warn() as soon as it's implemented in Temporal_hybrid constructors.
A constructor making a Temporal_hybrid from strings already exists and is used in Type_handler_temporal_with_date::create_literal_item() and Type_handler_date_common::create_literal_item(). str_to_datetime_with_warn() will reuse it.
A new constructor making a Temporal_hybrid from numbers (namely from Sec6) will be added under terms of this task.
Functions double_to_datetime_with_warn(), decimal_to_datetime_with_warn(), int_to_datetime_with_warn() will reuse this new constructor.
This is a self-containing dependency change to make the future patch for MDEV-16991 as simple and clear as possible.
Attachments
Issue Links
- blocks
-
MDEV-16991 Rounding vs truncation for TIME, DATETIME, TIMESTAMP
- Closed