From 299219833bf3ce97ee4e7e43f47b765649ebbf72 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Thu, 21 Dec 2023 19:32:09 +0300 Subject: [PATCH] cql3/statements: Keep local keyspace variable in alter_keyspace_statement::validate For convenience of next patching Signed-off-by: Pavel Emelyanov --- cql3/statements/alter_keyspace_statement.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cql3/statements/alter_keyspace_statement.cc b/cql3/statements/alter_keyspace_statement.cc index a329afd6e0..d3a143cac7 100644 --- a/cql3/statements/alter_keyspace_statement.cc +++ b/cql3/statements/alter_keyspace_statement.cc @@ -49,7 +49,8 @@ void cql3::statements::alter_keyspace_statement::validate(query_processor& qp, c throw exceptions::configuration_exception("Missing replication strategy class"); } try { - data_dictionary::storage_options current_options = qp.db().find_keyspace(_name).metadata()->get_storage_options(); + auto ks = qp.db().find_keyspace(_name); + data_dictionary::storage_options current_options = ks.metadata()->get_storage_options(); data_dictionary::storage_options new_options = _attrs->get_storage_options(); if (!current_options.can_update_to(new_options)) { throw exceptions::invalid_request_exception(format("Cannot alter storage options: {} to {} is not supported",