mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 04:47:18 +08:00
Fixed bug in in() serialization
in(select(...)) did have an extra set of braces, which lead to different behaviour. Thanks to Thomas Marsh for finding the bug
This commit is contained in:
parent
236b367231
commit
b3ef68101f
@ -79,6 +79,10 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
serialize(t._operand, context);
|
serialize(t._operand, context);
|
||||||
context << (t._inverted ? " NOT IN(" : " IN(");
|
context << (t._inverted ? " NOT IN(" : " IN(");
|
||||||
|
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);
|
interpret_tuple(t._args, ',', context);
|
||||||
context << ')';
|
context << ')';
|
||||||
return context;
|
return context;
|
||||||
|
@ -179,6 +179,9 @@ int main()
|
|||||||
printer.reset();
|
printer.reset();
|
||||||
std::cerr << serialize(x, printer).str() << std::endl;
|
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;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user