| 40 | } |
| 41 | |
| 42 | case_expr::case_expr(prod *p, sqltype *type_constraint) |
| 43 | : value_expr(p) |
| 44 | { |
| 45 | condition = bool_expr::factory(this); |
| 46 | true_expr = value_expr::factory(this, type_constraint); |
| 47 | false_expr = value_expr::factory(this, true_expr->type); |
| 48 | |
| 49 | if(false_expr->type != true_expr->type) { |
| 50 | /* Types are consistent but not identical. Try to find a more |
| 51 | concrete one for a better match. */ |
| 52 | if (true_expr->type->consistent(false_expr->type)) |
| 53 | true_expr = value_expr::factory(this, false_expr->type); |
| 54 | else |
| 55 | false_expr = value_expr::factory(this, true_expr->type); |
| 56 | } |
| 57 | type = true_expr->type; |
| 58 | } |
| 59 | |
| 60 | void case_expr::out(std::ostream &out) |
| 61 | { |
nothing calls this directly
no test coverage detected