fixed postgres tests

This commit is contained in:
2025-02-15 12:36:21 +01:00
parent 6e64ba99de
commit ec96c15905
16 changed files with 89 additions and 58 deletions
@@ -96,8 +96,8 @@ utils::result<std::unique_ptr<sql::query_result_impl>, utils::error> postgres_co
std::vector<object::attribute_definition> prototype = context.prototype;
const auto num_col = PQnfields(res);
if (prototype.size() != num_col) {
const int num_col = PQnfields(res);
if (prototype.size() != static_cast<size_t>(num_col)) {
return utils::failure(make_error(sql::error_code::FETCH_FAILED, res, conn_, "Number of received columns doesn't match expected columns.", context.sql));
}
for (int i = 0; i < num_col; ++i) {
@@ -170,7 +170,7 @@ utils::basic_type oid2type(const Oid oid) {
return utils::basic_type::type_int32;
case 20:
return utils::basic_type::type_int64;
case 24:
case 25:
return utils::basic_type::type_text;
case 1043:
return utils::basic_type::type_varchar;
+1 -1
View File
@@ -2,7 +2,7 @@ CPMAddPackage("gh:catchorg/Catch2@3.7.1")
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
set(POSTGRES_CONNECTION_STRING "postgres://news:news@localhost:15432/matador")
set(POSTGRES_CONNECTION_STRING "postgres://test:test123!@127.0.0.1:5432/matador")
configure_file(Connection.hpp.in ${PROJECT_BINARY_DIR}/backends/postgres/test/connection.hpp @ONLY IMMEDIATE)