[SERVER-29627] Replace pieces of time_support.h/cpp if they can be implemented using new timezone library Created: 14/Jun/17  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Charlie Swanson Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-28609 Redo existing TZ support by removing ... Closed
Related
is related to SERVER-34949 Improved safety for time_support.h API Closed
Assigned Teams:
Query Execution
Sprint: Query 2017-08-21, Query 2017-09-11
Participants:

 Description   

As part of the review for SERVER-28611 we realized we now have some duplicate logic in time_support.h and date_time_support.h. We should re-jigger the libraries and make time_support.h use the new helpers that call into timelib.

The following new format specifiers will also be available after this gets merged:

%a
The abbreviated English name of the day of the week.

%b
The abbreviated English name of the month.

%e
The day of the month as a decimal number, but unlike ``%d``, pre-padded with space instead of a ``0``.



 Comments   
Comment by Andy Schwerin [ 26/Jul/17 ]

derick, a bunch of the code for serializing Date_t to strings is used by the diagnostic logging code, and so must be present in the "base" library. This change may require more work than is warranted right now. It's not clear to me why the date/time support library in query is in query at all, and teasing it out of there may be required in order to fix to use it in time_support.h/cpp.

From my survey of the code, I think the work items for this ticket would be as follows:

  1. remove references to ServiceContext from date_time_support.h/cpp
  2. move those files into the base directory,
  3. Add $BUILD_DIR/third_party/shim_timelib to the baseLibDeps and base/date_time_support.cpp to baseSource
  4. Replace the pieces of time_support.h/cpp with those provided by the new timezone code.
  5. Put a separate library together that attaches a TimeZoneDatabase to ServiceContext (the piece removed in step 1). That library is separate from base, and its only job is to decorate ServiceContext with a TimeZoneDatabase.
Comment by Charlie Swanson [ 25/Jul/17 ]

derick I think it'd be good to move as much of the date handling as we can into date_time_support. I feel like these things can at least be moved into date_time_support.h, if not re-implemented by using timelib. Also, I think we were planning to make Value::coerceToString() output a date type using the ISO standard, which it currently doesn't do because it leaves off the milliseconds and the 'Z', which I was vaguely hoping was part of this work. I'm happy to spin off a separate ticket for that though, since it seems mostly orthogonal

Generated at Thu Feb 08 04:21:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.