Skip to content

Commit c03ea06

Browse files
authored
Merge pull request #1755 from joto/fix-isvalid-create-only
Fix: Do not try to run ST_IsValid() on create_only columns
2 parents d1b440a + 215f545 commit c03ea06

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/flex-table-column.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,14 @@ class flex_table_column_t
9090
* column? If the SRID is 4326 the geometry validity is already assured
9191
* by libosmium, so we don't need it. And Point geometries are always
9292
* valid.
93+
* No checks are needed for create_only columns, because they don't
94+
* contain anything.
9395
*/
9496
bool needs_isvalid() const noexcept
9597
{
9698
assert(is_geometry_column());
97-
return m_srid != 4326 && m_type != table_column_type::point;
99+
return !m_create_only && m_srid != 4326 &&
100+
m_type != table_column_type::point;
98101
}
99102

100103
std::string const &type_name() const noexcept { return m_type_name; }

0 commit comments

Comments
 (0)