Skip to content

Commit

Permalink
Undo changes to clp database classes which are no longer necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
gibber9809 committed Feb 14, 2024
1 parent 3d8eab3 commit 5294e38
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 38 deletions.
9 changes: 0 additions & 9 deletions components/core/src/clp/MySQLDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,6 @@ bool MySQLDB::execute_query(string const& sql_query) {
return true;
}

bool MySQLDB::get_affected_rows(uint64_t& num_affected_rows) {
if (nullptr == m_db_handle) {
throw OperationFailed(ErrorCode_NotInit, __FILENAME__, __LINE__);
}

num_affected_rows = mysql_affected_rows(m_db_handle);
return num_affected_rows != ~static_cast<uint64_t>(0);
}

MySQLPreparedStatement MySQLDB::prepare_statement(char const* statement, size_t statement_length) {
if (nullptr == m_db_handle) {
throw OperationFailed(ErrorCode_NotInit, __FILENAME__, __LINE__);
Expand Down
7 changes: 0 additions & 7 deletions components/core/src/clp/MySQLDB.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,6 @@ class MySQLDB {
* @return
*/
bool execute_query(std::string const& sql_query);
/**
* Get the number of rows affected by the previous SQL statement with the semantics of
* mysql_affected_rows returned by reference.
* @return true on success
* @return false on error
*/
bool get_affected_rows(uint64_t& num_affected_rows);
/**
* Prepares a statement on the database server
* @param statement
Expand Down
11 changes: 0 additions & 11 deletions components/core/src/clp/MySQLParamBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ void MySQLParamBindings::resize(size_t num_fields) {
}
}

void MySQLParamBindings::bind_int(size_t field_index, int& value) {
if (field_index >= m_statement_bindings.size()) {
throw OperationFailed(ErrorCode_OutOfBounds, __FILENAME__, __LINE__);
}

auto& binding = m_statement_bindings[field_index];
binding.buffer_type = MYSQL_TYPE_LONG;
binding.buffer = &value;
m_statement_binding_lengths[field_index] = sizeof(value);
}

void MySQLParamBindings::bind_int64(size_t field_index, int64_t& value) {
if (field_index >= m_statement_bindings.size()) {
throw OperationFailed(ErrorCode_OutOfBounds, __FILENAME__, __LINE__);
Expand Down
1 change: 0 additions & 1 deletion components/core/src/clp/MySQLParamBindings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class MySQLParamBindings {
*/
void resize(size_t num_fields);

void bind_int(size_t field_index, int& value);
void bind_int64(size_t field_index, int64_t& value);
void bind_uint64(size_t field_index, uint64_t& value);
void bind_varchar(size_t field_index, char const* value, size_t value_length);
Expand Down
9 changes: 0 additions & 9 deletions components/core/src/clp/MySQLPreparedStatement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,6 @@ bool MySQLPreparedStatement::execute() {
return true;
}

bool MySQLPreparedStatement::get_affected_rows(uint64_t& num_affected_rows) {
if (nullptr == m_statement_handle) {
throw OperationFailed(ErrorCode_NotInit, __FILE__, __LINE__);
}

num_affected_rows = mysql_affected_rows(m_db_handle);
return num_affected_rows != ~static_cast<uint64_t>(0);
}

void MySQLPreparedStatement::close() {
if (nullptr != m_statement_handle) {
if (0 != mysql_stmt_close(m_statement_handle)) {
Expand Down
1 change: 0 additions & 1 deletion components/core/src/clp/MySQLPreparedStatement.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class MySQLPreparedStatement {
// Methods
void set(char const* statement, size_t statement_length);
bool execute();
bool get_affected_rows(uint64_t& num_affected_rows);

MySQLParamBindings& get_statement_bindings() { return m_statement_bindings; }

Expand Down

0 comments on commit 5294e38

Please sign in to comment.