Fixed a few bugs found during mysql tests

This commit is contained in:
rbock
2014-01-22 18:35:08 +01:00
parent 4527ecaefb
commit 6e55f8f6cd
3 changed files with 4 additions and 6 deletions
+2 -5
View File
@@ -57,7 +57,7 @@ namespace sqlpp
-> use_default_values_t
{
static_assert(std::is_same<InsertList, vendor::noop>::value, "cannot call default_values() after set() or default_values()");
// FIXME: Need to check if all required columns are set
static_assert(Table::_required_insert_columns::size::value == 0, "cannot use default_values, because some columns are configured to require values");
return {
_table,
{},
@@ -110,10 +110,7 @@ namespace sqlpp
template<typename Db>
std::size_t run(Db& db) const
{
// FIXME: check if set or default_values() has ben called
constexpr bool calledSet = not vendor::is_noop<InsertList>::value;
constexpr bool requireSet = Table::_required_insert_columns::size::value > 0;
static_assert(calledSet or not requireSet, "calling set() required for given table");
static_assert(not vendor::is_noop<InsertList>::value, "calling set() or default_values()");
static_assert(_get_static_no_of_parameters() == 0, "cannot run insert directly with parameters, use prepare instead");
return db.insert(*this);
}
+1
View File
@@ -156,6 +156,7 @@ namespace sqlpp
context << " JOIN ";
context << "(";
interpret(t._rhs, context);
context << ")";
interpret(t._on, context);
return context;
}
+1 -1
View File
@@ -595,7 +595,7 @@ namespace sqlpp
const typename ColumnList::_dynamic_names_t& get_dynamic_names() const
{
return _columns._dynamic_expressions._dynamic_expression_names;
return _columns._dynamic_columns._dynamic_expression_names;
}
static constexpr size_t _get_static_no_of_parameters()