summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-02-04 20:20:34 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2019-02-04 20:20:34 +0000
commitb8a3e51079203d6d9f46d5faf9e624d53b62a0ad (patch)
tree6941cea3601920c97bfcdf5d628da77a9b16d229
parentDeriving comparator (diff)
downloadlibdbpp-b8a3e51079203d6d9f46d5faf9e624d53b62a0ad.tar.bz2
libdbpp-b8a3e51079203d6d9f46d5faf9e624d53b62a0ad.tar.xz
libdbpp-b8a3e51079203d6d9f46d5faf9e624d53b62a0ad.zip
Columns are unique, not shared
-rw-r--r--libdbpp/column.h2
-rw-r--r--libdbpp/selectcommand.cpp4
-rw-r--r--libdbpp/selectcommand.h2
m---------libdbpp/unittests/libdbpp-postgresql0
4 files changed, 4 insertions, 4 deletions
diff --git a/libdbpp/column.h b/libdbpp/column.h
index ae7634f..94d597b 100644
--- a/libdbpp/column.h
+++ b/libdbpp/column.h
@@ -115,7 +115,7 @@ namespace DB {
/// This column's name.
const std::string name;
};
- typedef std::shared_ptr<Column> ColumnPtr;
+ typedef std::unique_ptr<Column> ColumnPtr;
}
#endif
diff --git a/libdbpp/selectcommand.cpp b/libdbpp/selectcommand.cpp
index 1e67ce6..96b3276 100644
--- a/libdbpp/selectcommand.cpp
+++ b/libdbpp/selectcommand.cpp
@@ -73,10 +73,10 @@ DB::SelectCommand::columnCount() const
return columns->size();
}
-DB::ColumnPtr
+const DB::ColumnPtr &
DB::SelectCommand::insertColumn(ColumnPtr col)
{
- return *columns->insert(col).first;
+ return *columns->insert(std::move(col)).first;
}
DB::RowBase::RowBase(SelectCommand * s) :
diff --git a/libdbpp/selectcommand.h b/libdbpp/selectcommand.h
index 05ec2ce..2fb9253 100644
--- a/libdbpp/selectcommand.h
+++ b/libdbpp/selectcommand.h
@@ -128,7 +128,7 @@ namespace DB {
protected:
/// Helper function so clients need not know about boost::multi_index_container.
- ColumnPtr insertColumn(ColumnPtr);
+ const ColumnPtr & insertColumn(ColumnPtr);
class Columns;
diff --git a/libdbpp/unittests/libdbpp-postgresql b/libdbpp/unittests/libdbpp-postgresql
-Subproject 36d1ebb68359d7faa194a1f62c17011b462a3a1
+Subproject a0cedddde5ad16e2b885d3dd0b57b3e613a796a