mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-20 08:30:35 +00:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user