cql3: fix null handling in data_value formatting

data_value::to_parsable_string() crashed with a null pointer
dereference when called on a null data_value. Return "null" instead.

Fixes SCYLLADB-1350
This commit is contained in:
Dario Mirovic
2026-03-24 02:55:34 +01:00
parent 66be0f4577
commit fc705dfb4b

View File

@@ -3887,6 +3887,10 @@ data_value::data_value(empty_type_representation e) : data_value(make_new(empty_
}
sstring data_value::to_parsable_string() const {
if (is_null()) {
return "null";
}
// For some reason trying to do it using fmt::format refuses to compile
// auto to_parsable_str_transform = std::views::transform([](const data_value& dv) -> sstring {
// return dv.to_parsable_string();