[MDEV-17331] Reuse Temporal_hybrid in xxx_to_date_with_warn() Created: 2018-10-01  Updated: 2018-10-01  Resolved: 2018-10-01

Status: Closed
Project: MariaDB Server
Component/s: Data types, Temporal Types
Fix Version/s: 10.4.0

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-16991 Rounding vs truncation for TIME, DATE... Closed

 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.


Generated at Thu Feb 08 08:35:39 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.