Skip to content

Commit 29a923c

Browse files
authored
Merge pull request #927 from lonvia/fix-missing-get-wkb
Prepare get_wkb on copy connections as well
2 parents 00d8220 + 78a6c75 commit 29a923c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

table.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ table_t::table_t(table_t const &other,
4747
// this would be premature.
4848
if (other.sql_conn) {
4949
connect();
50+
prepare();
5051
}
5152
}
5253

@@ -171,6 +172,11 @@ void table_t::start(std::string const &conninfo,
171172
//TODO: change the type of the geometry column if needed - this can only change to a more permissive type
172173
}
173174

175+
prepare();
176+
}
177+
178+
void table_t::prepare()
179+
{
174180
//let postgres cache this query as it will presumably happen a lot
175181
pgsql_exec_simple(sql_conn, PGRES_COMMAND_OK,
176182
(fmt("PREPARE get_wkb (" POSTGRES_OSMID_TYPE

table.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class table_t
7171

7272
protected:
7373
void connect();
74+
void prepare();
7475
void teardown();
7576

7677
void write_columns(taglist_t const &tags, std::vector<bool> *used);

0 commit comments

Comments
 (0)