diff --git a/include/sqlpp11/multi_column.h b/include/sqlpp11/multi_column.h index 52de9d5f..ac09881c 100644 --- a/include/sqlpp11/multi_column.h +++ b/include/sqlpp11/multi_column.h @@ -76,7 +76,7 @@ namespace sqlpp template struct multi_column_alias_t { - using _traits = make_traits; + using _traits = make_traits; using _recursive_traits = make_recursive_traits; static_assert(detail::all_t::value...>::value, "multi_column parameters need to be named expressions"); diff --git a/include/sqlpp11/select_column_list.h b/include/sqlpp11/select_column_list.h index c24da000..0aab60ff 100644 --- a/include/sqlpp11/select_column_list.h +++ b/include/sqlpp11/select_column_list.h @@ -269,6 +269,7 @@ namespace sqlpp _alias_t as(const AliasProvider& aliasProvider) const { static_assert(Policies::_can_be_used_as_table::value, "statement cannot be used as table, e.g. due to missing tables"); + static_assert(::sqlpp::detail::none_t::value...>::value, "cannot use multi-columns in sub selects"); return _table_t(_get_statement()).as(aliasProvider); } diff --git a/tests/SelectTypeTest.cpp b/tests/SelectTypeTest.cpp index 2361a623..f709947a 100644 --- a/tests/SelectTypeTest.cpp +++ b/tests/SelectTypeTest.cpp @@ -290,11 +290,8 @@ int main() { auto m = multi_column(t.alpha, t.beta).as(alias::a); static_assert(not sqlpp::is_expression_t::value, "a multi_column is not a value"); - -#warning: A multicolumn cannot be used if the select is to be used like a table - auto a = select(m).from(t).as(alias::b).a; - //static_assert(not sqlpp::is_expression_t::value, "a multi_column is not a value"); } + // Test that result sets with identical name/value combinations have identical types { auto a = select(t.alpha);