From fd054d8a5aa0440ab12cdb6501470588eb7f6afb Mon Sep 17 00:00:00 2001 From: rbock Date: Fri, 22 Aug 2014 12:26:48 +0200 Subject: [PATCH] Fixed operators += et al --- include/sqlpp11/integral.h | 8 ++++---- include/sqlpp11/text.h | 2 +- tests/MockDb.h | 4 ---- tests/UpdateTest.cpp | 2 ++ 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/sqlpp11/integral.h b/include/sqlpp11/integral.h index ecb9b14d..0e509bbf 100644 --- a/include/sqlpp11/integral.h +++ b/include/sqlpp11/integral.h @@ -205,7 +205,7 @@ namespace sqlpp using rhs = wrap_operand_t; static_assert(_is_valid_operand::value, "invalid rhs assignment operand"); - return { *static_cast(this), { *static_cast(this), rhs{t} } }; + return { *static_cast(this), {{*static_cast(this), rhs{t}}}}; } template @@ -214,7 +214,7 @@ namespace sqlpp using rhs = wrap_operand_t; static_assert(_is_valid_operand::value, "invalid rhs assignment operand"); - return { *static_cast(this), { *static_cast(this), rhs{t} } }; + return { *static_cast(this), {{*static_cast(this), rhs{t}}}}; } template @@ -223,7 +223,7 @@ namespace sqlpp using rhs = wrap_operand_t; static_assert(_is_valid_operand::value, "invalid rhs assignment operand"); - return { *static_cast(this), { *static_cast(this), rhs{t} } }; + return { *static_cast(this), {{*static_cast(this), rhs{t}}}}; } template @@ -232,7 +232,7 @@ namespace sqlpp using rhs = wrap_operand_t; static_assert(_is_valid_operand::value, "invalid rhs assignment operand"); - return { *static_cast(this), { *static_cast(this), rhs{t} } }; + return { *static_cast(this), {{*static_cast(this), rhs{t}}}}; } }; }; diff --git a/include/sqlpp11/text.h b/include/sqlpp11/text.h index d707d5a1..7dda39a8 100644 --- a/include/sqlpp11/text.h +++ b/include/sqlpp11/text.h @@ -150,7 +150,7 @@ namespace sqlpp using rhs = wrap_operand_t; static_assert(_is_valid_operand::value, "invalid rhs assignment operand"); - return { *static_cast(this), { *static_cast(this), rhs{t} } }; + return { *static_cast(this), concat_t>{ *static_cast(this), rhs{t} } }; } }; }; diff --git a/tests/MockDb.h b/tests/MockDb.h index 5ef1f110..0586c04c 100644 --- a/tests/MockDb.h +++ b/tests/MockDb.h @@ -165,8 +165,6 @@ struct MockDbT: public sqlpp::connection template size_t run_prepared_insert(const PreparedInsert& x) { - _serializer_context_t context; - ::sqlpp::serialize(x, context); return 0; } @@ -181,8 +179,6 @@ struct MockDbT: public sqlpp::connection template result_t run_prepared_select(PreparedSelect& x) { - _serializer_context_t context; - ::sqlpp::serialize(x, context); return {}; } diff --git a/tests/UpdateTest.cpp b/tests/UpdateTest.cpp index 04f73024..e12224ec 100644 --- a/tests/UpdateTest.cpp +++ b/tests/UpdateTest.cpp @@ -68,6 +68,8 @@ int main() db(update(t).set(t.delta = sqlpp::null).where(true)); db(update(t).set(t.delta = sqlpp::default_value).where(true)); + db(update(t).set(t.delta += t.alpha * 2, t.beta += " and cake").where(true)); + return 0; }