diff --git a/include/sqlpp11/in.h b/include/sqlpp11/in.h index e3bf0915..3d8a98a0 100644 --- a/include/sqlpp11/in.h +++ b/include/sqlpp11/in.h @@ -79,7 +79,11 @@ namespace sqlpp { serialize(t._operand, context); context << (t._inverted ? " NOT IN(" : " IN("); - interpret_tuple(t._args, ',', context); + if (sizeof...(Args) == 1) + serialize(std::get<0>(t._args), context); // FIXME: this is a bit of a hack until there is a better overall strategy for using braces + // see https://github.com/rbock/sqlpp11/issues/18 + else + interpret_tuple(t._args, ',', context); context << ')'; return context; } diff --git a/tests/InterpretTest.cpp b/tests/InterpretTest.cpp index 6d0943ac..c3813a24 100644 --- a/tests/InterpretTest.cpp +++ b/tests/InterpretTest.cpp @@ -179,6 +179,9 @@ int main() printer.reset(); std::cerr << serialize(x, printer).str() << std::endl; + printer.reset(); + std::cerr << serialize(select(all_of(t)).from(t).where(t.alpha.in(select(f.epsilon).from(f).where(true))), printer).str() << std::endl; + return 0;