Skip to content

Commit

Permalink
SERVER-56371 Upgrade timelib to 2021.06
Browse files Browse the repository at this point in the history
  • Loading branch information
mdashti authored and Evergreen Agent committed Apr 27, 2021
1 parent a5b95e6 commit 0c7ff5f
Show file tree
Hide file tree
Showing 40 changed files with 35 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.third_party.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ a notice will be included in
| [schemastore.org] | Apache-2.0 | | 6847cfc3a1 | | |
| [scons] | MIT | 3.1.2 | 3.1.2 | | |
| [Snappy] | BSD-3-Clause | 1.1.8 | 1.1.7 |||
| [timelib] | MIT | 2021.05 | 2021.05 | ||
| [timelib] | MIT | 2021.06 | 2021.06 | ||
| [TomCrypt] | Public Domain | 1.18.2 | 1.18.2 |||
| [Unicode] | Unicode-DFS-2015 | 13.0.0 | 8.0.0 |||
| [Valgrind] | BSD-3-Clause<sup>\[<a href="#note_vg" id="ref_vg">1</a>]</sup> | 3.17.0 | 3.17.0 | ||
Expand Down
2 changes: 1 addition & 1 deletion etc/third_party_components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ components:
homepage_url: https://github.com/derickr/timelib
open_hub_url: N/A
release_monitoring_id: -1
local_directory_path: src/third_party/timelib-2021.05
local_directory_path: src/third_party/timelib-2021.06
team_owner: "Query"
# Note: Not in Black Duck

Expand Down
3 changes: 2 additions & 1 deletion src/mongo/db/query/datetime/date_time_support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ void TimeZoneDatabase::loadTimeZoneInfo(
<< entry.id << "\": " << timelib_get_error_message(errorCode)});
}

invariant(errorCode == TIMELIB_ERROR_NO_ERROR);
invariant(errorCode == TIMELIB_ERROR_NO_ERROR ||
errorCode == TIMELIB_ERROR_EMPTY_POSIX_STRING);
_timeZones[entry.id] = TimeZone{tzInfo};
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/third_party/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pcreSuffix = "-8.42"
mozjsSuffix = '-60'
yamlSuffix = '-0.6.2'
icuSuffix = '-57.1'
timelibSuffix = '-2021.05'
timelibSuffix = '-2021.06'
tomcryptSuffix = '-1.18.2'
variantSuffix = '-1.4.0'

Expand Down
2 changes: 1 addition & 1 deletion src/third_party/scripts/timelib_get_sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set -o errexit
# parser to hang.
#

VERSION=2021.05
VERSION=2021.06
NAME=timelib
TARBALL=$VERSION.tar.gz
TARBALL_DIR=$NAME-$VERSION
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Generated by re2c 0.15.3 on Tue Apr 20 10:50:52 2021 */
/* Generated by re2c 0.15.3 on Mon Apr 26 16:21:07 2021 */
#line 1 "parse_date.re"
/*
* The MIT License (MIT)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Generated by re2c 0.15.3 on Tue Apr 20 10:50:52 2021 */
/* Generated by re2c 0.15.3 on Mon Apr 26 16:21:07 2021 */
#line 1 "parse_iso_intervals.re"
/*
* The MIT License (MIT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,11 +553,22 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
timelib_free(date_str);
}

if (!tz->posix_string) {
printf("\n%43sNo POSIX string\n", "");
return;
}

if (strcmp("", tz->posix_string) == 0) {
printf("\n%43sEmpty POSIX string\n", "");
return;
}

printf("\n%43sPOSIX string: %s\n", "", tz->posix_string);
if (tz->posix_info->std) {
if (tz->posix_info && tz->posix_info->std) {
trans_str = format_offset_type(tz, tz->posix_info->type_index_std_type);
printf("%43sstd: %s\n", "", trans_str);
timelib_free(trans_str);

if (tz->posix_info->dst) {
trans_str = format_offset_type(tz, tz->posix_info->type_index_dst_type);
printf("%43sdst: %s\n", "", trans_str);
Expand Down Expand Up @@ -693,8 +704,10 @@ timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *t
}

read_posix_string(&tzf, tmp);
if (!integrate_posix_string(tmp)) {
*error_code = TIMELIB_ERROR_POSIX_MISSING_TTINFO;
if (strcmp("", tmp->posix_string) == 0) {
*error_code = TIMELIB_ERROR_EMPTY_POSIX_STRING;
} else if (!integrate_posix_string(tmp)) {
*error_code = TIMELIB_ERROR_CORRUPT_POSIX_STRING;
timelib_tzinfo_dtor(tmp);
return NULL;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#define TIMELIB_LLABS(y) (y < 0 ? (y * -1) : y)

const char *timelib_error_messages[9] = {
const char *timelib_error_messages[10] = {
"No error",
"Can not allocate buffer for parsing",
"Corrupt tzfile: The transitions in the file don't always increase",
Expand All @@ -44,6 +44,8 @@ const char *timelib_error_messages[9] = {
"The version used in this timezone identifier is unsupported",
"No timezone with this name could be found",
"A 'slim' timezone file has been detected",
"The embedded POSIX string is not valid",
"The embedded POSIX string is empty"
};

const char *timelib_get_error_message(int error_code)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
# include "timelib_config.h"
#endif

#define TIMELIB_VERSION 202105
#define TIMELIB_EXTENDED_VERSION 20210501
#define TIMELIB_ASCII_VERSION "2021.05"
#define TIMELIB_VERSION 202106
#define TIMELIB_EXTENDED_VERSION 20210601
#define TIMELIB_ASCII_VERSION "2021.06"

#include <stdlib.h>
#include <stdbool.h>
Expand Down Expand Up @@ -375,16 +375,18 @@ typedef struct _timelib_tzdb {
#define TIMELIB_UNSET -99999

/* An entry for each of these error codes is also in the
* timelib_error_messages array in timelib.c */
* timelib_error_messages array in timelib.c.
* Codes 0x00, 0x07, and 0x09 are warnings only. */
#define TIMELIB_ERROR_NO_ERROR 0x00
#define TIMELIB_ERROR_CANNOT_ALLOCATE 0x01
#define TIMELIB_ERROR_CORRUPT_TRANSITIONS_DONT_INCREASE 0x02
#define TIMELIB_ERROR_CORRUPT_NO_64BIT_PREAMBLE 0x03
#define TIMELIB_ERROR_CORRUPT_NO_ABBREVIATION 0x04
#define TIMELIB_ERROR_UNSUPPORTED_VERSION 0x05
#define TIMELIB_ERROR_NO_SUCH_TIMEZONE 0x06
#define TIMELIB_ERROR_SLIM_FILE 0x07
#define TIMELIB_ERROR_POSIX_MISSING_TTINFO 0x08
#define TIMELIB_ERROR_SLIM_FILE 0x07 /* Warns if the file is SLIM, but we can't read it */
#define TIMELIB_ERROR_CORRUPT_POSIX_STRING 0x08
#define TIMELIB_ERROR_EMPTY_POSIX_STRING 0x09 /* Warns if the POSIX string is empty, but still produces results */

#ifdef __cplusplus
extern "C" {
Expand Down

0 comments on commit 0c7ff5f

Please sign in to comment.