Skip to content

Commit

Permalink
Fix lint warnings
Browse files Browse the repository at this point in the history
Summary:
Run linter on all files in common/db/mysql_client

```
arc lint --lintall --engine extra squangle/mysql_client/mysql_protocol/*
```

Reviewed By: tensor-flower

Differential Revision: D68467189

fbshipit-source-id: fedd7243700195daef0fcd38f48107ee72bdc4f2
  • Loading branch information
Jay Edgar authored and facebook-github-bot committed Jan 22, 2025
1 parent 408dbf6 commit 0cb2a48
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ class MysqlConnectOperationImpl : public MysqlOperationImpl,
std::shared_ptr<const ConnectionKey> conn_key);
virtual ~MysqlConnectOperationImpl() override;

// copy and move not allowed
MysqlConnectOperationImpl(const MysqlConnectOperationImpl&) = delete;
MysqlConnectOperationImpl& operator=(const MysqlConnectOperationImpl&) =
delete;

MysqlConnectOperationImpl(MysqlConnectOperationImpl&&) = delete;
MysqlConnectOperationImpl& operator=(MysqlConnectOperationImpl&&) = delete;

static constexpr Duration kMinimumViableConnectTimeout =
std::chrono::microseconds(50);

Expand Down Expand Up @@ -88,10 +96,16 @@ class MysqlConnectOperationImpl : public MysqlOperationImpl,
: folly::AsyncTimeout(base), op_(connect_operation) {}

ConnectTcpTimeoutHandler() = delete;
~ConnectTcpTimeoutHandler() override = default;

// copy and move not allowed
ConnectTcpTimeoutHandler(const ConnectTcpTimeoutHandler&) = delete;
ConnectTcpTimeoutHandler& operator=(const ConnectTcpTimeoutHandler&) =
delete;

ConnectTcpTimeoutHandler(ConnectTcpTimeoutHandler&&) = delete;
ConnectTcpTimeoutHandler& operator=(ConnectTcpTimeoutHandler&&) = delete;

void timeoutExpired() noexcept override {
op_->tcpConnectTimeoutTriggered();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ uint64_t MysqlConnection::getAffectedRows() const {
std::string MysqlConnection::getConnectStageName() const {
auto stage = getMySqlConnectStage();
if (auto optStageName = findConnectStageName(stage)) {
return std::move(*optStageName);
return *std::move(optStageName);
}

return fmt::format("Unexpected connect_stage: {}", (int)stage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ class MysqlConnection : public InternalConnection {
// Closes the connection in hold
virtual ~MysqlConnection() override;

// copy not allowed
// copy and move not allowed
MysqlConnection(const MysqlConnection&) = delete;
MysqlConnection& operator=(const MysqlConnection&) = delete;

MysqlConnection(MysqlConnection&&) = delete;
MysqlConnection& operator=(MysqlConnection&&) = delete;

void setReusable(bool reusable) override {
canReuse_ = reusable;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ class MysqlOperationImpl : virtual public OperationBase,
// No public constructor.
virtual ~MysqlOperationImpl() override = default;

// copy and move not allowed
MysqlOperationImpl(const MysqlOperationImpl&) = delete;
MysqlOperationImpl& operator=(const MysqlOperationImpl&) = delete;

MysqlOperationImpl(MysqlOperationImpl&&) = delete;
MysqlOperationImpl& operator=(MysqlOperationImpl&&) = delete;

Duration getMaxThreadBlockTime() {
return max_thread_block_time_;
}
Expand Down

0 comments on commit 0cb2a48

Please sign in to comment.