zerebubuth / openstreetmap-cgimap

A C++ implementation of the OpenStreetMap API map call.
http://wiki.openstreetmap.org/wiki/Cgimap
GNU General Public License v2.0
72 stars 38 forks source link

libpqxx6 migration #163

Closed baerbock closed 5 years ago

baerbock commented 5 years ago

The current version of https://github.com/jtv/libpqxx is 6.2.5 There have breaking API changes since libpqxx4

tomhughes commented 5 years ago

It's not really an issue until Ubuntu has the new version though.

mmd-osm commented 5 years ago

For the fun of it, I ran the compilation step in a Docker container. Quite a bit of breakage in some parts of the code with 6.2.5:

``` make V=0 -k Making all in src make[1]: Entering directory '/root/openstreetmap-cgimap-feature-bulk_upload/src' CXX backend/apidb/readonly_pgsql_selection.lo backend/apidb/readonly_pgsql_selection.cpp:72:43: error: 'tuple' in namespace 'pqxx' does not name a type template T id_of(const pqxx::tuple &); ^~~~~ backend/apidb/readonly_pgsql_selection.cpp:75:46: error: 'tuple' in namespace 'pqxx' does not name a type osm_nwr_id_t id_of(const pqxx::tuple &row) { ^~~~~ backend/apidb/readonly_pgsql_selection.cpp: In function 'T {anonymous}::id_of(const int&) [with T = long unsigned int]': backend/apidb/readonly_pgsql_selection.cpp:76:20: error: request for member 'as' in '"id"[((int)row)]', which is of non-class type 'const char' return row["id"].as(); ^~ backend/apidb/readonly_pgsql_selection.cpp:76:35: error: expected primary-expression before '>' token return row["id"].as(); ^ backend/apidb/readonly_pgsql_selection.cpp:76:37: error: expected primary-expression before ')' token return row["id"].as(); ^ backend/apidb/readonly_pgsql_selection.cpp: At global scope: backend/apidb/readonly_pgsql_selection.cpp:80:58: error: 'tuple' in namespace 'pqxx' does not name a type osm_changeset_id_t id_of(const pqxx::tuple &row) { ^~~~~ backend/apidb/readonly_pgsql_selection.cpp: In function 'T {anonymous}::id_of(const int&) [with T = long int]': backend/apidb/readonly_pgsql_selection.cpp:81:20: error: request for member 'as' in '"id"[((int)row)]', which is of non-class type 'const char' return row["id"].as(); ^~ backend/apidb/readonly_pgsql_selection.cpp:81:41: error: expected primary-expression before '>' token return row["id"].as(); ^ backend/apidb/readonly_pgsql_selection.cpp:81:43: error: expected primary-expression before ')' token return row["id"].as(); ^ backend/apidb/readonly_pgsql_selection.cpp: At global scope: backend/apidb/readonly_pgsql_selection.cpp:85:48: error: 'tuple' in namespace 'pqxx' does not name a type osm_edition_t id_of(const pqxx::tuple &row) { ^~~~~ backend/apidb/readonly_pgsql_selection.cpp: In function 'T {anonymous}::id_of(const int&) [with T = std::pair]': backend/apidb/readonly_pgsql_selection.cpp:86:31: error: request for member 'as' in '"id"[((int)row)]', which is of non-class type 'const char' osm_nwr_id_t id = row["id"].as(); ^~ backend/apidb/readonly_pgsql_selection.cpp:86:46: error: expected primary-expression before '>' token osm_nwr_id_t id = row["id"].as(); ^ backend/apidb/readonly_pgsql_selection.cpp:86:48: error: expected primary-expression before ')' token osm_nwr_id_t id = row["id"].as(); ^ backend/apidb/readonly_pgsql_selection.cpp:87:38: error: request for member 'as' in '"version"[((int)row)]', which is of non-class type 'const char' osm_version_t ver = row["version"].as(); ^~ backend/apidb/readonly_pgsql_selection.cpp:87:54: error: expected primary-expression before '>' token osm_version_t ver = row["version"].as(); ^ backend/apidb/readonly_pgsql_selection.cpp:87:56: error: expected primary-expression before ')' token osm_version_t ver = row["version"].as(); ^ backend/apidb/readonly_pgsql_selection.cpp: In function 'int {anonymous}::insert_results(const pqxx::result&, std::set&)': backend/apidb/readonly_pgsql_selection.cpp:97:17: error: 'tuple' in namespace 'pqxx' does not name a type const pqxx::tuple &row = *itr; ^~~~~ backend/apidb/readonly_pgsql_selection.cpp:98:27: error: 'row' was not declared in this scope const T id = id_of(row); ^~~ backend/apidb/readonly_pgsql_selection.cpp:98:27: note: suggested alternative: In file included from /usr/local/include/pqxx/transaction_base.hxx:32:0, from /usr/local/include/pqxx/cursor.hxx:23, from /usr/local/include/pqxx/cursor:12, from /usr/local/include/pqxx/pqxx:12, from ../include/cgimap/backend/apidb/changeset.hpp:8, from ../include/cgimap/backend/apidb/readonly_pgsql_selection.hpp:5, from backend/apidb/readonly_pgsql_selection.cpp:1: /usr/local/include/pqxx/row.hxx:40:22: note: 'pqxx::row' class PQXX_LIBEXPORT row ^~~ Makefile:1328: recipe for target 'backend/apidb/readonly_pgsql_selection.lo' failed make[1]: *** [backend/apidb/readonly_pgsql_selection.lo] Error 1 CXX backend/apidb/common_pgsql_selection.lo backend/apidb/common_pgsql_selection.cpp:9:39: error: 'tuple' in 'class pqxx::result' does not name a type void extract_elem(const pqxx::result::tuple &row, element_info &elem, ^~~~~ backend/apidb/common_pgsql_selection.cpp: In function 'void {anonymous}::extract_elem(const int&, element_info&, cache&)': backend/apidb/common_pgsql_selection.cpp:11:23: error: request for member 'as' in '"id"[((int)row)]', which is of non-class type 'const char' elem.id = row["id"].as(); ^~ backend/apidb/common_pgsql_selection.cpp:11:38: error: expected primary-expression before '>' token elem.id = row["id"].as(); ^ backend/apidb/common_pgsql_selection.cpp:11:40: error: expected primary-expression before ')' token elem.id = row["id"].as(); ^ backend/apidb/common_pgsql_selection.cpp:12:33: error: request for member 'as' in '"version"[((int)row)]', which is of non-class type 'const char' elem.version = row["version"].as(); ^~ backend/apidb/common_pgsql_selection.cpp:12:36: error: expected primary-expression before 'int' elem.version = row["version"].as(); ^~~ backend/apidb/common_pgsql_selection.cpp:13:37: error: request for member 'c_str' in '"timestamp"[((int)row)]', which is of non-class type 'const char' elem.timestamp = row["timestamp"].c_str(); ^~~~~ backend/apidb/common_pgsql_selection.cpp:14:40: error: request for member 'as' in '"changeset_id"[((int)row)]', which is of non-class type 'const char' elem.changeset = row["changeset_id"].as(); ^~ backend/apidb/common_pgsql_selection.cpp:14:61: error: expected primary-expression before '>' token elem.changeset = row["changeset_id"].as(); ^ backend/apidb/common_pgsql_selection.cpp:14:63: error: expected primary-expression before ')' token elem.changeset = row["changeset_id"].as(); ^ backend/apidb/common_pgsql_selection.cpp:15:33: error: request for member 'as' in '"visible"[((int)row)]', which is of non-class type 'const char' elem.visible = row["visible"].as(); ^~ backend/apidb/common_pgsql_selection.cpp:15:36: error: expected primary-expression before 'bool' elem.visible = row["visible"].as(); ^~~~ backend/apidb/common_pgsql_selection.cpp: At global scope: backend/apidb/common_pgsql_selection.cpp:27:57: error: 'field' in 'class pqxx::result' does not name a type boost::optional extract_optional(const pqxx::result::field &f) { ^~~~~ backend/apidb/common_pgsql_selection.cpp: In function 'boost::optional {anonymous}::extract_optional(const int&)': backend/apidb/common_pgsql_selection.cpp:28:9: error: request for member 'is_null' in 'f', which is of non-class type 'const int' if (f.is_null()) { ^~~~~~~ backend/apidb/common_pgsql_selection.cpp:31:14: error: request for member 'as' in 'f', which is of non-class type 'const int' return f.as(); ^~ backend/apidb/common_pgsql_selection.cpp:31:18: error: expected primary-expression before '>' token return f.as(); ^ backend/apidb/common_pgsql_selection.cpp:31:20: error: expected primary-expression before ')' token return f.as(); ^ backend/apidb/common_pgsql_selection.cpp: At global scope: backend/apidb/common_pgsql_selection.cpp:35:44: error: 'tuple' in 'class pqxx::result' does not name a type void extract_changeset(const pqxx::result::tuple &row, ^~~~~ backend/apidb/common_pgsql_selection.cpp: In function 'void {anonymous}::extract_changeset(const int&, changeset_info&, cache&)': backend/apidb/common_pgsql_selection.cpp:38:23: error: request for member 'as' in '"id"[((int)row)]', which is of non-class type 'const char' elem.id = row["id"].as(); ^~ backend/apidb/common_pgsql_selection.cpp:38:44: error: expected primary-expression before '>' token elem.id = row["id"].as(); ^ backend/apidb/common_pgsql_selection.cpp:38:46: error: expected primary-expression before ')' token elem.id = row["id"].as(); ^ backend/apidb/common_pgsql_selection.cpp:39:39: error: request for member 'c_str' in '"created_at"[((int)row)]', which is of non-class type 'const char' elem.created_at = row["created_at"].c_str(); ^~~~~ backend/apidb/common_pgsql_selection.cpp:40:37: error: request for member 'c_str' in '"closed_at"[((int)row)]', which is of non-class type 'const char' elem.closed_at = row["closed_at"].c_str(); ^~~~~ backend/apidb/common_pgsql_selection.cpp:65:41: error: request for member 'as' in '"num_changes"[((int)row)]', which is of non-class type 'const char' elem.num_changes = row["num_changes"].as(); ^~ backend/apidb/common_pgsql_selection.cpp:65:50: error: expected primary-expression before '>' token elem.num_changes = row["num_changes"].as(); ^ backend/apidb/common_pgsql_selection.cpp:65:52: error: expected primary-expression before ')' token elem.num_changes = row["num_changes"].as(); ^ backend/apidb/common_pgsql_selection.cpp: At global scope: backend/apidb/common_pgsql_selection.cpp:68:39: error: 'tuple' in 'class pqxx::result' does not name a type void extract_tags(const pqxx::result::tuple &row, tags_t &tags) { ^~~~~ backend/apidb/common_pgsql_selection.cpp: In function 'void {anonymous}::extract_tags(const int&, tags_t&)': backend/apidb/common_pgsql_selection.cpp:70:69: error: request for member 'c_str' in '"tag_k"[((int)row)]', which is of non-class type 'const char' std::vector keys = psql_array_to_vector(row["tag_k"].c_str()); ^~~~~ backend/apidb/common_pgsql_selection.cpp:71:71: error: request for member 'c_str' in '"tag_v"[((int)row)]', which is of non-class type 'const char' std::vector values = psql_array_to_vector(row["tag_v"].c_str()); ^~~~~ backend/apidb/common_pgsql_selection.cpp: At global scope: backend/apidb/common_pgsql_selection.cpp:79:40: error: 'tuple' in 'class pqxx::result' does not name a type void extract_nodes(const pqxx::result::tuple &row, nodes_t &nodes) { ^~~~~ backend/apidb/common_pgsql_selection.cpp: In function 'void {anonymous}::extract_nodes(const int&, nodes_t&)': backend/apidb/common_pgsql_selection.cpp:81:71: error: request for member 'c_str' in '"node_ids"[((int)row)]', which is of non-class type 'const char' std::vector ids = psql_array_to_vector(row["node_ids"].c_str()); ^~~~~ backend/apidb/common_pgsql_selection.cpp: At global scope: backend/apidb/common_pgsql_selection.cpp:114:42: error: 'tuple' in 'class pqxx::result' does not name a type void extract_members(const pqxx::result::tuple &row, members_t &members) { ^~~~~ backend/apidb/common_pgsql_selection.cpp: In function 'void {anonymous}::extract_members(const int&, members_t&)': backend/apidb/common_pgsql_selection.cpp:117:77: error: request for member 'c_str' in '"member_types"[((int)row)]', which is of non-class type 'const char' std::vector types = psql_array_to_vector(row["member_types"].c_str()); ^~~~~ backend/apidb/common_pgsql_selection.cpp:118:73: error: request for member 'c_str' in '"member_ids"[((int)row)]', which is of non-class type 'const char' std::vector ids = psql_array_to_vector(row["member_ids"].c_str()); ^~~~~ backend/apidb/common_pgsql_selection.cpp:119:77: error: request for member 'c_str' in '"member_roles"[((int)row)]', which is of non-class type 'const char' std::vector roles = psql_array_to_vector(row["member_roles"].c_str()); ^~~~~ backend/apidb/common_pgsql_selection.cpp: At global scope: backend/apidb/common_pgsql_selection.cpp:131:43: error: 'tuple' in 'class pqxx::result' does not name a type void extract_comments(const pqxx::result::tuple &row, comments_t &comments) { ^~~~~ backend/apidb/common_pgsql_selection.cpp: In function 'void {anonymous}::extract_comments(const int&, comments_t&)': backend/apidb/common_pgsql_selection.cpp:134:86: error: request for member 'c_str' in '"comment_author_id"[((int)row)]', which is of non-class type 'const char' std::vector author_id = psql_array_to_vector(row["comment_author_id"].c_str()); ^~~~~ backend/apidb/common_pgsql_selection.cpp:135:92: error: request for member 'c_str' in '"comment_display_name"[((int)row)]', which is of non-class type 'const char' std::vector display_name = psql_array_to_vector(row["comment_display_name"].c_str()); ^~~~~ backend/apidb/common_pgsql_selection.cpp:136:76: error: request for member 'c_str' in '"comment_body"[((int)row)]', which is of non-class type 'const char' std::vector body = psql_array_to_vector(row["comment_body"].c_str()); ^~~~~ backend/apidb/common_pgsql_selection.cpp:137:88: error: request for member 'c_str' in '"comment_created_at"[((int)row)]', which is of non-class type 'const char' std::vector created_at = psql_array_to_vector(row["comment_created_at"].c_str()); ^~~~~ backend/apidb/common_pgsql_selection.cpp: At global scope: backend/apidb/common_pgsql_selection.cpp:154:37: error: 'tuple' in namespace 'pqxx' does not name a type inline void extract(const pqxx::tuple &row) { ^~~~~ backend/apidb/common_pgsql_selection.cpp: In member function 'void {anonymous}::node::extra_info::extract(const int&)': backend/apidb/common_pgsql_selection.cpp:155:37: error: request for member 'as' in '"longitude"[((int)row)]', which is of non-class type 'const char' lon = double(row["longitude"].as()) / (SCALE); ^~ backend/apidb/common_pgsql_selection.cpp:155:13: error: expected primary-expression before 'double' lon = double(row["longitude"].as()) / (SCALE); ^~~~~~ backend/apidb/common_pgsql_selection.cpp:156:36: error: request for member 'as' in '"latitude"[((int)row)]', which is of non-class type 'const char' lat = double(row["latitude"].as()) / (SCALE); ^~ backend/apidb/common_pgsql_selection.cpp:156:13: error: expected primary-expression before 'double' lat = double(row["latitude"].as()) / (SCALE); ^~~~~~ backend/apidb/common_pgsql_selection.cpp: At global scope: backend/apidb/common_pgsql_selection.cpp:169:37: error: 'tuple' in namespace 'pqxx' does not name a type inline void extract(const pqxx::tuple &row) { ^~~~~ backend/apidb/common_pgsql_selection.cpp:183:37: error: 'tuple' in namespace 'pqxx' does not name a type inline void extract(const pqxx::tuple &row) { ^~~~~ backend/apidb/common_pgsql_selection.cpp: In function 'void {anonymous}::extract(const pqxx::result&, output_formatter&, cache&)': backend/apidb/common_pgsql_selection.cpp:212:31: error: invalid initialization of reference of type 'const int&' from expression of type 'const pqxx::row' extract_elem(row, elem, cc); ^ backend/apidb/common_pgsql_selection.cpp:9:6: note: in passing argument 1 of 'void {anonymous}::extract_elem(const int&, element_info&, cache&)' void extract_elem(const pqxx::result::tuple &row, element_info &elem, ^~~~~~~~~~~~ backend/apidb/common_pgsql_selection.cpp:214:27: error: invalid initialization of reference of type 'const int&' from expression of type 'const pqxx::row' extract_tags(row, tags); ^ backend/apidb/common_pgsql_selection.cpp:68:6: note: in passing argument 1 of 'void {anonymous}::extract_tags(const int&, tags_t&)' void extract_tags(const pqxx::result::tuple &row, tags_t &tags) { ^~~~~~~~~~~~ backend/apidb/common_pgsql_selection.cpp: In function 'void extract_changesets(const pqxx::result&, output_formatter&, cache&, const boost::posix_time::ptime&, bool)': backend/apidb/common_pgsql_selection.cpp:251:23: error: invalid initialization of reference of type 'const int&' from expression of type 'const pqxx::row' extract_changeset(row, elem, cc); ^~~ backend/apidb/common_pgsql_selection.cpp:35:6: note: in passing argument 1 of 'void {anonymous}::extract_changeset(const int&, changeset_info&, cache&)' void extract_changeset(const pqxx::result::tuple &row, ^~~~~~~~~~~~~~~~~ backend/apidb/common_pgsql_selection.cpp:252:18: error: invalid initialization of reference of type 'const int&' from expression of type 'const pqxx::row' extract_tags(row, tags); ^~~ backend/apidb/common_pgsql_selection.cpp:68:6: note: in passing argument 1 of 'void {anonymous}::extract_tags(const int&, tags_t&)' void extract_tags(const pqxx::result::tuple &row, tags_t &tags) { ^~~~~~~~~~~~ backend/apidb/common_pgsql_selection.cpp:253:22: error: invalid initialization of reference of type 'const int&' from expression of type 'const pqxx::row' extract_comments(row, comments); ^~~ backend/apidb/common_pgsql_selection.cpp:131:6: note: in passing argument 1 of 'void {anonymous}::extract_comments(const int&, comments_t&)' void extract_comments(const pqxx::result::tuple &row, comments_t &comments) { ^~~~~~~~~~~~~~~~ backend/apidb/common_pgsql_selection.cpp: In instantiation of 'void {anonymous}::extract(const pqxx::result&, output_formatter&, cache&) [with T = {anonymous}::node]': backend/apidb/common_pgsql_selection.cpp:224:36: required from here backend/apidb/common_pgsql_selection.cpp:213:5: error: no matching function for call to '{anonymous}::node::extra_info::extract(const pqxx::row&)' extra.extract(row); ^~~~~ backend/apidb/common_pgsql_selection.cpp:154:17: note: candidate: void {anonymous}::node::extra_info::extract(const int&) inline void extract(const pqxx::tuple &row) { ^~~~~~~ backend/apidb/common_pgsql_selection.cpp:154:17: note: no known conversion for argument 1 from 'const pqxx::row' to 'const int&' backend/apidb/common_pgsql_selection.cpp: In instantiation of 'void {anonymous}::extract(const pqxx::result&, output_formatter&, cache&) [with T = {anonymous}::way]': backend/apidb/common_pgsql_selection.cpp:230:35: required from here backend/apidb/common_pgsql_selection.cpp:213:5: error: no matching function for call to '{anonymous}::way::extra_info::extract(const pqxx::row&)' extra.extract(row); ^~~~~ backend/apidb/common_pgsql_selection.cpp:169:17: note: candidate: void {anonymous}::way::extra_info::extract(const int&) inline void extract(const pqxx::tuple &row) { ^~~~~~~ backend/apidb/common_pgsql_selection.cpp:169:17: note: no known conversion for argument 1 from 'const pqxx::row' to 'const int&' backend/apidb/common_pgsql_selection.cpp: In instantiation of 'void {anonymous}::extract(const pqxx::result&, output_formatter&, cache&) [with T = {anonymous}::relation]': backend/apidb/common_pgsql_selection.cpp:238:40: required from here backend/apidb/common_pgsql_selection.cpp:213:5: error: no matching function for call to '{anonymous}::relation::extra_info::extract(const pqxx::row&)' extra.extract(row); ^~~~~ backend/apidb/common_pgsql_selection.cpp:183:17: note: candidate: void {anonymous}::relation::extra_info::extract(const int&) inline void extract(const pqxx::tuple &row) { ^~~~~~~ backend/apidb/common_pgsql_selection.cpp:183:17: note: no known conversion for argument 1 from 'const pqxx::row' to 'const int&' Makefile:1328: recipe for target 'backend/apidb/common_pgsql_selection.lo' failed make[1]: *** [backend/apidb/common_pgsql_selection.lo] Error 1 CXX backend/apidb/pgsql_update.lo CXX backend/apidb/changeset.lo CXX backend/apidb/quad_tile.lo CXX backend/apidb/oauth_store.lo CXX backend/apidb/transaction_manager.lo CXX backend/apidb/utils.lo CXX backend/apidb/changeset_upload/changeset_updater.lo CXX backend/apidb/changeset_upload/node_updater.lo CXX backend/apidb/changeset_upload/relation_updater.lo CXX backend/apidb/changeset_upload/way_updater.lo CXX backend/pgsnapshot/pgsnapshot.lo CXX backend/pgsnapshot/snapshot_selection.lo backend/pgsnapshot/snapshot_selection.cpp:67:39: error: 'tuple' in 'class pqxx::result' does not name a type void extract_elem(const pqxx::result::tuple &row, element_info &elem) { ^~~~~ backend/pgsnapshot/snapshot_selection.cpp: In function 'void {anonymous}::extract_elem(const int&, element_info&)': backend/pgsnapshot/snapshot_selection.cpp:68:23: error: request for member 'as' in '"id"[((int)row)]', which is of non-class type 'const char' elem.id = row["id"].as(); ^~ backend/pgsnapshot/snapshot_selection.cpp:68:38: error: expected primary-expression before '>' token elem.id = row["id"].as(); ^ backend/pgsnapshot/snapshot_selection.cpp:68:40: error: expected primary-expression before ')' token elem.id = row["id"].as(); ^ backend/pgsnapshot/snapshot_selection.cpp:69:33: error: request for member 'as' in '"version"[((int)row)]', which is of non-class type 'const char' elem.version = row["version"].as(); ^~ backend/pgsnapshot/snapshot_selection.cpp:69:36: error: expected primary-expression before 'int' elem.version = row["version"].as(); ^~~ backend/pgsnapshot/snapshot_selection.cpp:70:37: error: request for member 'c_str' in '"timestamp"[((int)row)]', which is of non-class type 'const char' elem.timestamp = row["timestamp"].c_str(); ^~~~~ backend/pgsnapshot/snapshot_selection.cpp:71:40: error: request for member 'as' in '"changeset_id"[((int)row)]', which is of non-class type 'const char' elem.changeset = row["changeset_id"].as(); ^~ backend/pgsnapshot/snapshot_selection.cpp:71:61: error: expected primary-expression before '>' token elem.changeset = row["changeset_id"].as(); ^ backend/pgsnapshot/snapshot_selection.cpp:71:63: error: expected primary-expression before ')' token elem.changeset = row["changeset_id"].as(); ^ backend/pgsnapshot/snapshot_selection.cpp:72:19: error: request for member 'is_null' in '"uid"[((int)row)]', which is of non-class type 'const char' if (!row["uid"].is_null()) { ^~~~~~~ backend/pgsnapshot/snapshot_selection.cpp:73:27: error: request for member 'as' in '"uid"[((int)row)]', which is of non-class type 'const char' elem.uid = row["uid"].as(); ^~ backend/pgsnapshot/snapshot_selection.cpp:73:43: error: expected primary-expression before '>' token elem.uid = row["uid"].as(); ^ backend/pgsnapshot/snapshot_selection.cpp:73:45: error: expected primary-expression before ')' token elem.uid = row["uid"].as(); ^ backend/pgsnapshot/snapshot_selection.cpp:77:28: error: request for member 'is_null' in '"display_name"[((int)row)]', which is of non-class type 'const char' if (!row["display_name"].is_null()) { ^~~~~~~ backend/pgsnapshot/snapshot_selection.cpp:78:45: error: request for member 'c_str' in '"display_name"[((int)row)]', which is of non-class type 'const char' elem.display_name = row["display_name"].c_str(); ^~~~~ backend/pgsnapshot/snapshot_selection.cpp: In member function 'virtual void snapshot_selection::write_nodes(output_formatter&)': backend/pgsnapshot/snapshot_selection.cpp:178:18: error: invalid initialization of reference of type 'const int&' from expression of type 'pqxx::const_result_iterator::reference {aka pqxx::row}' extract_elem(*itr, elem); ^~~~ backend/pgsnapshot/snapshot_selection.cpp:67:6: note: in passing argument 1 of 'void {anonymous}::extract_elem(const int&, element_info&)' void extract_elem(const pqxx::result::tuple &row, element_info &elem) { ^~~~~~~~~~~~ backend/pgsnapshot/snapshot_selection.cpp: In member function 'virtual void snapshot_selection::write_ways(output_formatter&)': backend/pgsnapshot/snapshot_selection.cpp:201:18: error: invalid initialization of reference of type 'const int&' from expression of type 'pqxx::const_result_iterator::reference {aka pqxx::row}' extract_elem(*itr, elem); ^~~~ backend/pgsnapshot/snapshot_selection.cpp:67:6: note: in passing argument 1 of 'void {anonymous}::extract_elem(const int&, element_info&)' void extract_elem(const pqxx::result::tuple &row, element_info &elem) { ^~~~~~~~~~~~ backend/pgsnapshot/snapshot_selection.cpp: In member function 'virtual void snapshot_selection::write_relations(output_formatter&)': backend/pgsnapshot/snapshot_selection.cpp:217:18: error: invalid initialization of reference of type 'const int&' from expression of type 'pqxx::const_result_iterator::reference {aka pqxx::row}' extract_elem(*itr, elem); ^~~~ backend/pgsnapshot/snapshot_selection.cpp:67:6: note: in passing argument 1 of 'void {anonymous}::extract_elem(const int&, element_info&)' void extract_elem(const pqxx::result::tuple &row, element_info &elem) { ^~~~~~~~~~~~ Makefile:1328: recipe for target 'backend/pgsnapshot/snapshot_selection.lo' failed make[1]: *** [backend/pgsnapshot/snapshot_selection.lo] Error 1 CXX backend/staticxml/staticxml.lo CXXLD libcgimap_staticxml.la ar: `u' modifier ignored since `D' is the default (see `U') CXX main.o make[1]: Target 'all' not remade because of errors. make[1]: Leaving directory '/root/openstreetmap-cgimap-feature-bulk_upload/src' make[1]: Entering directory '/root/openstreetmap-cgimap-feature-bulk_upload' make[1]: Leaving directory '/root/openstreetmap-cgimap-feature-bulk_upload' Makefile:1010: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1 make: Target 'all' not remade because of errors. ```
mmd-osm commented 5 years ago

Need to fix types in method signatures:

using pqxx_tuple = pqxx::result::reference; using pqxx_field = pqxx::field;

Fix in https://github.com/mmd-osm/openstreetmap-cgimap/commit/d0a2e1895fe8cd68670a301bd1c592d362a84eae - successfully tested on Ubuntu 18.10 which comes with libpqxx 6.2.5.

pnorman commented 5 years ago

It'll still have compatibility with 4, right?

mmd-osm commented 5 years ago

Right, the idea was to have compatibility with both 4.x and 6.x without introducing conditional #define stuff. Hopefully, the current definition is more stable over time.

Travis CI is still using Ubuntu 18.04, i.e. we would immediately see some failing builds in case the code is no longer compatible with 4.