Files
scylladb/cql3/statements/list_users_statement.hh
Alex feba21f868 cql: expose stable result metadata for prepared LIST statements
Prepared LIST statements were not calculating metadata in PREPARE path, and sent empty string hash to client causing problematic behaviour where metadat_id was not recalculated correctly.
This patch moves metadata construction into get_result_metadata() for the affected LIST statements and reuse that metadata when building the result set.
This gives PREPARE a stable metadata id for LIST ROLES, LIST USERS, LIST PERMISSIONS and the service-level variants.
This patch also adds a new boost test that verifies that when an EXECUTE request carries an empty result metadata id while the server has a real metadata id for the result set, the response is marked METADATA_CHANGED and includes the full result metadata plus the server metadata id.
This covers the recovery path for clients that send an empty or otherwise unusable metadata id instead of a matching cached one.
2026-04-16 14:30:31 +03:00

38 lines
912 B
C++

/*
* Copyright 2016-present ScyllaDB
*
* Modified by ScyllaDB
*/
/*
* SPDX-License-Identifier: (LicenseRef-ScyllaDB-Source-Available-1.0 and Apache-2.0)
*/
#pragma once
#include "authentication_statement.hh"
namespace cql3 {
class query_processor;
namespace statements {
class list_users_statement : public authentication_statement {
public:
std::unique_ptr<prepared_statement> prepare(data_dictionary::database db, cql_stats& stats) override;
virtual seastar::shared_ptr<const metadata> get_result_metadata() const override;
future<> check_access(query_processor& qp, const service::client_state&) const override;
future<::shared_ptr<cql_transport::messages::result_message>> execute(query_processor&
, service::query_state&
, const query_options&
, std::optional<service::group0_guard> guard) const override;
};
}
}