cql3: Use internal cql format in insert_prepared_json_statement cache

expr::constant is always serialized using the internal cql serialization format,
but currently the code keeps values in the cache in other format.

As preparation for moving from term to expression change
so that values kept in the cache are serialized using
the internal format.

Signed-off-by: Jan Ciolek <jan.ciolek@scylladb.com>
This commit is contained in:
Jan Ciolek
2021-10-28 20:42:43 +02:00
parent e5391f1eed
commit ba202cd8bd

View File

@@ -181,7 +181,7 @@ void update_statement::add_update_for_key(mutation& m, const query::clustering_r
modification_statement::json_cache_opt insert_prepared_json_statement::maybe_prepare_json_cache(const query_options& options) const {
sstring json_string = utf8_type->to_string(to_bytes(expr::evaluate_to_raw_view(_term, options)));
return json_helpers::parse(std::move(json_string), s->all_columns(), options.get_cql_serialization_format());
return json_helpers::parse(std::move(json_string), s->all_columns(), cql_serialization_format::internal());
}
void
@@ -212,7 +212,7 @@ insert_prepared_json_statement::execute_set_value(mutation& m, const clustering_
return;
}
cql_serialization_format sf = params._options.get_cql_serialization_format();
cql_serialization_format sf = cql_serialization_format::internal();
visit(*column.type, make_visitor(
[&] (const list_type_impl& ltype) {
auto val = ::make_shared<lists::value>(lists::value::from_serialized(raw_value_view::make_value(*value), ltype, sf));