Blame osm2pgsql-1.8.1-fmt10.patch
|
|
5cd067e |
commit da0e3ae02032328c792727806cca68be8e91118f
|
|
|
5cd067e |
Author: Tom Hughes <tom@compton.nu>
|
|
|
5cd067e |
Date: Fri Jul 14 13:20:38 2023 +0100
|
|
|
5cd067e |
|
|
|
5cd067e |
Make conversion of status enum to the underlying type explicit
|
|
|
5cd067e |
|
|
|
5cd067e |
diff --git a/src/pgsql.cpp b/src/pgsql.cpp
|
|
|
5cd067e |
index 1cd908f2..611cf5f3 100644
|
|
|
5cd067e |
--- a/src/pgsql.cpp
|
|
|
5cd067e |
+++ b/src/pgsql.cpp
|
|
|
5cd067e |
@@ -16,6 +16,7 @@
|
|
|
5cd067e |
#include <cassert>
|
|
|
5cd067e |
#include <stdexcept>
|
|
|
5cd067e |
#include <string>
|
|
|
5cd067e |
+#include <type_traits>
|
|
|
5cd067e |
#include <utility>
|
|
|
5cd067e |
|
|
|
5cd067e |
std::atomic<std::uint32_t> pg_conn_t::connection_id{0};
|
|
|
5cd067e |
@@ -169,7 +170,8 @@ pg_result_t pg_conn_t::exec_prepared_internal(char const *stmt, int num_params,
|
|
|
5cd067e |
if (status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK) {
|
|
|
5cd067e |
log_error("SQL command failed: EXECUTE {}({})", stmt,
|
|
|
5cd067e |
concat_params(num_params, param_values));
|
|
|
5cd067e |
- throw fmt_error("Database error: {} ({})", error_msg(), status);
|
|
|
5cd067e |
+ throw fmt_error("Database error: {} ({})", error_msg(),
|
|
|
5cd067e |
+ std::underlying_type_t<ExecStatusType>(status));
|
|
|
5cd067e |
}
|
|
|
5cd067e |
|
|
|
5cd067e |
return res;
|