From fc705dfb4b68bde355e78f550a68b130f058bacc Mon Sep 17 00:00:00 2001 From: Dario Mirovic Date: Tue, 24 Mar 2026 02:55:34 +0100 Subject: [PATCH] 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 --- types/types.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/types.cc b/types/types.cc index 9985abc5ea..9e49b19711 100644 --- a/types/types.cc +++ b/types/types.cc @@ -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();