From 159b4c715205807dcf6f22873c08b0253fe22b50 Mon Sep 17 00:00:00 2001 From: rbock Date: Mon, 28 Jul 2014 21:14:20 +0200 Subject: [PATCH] Fixed error in determining can_be_null for joins --- include/sqlpp11/statement.h | 2 +- tests/SelectTest.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/sqlpp11/statement.h b/include/sqlpp11/statement.h index 64d17e82..615a50cb 100644 --- a/include/sqlpp11/statement.h +++ b/include/sqlpp11/statement.h @@ -112,7 +112,7 @@ namespace sqlpp ::sqlpp::detail::make_intersect_set_t< required_tables_of<_result_type_provider>, provided_outer_tables_of - >::size::value>; + >::size::value != 0>; }; }; } diff --git a/tests/SelectTest.cpp b/tests/SelectTest.cpp index 7bdf43a5..5ccc94e4 100644 --- a/tests/SelectTest.cpp +++ b/tests/SelectTest.cpp @@ -64,6 +64,11 @@ int main() std::cout << a << ", " << b << ", " << g << std::endl; } + for (const auto& row : db(select(all_of(t), all_of(f)).from(t.join(f).on(t.alpha > f.omega)).where(true))) + { + std::cout << row.alpha << std::endl; + } + auto stat = sqlpp::select().columns(all_of(t)).flags(sqlpp::all).from(t).extra_tables(f,t).where(t.alpha > 0).group_by(t.alpha).order_by(t.gamma.asc()).having(t.gamma).limit(7).offset(19); auto s = dynamic_select(db).dynamic_columns(all_of(t)).dynamic_flags().dynamic_from(t).extra_tables(f,t).dynamic_where().dynamic_group_by(t.alpha).dynamic_order_by().dynamic_having(t.gamma).dynamic_limit().dynamic_offset();