From 15d49ded568529ba6e53ba5c7f4810721dd474dd Mon Sep 17 00:00:00 2001 From: Paul Norman Date: Thu, 16 Apr 2015 23:02:38 -0700 Subject: [PATCH] Fix a bug where modified tags weren't being copied from Lua Also add a small tag processing test for the multi-backend --- output-multi.cpp | 2 +- tests/test-output-multi-line-storage.cpp | 1 + tests/test_output_multi_line_trivial.lua | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/output-multi.cpp b/output-multi.cpp index 8421ce5d8..171092c92 100644 --- a/output-multi.cpp +++ b/output-multi.cpp @@ -317,7 +317,7 @@ int output_multi_t::process_way(osmid_t id, const idlist_t &nodes, const taglist m_expire->from_nodes_poly(m_way_helper.node_cache, id); else m_expire->from_nodes_line(m_way_helper.node_cache); - copy_to_table(id, wkt->geom.c_str(), tags); + copy_to_table(id, wkt->geom.c_str(), outtags); } } } diff --git a/tests/test-output-multi-line-storage.cpp b/tests/test-output-multi-line-storage.cpp index 2864bb303..fa9d7508f 100644 --- a/tests/test-output-multi-line-storage.cpp +++ b/tests/test-output-multi-line-storage.cpp @@ -98,6 +98,7 @@ int main(int argc, char *argv[]) { check_count(test_conn, 2, "SELECT ST_NumPoints(way) FROM test_line WHERE osm_id = 2"); check_count(test_conn, 2, "SELECT ST_NumPoints(way) FROM test_line WHERE osm_id = 3"); + check_count(test_conn, 3, "SELECT COUNT(*) FROM test_line WHERE foo = 'bar'"); return 0; } catch (const std::exception &e) { diff --git a/tests/test_output_multi_line_trivial.lua b/tests/test_output_multi_line_trivial.lua index 7c3f0da7e..7bd92bb98 100644 --- a/tests/test_output_multi_line_trivial.lua +++ b/tests/test_output_multi_line_trivial.lua @@ -5,6 +5,6 @@ end -- A generic way to process ways, given a function which determines if tags are interesting -- Takes an optional function to process tags. Always says it's a polygon if there's matching tags function test_ways (kv, num_keys) - tags = {} + tags = {["foo"] = "bar"} return 0, tags, 1, 0 end