From 28fc5900f21ef0c7dffef6854b4f50eed0b88bb0 Mon Sep 17 00:00:00 2001 From: rbock Date: Sat, 1 Feb 2014 14:28:23 +0100 Subject: [PATCH] Added missing overload for prepared statement parameters --- include/sqlpp11/parameter.h | 9 ++++++++- tests/InterpretTest.cpp | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/sqlpp11/parameter.h b/include/sqlpp11/parameter.h index 8d640330..3f33b808 100644 --- a/include/sqlpp11/parameter.h +++ b/include/sqlpp11/parameter.h @@ -65,12 +65,19 @@ namespace sqlpp } template - auto parameter(NamedExpr namedExpr) + auto parameter(const NamedExpr&) -> parameter_t { return {}; } + template + auto parameter(const ValueType&, const AliasProvider&) + -> parameter_t + { + return {}; + } + } #endif diff --git a/tests/InterpretTest.cpp b/tests/InterpretTest.cpp index 5d940868..8f523298 100644 --- a/tests/InterpretTest.cpp +++ b/tests/InterpretTest.cpp @@ -77,6 +77,7 @@ int main() interpret(select(sqlpp::distinct, t.alpha, t.beta).from(t).where(t.alpha == 3).group_by(t.gamma).having(t.beta.like("%kuchen")).order_by(t.beta.asc()), printer).flush(); interpret(select(sqlpp::distinct, t.alpha, t.beta).from(t).where(t.alpha == 3).group_by(t.gamma).having(t.beta.like("%kuchen")).order_by(t.beta.asc()).limit(17).offset(3), printer).flush(); + interpret(parameter(sqlpp::bigint(), t.alpha), printer).flush(); interpret(parameter(t.alpha), printer).flush(); interpret(t.alpha == parameter(t.alpha), printer).flush(); interpret(t.alpha == parameter(t.alpha) and (t.beta + "gimmick").like(parameter(t.beta)), printer).flush();