Skip to content

Commit 1cb89ce

Browse files
authored
Merge pull request #1509 from joto/no-index-for-tables-without-id
Do not try to create indexes for tables without id
2 parents f23e6ab + c0404d8 commit 1cb89ce

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/output-flex.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -820,8 +820,8 @@ void output_flex_t::setup_id_columns(flex_table_t *table)
820820
assert(table);
821821
lua_getfield(lua_state(), -1, "ids");
822822
if (lua_type(lua_state(), -1) != LUA_TTABLE) {
823-
log_warn("Table '{}' doesn't have an 'ids' column. Updates"
824-
" and expire will not work!",
823+
log_warn("Table '{}' doesn't have an id column. Two-stage"
824+
" processing, updates and expire will not work!",
825825
table->name());
826826
lua_pop(lua_state(), 1); // ids
827827
return;
@@ -1497,7 +1497,7 @@ void output_flex_t::delete_from_table(table_connection_t *table_connection,
14971497
void output_flex_t::delete_from_tables(osmium::item_type type, osmid_t osm_id)
14981498
{
14991499
for (auto &table : m_table_connections) {
1500-
if (table.table().matches_type(type)) {
1500+
if (table.table().matches_type(type) && table.table().has_id_column()) {
15011501
delete_from_table(&table, type, osm_id);
15021502
}
15031503
}
@@ -1722,7 +1722,8 @@ void output_flex_t::reprocess_marked()
17221722
util::timer_t timer;
17231723

17241724
for (auto &table : m_table_connections) {
1725-
if (table.table().matches_type(osmium::item_type::way)) {
1725+
if (table.table().matches_type(osmium::item_type::way) &&
1726+
table.table().has_id_column()) {
17261727
table.create_id_index();
17271728
}
17281729
}

0 commit comments

Comments
 (0)