Add debug queries to 03212_variant_dynamic_cast_or_default#88269
Conversation
This means they have a bug that must be fixed. |
This may also result from certain settings combinations I am testing out to reproduce locally. |
|
The bug doesn't occur on the local machine, even without this change. I tested running the test 1000 times with different settings similar to those in failed CI jobs. The issue might be related to other factors such as architecture, OS, etc. |
2425805 to
e75c54c
Compare
|
Simplify test, add debug information: select * from affected table to see original values |
9e2f52c to
ca97849
Compare
|
Flaky test |
85c240b to
eacae27
Compare
|
@zlareb1 I think it might be an issue with the de-/serialization, at some points we use littleEndian and at other points we use POD-type (native format). diff --git a/src/DataTypes/Serializations/SerializationIPv4andIPv6.cpp b/src/DataTypes/Serializations/SerializationIPv4andIPv6.cpp
index 115edacc6f7..9d3643492fe 100644
--- a/src/DataTypes/Serializations/SerializationIPv4andIPv6.cpp
+++ b/src/DataTypes/Serializations/SerializationIPv4andIPv6.cpp
@@ -128,20 +128,14 @@ template <typename IPv>
void SerializationIP<IPv>::serializeBinary(const Field & field, WriteBuffer & ostr, const FormatSettings &) const
{
IPv x = field.safeGet<IPv>();
- if constexpr (std::is_same_v<IPv, IPv6>)
- writeBinary(x, ostr);
- else
- writeBinaryLittleEndian(x, ostr);
+ writeBinary(x, ostr);
}
template <typename IPv>
void SerializationIP<IPv>::deserializeBinary(DB::Field & field, DB::ReadBuffer & istr, const DB::FormatSettings &) const
{
IPv x;
- if constexpr (std::is_same_v<IPv, IPv6>)
- readBinary(x, istr);
- else
- readBinaryLittleEndian(x, istr);
+ readBinary(x.toUnderType(), istr);
field = NearestFieldType<IPv>(x);
}Here are 2 points where we use Little Endian for Ipv4. But then in |
@raimannma Interesting. Would you like to take this on and make the necessary changes? Adding a brief reproducer test would also be helpful. |
eacae27 to
1ba225a
Compare

Changelog category (leave one):
Details
Added debug output to
03212_variant_dynamic_cast_or_default.sqlfor IPv4/IPv6 anomaly diagnostics.No effect on normal runs.
Changes
id UInt64 DEFAULT generateSerialID('03212_variant_seq')withENGINE = MergeTree ORDER BY id.INSERT INTO t (d) VALUES (...);to auto-fillid.ch_dbg_summary,ch_dbg_offenders) that print only on anomaly.SELECT d FROM t ORDER BY idfor quick inspection.