mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-05-03 17:39:09 -05:00
Allow parameter in having clause, see #443
Disallow mixing aggregate and non-aggregate columns in select, too.
This commit is contained in:
@@ -158,11 +158,12 @@ namespace
|
||||
|
||||
// OK
|
||||
static_consistency_check<sqlpp::consistent_t>(select_without_group_by, avg(t.alpha) > 17);
|
||||
static_consistency_check<sqlpp::consistent_t>(select_without_group_by, avg(t.alpha) > parameter(t.alpha));
|
||||
|
||||
// Try non aggregate
|
||||
static_consistency_check<sqlpp::assert_having_no_non_aggregates_t>(select_without_group_by, t.alpha > 17);
|
||||
static_consistency_check<sqlpp::assert_having_no_non_aggregates_t>(select_without_group_by,
|
||||
count(t.alpha) > 3 and t.alpha > 17);
|
||||
static_consistency_check<sqlpp::assert_having_all_aggregates_t>(select_without_group_by, t.alpha > 17);
|
||||
static_consistency_check<sqlpp::assert_having_all_aggregates_t>(select_without_group_by,
|
||||
count(t.alpha) > 3 and t.alpha > 17);
|
||||
|
||||
// Try foreign table
|
||||
static_consistency_check<sqlpp::assert_having_no_unknown_tables_t>(select_without_group_by, f.omega > 17);
|
||||
@@ -175,8 +176,8 @@ namespace
|
||||
static_consistency_check<sqlpp::consistent_t>(select_with_group_by, count(t.alpha) > 3 and t.alpha > 17);
|
||||
|
||||
// Try non aggregate
|
||||
static_consistency_check<sqlpp::assert_having_no_non_aggregates_t>(select_with_group_by, t.beta > "17");
|
||||
static_consistency_check<sqlpp::assert_having_no_non_aggregates_t>(select_with_group_by,
|
||||
static_consistency_check<sqlpp::assert_having_all_aggregates_t>(select_with_group_by, t.beta > "17");
|
||||
static_consistency_check<sqlpp::assert_having_all_aggregates_t>(select_with_group_by,
|
||||
count(t.beta) > 3 and t.beta > "17");
|
||||
|
||||
// Try foreign table
|
||||
|
||||
Reference in New Issue
Block a user