Skip to content

Commit

Permalink
Backport #60768 to 24.1: Update tzdata to 2024a
Browse files Browse the repository at this point in the history
  • Loading branch information
robot-clickhouse committed Mar 5, 2024
1 parent c6129a2 commit 48fdb17
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion contrib/cctz
Submodule cctz updated 66 files
+16 −4 BUILD
+3 −1 CMakeLists.txt
+2 −2 include/cctz/civil_time_detail.h
+1 −112 src/cctz_benchmark.cc
+2 −2 src/time_zone_format.cc
+18 −20 src/time_zone_info.cc
+8 −32 src/time_zone_lookup.cc
+1 −112 src/time_zone_lookup_test.cc
+3 −11 src/tzfile.h
+1 −1 testdata/README.zoneinfo
+1 −1 testdata/version
+ testdata/zoneinfo/America/Ensenada
+ testdata/zoneinfo/America/Godthab
+ testdata/zoneinfo/America/Goose_Bay
+ testdata/zoneinfo/America/Indiana/Winamac
+ testdata/zoneinfo/America/Matamoros
+ testdata/zoneinfo/America/Metlakatla
+ testdata/zoneinfo/America/Miquelon
+ testdata/zoneinfo/America/Moncton
+ testdata/zoneinfo/America/Montreal
+ testdata/zoneinfo/America/Nipigon
+ testdata/zoneinfo/America/Nuuk
+ testdata/zoneinfo/America/Ojinaga
+ testdata/zoneinfo/America/Santa_Isabel
+ testdata/zoneinfo/America/Scoresbysund
+ testdata/zoneinfo/America/St_Johns
+ testdata/zoneinfo/America/Thunder_Bay
+ testdata/zoneinfo/America/Tijuana
+ testdata/zoneinfo/America/Toronto
+ testdata/zoneinfo/Antarctica/Casey
+ testdata/zoneinfo/Antarctica/Macquarie
+ testdata/zoneinfo/Antarctica/Troll
+ testdata/zoneinfo/Antarctica/Vostok
+ testdata/zoneinfo/Asia/Almaty
+ testdata/zoneinfo/Asia/Gaza
+ testdata/zoneinfo/Asia/Hebron
+ testdata/zoneinfo/Asia/Ho_Chi_Minh
+ testdata/zoneinfo/Asia/Nicosia
+ testdata/zoneinfo/Asia/Qostanay
+ testdata/zoneinfo/Asia/Saigon
+ testdata/zoneinfo/Canada/Eastern
+ testdata/zoneinfo/Canada/Newfoundland
+ testdata/zoneinfo/Europe/Belfast
+ testdata/zoneinfo/Europe/Bucharest
+ testdata/zoneinfo/Europe/Chisinau
+ testdata/zoneinfo/Europe/Guernsey
+ testdata/zoneinfo/Europe/Isle_of_Man
+ testdata/zoneinfo/Europe/Jersey
+ testdata/zoneinfo/Europe/Kiev
+ testdata/zoneinfo/Europe/Kyiv
+ testdata/zoneinfo/Europe/London
+ testdata/zoneinfo/Europe/Nicosia
+ testdata/zoneinfo/Europe/Riga
+ testdata/zoneinfo/Europe/Sofia
+ testdata/zoneinfo/Europe/Tallinn
+ testdata/zoneinfo/Europe/Tiraspol
+ testdata/zoneinfo/Europe/Uzhgorod
+ testdata/zoneinfo/Europe/Vilnius
+ testdata/zoneinfo/Europe/Zaporozhye
+ testdata/zoneinfo/GB
+ testdata/zoneinfo/GB-Eire
+ testdata/zoneinfo/Mexico/BajaNorte
+ testdata/zoneinfo/Pacific/Norfolk
+11 −6 testdata/zoneinfo/iso3166.tab
+15 −14 testdata/zoneinfo/zone1970.tab
+303 −0 testdata/zoneinfo/zonenow.tab
9 changes: 9 additions & 0 deletions src/Core/SettingsFields.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#include <IO/ReadHelpers.h>
#include <IO/ReadBufferFromString.h>
#include <IO/WriteHelpers.h>

#include <boost/algorithm/string/predicate.hpp>
#include <cctz/time_zone.h>

#include <cmath>

Expand Down Expand Up @@ -496,6 +498,13 @@ void SettingFieldTimezone::readBinary(ReadBuffer & in)
*this = std::move(str);
}

void SettingFieldTimezone::validateTimezone(const std::string & tz_str)
{
cctz::time_zone validated_tz;
if (!tz_str.empty() && !cctz::load_time_zone(tz_str, &validated_tz))
throw DB::Exception(DB::ErrorCodes::BAD_ARGUMENTS, "Invalid time zone: {}", tz_str);
}

String SettingFieldCustom::toString() const
{
return value.dump();
Expand Down
8 changes: 1 addition & 7 deletions src/Core/SettingsFields.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <Core/Field.h>
#include <Core/MultiEnum.h>
#include <boost/range/adaptor/map.hpp>
#include <cctz/time_zone.h>
#include <chrono>
#include <unordered_map>
#include <string_view>
Expand Down Expand Up @@ -608,12 +607,7 @@ struct SettingFieldTimezone
void readBinary(ReadBuffer & in);

private:
void validateTimezone(const std::string & tz_str)
{
cctz::time_zone validated_tz;
if (!tz_str.empty() && !cctz::load_time_zone(tz_str, &validated_tz))
throw DB::Exception(DB::ErrorCodes::BAD_ARGUMENTS, "Invalid time zone: {}", tz_str);
}
void validateTimezone(const std::string & tz_str);
};

/// Can keep a value of any type. Used for user-defined settings.
Expand Down

0 comments on commit 48fdb17

Please sign in to comment.