mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 04:47:18 +08:00
Fix incorrect expressions for paramterized_verbatim, #584
This commit is contained in:
parent
166b01a32f
commit
d6f5e498b9
@ -35,7 +35,7 @@
|
|||||||
namespace sqlpp
|
namespace sqlpp
|
||||||
{
|
{
|
||||||
template <typename ValueType, typename Expr>
|
template <typename ValueType, typename Expr>
|
||||||
struct parameterized_verbatim_t : public expression_operators<verbatim_t<ValueType>, ValueType>,
|
struct parameterized_verbatim_t : public expression_operators<parameterized_verbatim_t<ValueType, Expr>, ValueType>,
|
||||||
public alias_operators<verbatim_t<ValueType>>
|
public alias_operators<verbatim_t<ValueType>>
|
||||||
{
|
{
|
||||||
using _traits = make_traits<ValueType, tag::is_expression>;
|
using _traits = make_traits<ValueType, tag::is_expression>;
|
||||||
|
@ -62,6 +62,8 @@ void print_row(Row const& row)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SQLPP_ALIAS_PROVIDER(cheese)
|
SQLPP_ALIAS_PROVIDER(cheese)
|
||||||
|
SQLPP_ALIAS_PROVIDER(param1)
|
||||||
|
SQLPP_ALIAS_PROVIDER(param2)
|
||||||
|
|
||||||
int Select(int, char*[])
|
int Select(int, char*[])
|
||||||
{
|
{
|
||||||
@ -219,5 +221,12 @@ int Select(int, char*[])
|
|||||||
std::cout << row.omega << " " << row.cheese << std::endl;
|
std::cout << row.omega << " " << row.cheese << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// checking #584
|
||||||
|
auto abs = db.prepare(select(t.alpha).from(t).where(sqlpp::parameterized_verbatim<sqlpp::unsigned_integral>(
|
||||||
|
"ABS(field1 -", sqlpp::parameter(t.alpha), ")") <=
|
||||||
|
sqlpp::parameter(sqlpp::unsigned_integral(), param2)));
|
||||||
|
abs.params.alpha = 7;
|
||||||
|
abs.params.param2 = 7;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user