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

Method column_reference

expr.cc:77–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77column_reference::column_reference(prod *p, sqltype *type_constraint) : value_expr(p)
78{
79 if (type_constraint) {
80 auto pairs = scope->refs_of_type(type_constraint);
81 auto picked = random_pick(pairs);
82 reference += picked.first->ident()
83 + "." + picked.second.name;
84 type = picked.second.type;
85 assert(type_constraint->consistent(type));
86 } else {
87 named_relation *r = random_pick(scope->refs);
88
89 reference += r->ident() + ".";
90 column &c = random_pick(r->columns());
91 type = c.type;
92 reference += c.name;
93 }
94}
95
96shared_ptr<bool_expr> bool_expr::factory(prod *p)
97{

Callers

nothing calls this directly

Calls 4

random_pickFunction · 0.85
refs_of_typeMethod · 0.80
identMethod · 0.45
consistentMethod · 0.45

Tested by

no test coverage detected