cql3/statements: Keep local keyspace variable in alter_keyspace_statement::validate

For convenience of next patching

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2023-12-21 19:32:09 +03:00
parent 5e55954f27
commit 299219833b

View File

@@ -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",