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

Method comparison_op

expr.cc:143–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143comparison_op::comparison_op(prod *p) : bool_binop(p)
144{
145 auto &idx = p->scope->schema->operators_returning_type;
146
147 auto iters = idx.equal_range(scope->schema->booltype);
148 oper = random_pick(random_pick(iters)->second);
149
150 lhs = value_expr::factory(this, oper->left);
151 rhs = value_expr::factory(this, oper->right);
152
153 if (oper->left == oper->right
154 && lhs->type != rhs->type) {
155
156 if (lhs->type->consistent(rhs->type))
157 lhs = value_expr::factory(this, rhs->type);
158 else
159 rhs = value_expr::factory(this, lhs->type);
160 }
161}
162
163coalesce::coalesce(prod *p, sqltype *type_constraint, const char *abbrev)
164 : value_expr(p), abbrev_(abbrev)

Callers

nothing calls this directly

Calls 2

random_pickFunction · 0.85
consistentMethod · 0.45

Tested by

no test coverage detected