| 161 | } |
| 162 | |
| 163 | coalesce::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 | |
| 183 | void coalesce::out(std::ostream &out) |
| 184 | { |
nothing calls this directly
no test coverage detected