fix compile of master (#23467)

This commit is contained in:
zclllyybb
2023-08-25 11:47:39 +08:00
committed by GitHub
parent 8ef6b4d996
commit 84792d0886
2 changed files with 12 additions and 10 deletions

View File

@ -857,11 +857,11 @@ bool try_parse_impl(typename DataType::FieldType& x, ReadBuffer& rb,
std::shared_mutex& cache_lock,
Additions additions [[maybe_unused]] = Additions()) {
if constexpr (IsDateTimeType<DataType>) {
return try_read_datetime_text(x, rb, local_time_zone, time_zone_cache);
return try_read_datetime_text(x, rb, local_time_zone, time_zone_cache, cache_lock);
}
if constexpr (IsDateType<DataType>) {
return try_read_date_text(x, rb, local_time_zone, time_zone_cache);
return try_read_date_text(x, rb, local_time_zone, time_zone_cache, cache_lock);
}
if constexpr (IsDateV2Type<DataType>) {

View File

@ -284,10 +284,11 @@ bool read_date_text_impl(T& x, ReadBuffer& buf) {
template <typename T>
bool read_date_text_impl(T& x, ReadBuffer& buf, const cctz::time_zone& local_time_zone,
ZoneList& time_zone_cache) {
ZoneList& time_zone_cache, std::shared_mutex& cache_lock) {
static_assert(std::is_same_v<Int64, T>);
auto dv = binary_cast<Int64, VecDateTimeValue>(x);
auto ans = dv.from_date_str(buf.position(), buf.count(), local_time_zone, time_zone_cache);
auto ans = dv.from_date_str(buf.position(), buf.count(), local_time_zone, time_zone_cache,
&cache_lock);
dv.cast_to_date();
// only to match the is_all_read() check to prevent return null
@ -311,10 +312,11 @@ bool read_datetime_text_impl(T& x, ReadBuffer& buf) {
template <typename T>
bool read_datetime_text_impl(T& x, ReadBuffer& buf, const cctz::time_zone& local_time_zone,
ZoneList& time_zone_cache) {
ZoneList& time_zone_cache, std::shared_mutex& cache_lock) {
static_assert(std::is_same_v<Int64, T>);
auto dv = binary_cast<Int64, VecDateTimeValue>(x);
auto ans = dv.from_date_str(buf.position(), buf.count(), local_time_zone, time_zone_cache);
auto ans = dv.from_date_str(buf.position(), buf.count(), local_time_zone, time_zone_cache,
&cache_lock);
dv.to_datetime();
// only to match the is_all_read() check to prevent return null
@ -453,14 +455,14 @@ bool try_read_decimal_text(T& x, ReadBuffer& in, UInt32 precision, UInt32 scale)
template <typename T>
bool try_read_datetime_text(T& x, ReadBuffer& in, const cctz::time_zone& local_time_zone,
ZoneList& time_zone_cache) {
return read_datetime_text_impl<T>(x, in, local_time_zone, time_zone_cache);
ZoneList& time_zone_cache, std::shared_mutex& cache_lock) {
return read_datetime_text_impl<T>(x, in, local_time_zone, time_zone_cache, cache_lock);
}
template <typename T>
bool try_read_date_text(T& x, ReadBuffer& in, const cctz::time_zone& local_time_zone,
ZoneList& time_zone_cache) {
return read_date_text_impl<T>(x, in, local_time_zone, time_zone_cache);
ZoneList& time_zone_cache, std::shared_mutex& cache_lock) {
return read_date_text_impl<T>(x, in, local_time_zone, time_zone_cache, cache_lock);
}
template <typename T>