MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / validateIsAllUnionOrUnionAll

Function validateIsAllUnionOrUnionAll

src/binder/bind/bind_query.cpp:33–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33void validateIsAllUnionOrUnionAll(const BoundRegularQuery& regularQuery) {
34 auto unionAllExpressionCounter = 0u;
35 for (auto i = 0u; i < regularQuery.getNumSingleQueries() - 1; i++) {
36 unionAllExpressionCounter += regularQuery.getIsUnionAll(i);
37 }
38 if ((0 < unionAllExpressionCounter) &&
39 (unionAllExpressionCounter < regularQuery.getNumSingleQueries() - 1)) {
40 throw BinderException("Union and union all can not be used together.");
41 }
42}
43
44std::unique_ptr<BoundRegularQuery> Binder::bindQuery(const Statement& statement) {
45 auto& regularQuery = statement.constCast<RegularQuery>();

Callers 1

bindQueryMethod · 0.85

Calls 2

getNumSingleQueriesMethod · 0.45
getIsUnionAllMethod · 0.45

Tested by

no test coverage detected