diff --git a/src/backend/dbi/gnc-backend-dbi.hpp b/src/backend/dbi/gnc-backend-dbi.hpp index cf1b1abae2..66c87320aa 100644 --- a/src/backend/dbi/gnc-backend-dbi.hpp +++ b/src/backend/dbi/gnc-backend-dbi.hpp @@ -89,7 +89,7 @@ public: GncSqlBackend(conn, book, format), m_exists{false} {} bool connected() const noexcept { return m_conn != nullptr; } /** FIXME: Just a pass-through to m_conn: */ - void set_error(int error, int repeat, bool retry) noexcept + void set_error(int error, unsigned int repeat, bool retry) noexcept { m_conn->set_error(error, repeat, retry); } diff --git a/src/backend/dbi/gnc-dbisqlconnection.hpp b/src/backend/dbi/gnc-dbisqlconnection.hpp index b97520fbc5..fd332948b2 100644 --- a/src/backend/dbi/gnc-dbisqlconnection.hpp +++ b/src/backend/dbi/gnc-dbisqlconnection.hpp @@ -58,7 +58,8 @@ public: return dbi_conn_error(m_conn, nullptr); } QofBackend* qbe () const noexcept { return m_qbe; } dbi_conn conn() const noexcept { return m_conn; } - inline void set_error(int error, int repeat, bool retry) noexcept override + inline void set_error(int error, unsigned int repeat, + bool retry) noexcept override { m_last_error = error; m_error_repeat = repeat; @@ -96,7 +97,7 @@ private: * the original call is allowed. error_repeat tracks the number of attempts * and can be used to prevent infinite loops. */ - int m_error_repeat; + unsigned int m_error_repeat; /** Signals the calling function that it should retry (the error handler * detected transient error and managed to resolve it, but it can't run the * original query) diff --git a/src/backend/sql/gnc-backend-sql.h b/src/backend/sql/gnc-backend-sql.h index cdf72fc9a8..c2c891bd18 100644 --- a/src/backend/sql/gnc-backend-sql.h +++ b/src/backend/sql/gnc-backend-sql.h @@ -313,7 +313,7 @@ public: * If not 0 will normally be meaningless outside of implementation code. */ virtual int dberror() const noexcept = 0; - virtual void set_error(int error, int repeat, bool retry) noexcept = 0; + virtual void set_error(int error, unsigned int repeat, bool retry) noexcept = 0; virtual bool verify() noexcept = 0; virtual bool retry_connection(const char* msg) noexcept = 0; diff --git a/src/backend/sql/test/utest-gnc-backend-sql.cpp b/src/backend/sql/test/utest-gnc-backend-sql.cpp index f2922c1812..f968a91e2f 100644 --- a/src/backend/sql/test/utest-gnc-backend-sql.cpp +++ b/src/backend/sql/test/utest-gnc-backend-sql.cpp @@ -105,7 +105,7 @@ public: virtual std::string quote_string (const std::string& str) const noexcept override { return std::string{str}; } int dberror() const noexcept override { return 0; } - void set_error(int error, int repeat, bool retry) noexcept override { return; } + void set_error(int error, unsigned int repeat, bool retry) noexcept override { return; } bool verify() noexcept override { return true; } bool retry_connection(const char* msg) noexcept override { return true; } private: