MCPcopy Create free account
hub / github.com/anse1/sqlsmith / coalesce

Method coalesce

expr.cc:163–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163coalesce::coalesce(prod *p, sqltype *type_constraint, const char *abbrev)
164 : value_expr(p), abbrev_(abbrev)
165{
166 auto first_expr = value_expr::factory(this, type_constraint);
167 auto second_expr = value_expr::factory(this, first_expr->type);
168
169 retry_limit = 20;
170 while(first_expr->type != second_expr->type) {
171 retry();
172 if (first_expr->type->consistent(second_expr->type))
173 first_expr = value_expr::factory(this, second_expr->type);
174 else
175 second_expr = value_expr::factory(this, first_expr->type);
176 }
177 type = second_expr->type;
178
179 value_exprs.push_back(first_expr);
180 value_exprs.push_back(second_expr);
181}
182
183void coalesce::out(std::ostream &out)
184{

Callers

nothing calls this directly

Calls 2

retryFunction · 0.70
consistentMethod · 0.45

Tested by

no test coverage detected