mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Merge pull request #41186 from ClickHouse/fix-three-fourth-of-trash
Fix more than half of the trash
This commit is contained in:
commit
45afacdae4
@ -24,7 +24,10 @@ if (COMPILER_CLANG)
|
||||
no_warning(c++98-compat-pedantic)
|
||||
no_warning(c++98-compat)
|
||||
no_warning(c++20-compat) # Use constinit in C++20 without warnings
|
||||
no_warning(conversion)
|
||||
no_warning(sign-conversion)
|
||||
no_warning(implicit-int-conversion)
|
||||
no_warning(implicit-int-float-conversion)
|
||||
no_warning(shorten-64-to-32)
|
||||
no_warning(ctad-maybe-unsupported) # clang 9+, linux-only
|
||||
no_warning(disabled-macro-expansion)
|
||||
no_warning(documentation-unknown-command)
|
||||
|
@ -1118,7 +1118,7 @@ int Server::main(const std::vector<std::string> & /*args*/)
|
||||
size_t max_server_memory_usage = config->getUInt64("max_server_memory_usage", 0);
|
||||
|
||||
double max_server_memory_usage_to_ram_ratio = config->getDouble("max_server_memory_usage_to_ram_ratio", 0.9);
|
||||
size_t default_max_server_memory_usage = memory_amount * max_server_memory_usage_to_ram_ratio;
|
||||
size_t default_max_server_memory_usage = static_cast<size_t>(memory_amount * max_server_memory_usage_to_ram_ratio);
|
||||
|
||||
if (max_server_memory_usage == 0)
|
||||
{
|
||||
@ -1391,7 +1391,7 @@ int Server::main(const std::vector<std::string> & /*args*/)
|
||||
|
||||
/// Lower cache size on low-memory systems.
|
||||
double cache_size_to_ram_max_ratio = config().getDouble("cache_size_to_ram_max_ratio", 0.5);
|
||||
size_t max_cache_size = memory_amount * cache_size_to_ram_max_ratio;
|
||||
size_t max_cache_size = static_cast<size_t>(memory_amount * cache_size_to_ram_max_ratio);
|
||||
|
||||
/// Size of cache for uncompressed blocks. Zero means disabled.
|
||||
String uncompressed_cache_policy = config().getString("uncompressed_cache_policy", "");
|
||||
@ -1614,7 +1614,7 @@ int Server::main(const std::vector<std::string> & /*args*/)
|
||||
}
|
||||
|
||||
double total_memory_tracker_sample_probability = config().getDouble("total_memory_tracker_sample_probability", 0);
|
||||
if (total_memory_tracker_sample_probability)
|
||||
if (total_memory_tracker_sample_probability > 0.0)
|
||||
{
|
||||
total_memory_tracker.setSampleProbability(total_memory_tracker_sample_probability);
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ private:
|
||||
Y max_y = data.max_y;
|
||||
Float64 diff_y = max_y - min_y;
|
||||
|
||||
if (diff_y)
|
||||
if (diff_y != 0.0)
|
||||
{
|
||||
for (size_t i = 0; i <= diff_x; ++i)
|
||||
{
|
||||
@ -194,7 +194,7 @@ private:
|
||||
auto upper_bound = [&](size_t bucket_num)
|
||||
{
|
||||
bound.second = (bucket_num + 1) * multiple_d;
|
||||
bound.first = std::floor(bound.second);
|
||||
bound.first = static_cast<size_t>(std::floor(bound.second));
|
||||
};
|
||||
upper_bound(cur_bucket_num);
|
||||
for (size_t i = 0; i <= (diff_x + 1); ++i)
|
||||
@ -249,7 +249,7 @@ private:
|
||||
value += getBar(point_y ? 1 : 0);
|
||||
};
|
||||
|
||||
if (diff_y)
|
||||
if (diff_y != 0.0)
|
||||
std::for_each(new_points.begin(), new_points.end(), get_bars);
|
||||
else
|
||||
std::for_each(new_points.begin(), new_points.end(), get_bars_for_constant);
|
||||
|
@ -225,7 +225,7 @@ public:
|
||||
ResultType var_value = data.getPopulation();
|
||||
|
||||
if (var_value > 0)
|
||||
dst.push_back(data.getMoment3() / pow(var_value, 1.5));
|
||||
dst.push_back(static_cast<ResultType>(data.getMoment3() / pow(var_value, 1.5)));
|
||||
else
|
||||
dst.push_back(std::numeric_limits<ResultType>::quiet_NaN());
|
||||
}
|
||||
@ -234,7 +234,7 @@ public:
|
||||
ResultType var_value = data.getSample();
|
||||
|
||||
if (var_value > 0)
|
||||
dst.push_back(data.getMoment3() / pow(var_value, 1.5));
|
||||
dst.push_back(static_cast<ResultType>(data.getMoment3() / pow(var_value, 1.5)));
|
||||
else
|
||||
dst.push_back(std::numeric_limits<ResultType>::quiet_NaN());
|
||||
}
|
||||
@ -243,7 +243,7 @@ public:
|
||||
ResultType var_value = data.getPopulation();
|
||||
|
||||
if (var_value > 0)
|
||||
dst.push_back(data.getMoment4() / pow(var_value, 2));
|
||||
dst.push_back(static_cast<ResultType>(data.getMoment4() / pow(var_value, 2)));
|
||||
else
|
||||
dst.push_back(std::numeric_limits<ResultType>::quiet_NaN());
|
||||
}
|
||||
@ -252,7 +252,7 @@ public:
|
||||
ResultType var_value = data.getSample();
|
||||
|
||||
if (var_value > 0)
|
||||
dst.push_back(data.getMoment4() / pow(var_value, 2));
|
||||
dst.push_back(static_cast<ResultType>(data.getMoment4() / pow(var_value, 2)));
|
||||
else
|
||||
dst.push_back(std::numeric_limits<ResultType>::quiet_NaN());
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ public:
|
||||
for (size_t i = 0; i < keys_vec_size; ++i)
|
||||
{
|
||||
auto value = value_column[values_vec_offset + i];
|
||||
auto key = key_column[keys_vec_offset + i].get<T>();
|
||||
T key = static_cast<T>(key_column[keys_vec_offset + i].get<T>());
|
||||
|
||||
if (!keepKey(key))
|
||||
continue;
|
||||
|
@ -145,10 +145,10 @@ private:
|
||||
accumulated += p->second;
|
||||
|
||||
if (accumulated >= threshold)
|
||||
return p->first;
|
||||
return static_cast<T>(p->first);
|
||||
}
|
||||
|
||||
return array[size - 1].first;
|
||||
return static_cast<T>(array[size - 1].first);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -188,7 +188,7 @@ private:
|
||||
|
||||
while (accumulated >= threshold)
|
||||
{
|
||||
result[indices[level_index]] = p->first;
|
||||
result[indices[level_index]] = static_cast<T>(p->first);
|
||||
++level_index;
|
||||
|
||||
if (level_index == num_levels)
|
||||
@ -200,7 +200,7 @@ private:
|
||||
|
||||
while (level_index < num_levels)
|
||||
{
|
||||
result[indices[level_index]] = array[size - 1].first;
|
||||
result[indices[level_index]] = static_cast<T>(array[size - 1].first);
|
||||
++level_index;
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ struct QuantileExact : QuantileExactBase<Value, QuantileExact<Value>>
|
||||
{
|
||||
if (!array.empty())
|
||||
{
|
||||
size_t n = level < 1 ? level * array.size() : (array.size() - 1);
|
||||
size_t n = level < 1 ? static_cast<size_t>(level * array.size()) : (array.size() - 1);
|
||||
::nth_element(array.begin(), array.begin() + n, array.end()); /// NOTE: You can think of the radix-select algorithm.
|
||||
return array[n];
|
||||
}
|
||||
@ -106,7 +106,7 @@ struct QuantileExact : QuantileExactBase<Value, QuantileExact<Value>>
|
||||
{
|
||||
auto level = levels[indices[i]];
|
||||
|
||||
size_t n = level < 1 ? level * array.size() : (array.size() - 1);
|
||||
size_t n = level < 1 ? static_cast<size_t>(level * array.size()) : (array.size() - 1);
|
||||
::nth_element(array.begin() + prev_n, array.begin() + n, array.end());
|
||||
result[indices[i]] = array[n];
|
||||
prev_n = n;
|
||||
@ -282,7 +282,7 @@ struct QuantileExactLow : public QuantileExactBase<Value, QuantileExactLow<Value
|
||||
// else quantile is the nth index of the sorted array obtained by multiplying
|
||||
// level and size of array. Example if level = 0.1 and size of array is 10,
|
||||
// then return array[1].
|
||||
n = level < 1 ? level * array.size() : (array.size() - 1);
|
||||
n = level < 1 ? static_cast<size_t>(level * array.size()) : (array.size() - 1);
|
||||
}
|
||||
::nth_element(array.begin(), array.begin() + n, array.end());
|
||||
return array[n];
|
||||
@ -317,7 +317,7 @@ struct QuantileExactLow : public QuantileExactBase<Value, QuantileExactLow<Value
|
||||
{
|
||||
// else quantile is the nth index of the sorted array obtained by multiplying
|
||||
// level and size of array. Example if level = 0.1 and size of array is 10.
|
||||
n = level < 1 ? level * array.size() : (array.size() - 1);
|
||||
n = level < 1 ? static_cast<size_t>(level * array.size()) : (array.size() - 1);
|
||||
}
|
||||
::nth_element(array.begin() + prev_n, array.begin() + n, array.end());
|
||||
result[indices[i]] = array[n];
|
||||
@ -356,7 +356,7 @@ struct QuantileExactHigh : public QuantileExactBase<Value, QuantileExactHigh<Val
|
||||
{
|
||||
// else quantile is the nth index of the sorted array obtained by multiplying
|
||||
// level and size of array. Example if level = 0.1 and size of array is 10.
|
||||
n = level < 1 ? level * array.size() : (array.size() - 1);
|
||||
n = level < 1 ? static_cast<size_t>(level * array.size()) : (array.size() - 1);
|
||||
}
|
||||
::nth_element(array.begin(), array.begin() + n, array.end());
|
||||
return array[n];
|
||||
@ -384,7 +384,7 @@ struct QuantileExactHigh : public QuantileExactBase<Value, QuantileExactHigh<Val
|
||||
{
|
||||
// else quantile is the nth index of the sorted array obtained by multiplying
|
||||
// level and size of array. Example if level = 0.1 and size of array is 10.
|
||||
n = level < 1 ? level * array.size() : (array.size() - 1);
|
||||
n = level < 1 ? static_cast<size_t>(level * array.size()) : (array.size() - 1);
|
||||
}
|
||||
::nth_element(array.begin() + prev_n, array.begin() + n, array.end());
|
||||
result[indices[i]] = array[n];
|
||||
|
@ -55,7 +55,10 @@ struct QuantileReservoirSampler
|
||||
/// Get the value of the `level` quantile. The level must be between 0 and 1.
|
||||
Value get(Float64 level)
|
||||
{
|
||||
return Value(data.quantileInterpolated(level));
|
||||
if constexpr (is_decimal<Value>)
|
||||
return Value(static_cast<typename Value::NativeType>(data.quantileInterpolated(level)));
|
||||
else
|
||||
return static_cast<Value>(data.quantileInterpolated(level));
|
||||
}
|
||||
|
||||
/// Get the `size` values of `levels` quantiles. Write `size` results starting with `result` address.
|
||||
@ -63,7 +66,10 @@ struct QuantileReservoirSampler
|
||||
void getMany(const Float64 * levels, const size_t * indices, size_t size, Value * result)
|
||||
{
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
result[indices[i]] = Value(data.quantileInterpolated(levels[indices[i]]));
|
||||
if constexpr (is_decimal<Value>)
|
||||
result[indices[i]] = Value(static_cast<typename Value::NativeType>(data.quantileInterpolated(levels[indices[i]])));
|
||||
else
|
||||
result[indices[i]] = Value(data.quantileInterpolated(levels[indices[i]]));
|
||||
}
|
||||
|
||||
/// The same, but in the case of an empty state, NaN is returned.
|
||||
|
@ -55,7 +55,10 @@ struct QuantileReservoirSamplerDeterministic
|
||||
/// Get the value of the `level` quantile. The level must be between 0 and 1.
|
||||
Value get(Float64 level)
|
||||
{
|
||||
return data.quantileInterpolated(level);
|
||||
if constexpr (is_decimal<Value>)
|
||||
return static_cast<typename Value::NativeType>(data.quantileInterpolated(level));
|
||||
else
|
||||
return static_cast<Value>(data.quantileInterpolated(level));
|
||||
}
|
||||
|
||||
/// Get the `size` values of `levels` quantiles. Write `size` results starting with `result` address.
|
||||
@ -63,7 +66,10 @@ struct QuantileReservoirSamplerDeterministic
|
||||
void getMany(const Float64 * levels, const size_t * indices, size_t size, Value * result)
|
||||
{
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
result[indices[i]] = data.quantileInterpolated(levels[indices[i]]);
|
||||
if constexpr (is_decimal<Value>)
|
||||
result[indices[i]] = static_cast<typename Value::NativeType>(data.quantileInterpolated(levels[indices[i]]));
|
||||
else
|
||||
result[indices[i]] = static_cast<Value>(data.quantileInterpolated(levels[indices[i]]));
|
||||
}
|
||||
|
||||
/// The same, but in the case of an empty state, NaN is returned.
|
||||
|
@ -165,8 +165,8 @@ class QuantileTDigest
|
||||
{
|
||||
l_mean += r->count * (r->mean - l_mean) / l_count; // Symmetric algo (M1*C1 + M2*C2)/(C1+C2) is numerically better, but slower
|
||||
}
|
||||
l->mean = l_mean;
|
||||
l->count = l_count;
|
||||
l->mean = static_cast<Value>(l_mean);
|
||||
l->count = static_cast<Value>(l_count);
|
||||
batch_pos += 1;
|
||||
}
|
||||
else
|
||||
@ -252,8 +252,8 @@ public:
|
||||
{
|
||||
l_mean += r->count * (r->mean - l_mean) / l_count; // Symmetric algo (M1*C1 + M2*C2)/(C1+C2) is numerically better, but slower
|
||||
}
|
||||
l->mean = l_mean;
|
||||
l->count = l_count;
|
||||
l->mean = static_cast<Value>(l_mean);
|
||||
l->count = static_cast<Value>(l_count);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -369,7 +369,12 @@ public:
|
||||
else if (x >= right)
|
||||
return checkOverflow<ResultType>(c.mean);
|
||||
else
|
||||
return checkOverflow<ResultType>(interpolate(x, left, prev_mean, right, c.mean));
|
||||
return checkOverflow<ResultType>(interpolate(
|
||||
static_cast<Value>(x),
|
||||
static_cast<Value>(left),
|
||||
prev_mean,
|
||||
static_cast<Value>(right),
|
||||
c.mean));
|
||||
}
|
||||
|
||||
sum += c.count;
|
||||
@ -401,7 +406,7 @@ public:
|
||||
if (centroids.size() == 1)
|
||||
{
|
||||
for (size_t result_num = 0; result_num < size; ++result_num)
|
||||
result[result_num] = centroids.front().mean;
|
||||
result[result_num] = static_cast<ResultType>(centroids.front().mean);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -425,11 +430,12 @@ public:
|
||||
while (current_x >= x)
|
||||
{
|
||||
if (x <= left)
|
||||
result[levels_permutation[result_num]] = prev_mean;
|
||||
result[levels_permutation[result_num]] = static_cast<ResultType>(prev_mean);
|
||||
else if (x >= right)
|
||||
result[levels_permutation[result_num]] = c.mean;
|
||||
result[levels_permutation[result_num]] = static_cast<ResultType>(c.mean);
|
||||
else
|
||||
result[levels_permutation[result_num]] = interpolate(x, left, prev_mean, right, c.mean);
|
||||
result[levels_permutation[result_num]] = static_cast<ResultType>(interpolate(
|
||||
static_cast<Value>(x), static_cast<Value>(left), prev_mean, static_cast<Value>(right), c.mean));
|
||||
|
||||
++result_num;
|
||||
if (result_num >= size)
|
||||
@ -447,7 +453,7 @@ public:
|
||||
|
||||
auto rest_of_results = centroids.back().mean;
|
||||
for (; result_num < size; ++result_num)
|
||||
result[levels_permutation[result_num]] = rest_of_results;
|
||||
result[levels_permutation[result_num]] = static_cast<ResultType>(rest_of_results);
|
||||
}
|
||||
|
||||
T get(Float64 level)
|
||||
|
@ -563,8 +563,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void add(UInt64 x)
|
||||
template <typename T>
|
||||
void add(T x_)
|
||||
{
|
||||
UInt64 x = static_cast<UInt64>(x_);
|
||||
|
||||
if (tiny.count < TINY_MAX_ELEMS)
|
||||
{
|
||||
tiny.insert(x);
|
||||
@ -589,8 +592,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void add(UInt64 x, size_t weight)
|
||||
template <typename T>
|
||||
void add(T x_, size_t weight)
|
||||
{
|
||||
UInt64 x = static_cast<UInt64>(x_);
|
||||
|
||||
/// NOTE: First condition is to avoid overflow.
|
||||
if (weight < TINY_MAX_ELEMS && tiny.count + weight <= TINY_MAX_ELEMS)
|
||||
{
|
||||
|
@ -184,14 +184,17 @@ public:
|
||||
/// When frequency is too low, replace just one random element with the corresponding probability.
|
||||
if (frequency * 2 >= sample_count)
|
||||
{
|
||||
UInt64 rnd = genRandom(frequency);
|
||||
UInt64 rnd = genRandom(static_cast<UInt64>(frequency));
|
||||
if (rnd < sample_count)
|
||||
samples[rnd] = b.samples[rnd];
|
||||
}
|
||||
else
|
||||
{
|
||||
for (double i = 0; i < sample_count; i += frequency) /// NOLINT
|
||||
samples[i] = b.samples[i];
|
||||
{
|
||||
size_t idx = static_cast<size_t>(i);
|
||||
samples[idx] = b.samples[idx];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -237,14 +240,15 @@ private:
|
||||
bool sorted = false;
|
||||
|
||||
|
||||
UInt64 genRandom(size_t lim)
|
||||
UInt64 genRandom(UInt64 limit)
|
||||
{
|
||||
assert(lim > 0);
|
||||
assert(limit > 0);
|
||||
|
||||
/// With a large number of values, we will generate random numbers several times slower.
|
||||
if (lim <= static_cast<UInt64>(rng.max()))
|
||||
return static_cast<UInt32>(rng()) % static_cast<UInt32>(lim);
|
||||
if (limit <= static_cast<UInt64>(rng.max()))
|
||||
return static_cast<UInt32>(rng()) % static_cast<UInt32>(limit);
|
||||
else
|
||||
return (static_cast<UInt64>(rng()) * (static_cast<UInt64>(rng.max()) + 1ULL) + static_cast<UInt64>(rng())) % lim;
|
||||
return (static_cast<UInt64>(rng()) * (static_cast<UInt64>(rng.max()) + 1ULL) + static_cast<UInt64>(rng())) % limit;
|
||||
}
|
||||
|
||||
void sortIfNeeded()
|
||||
|
@ -358,7 +358,7 @@ public:
|
||||
* filled buckets with average of res is obtained.
|
||||
*/
|
||||
size_t p32 = 1ULL << 32;
|
||||
size_t fixed_res = round(p32 * (log(p32) - log(p32 - res)));
|
||||
size_t fixed_res = static_cast<size_t>(round(p32 * (log(p32) - log(p32 - res))));
|
||||
return fixed_res;
|
||||
}
|
||||
|
||||
|
@ -282,7 +282,7 @@ public:
|
||||
|
||||
/// The constant value. It is valid even if the size of the column is 0.
|
||||
template <typename T>
|
||||
T getValue() const { return getField().safeGet<T>(); }
|
||||
T getValue() const { return static_cast<T>(getField().safeGet<T>()); }
|
||||
|
||||
bool isCollationSupported() const override { return data->isCollationSupported(); }
|
||||
};
|
||||
|
@ -918,7 +918,7 @@ ColumnPtr ColumnVector<T>::createWithOffsets(const IColumn::Offsets & offsets, c
|
||||
auto res = this->create();
|
||||
auto & res_data = res->getData();
|
||||
|
||||
T default_value = default_field.safeGet<T>();
|
||||
T default_value = static_cast<T>(default_field.safeGet<T>());
|
||||
res_data.resize_fill(total_rows, default_value);
|
||||
for (size_t i = 0; i < offsets.size(); ++i)
|
||||
res_data[offsets[i]] = data[i + shift];
|
||||
|
@ -301,7 +301,7 @@ public:
|
||||
|
||||
void insert(const Field & x) override
|
||||
{
|
||||
data.push_back(x.get<T>());
|
||||
data.push_back(static_cast<T>(x.get<T>()));
|
||||
}
|
||||
|
||||
void insertRangeFrom(const IColumn & src, size_t start, size_t length) override;
|
||||
|
@ -244,7 +244,7 @@ private:
|
||||
|
||||
static inline LUTIndex toLUTIndex(ExtendedDayNum d)
|
||||
{
|
||||
return normalizeLUTIndex(static_cast<UInt32>(d + daynum_offset_epoch));
|
||||
return normalizeLUTIndex(static_cast<Int64>(d + daynum_offset_epoch));
|
||||
}
|
||||
|
||||
inline LUTIndex toLUTIndex(Time t) const
|
||||
|
@ -444,7 +444,14 @@ struct IntHash32
|
||||
}
|
||||
else if constexpr (sizeof(T) <= sizeof(UInt64))
|
||||
{
|
||||
return intHash32<salt>(key);
|
||||
union
|
||||
{
|
||||
T in;
|
||||
DB::UInt64 out;
|
||||
} u;
|
||||
u.out = 0;
|
||||
u.in = key;
|
||||
return intHash32<salt>(u.out);
|
||||
}
|
||||
|
||||
assert(false);
|
||||
|
@ -162,7 +162,7 @@ class __attribute__((__packed__)) Denominator<precision, max_rank, HashValueType
|
||||
public:
|
||||
Denominator(DenominatorType initial_value) /// NOLINT
|
||||
{
|
||||
rank_count[0] = initial_value;
|
||||
rank_count[0] = static_cast<UInt32>(initial_value);
|
||||
}
|
||||
|
||||
inline void update(UInt8 cur_rank, UInt8 new_rank)
|
||||
@ -189,7 +189,7 @@ public:
|
||||
val /= 2.0;
|
||||
val += rank_count[i];
|
||||
}
|
||||
return val;
|
||||
return static_cast<DenominatorType>(val);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -182,7 +182,7 @@ struct Dictionary
|
||||
case AttributeUnderlyingTypeTest::Int16: std::get<ContainerPtrType<Int16>>(attribute.arrays)[idx] = value.get<Int64>(); break;
|
||||
case AttributeUnderlyingTypeTest::Int32: std::get<ContainerPtrType<Int32>>(attribute.arrays)[idx] = value.get<Int64>(); break;
|
||||
case AttributeUnderlyingTypeTest::Int64: std::get<ContainerPtrType<Int64>>(attribute.arrays)[idx] = value.get<Int64>(); break;
|
||||
case AttributeUnderlyingTypeTest::Float32: std::get<ContainerPtrType<Float32>>(attribute.arrays)[idx] = value.get<Float64>(); break;
|
||||
case AttributeUnderlyingTypeTest::Float32: std::get<ContainerPtrType<Float32>>(attribute.arrays)[idx] = static_cast<Float32>(value.get<Float64>()); break;
|
||||
case AttributeUnderlyingTypeTest::Float64: std::get<ContainerPtrType<Float64>>(attribute.arrays)[idx] = value.get<Float64>(); break;
|
||||
case AttributeUnderlyingTypeTest::String:
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ namespace mysqlxx
|
||||
|
||||
Query::Query(Connection * conn_, const std::string & query_string) : conn(conn_)
|
||||
{
|
||||
/// Важно в случае, если Query используется не из того же потока, что Connection.
|
||||
/// Makes sense if called from the other thread than Connection.
|
||||
mysql_thread_init();
|
||||
|
||||
query = query_string;
|
||||
@ -26,7 +26,7 @@ Query::Query(Connection * conn_, const std::string & query_string) : conn(conn_)
|
||||
|
||||
Query::Query(const Query & other) : conn(other.conn)
|
||||
{
|
||||
/// Важно в случае, если Query используется не из того же потока, что Connection.
|
||||
/// Makes sense if called from the other thread than Connection.
|
||||
mysql_thread_init();
|
||||
|
||||
query = other.query;
|
||||
|
@ -8,8 +8,8 @@
|
||||
namespace mysqlxx
|
||||
{
|
||||
|
||||
/** RAII для транзакции. При инициализации, транзакция стартует.
|
||||
* При уничтожении, если не был вызван метод commit(), будет произведёт rollback.
|
||||
/** Transaction RAII.
|
||||
* If commit() was not called before destroy, it will be rolled back.
|
||||
*/
|
||||
class Transaction : private boost::noncopyable
|
||||
{
|
||||
|
@ -1,656 +0,0 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <exception>
|
||||
#include <string_view>
|
||||
#include <base/JSON.h>
|
||||
|
||||
#include <boost/range/irange.hpp>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
enum class ResultType
|
||||
{
|
||||
Return,
|
||||
Throw
|
||||
};
|
||||
|
||||
struct GetStringTestRecord
|
||||
{
|
||||
std::string_view input;
|
||||
ResultType result_type;
|
||||
std::string_view result;
|
||||
};
|
||||
|
||||
TEST(JSONSuite, SimpleTest)
|
||||
{
|
||||
using namespace std::literals;
|
||||
|
||||
std::vector<GetStringTestRecord> test_data =
|
||||
{
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Вафельница Vitek WX-1102 FL")"sv, ResultType::Return, "Вафельница Vitek WX-1102 FL"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("184509")"sv, ResultType::Return, "184509"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("Все для детей/Детская техника/Vitek")"sv, ResultType::Return, "Все для детей/Детская техника/Vitek"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("В наличии")"sv, ResultType::Return, "В наличии"sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("2390.00")"sv, ResultType::Return, "2390.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("Карточка")"sv, ResultType::Return, "Карточка"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("detail")"sv, ResultType::Return, "detail"sv },
|
||||
{ R"("actionField")"sv, ResultType::Return, "actionField"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("http://www.techport.ru/q/?t=вафельница&sort=price&sdim=asc")"sv, ResultType::Return, "http://www.techport.ru/q/?t=вафельница&sort=price&sdim=asc"sv },
|
||||
{ R"("action")"sv, ResultType::Return, "action"sv },
|
||||
{ R"("detail")"sv, ResultType::Return, "detail"sv },
|
||||
{ R"("products")"sv, ResultType::Return, "products"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Вафельница Vitek WX-1102 FL")"sv, ResultType::Return, "Вафельница Vitek WX-1102 FL"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("184509")"sv, ResultType::Return, "184509"sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("2390.00")"sv, ResultType::Return, "2390.00"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("Vitek")"sv, ResultType::Return, "Vitek"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("Все для детей/Детская техника/Vitek")"sv, ResultType::Return, "Все для детей/Детская техника/Vitek"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("В наличии")"sv, ResultType::Return, "В наличии"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("experiments")"sv, ResultType::Return, "experiments"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("los_portal")"sv, ResultType::Return, "los_portal"sv },
|
||||
{ R"("los_level")"sv, ResultType::Return, "los_level"sv },
|
||||
{ R"("none")"sv, ResultType::Return, "none"sv },
|
||||
{ R"("isAuthorized")"sv, ResultType::Return, "isAuthorized"sv },
|
||||
{ R"("isSubscriber")"sv, ResultType::Return, "isSubscriber"sv },
|
||||
{ R"("postType")"sv, ResultType::Return, "postType"sv },
|
||||
{ R"("Новости")"sv, ResultType::Return, "Новости"sv },
|
||||
{ R"("experiments")"sv, ResultType::Return, "experiments"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("los_portal")"sv, ResultType::Return, "los_portal"sv },
|
||||
{ R"("los_level")"sv, ResultType::Return, "los_level"sv },
|
||||
{ R"("none")"sv, ResultType::Return, "none"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("Электроплита GEFEST Брест ЭПНД 5140-01 0001")"sv, ResultType::Return, "Электроплита GEFEST Брест ЭПНД 5140-01 0001"sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("currencyCode")"sv, ResultType::Return, "currencyCode"sv },
|
||||
{ R"("RUB")"sv, ResultType::Return, "RUB"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("experiments")"sv, ResultType::Return, "experiments"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("los_portal")"sv, ResultType::Return, "los_portal"sv },
|
||||
{ R"("los_level")"sv, ResultType::Return, "los_level"sv },
|
||||
{ R"("none")"sv, ResultType::Return, "none"sv },
|
||||
{ R"("trash_login")"sv, ResultType::Return, "trash_login"sv },
|
||||
{ R"("novikoff")"sv, ResultType::Return, "novikoff"sv },
|
||||
{ R"("trash_cat_link")"sv, ResultType::Return, "trash_cat_link"sv },
|
||||
{ R"("progs")"sv, ResultType::Return, "progs"sv },
|
||||
{ R"("trash_parent_link")"sv, ResultType::Return, "trash_parent_link"sv },
|
||||
{ R"("content")"sv, ResultType::Return, "content"sv },
|
||||
{ R"("trash_posted_parent")"sv, ResultType::Return, "trash_posted_parent"sv },
|
||||
{ R"("content.01.2016")"sv, ResultType::Return, "content.01.2016"sv },
|
||||
{ R"("trash_posted_cat")"sv, ResultType::Return, "trash_posted_cat"sv },
|
||||
{ R"("progs.01.2016")"sv, ResultType::Return, "progs.01.2016"sv },
|
||||
{ R"("trash_virus_count")"sv, ResultType::Return, "trash_virus_count"sv },
|
||||
{ R"("trash_is_android")"sv, ResultType::Return, "trash_is_android"sv },
|
||||
{ R"("trash_is_wp8")"sv, ResultType::Return, "trash_is_wp8"sv },
|
||||
{ R"("trash_is_ios")"sv, ResultType::Return, "trash_is_ios"sv },
|
||||
{ R"("trash_posted")"sv, ResultType::Return, "trash_posted"sv },
|
||||
{ R"("01.2016")"sv, ResultType::Return, "01.2016"sv },
|
||||
{ R"("experiments")"sv, ResultType::Return, "experiments"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("los_portal")"sv, ResultType::Return, "los_portal"sv },
|
||||
{ R"("los_level")"sv, ResultType::Return, "los_level"sv },
|
||||
{ R"("none")"sv, ResultType::Return, "none"sv },
|
||||
{ R"("merchantId")"sv, ResultType::Return, "merchantId"sv },
|
||||
{ R"("13694_49246")"sv, ResultType::Return, "13694_49246"sv },
|
||||
{ R"("cps-source")"sv, ResultType::Return, "cps-source"sv },
|
||||
{ R"("wargaming")"sv, ResultType::Return, "wargaming"sv },
|
||||
{ R"("cps_provider")"sv, ResultType::Return, "cps_provider"sv },
|
||||
{ R"("default")"sv, ResultType::Return, "default"sv },
|
||||
{ R"("errorReason")"sv, ResultType::Return, "errorReason"sv },
|
||||
{ R"("no errors")"sv, ResultType::Return, "no errors"sv },
|
||||
{ R"("scid")"sv, ResultType::Return, "scid"sv },
|
||||
{ R"("isAuthPayment")"sv, ResultType::Return, "isAuthPayment"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("rubric")"sv, ResultType::Return, "rubric"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("rubric")"sv, ResultType::Return, "rubric"sv },
|
||||
{ R"("Мир")"sv, ResultType::Return, "Мир"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("experiments")"sv, ResultType::Return, "experiments"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("los_portal")"sv, ResultType::Return, "los_portal"sv },
|
||||
{ R"("los_level")"sv, ResultType::Return, "los_level"sv },
|
||||
{ R"("none")"sv, ResultType::Return, "none"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("__ym")"sv, ResultType::Return, "__ym"sv },
|
||||
{ R"("ecommerce")"sv, ResultType::Return, "ecommerce"sv },
|
||||
{ R"("impressions")"sv, ResultType::Return, "impressions"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("863813")"sv, ResultType::Return, "863813"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Футболка детская 3D Happy, возраст 1-2 года, трикотаж")"sv, ResultType::Return, "Футболка детская 3D Happy, возраст 1-2 года, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("390.00")"sv, ResultType::Return, "390.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("863839")"sv, ResultType::Return, "863839"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Футболка детская 3D Pretty kitten, возраст 1-2 года, трикотаж")"sv, ResultType::Return, "Футболка детская 3D Pretty kitten, возраст 1-2 года, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("390.00")"sv, ResultType::Return, "390.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("863847")"sv, ResultType::Return, "863847"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Футболка детская 3D Little tiger, возраст 1-2 года, трикотаж")"sv, ResultType::Return, "Футболка детская 3D Little tiger, возраст 1-2 года, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("390.00")"sv, ResultType::Return, "390.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("911480")"sv, ResultType::Return, "911480"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Футболка детская 3D Puppy, возраст 1-2 года, трикотаж")"sv, ResultType::Return, "Футболка детская 3D Puppy, возраст 1-2 года, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("390.00")"sv, ResultType::Return, "390.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("911484")"sv, ResultType::Return, "911484"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Футболка детская 3D Little bears, возраст 1-2 года, трикотаж")"sv, ResultType::Return, "Футболка детская 3D Little bears, возраст 1-2 года, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("390.00")"sv, ResultType::Return, "390.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("911489")"sv, ResultType::Return, "911489"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Футболка детская 3D Dolphin, возраст 2-4 года, трикотаж")"sv, ResultType::Return, "Футболка детская 3D Dolphin, возраст 2-4 года, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("390.00")"sv, ResultType::Return, "390.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("911496")"sv, ResultType::Return, "911496"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Футболка детская 3D Pretty, возраст 1-2 года, трикотаж")"sv, ResultType::Return, "Футболка детская 3D Pretty, возраст 1-2 года, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("390.00")"sv, ResultType::Return, "390.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("911504")"sv, ResultType::Return, "911504"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Футболка детская 3D Fairytale, возраст 1-2 года, трикотаж")"sv, ResultType::Return, "Футболка детская 3D Fairytale, возраст 1-2 года, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("390.00")"sv, ResultType::Return, "390.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("911508")"sv, ResultType::Return, "911508"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Футболка детская 3D Kittens, возраст 1-2 года, трикотаж")"sv, ResultType::Return, "Футболка детская 3D Kittens, возраст 1-2 года, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("390.00")"sv, ResultType::Return, "390.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("911512")"sv, ResultType::Return, "911512"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Футболка детская 3D Sunshine, возраст 1-2 года, трикотаж")"sv, ResultType::Return, "Футболка детская 3D Sunshine, возраст 1-2 года, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("390.00")"sv, ResultType::Return, "390.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("911516")"sv, ResultType::Return, "911516"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Футболка детская 3D Dog in bag, возраст 1-2 года, трикотаж")"sv, ResultType::Return, "Футболка детская 3D Dog in bag, возраст 1-2 года, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("390.00")"sv, ResultType::Return, "390.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("911520")"sv, ResultType::Return, "911520"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Футболка детская 3D Cute puppy, возраст 1-2 года, трикотаж")"sv, ResultType::Return, "Футболка детская 3D Cute puppy, возраст 1-2 года, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("390.00")"sv, ResultType::Return, "390.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("911524")"sv, ResultType::Return, "911524"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Футболка детская 3D Rabbit, возраст 1-2 года, трикотаж")"sv, ResultType::Return, "Футболка детская 3D Rabbit, возраст 1-2 года, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("390.00")"sv, ResultType::Return, "390.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("911528")"sv, ResultType::Return, "911528"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Футболка детская 3D Turtle, возраст 1-2 года, трикотаж")"sv, ResultType::Return, "Футболка детская 3D Turtle, возраст 1-2 года, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("390.00")"sv, ResultType::Return, "390.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("888616")"sv, ResultType::Return, "888616"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ "\"3Д Футболка мужская \\\"Collorista\\\" Светлое завтра р-р XL(52-54), 100% хлопок, трикотаж\""sv, ResultType::Return, "3Д Футболка мужская \"Collorista\" Светлое завтра р-р XL(52-54), 100% хлопок, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Одежда и обувь/Мужская одежда/Футболки/")"sv, ResultType::Return, "/Одежда и обувь/Мужская одежда/Футболки/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("406.60")"sv, ResultType::Return, "406.60"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("913361")"sv, ResultType::Return, "913361"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("3Д Футболка детская World р-р 8-10, 100% хлопок, трикотаж")"sv, ResultType::Return, "3Д Футболка детская World р-р 8-10, 100% хлопок, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("470.00")"sv, ResultType::Return, "470.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("913364")"sv, ResultType::Return, "913364"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("3Д Футболка детская Force р-р 8-10, 100% хлопок, трикотаж")"sv, ResultType::Return, "3Д Футболка детская Force р-р 8-10, 100% хлопок, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("470.00")"sv, ResultType::Return, "470.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("913367")"sv, ResultType::Return, "913367"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("3Д Футболка детская Winter tale р-р 8-10, 100% хлопок, трикотаж")"sv, ResultType::Return, "3Д Футболка детская Winter tale р-р 8-10, 100% хлопок, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("470.00")"sv, ResultType::Return, "470.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("913385")"sv, ResultType::Return, "913385"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("3Д Футболка детская Moonshine р-р 8-10, 100% хлопок, трикотаж")"sv, ResultType::Return, "3Д Футболка детская Moonshine р-р 8-10, 100% хлопок, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("470.00")"sv, ResultType::Return, "470.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("913391")"sv, ResultType::Return, "913391"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("3Д Футболка детская Shaman р-р 8-10, 100% хлопок, трикотаж")"sv, ResultType::Return, "3Д Футболка детская Shaman р-р 8-10, 100% хлопок, трикотаж"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("/Летние товары/Летний текстиль/")"sv, ResultType::Return, "/Летние товары/Летний текстиль/"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("")"sv, ResultType::Return, ""sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("470.00")"sv, ResultType::Return, "470.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("/retailrocket/")"sv, ResultType::Return, "/retailrocket/"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/")"sv, ResultType::Return, "/911488/futbolka-detskaya-3d-dolphin-vozrast-1-2-goda-trikotazh/"sv },
|
||||
{ R"("usertype")"sv, ResultType::Return, "usertype"sv },
|
||||
{ R"("visitor")"sv, ResultType::Return, "visitor"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("__ym")"sv, ResultType::Return, "__ym"sv },
|
||||
{ R"("ecommerce")"sv, ResultType::Return, "ecommerce"sv },
|
||||
{ R"("impressions")"sv, ResultType::Return, "impressions"sv },
|
||||
{ R"("experiments")"sv, ResultType::Return, "experiments"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("los_portal")"sv, ResultType::Return, "los_portal"sv },
|
||||
{ R"("los_level")"sv, ResultType::Return, "los_level"sv },
|
||||
{ R"("none")"sv, ResultType::Return, "none"sv },
|
||||
{ R"("experiments")"sv, ResultType::Return, "experiments"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("los_portal")"sv, ResultType::Return, "los_portal"sv },
|
||||
{ R"("los_level")"sv, ResultType::Return, "los_level"sv },
|
||||
{ R"("none")"sv, ResultType::Return, "none"sv },
|
||||
{ R"("experiments")"sv, ResultType::Return, "experiments"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("los_portal")"sv, ResultType::Return, "los_portal"sv },
|
||||
{ R"("los_level")"sv, ResultType::Return, "los_level"sv },
|
||||
{ R"("none")"sv, ResultType::Return, "none"sv },
|
||||
{ R"("experiments")"sv, ResultType::Return, "experiments"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("los_portal")"sv, ResultType::Return, "los_portal"sv },
|
||||
{ R"("los_level")"sv, ResultType::Return, "los_level"sv },
|
||||
{ R"("none")"sv, ResultType::Return, "none"sv },
|
||||
{ R"("experiments")"sv, ResultType::Return, "experiments"sv },
|
||||
{ R"("lang")"sv, ResultType::Return, "lang"sv },
|
||||
{ R"("ru")"sv, ResultType::Return, "ru"sv },
|
||||
{ R"("los_portal")"sv, ResultType::Return, "los_portal"sv },
|
||||
{ R"("los_level")"sv, ResultType::Return, "los_level"sv },
|
||||
{ R"("none")"sv, ResultType::Return, "none"sv },
|
||||
{ R"("__ym")"sv, ResultType::Return, "__ym"sv },
|
||||
{ R"("ecommerce")"sv, ResultType::Return, "ecommerce"sv },
|
||||
{ R"("currencyCode")"sv, ResultType::Return, "currencyCode"sv },
|
||||
{ R"("RUR")"sv, ResultType::Return, "RUR"sv },
|
||||
{ R"("impressions")"sv, ResultType::Return, "impressions"sv },
|
||||
{ R"("name")"sv, ResultType::Return, "name"sv },
|
||||
{ R"("Чайник электрический Mystery MEK-1627, белый")"sv, ResultType::Return, "Чайник электрический Mystery MEK-1627, белый"sv },
|
||||
{ R"("brand")"sv, ResultType::Return, "brand"sv },
|
||||
{ R"("Mystery")"sv, ResultType::Return, "Mystery"sv },
|
||||
{ R"("id")"sv, ResultType::Return, "id"sv },
|
||||
{ R"("187180")"sv, ResultType::Return, "187180"sv },
|
||||
{ R"("category")"sv, ResultType::Return, "category"sv },
|
||||
{ R"("Мелкая бытовая техника/Мелкие кухонные приборы/Чайники электрические/Mystery")"sv, ResultType::Return, "Мелкая бытовая техника/Мелкие кухонные приборы/Чайники электрические/Mystery"sv },
|
||||
{ R"("variant")"sv, ResultType::Return, "variant"sv },
|
||||
{ R"("В наличии")"sv, ResultType::Return, "В наличии"sv },
|
||||
{ R"("price")"sv, ResultType::Return, "price"sv },
|
||||
{ R"("1630.00")"sv, ResultType::Return, "1630.00"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ R"("Карточка")"sv, ResultType::Return, "Карточка"sv },
|
||||
{ R"("position")"sv, ResultType::Return, "position"sv },
|
||||
{ R"("detail")"sv, ResultType::Return, "detail"sv },
|
||||
{ R"("actionField")"sv, ResultType::Return, "actionField"sv },
|
||||
{ R"("list")"sv, ResultType::Return, "list"sv },
|
||||
{ "\0\""sv, ResultType::Throw, "JSON: expected \", got \0"sv },
|
||||
{ "\"/igrushki/konstruktory\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/1290414/komplekt-zhenskiy-dzhemper-plusbryuki-m-254-09-malina-plustemno-siniy-\0a"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Творчество/Рисование/Инструменты и кра\0a"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Строительство и ремонт/Силовая техника/Зарядные устройства для автомобильных аккумуляторов/Пуско-зарядные устр\xD0\0a"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Строительство и ремонт/Силовая техника/Зарядные устройств\xD0\0t"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Строительство и ремонт/Силовая техника/Зарядные устройства для автомобиль\0k"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\0t"sv, ResultType::Throw, "JSON: expected \", got \0"sv },
|
||||
{ "\"/Хозтовары/Хранение вещей и организа\xD1\0t"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Хозтовары/Товары для стир\0a"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"li\0a"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/734859/samolet-radioupravlyaemyy-istrebitel-rabotaet-o\0k"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/kosmetika-i-parfyum/parfyumeriya/mu\0t"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/ko\0\x04"sv, ResultType::Throw, "JSON: begin >= end."sv },
|
||||
{ ""sv, ResultType::Throw, "JSON: expected \", got \0"sv },
|
||||
{ "\"/stroitelstvo-i-remont/stroit\0t"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/stroitelstvo-i-remont/stroitelnyy-instrument/av\0k"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/s\0a"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Строительство и ремонт/Строительный инструмент/Изм\0e"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/avto/soputstvuy\0l"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/str\0\xD0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Отвертка 2 в 1 \\\"TUNDRA basic\\\" 5х75 мм (+,-) \0\xFF"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/stroitelstvo-i-remont/stroitelnyy-instrument/avtoinstrumen\0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Мелкая бытовая техника/Мелки\xD0\0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Пряжа \\\"Бамбук стрейч\\0\0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Карандаш чёрнографитны\xD0\0\xD0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Творчество/Рукоделие, аппликации/Пряжа и шерсть для \xD0\0l"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/1071547/karandash-chernografitnyy-volshebstvo-nv-kruglyy-d-7-2mm-dl-176mm-plast-tuba/\0e"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"ca\0e"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"ca\0e"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/1165424/chipbord-vyrubnoy-dlya-skrapbukinga-malyshi-mikki-maus-disney-bebi\0t"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/posuda/kuhonnye-prinadlezhnosti-i-i\0d"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Канцтовары/Ежедневники и блокн\xD0\0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/kanctovary/ezhednevniki-i-blok\0a"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Стакан \xD0\0a"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Набор бумаги для скрапбукинга \\\"Мои первый годик\\\": Микки Маус, Дисней бэби, 12 листов 29.5 х 29.5 см, 160\0\x80"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"c\0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Органайзер для хранения аксессуаров, \0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"quantity\00"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Сменный блок для тетрадей на кольцах А5, 160 листов клетка, офсет \xE2\x84\0="sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Сувениры/Ф\xD0\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"\0\""sv, ResultType::Return, "\0"sv },
|
||||
{ "\"\0\x04"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"va\0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"ca\0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"В \0\x04"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/letnie-tovary/z\0\x04"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Посудомоечная машина Ha\0="sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Крупная бытов\0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Полочная акустическая система Magnat Needl\0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"brand\00"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"\0d"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"pos\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"c\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"var\0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Телевизоры и видеотехника/Всё для домашних кинотеатр\0="sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Флеш-диск Transcend JetFlash 620 8GB (TS8GJF62\0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Табурет Мег\0\xD0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"variant\0\x04"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Катал\xD0\0\""sv, ResultType::Return, "Катал\xD0\0"sv },
|
||||
{ "\"К\0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Полочная акустическая система Magnat Needl\0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"brand\00"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"\0d"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"pos\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"c\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"17\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/igrushki/razvivayusc\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Ключница \\\"\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Игр\xD1\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Игрушки/Игрушки для девочек/Игровые модули дл\xD1\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Крупная бытовая техника/Стиральные машины/С фронт\xD0\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\0 "sv, ResultType::Throw, "JSON: expected \", got \0"sv },
|
||||
{ "\"Светодиодная лента SMD3528, 5 м. IP33, 60LED, зеленый, 4,8W/мет\xD1\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Сантехника/Мебель для ванных комнат/Стол\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\0o"sv, ResultType::Throw, "JSON: expected \", got \0"sv },
|
||||
{ "\"/igrushki/konstruktory\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/posuda/kuhonnye-prinadlezhnosti-i-instrumenty/kuhonnye-pr\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/1290414/komplekt-zhenskiy-dzhemper-plusbryuki-m-254-09-malina-plustemno-siniy-\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Творчество/Рисование/Инструменты и кра\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Строительство и ремонт/Силовая техника/Зарядные устройства для автомобильных аккумуляторов/Пуско-зарядные устр\xD0\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Строительство и ремонт/Силовая техника/Зарядные устройств\xD0\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Строительство и ремонт/Силовая техника/Зарядные устройства для автомобиль\0d"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\0 "sv, ResultType::Throw, "JSON: expected \", got \0"sv },
|
||||
{ "\"/Хозтовары/Хранение вещей и организа\xD1\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Хозтовары/Товары для стир\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"li\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/igrushki/igrus\0d"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/734859/samolet-radioupravlyaemyy-istrebitel-rabotaet-o\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/kosmetika-i-parfyum/parfyumeriya/mu\00"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/ko\0\0"sv, ResultType::Throw, "JSON: begin >= end."sv },
|
||||
{ "\"/avto/avtomobilnyy\0\0"sv, ResultType::Throw, "JSON: begin >= end."sv },
|
||||
{ "\"/stroitelstvo-i-remont/stroit\00"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/stroitelstvo-i-remont/stroitelnyy-instrument/av\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/s\0d"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Строительство и ремонт/Строительный инструмент/Изм\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/avto/soputstvuy\0\""sv, ResultType::Return, "/avto/soputstvuy\0"sv },
|
||||
{ "\"/str\0k"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Отвертка 2 в 1 \\\"TUNDRA basic\\\" 5х75 мм (+,-) \0\xD0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/stroitelstvo-i-remont/stroitelnyy-instrument/avtoinstrumen\0="sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Чайник электрический Vitesse\0="sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Мелкая бытовая техника/Мелки\xD0\0\xD0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Пряжа \\\"Бамбук стрейч\\0о"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Карандаш чёрнографитны\xD0\0k"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Творчество/Рукоделие, аппликации/Пряжа и шерсть для \xD0\0\""sv, ResultType::Return, "/Творчество/Рукоделие, аппликации/Пряжа и шерсть для \xD0\0"sv },
|
||||
{ "\"/1071547/karandash-chernografitnyy-volshebstvo-nv-kruglyy-d-7-2mm-dl-176mm-plast-tuba/\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"ca\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Подаро\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Средство для прочис\xD1\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"i\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/p\0\""sv, ResultType::Return, "/p\0"sv },
|
||||
{ "\"/Сувениры/Магниты, н\xD0\0k"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Дерев\xD0\0="sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/prazdniki/svadba/svadebnaya-c\0\xD0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Канцт\0d"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Праздники/То\xD0\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"v\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Косметика \xD0\0d"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Спорт и отдых/Настольные игры/Покер, руле\xD1\0\xD0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"categ\0="sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/retailr\0k"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/retailrocket\0k"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Ежедневник недат А5 140л кл,ляссе,обл пв\0="sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/432809/ezhednevnik-organayzer-sredniy-s-remeshkom-na-knopke-v-oblozhke-kalkulyator-kalendar-do-\0\xD0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/1165424/chipbord-vyrubnoy-dlya-skrapbukinga-malyshi-mikki-maus-disney-bebi\0d"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/posuda/kuhonnye-prinadlezhnosti-i-i\0 "sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/Канцтовары/Ежедневники и блокн\xD0\0o"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"/kanctovary/ezhednevniki-i-blok\00"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Стакан \xD0\0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"Набор бумаги для скрапбукинга \\\"Мои первый годик\\\": Микки Маус, Дисней бэби, 12 листов 29.5 х 29.5 см, 160\0\0"sv, ResultType::Throw, "JSON: incorrect syntax (expected end of string, found end of JSON)."sv },
|
||||
{ "\"c\0\""sv, ResultType::Return, "c\0"sv },
|
||||
};
|
||||
|
||||
for (auto i : boost::irange(0, 1/*00000*/))
|
||||
{
|
||||
static_cast<void>(i);
|
||||
|
||||
for (auto & r : test_data)
|
||||
{
|
||||
try
|
||||
{
|
||||
JSON j(r.input.data(), r.input.data() + r.input.size());
|
||||
|
||||
ASSERT_EQ(j.getString(), r.result);
|
||||
ASSERT_EQ(r.result_type, ResultType::Return);
|
||||
}
|
||||
catch (const JSONException &)
|
||||
{
|
||||
ASSERT_EQ(r.result_type, ResultType::Throw);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -126,7 +126,7 @@ static PollPidResult pollPid(pid_t pid, int timeout_in_ms)
|
||||
if (kq == -1)
|
||||
return PollPidResult::FAILED;
|
||||
|
||||
struct kevent change = {.ident = NULL};
|
||||
struct kevent change = {.ident = 0};
|
||||
EV_SET(&change, pid, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, NULL);
|
||||
|
||||
int event_add_result = HANDLE_EINTR(kevent(kq, &change, 1, NULL, 0, NULL));
|
||||
@ -138,7 +138,7 @@ static PollPidResult pollPid(pid_t pid, int timeout_in_ms)
|
||||
return PollPidResult::FAILED;
|
||||
}
|
||||
|
||||
struct kevent event = {.ident = NULL};
|
||||
struct kevent event = {.ident = 0};
|
||||
struct timespec remaining_timespec = {.tv_sec = timeout_in_ms / 1000, .tv_nsec = (timeout_in_ms % 1000) * 1000000};
|
||||
int ready = HANDLE_EINTR(kevent(kq, nullptr, 0, &event, 1, &remaining_timespec));
|
||||
PollPidResult result = ready < 0 ? PollPidResult::FAILED : PollPidResult::RESTART;
|
||||
|
@ -1019,7 +1019,7 @@ INSTANTIATE_TEST_SUITE_P(MonotonicFloat,
|
||||
Codec("Gorilla")
|
||||
),
|
||||
::testing::Values(
|
||||
generateSeq<Float32>(G(MonotonicGenerator<Float32>(M_E, 5))),
|
||||
generateSeq<Float32>(G(MonotonicGenerator<Float32>(static_cast<Float32>(M_E), 5))),
|
||||
generateSeq<Float64>(G(MonotonicGenerator<Float64>(M_E, 5)))
|
||||
)
|
||||
)
|
||||
@ -1032,7 +1032,7 @@ INSTANTIATE_TEST_SUITE_P(MonotonicReverseFloat,
|
||||
Codec("Gorilla")
|
||||
),
|
||||
::testing::Values(
|
||||
generateSeq<Float32>(G(MonotonicGenerator<Float32>(-1 * M_E, 5))),
|
||||
generateSeq<Float32>(G(MonotonicGenerator<Float32>(static_cast<Float32>(-1 * M_E), 5))),
|
||||
generateSeq<Float64>(G(MonotonicGenerator<Float64>(-1 * M_E, 5)))
|
||||
)
|
||||
)
|
||||
|
@ -168,7 +168,7 @@ inline bool NO_SANITIZE_UNDEFINED convertNumeric(From value, To & result)
|
||||
/// Note that NaNs doesn't compare equal to anything, but they are still in range of any Float type.
|
||||
if (isNaN(value))
|
||||
{
|
||||
result = value;
|
||||
result = static_cast<To>(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -444,7 +444,9 @@ public:
|
||||
}
|
||||
|
||||
template <typename T> auto & safeGet() const
|
||||
{ return const_cast<Field *>(this)->safeGet<T>(); }
|
||||
{
|
||||
return const_cast<Field *>(this)->safeGet<T>();
|
||||
}
|
||||
|
||||
template <typename T> auto & safeGet();
|
||||
|
||||
|
@ -105,7 +105,7 @@ template <typename T>
|
||||
void SerializationNumber<T>::serializeBinary(const Field & field, WriteBuffer & ostr) const
|
||||
{
|
||||
/// ColumnVector<T>::ValueType is a narrower type. For example, UInt8, when the Field type is UInt64
|
||||
typename ColumnVector<T>::ValueType x = field.get<FieldType>();
|
||||
typename ColumnVector<T>::ValueType x = static_cast<typename ColumnVector<T>::ValueType>(field.get<FieldType>());
|
||||
writeBinary(x, ostr);
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ private:
|
||||
attribute,
|
||||
fetched_columns_index,
|
||||
fetched_keys,
|
||||
[&](auto value) { data.push_back(value); },
|
||||
[&](auto value) { data.push_back(static_cast<AttributeType>(value)); },
|
||||
default_value_provider);
|
||||
}
|
||||
};
|
||||
@ -338,7 +338,7 @@ private:
|
||||
}
|
||||
else
|
||||
{
|
||||
container.back() = column_value.get<NearestFieldType<ElementType>>();
|
||||
container.back() = static_cast<ElementType>(column_value.get<ElementType>());
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -391,7 +391,7 @@ private:
|
||||
}
|
||||
else
|
||||
{
|
||||
container[index_to_use] = column_value.get<NearestFieldType<ElementType>>();
|
||||
container[index_to_use] = static_cast<ElementType>(column_value.get<ElementType>());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -317,7 +317,7 @@ public:
|
||||
if (attribute_default_value.isNull())
|
||||
default_value_is_null = true;
|
||||
else
|
||||
default_value = attribute_default_value.get<NearestFieldType<DictionaryAttributeType>>();
|
||||
default_value = static_cast<DictionaryAttributeType>(attribute_default_value.get<DictionaryAttributeType>());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -689,5 +689,3 @@ static ColumnPtr getColumnFromPODArray(const PaddedPODArray<T> & array, size_t s
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -617,7 +617,7 @@ void FlatDictionary::setAttributeValue(Attribute & attribute, const UInt64 key,
|
||||
}
|
||||
else
|
||||
{
|
||||
container[key] = attribute_value;
|
||||
container[key] = static_cast<ValueType>(attribute_value);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -513,7 +513,7 @@ void HashedArrayDictionary<dictionary_key_type>::blockToAttributes(const Block &
|
||||
}
|
||||
else
|
||||
{
|
||||
auto value_to_insert = column_value_to_insert.get<NearestFieldType<AttributeValueType>>();
|
||||
auto value_to_insert = static_cast<AttributeValueType>(column_value_to_insert.get<AttributeValueType>());
|
||||
attribute_container.back() = value_to_insert;
|
||||
}
|
||||
};
|
||||
|
@ -549,7 +549,7 @@ void HashedDictionary<dictionary_key_type, sparse>::blockToAttributes(const Bloc
|
||||
}
|
||||
else
|
||||
{
|
||||
auto value_to_insert = column_value_to_insert.get<NearestFieldType<AttributeValueType>>();
|
||||
auto value_to_insert = static_cast<AttributeValueType>(column_value_to_insert.get<AttributeValueType>());
|
||||
container.insert({key, value_to_insert});
|
||||
}
|
||||
|
||||
|
@ -771,7 +771,7 @@ void IPAddressDictionary::setAttributeValue(Attribute & attribute, const Field &
|
||||
}
|
||||
else
|
||||
{
|
||||
setAttributeValueImpl<AttributeType>(attribute, value.get<AttributeType>());
|
||||
setAttributeValueImpl<AttributeType>(attribute, static_cast<AttributeType>(value.get<AttributeType>()));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -133,7 +133,7 @@ ColumnPtr IPolygonDictionary::getColumn(
|
||||
getItemsImpl<ValueType>(
|
||||
requested_key_points,
|
||||
[&](size_t row) { return attribute_data[row]; },
|
||||
[&](auto value) { result_data.emplace_back(value); },
|
||||
[&](auto value) { result_data.emplace_back(static_cast<AttributeType>(value)); },
|
||||
default_value_provider);
|
||||
}
|
||||
};
|
||||
@ -525,7 +525,11 @@ void handlePointsReprByArrays(const IColumn * column, Data & data, Offset & offs
|
||||
if (offsets[i] - prev_offset != 2)
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "All points should be two-dimensional");
|
||||
prev_offset = offsets[i];
|
||||
addNewPoint(ptr_coord->getElement(2 * i), ptr_coord->getElement(2 * i + 1), data, offset);
|
||||
addNewPoint(
|
||||
static_cast<IPolygonDictionary::Coord>(ptr_coord->getElement(2 * i)),
|
||||
static_cast<IPolygonDictionary::Coord>(ptr_coord->getElement(2 * i + 1)),
|
||||
data,
|
||||
offset);
|
||||
}
|
||||
}
|
||||
|
||||
@ -542,7 +546,11 @@ void handlePointsReprByTuples(const IColumn * column, Data & data, Offset & offs
|
||||
throw Exception(ErrorCodes::TYPE_MISMATCH, "Expected coordinates to be of type Float64");
|
||||
for (size_t i = 0; i < column_x->size(); ++i)
|
||||
{
|
||||
addNewPoint(column_x->getElement(i), column_y->getElement(i), data, offset);
|
||||
addNewPoint(
|
||||
static_cast<IPolygonDictionary::Coord>(column_x->getElement(i)),
|
||||
static_cast<IPolygonDictionary::Coord>(column_y->getElement(i)),
|
||||
data,
|
||||
offset);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ public:
|
||||
static constexpr size_t kMultiProcessingDepth = 2;
|
||||
|
||||
/** A constant used to avoid errors with points falling on the boundaries of cells. */
|
||||
static constexpr Coord kEps = 1e-4;
|
||||
static constexpr Coord kEps = 1e-4f;
|
||||
|
||||
private:
|
||||
std::unique_ptr<ICell<ReturnCell>> root = nullptr;
|
||||
|
@ -880,7 +880,7 @@ void RangeHashedDictionary<dictionary_key_type>::setAttributeValue(Attribute & a
|
||||
}
|
||||
else
|
||||
{
|
||||
value_to_insert = value.get<ValueType>();
|
||||
value_to_insert = static_cast<ValueType>(value.get<ValueType>());
|
||||
}
|
||||
|
||||
container.back() = value_to_insert;
|
||||
|
@ -226,7 +226,7 @@ namespace
|
||||
void writeInt(NumberType value)
|
||||
{
|
||||
auto casted = castNumber<Int64>(value);
|
||||
if (casted || !skip_zero_or_empty)
|
||||
if (casted != 0 || !skip_zero_or_empty)
|
||||
writer->writeInt(field_tag, casted);
|
||||
}
|
||||
|
||||
@ -234,7 +234,7 @@ namespace
|
||||
void writeSInt(NumberType value)
|
||||
{
|
||||
auto casted = castNumber<Int64>(value);
|
||||
if (casted || !skip_zero_or_empty)
|
||||
if (casted != 0 || !skip_zero_or_empty)
|
||||
writer->writeSInt(field_tag, casted);
|
||||
}
|
||||
|
||||
@ -242,7 +242,7 @@ namespace
|
||||
void writeUInt(NumberType value)
|
||||
{
|
||||
auto casted = castNumber<UInt64>(value);
|
||||
if (casted || !skip_zero_or_empty)
|
||||
if (casted != 0 || !skip_zero_or_empty)
|
||||
writer->writeUInt(field_tag, casted);
|
||||
}
|
||||
|
||||
@ -250,7 +250,7 @@ namespace
|
||||
void writeFixed(NumberType value)
|
||||
{
|
||||
auto casted = castNumber<FieldType>(value);
|
||||
if (casted || !skip_zero_or_empty)
|
||||
if (casted != 0 || !skip_zero_or_empty)
|
||||
writer->writeFixed(field_tag, casted);
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ struct Base58Encode
|
||||
/// Base58 has efficiency of 73% (8/11) [https://monerodocs.org/cryptography/base58/],
|
||||
/// and we take double scale to avoid any reallocation.
|
||||
|
||||
size_t max_result_size = ceil(2 * src_column.getChars().size() + 1);
|
||||
size_t max_result_size = static_cast<size_t>(ceil(2 * src_column.getChars().size() + 1));
|
||||
|
||||
dst_data.resize(max_result_size);
|
||||
dst_offsets.resize(input_rows_count);
|
||||
|
@ -14,7 +14,7 @@ class FunctionConstantBase : public IFunction
|
||||
public:
|
||||
template <typename U>
|
||||
explicit FunctionConstantBase(U && constant_value_, bool is_distributed_ = false)
|
||||
: constant_value(std::forward<U>(constant_value_)), is_distributed(is_distributed_)
|
||||
: constant_value(static_cast<T>(std::forward<U>(constant_value_))), is_distributed(is_distributed_)
|
||||
{
|
||||
}
|
||||
|
||||
@ -52,4 +52,3 @@ private:
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ namespace DB
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int LOGICAL_ERROR;
|
||||
extern const int DECIMAL_OVERFLOW;
|
||||
extern const int ILLEGAL_COLUMN;
|
||||
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
|
||||
@ -671,9 +672,13 @@ public:
|
||||
using ResultDataType = TransformResultDataType<FromDataType>;
|
||||
|
||||
if constexpr (std::is_same_v<ResultDataType, DataTypeDate>)
|
||||
{
|
||||
return std::make_shared<DataTypeDate>();
|
||||
}
|
||||
else if constexpr (std::is_same_v<ResultDataType, DataTypeDate32>)
|
||||
{
|
||||
return std::make_shared<DataTypeDate32>();
|
||||
}
|
||||
else if constexpr (std::is_same_v<ResultDataType, DataTypeDateTime>)
|
||||
{
|
||||
return std::make_shared<DataTypeDateTime>(extractTimeZoneNameFromFunctionArguments(arguments, 2, 0));
|
||||
@ -712,13 +717,8 @@ public:
|
||||
return std::make_shared<DataTypeDateTime64>(scale, extractTimeZoneNameFromFunctionArguments(arguments, 2, 0));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
static_assert("Failed to resolve return type.");
|
||||
}
|
||||
|
||||
//to make PVS and GCC happy.
|
||||
return nullptr;
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Unexpected result type in datetime add interval function");
|
||||
}
|
||||
|
||||
bool useDefaultImplementationForConstants() const override { return true; }
|
||||
@ -757,4 +757,3 @@ public:
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
@ -398,12 +398,12 @@ struct ToDateTransform32Or64Signed
|
||||
if (from < 0)
|
||||
return 0;
|
||||
|
||||
auto day_num = time_zone.toDayNum(ExtendedDayNum(from));
|
||||
auto day_num = time_zone.toDayNum(ExtendedDayNum(static_cast<Int32>(from)));
|
||||
return day_num < DATE_LUT_MAX_DAY_NUM ? day_num : DATE_LUT_MAX_DAY_NUM;
|
||||
|
||||
return (from < DATE_LUT_MAX_DAY_NUM)
|
||||
? from
|
||||
: std::min<Int32>(Int32(time_zone.toDayNum(from)), Int32(0xFFFFFFFF));
|
||||
: std::min<Int32>(Int32(time_zone.toDayNum(static_cast<UInt16>(from))), Int32(0xFFFFFFFF));
|
||||
|
||||
}
|
||||
};
|
||||
@ -450,7 +450,7 @@ struct ToDate32Transform32Or64Signed
|
||||
if (from < daynum_min_offset)
|
||||
return daynum_min_offset;
|
||||
return (from < DATE_LUT_MAX_EXTEND_DAY_NUM)
|
||||
? from
|
||||
? static_cast<ToType>(from)
|
||||
: time_zone.toDayNum(std::min<Int64>(Int64(from), Int64(0xFFFFFFFF)));
|
||||
}
|
||||
};
|
||||
|
@ -683,7 +683,7 @@ public:
|
||||
/// We permit inaccurate conversion of double to float.
|
||||
/// Example: double 0.1 from JSON is not representable in float.
|
||||
/// But it will be more convenient for user to perform conversion.
|
||||
value = element.getDouble();
|
||||
value = static_cast<NumberType>(element.getDouble());
|
||||
}
|
||||
else if (!accurate::convertNumeric(element.getDouble(), value))
|
||||
return false;
|
||||
|
@ -130,7 +130,7 @@ struct NotImpl
|
||||
|
||||
static inline ResultType apply(A a)
|
||||
{
|
||||
return !a;
|
||||
return !static_cast<bool>(a);
|
||||
}
|
||||
|
||||
#if USE_EMBEDDED_COMPILER
|
||||
|
@ -745,7 +745,7 @@ private:
|
||||
using ValueType = typename Container::value_type;
|
||||
std::vector<ValueType> boundary_values(boundaries.size());
|
||||
for (size_t i = 0; i < boundaries.size(); ++i)
|
||||
boundary_values[i] = boundaries[i].get<ValueType>();
|
||||
boundary_values[i] = static_cast<ValueType>(boundaries[i].get<ValueType>());
|
||||
|
||||
::sort(boundary_values.begin(), boundary_values.end());
|
||||
boundary_values.erase(std::unique(boundary_values.begin(), boundary_values.end()), boundary_values.end());
|
||||
|
@ -52,9 +52,9 @@ struct FunctionDetectTonalityImpl
|
||||
/// Calculate average value of tonality.
|
||||
/// Convert values -12..6 to -1..1
|
||||
if (weight > 0)
|
||||
return weight / count_words / 6;
|
||||
return static_cast<Float32>(weight / count_words / 6);
|
||||
else
|
||||
return weight / count_words / 12;
|
||||
return static_cast<Float32>(weight / count_words / 12);
|
||||
}
|
||||
|
||||
static void vector(
|
||||
|
@ -39,7 +39,7 @@ const uint8_t geohash_base32_decode_lookup_table[256] = {
|
||||
|
||||
const size_t BITS_PER_SYMBOL = 5;
|
||||
const size_t MAX_PRECISION = 12;
|
||||
const size_t MAX_BITS = MAX_PRECISION * BITS_PER_SYMBOL * 1.5;
|
||||
const size_t MAX_BITS = (MAX_PRECISION * BITS_PER_SYMBOL * 3) / 2;
|
||||
const Float64 LON_MIN = -180;
|
||||
const Float64 LON_MAX = 180;
|
||||
const Float64 LAT_MIN = -90;
|
||||
@ -301,8 +301,8 @@ GeohashesInBoxPreparedArgs geohashesInBoxPrepare(
|
||||
Float64 lon_max = ceil(longitude_max / lon_step) * lon_step;
|
||||
Float64 lat_max = ceil(latitude_max / lat_step) * lat_step;
|
||||
|
||||
UInt32 lon_items = (lon_max - lon_min) / lon_step;
|
||||
UInt32 lat_items = (lat_max - lat_min) / lat_step;
|
||||
UInt32 lon_items = static_cast<UInt32>((lon_max - lon_min) / lon_step);
|
||||
UInt32 lat_items = static_cast<UInt32>((lat_max - lat_min) / lat_step);
|
||||
|
||||
return GeohashesInBoxPreparedArgs
|
||||
{
|
||||
|
@ -361,8 +361,8 @@ bool PointInPolygonWithGrid<CoordinateType>::contains(CoordinateType x, Coordina
|
||||
if (float_col < 0 || float_col > grid_size)
|
||||
return false;
|
||||
|
||||
int row = std::min<int>(float_row, grid_size - 1);
|
||||
int col = std::min<int>(float_col, grid_size - 1);
|
||||
int row = std::min<int>(static_cast<int>(float_row), grid_size - 1);
|
||||
int col = std::min<int>(static_cast<int>(float_col), grid_size - 1);
|
||||
|
||||
int index = getCellIndex(row, col);
|
||||
const auto & cell = cells[index];
|
||||
|
@ -112,7 +112,7 @@ struct LpDistance
|
||||
template <typename ResultType>
|
||||
static void accumulate(State<ResultType> & state, ResultType x, ResultType y, const ConstParams & params)
|
||||
{
|
||||
state.sum += std::pow(fabs(x - y), params.power);
|
||||
state.sum += static_cast<ResultType>(std::pow(fabs(x - y), params.power));
|
||||
}
|
||||
|
||||
template <typename ResultType>
|
||||
@ -124,7 +124,7 @@ struct LpDistance
|
||||
template <typename ResultType>
|
||||
static ResultType finalize(const State<ResultType> & state, const ConstParams & params)
|
||||
{
|
||||
return std::pow(state.sum, params.inverted_power);
|
||||
return static_cast<ResultType>(std::pow(state.sum, params.inverted_power));
|
||||
}
|
||||
};
|
||||
|
||||
@ -380,7 +380,8 @@ private:
|
||||
for (; prev + VEC_SIZE < off; prev += VEC_SIZE)
|
||||
{
|
||||
for (size_t s = 0; s < VEC_SIZE; ++s)
|
||||
Kernel::template accumulate<ResultType>(states[s], data_x[prev+s], data_y[prev+s], kernel_params);
|
||||
Kernel::template accumulate<ResultType>(
|
||||
states[s], static_cast<ResultType>(data_x[prev + s]), static_cast<ResultType>(data_y[prev + s]), kernel_params);
|
||||
}
|
||||
|
||||
typename Kernel::template State<ResultType> state;
|
||||
@ -390,7 +391,8 @@ private:
|
||||
/// Process the tail
|
||||
for (; prev < off; ++prev)
|
||||
{
|
||||
Kernel::template accumulate<ResultType>(state, data_x[prev], data_y[prev], kernel_params);
|
||||
Kernel::template accumulate<ResultType>(
|
||||
state, static_cast<ResultType>(data_x[prev]), static_cast<ResultType>(data_y[prev]), kernel_params);
|
||||
}
|
||||
result_data[row] = Kernel::finalize(state, kernel_params);
|
||||
row++;
|
||||
@ -447,7 +449,8 @@ private:
|
||||
for (; prev + VEC_SIZE < off; i += VEC_SIZE, prev += VEC_SIZE)
|
||||
{
|
||||
for (size_t s = 0; s < VEC_SIZE; ++s)
|
||||
Kernel::template accumulate<ResultType>(states[s], data_x[i+s], data_y[prev+s], kernel_params);
|
||||
Kernel::template accumulate<ResultType>(
|
||||
states[s], static_cast<ResultType>(data_x[i + s]), static_cast<ResultType>(data_y[prev + s]), kernel_params);
|
||||
}
|
||||
|
||||
typename Kernel::template State<ResultType> state;
|
||||
@ -457,7 +460,8 @@ private:
|
||||
/// Process the tail
|
||||
for (; prev < off; ++i, ++prev)
|
||||
{
|
||||
Kernel::template accumulate<ResultType>(state, data_x[i], data_y[prev], kernel_params);
|
||||
Kernel::template accumulate<ResultType>(
|
||||
state, static_cast<ResultType>(data_x[i]), static_cast<ResultType>(data_y[prev]), kernel_params);
|
||||
}
|
||||
result_data[row] = Kernel::finalize(state, kernel_params);
|
||||
row++;
|
||||
|
@ -94,7 +94,7 @@ struct LpNorm
|
||||
template <typename ResultType>
|
||||
inline static ResultType accumulate(ResultType result, ResultType value, const ConstParams & params)
|
||||
{
|
||||
return result + std::pow(fabs(value), params.power);
|
||||
return result + static_cast<ResultType>(std::pow(fabs(value), params.power));
|
||||
}
|
||||
|
||||
template <typename ResultType>
|
||||
@ -106,7 +106,7 @@ struct LpNorm
|
||||
template <typename ResultType>
|
||||
inline static ResultType finalize(ResultType result, const ConstParams & params)
|
||||
{
|
||||
return std::pow(result, params.inverted_power);
|
||||
return static_cast<ResultType>(std::pow(result, params.inverted_power));
|
||||
}
|
||||
};
|
||||
|
||||
@ -254,7 +254,7 @@ private:
|
||||
for (; prev + VEC_SIZE < off; prev += VEC_SIZE)
|
||||
{
|
||||
for (size_t s = 0; s < VEC_SIZE; ++s)
|
||||
results[s] = Kernel::template accumulate<ResultType>(results[s], data[prev+s], kernel_params);
|
||||
results[s] = Kernel::template accumulate<ResultType>(results[s], static_cast<ResultType>(data[prev + s]), kernel_params);
|
||||
}
|
||||
|
||||
ResultType result = 0;
|
||||
@ -264,7 +264,7 @@ private:
|
||||
/// Process the tail
|
||||
for (; prev < off; ++prev)
|
||||
{
|
||||
result = Kernel::template accumulate<ResultType>(result, data[prev], kernel_params);
|
||||
result = Kernel::template accumulate<ResultType>(result, static_cast<ResultType>(data[prev]), kernel_params);
|
||||
}
|
||||
result_data[row] = Kernel::finalize(result, kernel_params);
|
||||
row++;
|
||||
|
@ -157,7 +157,7 @@ public:
|
||||
switch (max_unit) /// A kind of Duff Device.
|
||||
{
|
||||
case Years: processUnit(365 * 24 * 3600, " year", 5, value, buf_to, has_output); [[fallthrough]];
|
||||
case Months: processUnit(30.5 * 24 * 3600, " month", 6, value, buf_to, has_output); [[fallthrough]];
|
||||
case Months: processUnit(static_cast<UInt64>(30.5 * 24 * 3600), " month", 6, value, buf_to, has_output); [[fallthrough]];
|
||||
case Days: processUnit(24 * 3600, " day", 4, value, buf_to, has_output); [[fallthrough]];
|
||||
case Hours: processUnit(3600, " hour", 5, value, buf_to, has_output); [[fallthrough]];
|
||||
case Minutes: processUnit(60, " minute", 7, value, buf_to, has_output); [[fallthrough]];
|
||||
@ -188,7 +188,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
UInt64 num_units = value / unit_size;
|
||||
UInt64 num_units = static_cast<UInt64>(value / unit_size);
|
||||
|
||||
if (!num_units)
|
||||
{
|
||||
@ -228,4 +228,3 @@ REGISTER_FUNCTION(FormatReadableTimeDelta)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,15 +2,14 @@
|
||||
#include <Columns/ColumnsNumber.h>
|
||||
#include <Columns/ColumnConst.h>
|
||||
#include <Common/typeid_cast.h>
|
||||
#include <Common/assert_cast.h>
|
||||
#include <Functions/IFunction.h>
|
||||
#include <Functions/FunctionHelpers.h>
|
||||
#include <Functions/FunctionFactory.h>
|
||||
#include <Functions/PerformanceAdaptors.h>
|
||||
#include <Interpreters/castColumn.h>
|
||||
#include <Common/TargetSpecific.h>
|
||||
#include <base/range.h>
|
||||
#include <cmath>
|
||||
#include <numbers>
|
||||
|
||||
|
||||
namespace DB
|
||||
@ -43,18 +42,21 @@ namespace ErrorCodes
|
||||
namespace
|
||||
{
|
||||
|
||||
constexpr double PI = 3.14159265358979323846;
|
||||
constexpr double PI = std::numbers::pi_v<double>;
|
||||
constexpr float PI_F = std::numbers::pi_v<float>;
|
||||
|
||||
constexpr float RAD_IN_DEG = static_cast<float>(PI / 180.0);
|
||||
constexpr float RAD_IN_DEG_HALF = static_cast<float>(PI / 360.0);
|
||||
|
||||
constexpr size_t COS_LUT_SIZE = 1024; // maxerr 0.00063%
|
||||
constexpr float COS_LUT_SIZE_F = 1024.0f; // maxerr 0.00063%
|
||||
constexpr size_t ASIN_SQRT_LUT_SIZE = 512;
|
||||
constexpr size_t METRIC_LUT_SIZE = 1024;
|
||||
|
||||
/** Earth radius in meters using WGS84 authalic radius.
|
||||
* We use this value to be consistent with H3 library.
|
||||
*/
|
||||
constexpr float EARTH_RADIUS = 6371007.180918475;
|
||||
constexpr float EARTH_RADIUS = 6371007.180918475f;
|
||||
constexpr float EARTH_DIAMETER = 2 * EARTH_RADIUS;
|
||||
|
||||
|
||||
@ -98,7 +100,7 @@ void geodistInit()
|
||||
|
||||
sphere_metric_meters_lut[i] = static_cast<float>(sqr((EARTH_DIAMETER * PI / 360) * cos(latitude)));
|
||||
|
||||
sphere_metric_lut[i] = sqrf(cosf(latitude));
|
||||
sphere_metric_lut[i] = static_cast<float>(sqr(cos(latitude)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,7 +120,7 @@ inline float geodistDegDiff(float f)
|
||||
|
||||
inline float geodistFastCos(float x)
|
||||
{
|
||||
float y = fabsf(x) * (COS_LUT_SIZE / PI / 2);
|
||||
float y = fabsf(x) * (COS_LUT_SIZE_F / PI_F / 2.0f);
|
||||
size_t i = floatToIndex(y);
|
||||
y -= i;
|
||||
i &= (COS_LUT_SIZE - 1);
|
||||
@ -127,7 +129,7 @@ inline float geodistFastCos(float x)
|
||||
|
||||
inline float geodistFastSin(float x)
|
||||
{
|
||||
float y = fabsf(x) * (COS_LUT_SIZE / PI / 2);
|
||||
float y = fabsf(x) * (COS_LUT_SIZE_F / PI_F / 2.0f);
|
||||
size_t i = floatToIndex(y);
|
||||
y -= i;
|
||||
i = (i - COS_LUT_SIZE / 4) & (COS_LUT_SIZE - 1); // cos(x - pi / 2) = sin(x), costable / 4 = pi / 2
|
||||
@ -202,7 +204,7 @@ float distance(float lon1deg, float lat1deg, float lon2deg, float lat2deg)
|
||||
}
|
||||
else if constexpr (method == Method::SPHERE_METERS)
|
||||
{
|
||||
k_lat = sqr(EARTH_DIAMETER * PI / 360);
|
||||
k_lat = sqrf(EARTH_DIAMETER * PI_F / 360.0f);
|
||||
|
||||
k_lon = sphere_metric_meters_lut[latitude_midpoint_index]
|
||||
+ (sphere_metric_meters_lut[latitude_midpoint_index + 1] - sphere_metric_meters_lut[latitude_midpoint_index]) * (latitude_midpoint - latitude_midpoint_index);
|
||||
@ -227,7 +229,7 @@ float distance(float lon1deg, float lat1deg, float lon2deg, float lat2deg)
|
||||
+ geodistFastCos(lat1deg * RAD_IN_DEG) * geodistFastCos(lat2deg * RAD_IN_DEG) * sqrf(geodistFastSin(lon_diff * RAD_IN_DEG_HALF));
|
||||
|
||||
if constexpr (method == Method::SPHERE_DEGREES)
|
||||
return (360.0f / PI) * geodistFastAsinSqrt(a);
|
||||
return (360.0f / PI_F) * geodistFastAsinSqrt(a);
|
||||
else
|
||||
return EARTH_DIAMETER * geodistFastAsinSqrt(a);
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ struct IntExp10Impl
|
||||
if constexpr (is_big_int_v<A> || std::is_same_v<A, Decimal256>)
|
||||
throw DB::Exception("IntExp10 is not implemented for big integers", ErrorCodes::NOT_IMPLEMENTED);
|
||||
else
|
||||
return intExp10(a);
|
||||
return intExp10(static_cast<int>(a));
|
||||
}
|
||||
|
||||
#if USE_EMBEDDED_COMPILER
|
||||
|
@ -26,7 +26,7 @@ struct IntExp2Impl
|
||||
if constexpr (is_big_int_v<A>)
|
||||
throw DB::Exception("intExp2 not implemented for big integers", ErrorCodes::NOT_IMPLEMENTED);
|
||||
else
|
||||
return intExp2(a);
|
||||
return intExp2(static_cast<int>(a));
|
||||
}
|
||||
|
||||
#if USE_EMBEDDED_COMPILER
|
||||
|
@ -101,7 +101,7 @@ private:
|
||||
void processNotNullable(const InputData & input_data, ColumnUInt8::Container & result_data, size_t input_rows_count) const
|
||||
{
|
||||
for (size_t i = 0; i < input_rows_count; ++i)
|
||||
result_data[i] = !input_data[i];
|
||||
result_data[i] = input_data[i] == 0;
|
||||
}
|
||||
|
||||
template <typename InputData>
|
||||
@ -109,7 +109,7 @@ private:
|
||||
ColumnUInt8::Container & result_data, size_t input_rows_count) const
|
||||
{
|
||||
for (size_t i = 0; i < input_rows_count; ++i)
|
||||
result_data[i] = input_null_map[i] || !input_data[i];
|
||||
result_data[i] = input_null_map[i] || input_data[i] == 0;
|
||||
}
|
||||
};
|
||||
|
||||
@ -121,4 +121,3 @@ REGISTER_FUNCTION(IsZeroOrNull)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -132,9 +132,9 @@ public:
|
||||
year <= Traits::MAX_YEAR &&
|
||||
month >= 1 && month <= 12 &&
|
||||
day >= 1 && day <= 31 &&
|
||||
YearMonthDayToSingleInt(year, month, day) <= Traits::MAX_DATE)
|
||||
YearMonthDayToSingleInt(static_cast<Int64>(year), static_cast<Int64>(month), static_cast<Int64>(day)) <= Traits::MAX_DATE)
|
||||
{
|
||||
day_num = date_lut.makeDayNum(year, month, day);
|
||||
day_num = date_lut.makeDayNum(static_cast<Int16>(year), static_cast<UInt8>(month), static_cast<UInt8>(day));
|
||||
}
|
||||
|
||||
result_data[i] = day_num;
|
||||
@ -205,7 +205,9 @@ protected:
|
||||
if (unlikely(year > DATE_LUT_MAX_YEAR))
|
||||
return maxDateTime(lut);
|
||||
|
||||
return lut.makeDateTime(year, month, day_of_month, hour, minute, second);
|
||||
return lut.makeDateTime(
|
||||
static_cast<Int16>(year), static_cast<UInt8>(month), static_cast<UInt8>(day_of_month),
|
||||
static_cast<UInt8>(hour), static_cast<UInt8>(minute), static_cast<UInt8>(second));
|
||||
}
|
||||
|
||||
static Int64 minDateTime(const DateLUTImpl & lut)
|
||||
@ -394,7 +396,7 @@ public:
|
||||
if (unlikely(date_time == min_date_time))
|
||||
fraction = 0;
|
||||
else if (unlikely(date_time == max_date_time))
|
||||
fraction = 999999999ll;
|
||||
fraction = 999999999;
|
||||
else
|
||||
{
|
||||
fraction = fraction_data ? (*fraction_data)[i] : 0;
|
||||
@ -409,7 +411,7 @@ public:
|
||||
fraction = max_fraction;
|
||||
}
|
||||
|
||||
result_data[i] = DecimalUtils::decimalFromComponents<DateTime64>(date_time, fraction, precision);
|
||||
result_data[i] = DecimalUtils::decimalFromComponents<DateTime64>(date_time, static_cast<Int64>(fraction), precision);
|
||||
}
|
||||
|
||||
return res_column;
|
||||
|
@ -78,10 +78,9 @@ public:
|
||||
auto geometries = Converter::convert(arguments[0].column->convertToFullColumnIfConst());
|
||||
|
||||
for (size_t i = 0; i < input_rows_count; ++i)
|
||||
res_data.emplace_back(boost::geometry::perimeter(geometries[i]));
|
||||
res_data.emplace_back(static_cast<Float64>(boost::geometry::perimeter(geometries[i])));
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
return res_column;
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public:
|
||||
throw Exception("The maximum sleep time is 3 seconds. Requested: " + toString(seconds), ErrorCodes::TOO_SLOW);
|
||||
|
||||
UInt64 count = (variant == FunctionSleepVariant::PerBlock ? 1 : size);
|
||||
UInt64 microseconds = seconds * count * 1e6;
|
||||
UInt64 microseconds = static_cast<UInt64>(seconds * count * 1e6);
|
||||
sleepForMicroseconds(microseconds);
|
||||
ProfileEvents::increment(ProfileEvents::SleepFunctionCalls, count);
|
||||
ProfileEvents::increment(ProfileEvents::SleepFunctionMicroseconds, microseconds);
|
||||
|
@ -395,7 +395,7 @@ private:
|
||||
if (!out)
|
||||
return false;
|
||||
|
||||
executeImplNumToNumWithConstDefault<T, U>(in->getData(), out->getData(), cache.const_default_value.get<U>());
|
||||
executeImplNumToNumWithConstDefault<T, U>(in->getData(), out->getData(), static_cast<U>(cache.const_default_value.get<U>()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -418,7 +418,7 @@ private:
|
||||
if (!out)
|
||||
return false;
|
||||
|
||||
executeImplNumToNumWithConstDefault<T, U>(in->getData(), out->getData(), cache.const_default_value.get<U>());
|
||||
executeImplNumToNumWithConstDefault<T, U>(in->getData(), out->getData(), static_cast<U>(cache.const_default_value.get<U>()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -697,7 +697,8 @@ private:
|
||||
if (!out)
|
||||
return false;
|
||||
|
||||
executeImplStringToNumWithConstDefault<U>(in->getChars(), in->getOffsets(), out->getData(), cache.const_default_value.get<U>());
|
||||
executeImplStringToNumWithConstDefault<U>(
|
||||
in->getChars(), in->getOffsets(), out->getData(), static_cast<U>(cache.const_default_value.get<U>()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -869,8 +870,10 @@ private:
|
||||
const auto * it = table.find(bit_cast<UInt64>(src[i]));
|
||||
if (it)
|
||||
memcpy(&dst[i], &it->getMapped(), sizeof(dst[i])); /// little endian.
|
||||
else if constexpr (is_decimal<U>)
|
||||
dst[i] = static_cast<typename U::NativeType>(dst_default[i]);
|
||||
else
|
||||
dst[i] = dst_default[i]; // NOLINT
|
||||
dst[i] = static_cast<U>(dst_default[i]); // NOLINT(bugprone-signed-char-misuse,cert-str34-c)
|
||||
}
|
||||
}
|
||||
|
||||
@ -977,8 +980,10 @@ private:
|
||||
const auto * it = table.find(ref);
|
||||
if (it)
|
||||
memcpy(&dst[i], &it->getMapped(), sizeof(dst[i]));
|
||||
else if constexpr (is_decimal<U>)
|
||||
dst[i] = static_cast<typename U::NativeType>(dst_default[i]);
|
||||
else
|
||||
dst[i] = dst_default[i]; // NOLINT
|
||||
dst[i] = static_cast<U>(dst_default[i]); // NOLINT(bugprone-signed-char-misuse,cert-str34-c)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,10 +29,6 @@ auto getTypeName(const ValueType &)
|
||||
{
|
||||
return "DateTime64WithScale";
|
||||
}
|
||||
else
|
||||
{
|
||||
static_assert("unsupported ValueType");
|
||||
}
|
||||
}
|
||||
|
||||
std::ostream & dump_datetime(std::ostream & ostr, const DayNum & d)
|
||||
@ -53,10 +49,10 @@ std::ostream & dump_datetime(std::ostream & ostr, const DateTime64WithScale & dt
|
||||
template <typename ValueType>
|
||||
struct DateTimeToStringParamTestCase
|
||||
{
|
||||
const char* description;
|
||||
const char * description;
|
||||
const ValueType input;
|
||||
const char* expected;
|
||||
const char* timezone = "UTC";
|
||||
const char * expected;
|
||||
const char * timezone = "UTC";
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
@ -105,10 +101,6 @@ public:
|
||||
{
|
||||
writeDateTimeText(input.value, input.scale, out, DateLUT::instance(timezone_name));
|
||||
}
|
||||
else
|
||||
{
|
||||
static_assert("unsupported ValueType");
|
||||
}
|
||||
|
||||
ASSERT_EQ(expected, out.str());
|
||||
}
|
||||
|
@ -1603,8 +1603,8 @@ void Aggregator::writeToTemporaryFile(AggregatedDataVariants & data_variants, si
|
||||
file_buf.next();
|
||||
|
||||
double elapsed_seconds = watch.elapsedSeconds();
|
||||
double compressed_bytes = file_buf.count();
|
||||
double uncompressed_bytes = compressed_buf.count();
|
||||
size_t compressed_bytes = file_buf.count();
|
||||
size_t uncompressed_bytes = compressed_buf.count();
|
||||
|
||||
{
|
||||
std::lock_guard lock(temporary_files.mutex);
|
||||
@ -1626,12 +1626,12 @@ void Aggregator::writeToTemporaryFile(AggregatedDataVariants & data_variants, si
|
||||
rows,
|
||||
ReadableSize(uncompressed_bytes),
|
||||
ReadableSize(compressed_bytes),
|
||||
uncompressed_bytes / rows,
|
||||
compressed_bytes / rows,
|
||||
uncompressed_bytes / compressed_bytes,
|
||||
rows / elapsed_seconds,
|
||||
ReadableSize(uncompressed_bytes / elapsed_seconds),
|
||||
ReadableSize(compressed_bytes / elapsed_seconds));
|
||||
static_cast<double>(uncompressed_bytes) / rows,
|
||||
static_cast<double>(compressed_bytes) / rows,
|
||||
static_cast<double>(uncompressed_bytes) / compressed_bytes,
|
||||
static_cast<double>(rows) / elapsed_seconds,
|
||||
ReadableSize(static_cast<double>(uncompressed_bytes) / elapsed_seconds),
|
||||
ReadableSize(static_cast<double>(compressed_bytes) / elapsed_seconds));
|
||||
}
|
||||
|
||||
|
||||
|
@ -2797,7 +2797,7 @@ OutputFormatPtr Context::getOutputFormatParallelIfPossible(const String & name,
|
||||
}
|
||||
|
||||
|
||||
time_t Context::getUptimeSeconds() const
|
||||
double Context::getUptimeSeconds() const
|
||||
{
|
||||
auto lock = getLock();
|
||||
return shared->uptime_watch.elapsedSeconds();
|
||||
|
@ -919,7 +919,7 @@ public:
|
||||
StoragePolicyPtr getStoragePolicy(const String & name) const;
|
||||
|
||||
/// Get the server uptime in seconds.
|
||||
time_t getUptimeSeconds() const;
|
||||
double getUptimeSeconds() const;
|
||||
|
||||
using ConfigReloadCallback = std::function<void()>;
|
||||
void setConfigReloadCallback(ConfigReloadCallback && callback);
|
||||
|
@ -2206,7 +2206,7 @@ void InterpreterSelectQuery::executeFetchColumns(QueryProcessingStage::Enum proc
|
||||
|
||||
/// If necessary, we request more sources than the number of threads - to distribute the work evenly over the threads.
|
||||
if (max_streams > 1 && !is_remote)
|
||||
max_streams *= settings.max_streams_to_max_threads_ratio;
|
||||
max_streams = static_cast<size_t>(max_streams * settings.max_streams_to_max_threads_ratio);
|
||||
|
||||
auto & prewhere_info = analysis_result.prewhere_info;
|
||||
|
||||
|
@ -405,7 +405,7 @@ CSN TransactionLog::commitTransaction(const MergeTreeTransactionPtr & txn, bool
|
||||
String csn_path_created;
|
||||
try
|
||||
{
|
||||
if (unlikely(fault_probability_before_commit))
|
||||
if (unlikely(fault_probability_before_commit > 0.0))
|
||||
{
|
||||
std::bernoulli_distribution fault(fault_probability_before_commit);
|
||||
if (fault(thread_local_rng))
|
||||
@ -415,7 +415,7 @@ CSN TransactionLog::commitTransaction(const MergeTreeTransactionPtr & txn, bool
|
||||
/// Commit point
|
||||
csn_path_created = current_zookeeper->create(zookeeper_path_log + "/csn-", serializeTID(txn->tid), zkutil::CreateMode::PersistentSequential);
|
||||
|
||||
if (unlikely(fault_probability_after_commit))
|
||||
if (unlikely(fault_probability_after_commit > 0.0))
|
||||
{
|
||||
std::bernoulli_distribution fault(fault_probability_after_commit);
|
||||
if (fault(thread_local_rng))
|
||||
|
@ -259,7 +259,7 @@ struct Grower : public HashTableGrower<>
|
||||
static const size_t initial_size_degree = 16;
|
||||
Grower() { size_degree = initial_size_degree; }
|
||||
|
||||
size_t max_fill = (1ULL << initial_size_degree) * 0.9;
|
||||
size_t max_fill = (1ULL << initial_size_degree) * 9 / 10;
|
||||
|
||||
/// The size of the hash table in the cells.
|
||||
size_t bufSize() const { return 1ULL << size_degree; }
|
||||
@ -280,7 +280,7 @@ struct Grower : public HashTableGrower<>
|
||||
void increaseSize()
|
||||
{
|
||||
size_degree += size_degree >= 23 ? 1 : 2;
|
||||
max_fill = (1ULL << size_degree) * 0.9;
|
||||
max_fill = (1ULL << size_degree) * 9 / 10;
|
||||
}
|
||||
|
||||
/// Set the buffer size by the number of elements in the hash table. Used when deserializing a hash table.
|
||||
|
@ -784,7 +784,7 @@ static std::tuple<ASTPtr, BlockIO> executeQueryImpl(
|
||||
/// Common code for finish and exception callbacks
|
||||
auto status_info_to_query_log = [](QueryLogElement & element, const QueryStatusInfo & info, const ASTPtr query_ast, const ContextPtr context_ptr) mutable
|
||||
{
|
||||
DB::UInt64 query_time = info.elapsed_seconds * 1000000;
|
||||
UInt64 query_time = static_cast<UInt64>(info.elapsed_seconds * 1000000);
|
||||
ProfileEvents::increment(ProfileEvents::QueryTimeMicroseconds, query_time);
|
||||
if (query_ast->as<ASTSelectQuery>() || query_ast->as<ASTSelectWithUnionQuery>())
|
||||
{
|
||||
@ -799,7 +799,7 @@ static std::tuple<ASTPtr, BlockIO> executeQueryImpl(
|
||||
ProfileEvents::increment(ProfileEvents::OtherQueryTimeMicroseconds, query_time);
|
||||
}
|
||||
|
||||
element.query_duration_ms = info.elapsed_seconds * 1000;
|
||||
element.query_duration_ms = static_cast<UInt64>(info.elapsed_seconds * 1000);
|
||||
|
||||
element.read_rows = info.read_rows;
|
||||
element.read_bytes = info.read_bytes;
|
||||
|
@ -137,13 +137,13 @@ static void insertNumber(IColumn & column, WhichDataType type, T value)
|
||||
assert_cast<ColumnFloat64 &>(column).insertValue(static_cast<Float64>(value));
|
||||
break;
|
||||
case TypeIndex::Decimal32:
|
||||
assert_cast<ColumnDecimal<Decimal32> &>(column).insertValue(static_cast<Decimal32>(value));
|
||||
assert_cast<ColumnDecimal<Decimal32> &>(column).insertValue(static_cast<Int32>(value));
|
||||
break;
|
||||
case TypeIndex::Decimal64:
|
||||
assert_cast<ColumnDecimal<Decimal64> &>(column).insertValue(static_cast<Decimal64>(value));
|
||||
assert_cast<ColumnDecimal<Decimal64> &>(column).insertValue(static_cast<Int64>(value));
|
||||
break;
|
||||
case TypeIndex::DateTime64:
|
||||
assert_cast<ColumnDecimal<DateTime64> &>(column).insertValue(static_cast<DateTime64>(value));
|
||||
assert_cast<ColumnDecimal<DateTime64> &>(column).insertValue(static_cast<Int64>(value));
|
||||
break;
|
||||
default:
|
||||
throw Exception("Type is not compatible with Avro", ErrorCodes::ILLEGAL_COLUMN);
|
||||
|
@ -132,7 +132,7 @@ static void insertFloat(IColumn & column, const DataTypePtr & column_type, Float
|
||||
switch (column_type->getTypeId())
|
||||
{
|
||||
case TypeIndex::Float32:
|
||||
assert_cast<ColumnFloat32 &>(column).insertValue(value);
|
||||
assert_cast<ColumnFloat32 &>(column).insertValue(static_cast<Float32>(value));
|
||||
break;
|
||||
case TypeIndex::Float64:
|
||||
assert_cast<ColumnFloat64 &>(column).insertValue(value);
|
||||
|
@ -253,8 +253,8 @@ void ORCBlockOutputFormat::writeDateTimes(
|
||||
}
|
||||
|
||||
timestamp_orc_column.notNull[i] = 1;
|
||||
timestamp_orc_column.data[i] = get_seconds(timestamp_column.getElement(i));
|
||||
timestamp_orc_column.nanoseconds[i] = get_nanoseconds(timestamp_column.getElement(i));
|
||||
timestamp_orc_column.data[i] = static_cast<int64_t>(get_seconds(timestamp_column.getElement(i)));
|
||||
timestamp_orc_column.nanoseconds[i] = static_cast<int64_t>(get_nanoseconds(timestamp_column.getElement(i)));
|
||||
}
|
||||
timestamp_orc_column.numElements = timestamp_column.size();
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ void PrettyBlockOutputFormat::calculateWidths(
|
||||
size_t num_rows = std::min(chunk.getNumRows(), format_settings.pretty.max_rows);
|
||||
|
||||
/// len(num_rows) + len(". ")
|
||||
row_number_width = std::floor(std::log10(num_rows)) + 3;
|
||||
row_number_width = static_cast<size_t>(std::floor(std::log10(num_rows))) + 3;
|
||||
|
||||
size_t num_columns = chunk.getNumColumns();
|
||||
const auto & columns = chunk.getColumns();
|
||||
|
@ -513,7 +513,7 @@ bool ValuesBlockInputFormat::shouldDeduceNewTemplate(size_t column_idx)
|
||||
|
||||
/// Using template from cache is approx 2x faster, than evaluating single expression
|
||||
/// Construction of new template is approx 1.5x slower, than evaluating single expression
|
||||
float attempts_weighted = 1.5 * attempts_to_deduce_template[column_idx] + 0.5 * attempts_to_deduce_template_cached[column_idx];
|
||||
double attempts_weighted = 1.5 * attempts_to_deduce_template[column_idx] + 0.5 * attempts_to_deduce_template_cached[column_idx];
|
||||
|
||||
constexpr size_t max_attempts = 100;
|
||||
if (attempts_weighted < max_attempts)
|
||||
|
@ -80,7 +80,7 @@ void VerticalRowOutputFormat::writeRowStartDelimiter()
|
||||
writeIntText(row_number, out);
|
||||
writeCString(":\n", out);
|
||||
|
||||
size_t width = log10(row_number + 1) + 1 + strlen("Row :");
|
||||
size_t width = static_cast<size_t>(log10(row_number + 1)) + 1 + strlen("Row :");
|
||||
for (size_t i = 0; i < width; ++i)
|
||||
writeCString("─", out);
|
||||
writeChar('\n', out);
|
||||
|
@ -163,7 +163,7 @@ void FinishAggregatingInOrderAlgorithm::addToAggregation()
|
||||
states[i].current_row = states[i].to_row;
|
||||
|
||||
/// We assume that sizes in bytes of rows are almost the same.
|
||||
accumulated_bytes += states[i].total_bytes * (static_cast<double>(current_rows) / states[i].num_rows);
|
||||
accumulated_bytes += static_cast<size_t>(static_cast<double>(states[i].total_bytes) * current_rows / states[i].num_rows);
|
||||
accumulated_rows += current_rows;
|
||||
|
||||
|
||||
|
@ -52,7 +52,7 @@ void MergingSortedTransform::onFinish()
|
||||
|
||||
double seconds = total_stopwatch.elapsedSeconds();
|
||||
|
||||
if (!seconds)
|
||||
if (seconds == 0.0)
|
||||
LOG_DEBUG(log, "Merge sorted {} blocks, {} rows in 0 sec.", merged_data.totalChunks(), merged_data.totalMergedRows());
|
||||
else
|
||||
LOG_DEBUG(log, "Merge sorted {} blocks, {} rows in {} sec., {} rows/sec., {}/sec",
|
||||
|
@ -184,12 +184,12 @@ namespace
|
||||
std::vector<String> hhmmss;
|
||||
boost::split(hhmmss, time_str, [](char c) { return c == ':'; });
|
||||
Int64 v = 0;
|
||||
|
||||
if (hhmmss.size() == 3)
|
||||
{
|
||||
v = (std::stoi(hhmmss[0]) * 3600 + std::stoi(hhmmss[1]) * 60 + std::stold(hhmmss[2])) * 1000000;
|
||||
}
|
||||
v = static_cast<Int64>((std::stoi(hhmmss[0]) * 3600 + std::stoi(hhmmss[1]) * 60 + std::stold(hhmmss[2])) * 1000000);
|
||||
else
|
||||
throw Exception("Unsupported value format", ErrorCodes::NOT_IMPLEMENTED);
|
||||
|
||||
if (negative) v = -v;
|
||||
assert_cast<ColumnInt64 &>(column).insertValue(v);
|
||||
read_bytes_size += value.size();
|
||||
@ -202,7 +202,7 @@ namespace
|
||||
break;
|
||||
}
|
||||
case ValueType::vtFloat32:
|
||||
assert_cast<ColumnFloat32 &>(column).insertValue(value.getDouble());
|
||||
assert_cast<ColumnFloat32 &>(column).insertValue(static_cast<Float32>(value.getDouble()));
|
||||
read_bytes_size += 4;
|
||||
break;
|
||||
case ValueType::vtFloat64:
|
||||
|
@ -139,7 +139,7 @@ void SQLiteSource::insertValue(IColumn & column, ExternalResultDescription::Valu
|
||||
assert_cast<ColumnInt64 &>(column).insertValue(sqlite3_column_int64(compiled_statement.get(), idx));
|
||||
break;
|
||||
case ValueType::vtFloat32:
|
||||
assert_cast<ColumnFloat32 &>(column).insertValue(sqlite3_column_double(compiled_statement.get(), idx));
|
||||
assert_cast<ColumnFloat32 &>(column).insertValue(static_cast<Float32>(sqlite3_column_double(compiled_statement.get(), idx)));
|
||||
break;
|
||||
case ValueType::vtFloat64:
|
||||
assert_cast<ColumnFloat64 &>(column).insertValue(sqlite3_column_double(compiled_statement.get(), idx));
|
||||
|
@ -155,7 +155,7 @@ void ColumnGathererTransform::onFinish()
|
||||
double seconds = static_cast<double>(elapsed_ns) / 1000000000ULL;
|
||||
const auto & column_name = getOutputPort().getHeader().getByPosition(0).name;
|
||||
|
||||
if (!seconds)
|
||||
if (seconds == 0.0)
|
||||
LOG_DEBUG(log, "Gathered column {} ({} bytes/elem.) in 0 sec.",
|
||||
column_name, static_cast<double>(merged_bytes) / merged_rows);
|
||||
else
|
||||
|
@ -307,7 +307,7 @@ void MergeSortingTransform::remerge()
|
||||
LOG_DEBUG(log, "Memory usage is lowered from {} to {}", ReadableSize(sum_bytes_in_blocks), ReadableSize(new_sum_bytes_in_blocks));
|
||||
|
||||
/// If the memory consumption was not lowered enough - we will not perform remerge anymore.
|
||||
if (remerge_lowered_memory_bytes_ratio && (new_sum_bytes_in_blocks * remerge_lowered_memory_bytes_ratio > sum_bytes_in_blocks))
|
||||
if (remerge_lowered_memory_bytes_ratio > 0.0 && (new_sum_bytes_in_blocks * remerge_lowered_memory_bytes_ratio > sum_bytes_in_blocks))
|
||||
{
|
||||
remerge_is_useful = false;
|
||||
LOG_DEBUG(log, "Re-merging is not useful (memory usage was not lowered by remerge_sort_lowered_memory_bytes_ratio={})", remerge_lowered_memory_bytes_ratio);
|
||||
|
@ -187,8 +187,8 @@ namespace
|
||||
static_cast<const Poco::MongoDB::ConcreteElement<Poco::Int64> &>(value).value());
|
||||
break;
|
||||
case Poco::MongoDB::ElementTraits<Float64>::TypeId:
|
||||
assert_cast<ColumnVector<T> &>(column).getData().push_back(
|
||||
static_cast<const Poco::MongoDB::ConcreteElement<Float64> &>(value).value());
|
||||
assert_cast<ColumnVector<T> &>(column).getData().push_back(static_cast<T>(
|
||||
static_cast<const Poco::MongoDB::ConcreteElement<Float64> &>(value).value()));
|
||||
break;
|
||||
case Poco::MongoDB::ElementTraits<bool>::TypeId:
|
||||
assert_cast<ColumnVector<T> &>(column).getData().push_back(
|
||||
|
@ -143,22 +143,14 @@ static int compareValuesWithOffsetFloat(const IColumn * _compared_column,
|
||||
auto reference_value = unalignedLoad<typename ColumnType::ValueType>(
|
||||
reference_value_data.data);
|
||||
|
||||
// Floats overflow to Inf and the comparison will work normally, so we don't
|
||||
// have to do anything.
|
||||
/// Floats overflow to Inf and the comparison will work normally, so we don't have to do anything.
|
||||
if (offset_is_preceding)
|
||||
{
|
||||
reference_value -= offset;
|
||||
}
|
||||
reference_value -= static_cast<typename ColumnType::ValueType>(offset);
|
||||
else
|
||||
{
|
||||
reference_value += offset;
|
||||
}
|
||||
reference_value += static_cast<typename ColumnType::ValueType>(offset);
|
||||
|
||||
const auto result = compared_value < reference_value ? -1
|
||||
: compared_value == reference_value ? 0 : 1;
|
||||
|
||||
// fmt::print(stderr, "compared {}, offset {}, reference {}, result {}\n",
|
||||
// compared_value, offset, reference_value, result);
|
||||
: (compared_value == reference_value ? 0 : 1);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -42,10 +42,11 @@ void BackgroundJobsAssignee::postpone()
|
||||
no_work_done_count += 1;
|
||||
double random_addition = std::uniform_real_distribution<double>(0, sleep_settings.task_sleep_seconds_when_no_work_random_part)(rng);
|
||||
|
||||
size_t next_time_to_execute = 1000 * (std::min(
|
||||
size_t next_time_to_execute = static_cast<size_t>(
|
||||
1000 * (std::min(
|
||||
sleep_settings.task_sleep_seconds_when_no_work_max,
|
||||
sleep_settings.thread_sleep_seconds_if_nothing_to_do * std::pow(sleep_settings.task_sleep_seconds_when_no_work_multiplier, no_work_done_count))
|
||||
+ random_addition);
|
||||
+ random_addition));
|
||||
|
||||
holder->scheduleAfter(next_time_to_execute, false);
|
||||
}
|
||||
|
@ -1804,7 +1804,7 @@ bool KeyCondition::tryParseAtomFromAST(const Tree & node, ContextPtr context, Bl
|
||||
}
|
||||
else if (const_value.getType() == Field::Types::Float64)
|
||||
{
|
||||
out.function = const_value.safeGet<Float64>() ? RPNElement::ALWAYS_TRUE : RPNElement::ALWAYS_FALSE;
|
||||
out.function = const_value.safeGet<Float64>() != 0.0 ? RPNElement::ALWAYS_TRUE : RPNElement::ALWAYS_FALSE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ MergeListElement::MergeListElement(
|
||||
memory_tracker.setProfilerStep(settings.memory_profiler_step);
|
||||
memory_tracker.setSampleProbability(settings.memory_profiler_sample_probability);
|
||||
memory_tracker.setSoftLimit(settings.memory_overcommit_ratio_denominator);
|
||||
if (settings.memory_tracker_fault_probability)
|
||||
if (settings.memory_tracker_fault_probability > 0.0)
|
||||
memory_tracker.setFaultProbability(settings.memory_tracker_fault_probability);
|
||||
|
||||
/// Let's try to copy memory related settings from the query,
|
||||
|
@ -116,7 +116,7 @@ struct MergeTreeBlockSizePredictor
|
||||
inline size_t estimateNumRows(size_t bytes_quota) const
|
||||
{
|
||||
return (bytes_quota > block_size_bytes)
|
||||
? static_cast<size_t>((bytes_quota - block_size_bytes) / std::max<size_t>(1, bytes_per_row_current))
|
||||
? static_cast<size_t>((bytes_quota - block_size_bytes) / std::max<size_t>(1, static_cast<size_t>(bytes_per_row_current)))
|
||||
: 0;
|
||||
}
|
||||
|
||||
|
@ -3559,7 +3559,7 @@ void MergeTreeData::delayInsertOrThrowIfNeeded(Poco::Event * until, ContextPtr q
|
||||
max_k = settings->inactive_parts_to_throw_insert - settings->inactive_parts_to_delay_insert;
|
||||
k = k_inactive + 1;
|
||||
}
|
||||
const double delay_milliseconds = ::pow(settings->max_delay_to_insert * 1000, static_cast<double>(k) / max_k);
|
||||
const UInt64 delay_milliseconds = static_cast<UInt64>(::pow(settings->max_delay_to_insert * 1000, static_cast<double>(k) / max_k));
|
||||
|
||||
ProfileEvents::increment(ProfileEvents::DelayedInserts);
|
||||
ProfileEvents::increment(ProfileEvents::DelayedInsertsMilliseconds, delay_milliseconds);
|
||||
|
@ -98,10 +98,10 @@ UInt64 MergeTreeDataMergerMutator::getMaxSourcePartsSizeForMerge(size_t max_coun
|
||||
if (scheduled_tasks_count <= 1 || free_entries >= data_settings->number_of_free_entries_in_pool_to_lower_max_size_of_merge)
|
||||
max_size = data_settings->max_bytes_to_merge_at_max_space_in_pool;
|
||||
else
|
||||
max_size = interpolateExponential(
|
||||
max_size = static_cast<UInt64>(interpolateExponential(
|
||||
data_settings->max_bytes_to_merge_at_min_space_in_pool,
|
||||
data_settings->max_bytes_to_merge_at_max_space_in_pool,
|
||||
static_cast<double>(free_entries) / data_settings->number_of_free_entries_in_pool_to_lower_max_size_of_merge);
|
||||
static_cast<double>(free_entries) / data_settings->number_of_free_entries_in_pool_to_lower_max_size_of_merge));
|
||||
|
||||
return std::min(max_size, static_cast<UInt64>(data.getStoragePolicy()->getMaxUnreservedFreeSpace() / DISK_USAGE_COEFFICIENT_TO_SELECT));
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ bool MergeTreeIndexConditionBloomFilter::traverseAtomAST(const ASTPtr & node, Bl
|
||||
|
||||
if (const_value.getType() == Field::Types::Float64)
|
||||
{
|
||||
out.function = const_value.get<Float64>() ? RPNElement::ALWAYS_TRUE : RPNElement::ALWAYS_FALSE;
|
||||
out.function = const_value.get<Float64>() != 0.0 ? RPNElement::ALWAYS_TRUE : RPNElement::ALWAYS_FALSE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ bool MergeTreePartsMover::selectPartsForMove(
|
||||
{
|
||||
for (const auto & disk : volumes[i]->getDisks())
|
||||
{
|
||||
UInt64 required_maximum_available_space = disk->getTotalSpace() * policy->getMoveFactor();
|
||||
UInt64 required_maximum_available_space = static_cast<UInt64>(disk->getTotalSpace() * policy->getMoveFactor());
|
||||
UInt64 unreserved_space = disk->getUnreservedSpace();
|
||||
|
||||
if (unreserved_space < required_maximum_available_space && !disk->isBroken())
|
||||
|
@ -97,7 +97,7 @@ void ReplicatedMergeTreeCleanupThread::clearOldLogs()
|
||||
/// Numbers are arbitrary.
|
||||
std::uniform_real_distribution<double> distr(1.05, 1.15);
|
||||
double ratio = distr(rng);
|
||||
size_t min_replicated_logs_to_keep = storage_settings->min_replicated_logs_to_keep * ratio;
|
||||
size_t min_replicated_logs_to_keep = static_cast<size_t>(storage_settings->min_replicated_logs_to_keep * ratio);
|
||||
|
||||
if (static_cast<double>(children_count) < min_replicated_logs_to_keep)
|
||||
return;
|
||||
|
@ -1368,7 +1368,7 @@ void StorageDistributed::delayInsertOrThrowIfNeeded() const
|
||||
{
|
||||
/// Step is 5% of the delay and minimal one second.
|
||||
/// NOTE: max_delay_to_insert is in seconds, and step is in ms.
|
||||
const size_t step_ms = std::min<double>(1., static_cast<double>(distributed_settings.max_delay_to_insert) * 1'000 * 0.05);
|
||||
const size_t step_ms = static_cast<size_t>(std::min<double>(1., static_cast<double>(distributed_settings.max_delay_to_insert) * 1'000 * 0.05));
|
||||
UInt64 delayed_ms = 0;
|
||||
|
||||
do {
|
||||
|
@ -579,7 +579,7 @@ public:
|
||||
if (num_rows)
|
||||
{
|
||||
auto bytes_per_row = std::ceil(static_cast<double>(chunk.bytes()) / num_rows);
|
||||
size_t total_rows_approx = std::ceil(static_cast<double>(files_info->total_bytes_to_read) / bytes_per_row);
|
||||
size_t total_rows_approx = static_cast<size_t>(std::ceil(static_cast<double>(files_info->total_bytes_to_read) / bytes_per_row));
|
||||
total_rows_approx_accumulated += total_rows_approx;
|
||||
++total_rows_count_times;
|
||||
total_rows_approx = total_rows_approx_accumulated / total_rows_count_times;
|
||||
|
@ -357,7 +357,7 @@ void ReadFromMerge::initializePipeline(QueryPipelineBuilder & pipeline, const Bu
|
||||
size_t tables_count = selected_tables.size();
|
||||
Float64 num_streams_multiplier
|
||||
= std::min(static_cast<unsigned>(tables_count), std::max(1U, static_cast<unsigned>(context->getSettingsRef().max_streams_multiplier_for_merge_tables)));
|
||||
size_t num_streams = requested_num_streams * num_streams_multiplier;
|
||||
size_t num_streams = static_cast<size_t>(requested_num_streams * num_streams_multiplier);
|
||||
size_t remaining_streams = num_streams;
|
||||
|
||||
InputOrderInfoPtr input_sorting_info;
|
||||
|
@ -178,7 +178,7 @@ public:
|
||||
if (block.rows() <= max_rows)
|
||||
return {block};
|
||||
|
||||
const size_t split_block_size = ceil(block.rows() * 1.0 / max_rows);
|
||||
const size_t split_block_size = static_cast<size_t>(ceil(block.rows() * 1.0 / max_rows));
|
||||
Blocks split_blocks(split_block_size);
|
||||
|
||||
for (size_t idx = 0; idx < split_block_size; ++idx)
|
||||
|
@ -115,9 +115,9 @@ int main(int, char **)
|
||||
|
||||
double time_to_merge = sum_merged_size / (1048576 * 10.0);
|
||||
|
||||
age_passed += time_to_merge;
|
||||
age_passed = static_cast<size_t>(age_passed + time_to_merge);
|
||||
for (auto & part : parts)
|
||||
part.age += time_to_merge;
|
||||
part.age = static_cast<time_t>(part.age + time_to_merge);
|
||||
|
||||
std::cout << "Time passed: " << age_passed << ", num parts: " << parts.size()
|
||||
<< ", merged " << selected_parts.size() << " parts, " << formatReadableSizeWithBinarySuffix(sum_merged_size)
|
||||
|
@ -1,8 +1,8 @@
|
||||
111195.05
|
||||
111195.05
|
||||
111195.055
|
||||
111195.055
|
||||
110567.33
|
||||
111699.25
|
||||
10007554
|
||||
10007554
|
||||
10007555
|
||||
10007554
|
||||
10001780
|
||||
|
@ -1,5 +1,5 @@
|
||||
0.1224
|
||||
0.7071
|
||||
0.7135
|
||||
10007554
|
||||
10007555
|
||||
10007554
|
||||
|
Loading…
Reference in New Issue
Block a user