diff --git a/include/sqlpp11/parameterized_verbatim.h b/include/sqlpp11/parameterized_verbatim.h index 456fb6b3..7956450f 100644 --- a/include/sqlpp11/parameterized_verbatim.h +++ b/include/sqlpp11/parameterized_verbatim.h @@ -35,7 +35,7 @@ namespace sqlpp { template - struct parameterized_verbatim_t : public expression_operators, ValueType>, + struct parameterized_verbatim_t : public expression_operators, ValueType>, public alias_operators> { using _traits = make_traits; diff --git a/tests/core/usage/Select.cpp b/tests/core/usage/Select.cpp index bb01f965..cce0e82f 100644 --- a/tests/core/usage/Select.cpp +++ b/tests/core/usage/Select.cpp @@ -62,6 +62,8 @@ void print_row(Row const& row) } SQLPP_ALIAS_PROVIDER(cheese) +SQLPP_ALIAS_PROVIDER(param1) +SQLPP_ALIAS_PROVIDER(param2) int Select(int, char*[]) { @@ -219,5 +221,12 @@ int Select(int, char*[]) std::cout << row.omega << " " << row.cheese << std::endl; } + // checking #584 + auto abs = db.prepare(select(t.alpha).from(t).where(sqlpp::parameterized_verbatim( + "ABS(field1 -", sqlpp::parameter(t.alpha), ")") <= + sqlpp::parameter(sqlpp::unsigned_integral(), param2))); + abs.params.alpha = 7; + abs.params.param2 = 7; + return 0; }