summaryrefslogtreecommitdiff
path: root/libpqpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-02-04 20:19:52 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2019-02-04 20:19:52 +0000
commita0cedddde5ad16e2b885d3dd0b57b3e613a796a3 (patch)
treed75ff3fc2923ac10f6c7ca5ef7cc123cabc16070 /libpqpp
parentCTF for parameter binding (diff)
downloadlibdbpp-postgresql-a0cedddde5ad16e2b885d3dd0b57b3e613a796a3.tar.bz2
libdbpp-postgresql-a0cedddde5ad16e2b885d3dd0b57b3e613a796a3.tar.xz
libdbpp-postgresql-a0cedddde5ad16e2b885d3dd0b57b3e613a796a3.zip
Pass new columns from make_unique
Diffstat (limited to 'libpqpp')
-rw-r--r--libpqpp/pq-selectbase.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libpqpp/pq-selectbase.cpp b/libpqpp/pq-selectbase.cpp
index 54b2a57..f9a2eb0 100644
--- a/libpqpp/pq-selectbase.cpp
+++ b/libpqpp/pq-selectbase.cpp
@@ -25,7 +25,10 @@ PQ::SelectBase::createColumns(PGresult * execRes)
{
unsigned int nFields = PQnfields(execRes);
for (unsigned int f = 0; f < nFields; f += 1) {
- insertColumn(DB::ColumnPtr(binary ? new BinaryColumn(this, f) : new Column(this, f)));
+ if (binary)
+ insertColumn(std::make_unique<BinaryColumn>(this, f));
+ else
+ insertColumn(std::make_unique<Column>(this, f));
}
}