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

Method target_table

grammar.cc:42–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42target_table::target_table(prod *p, table *victim) : table_ref(p)
43{
44 while (! victim
45 || victim->schema == "pg_catalog"
46 || !victim->is_base_table
47 || !victim->columns().size()) {
48 struct named_relation *pick = random_pick(scope->tables);
49 victim = dynamic_cast<table *>(pick);
50 retry();
51 }
52 victim_ = victim;
53 refs.push_back(make_shared<aliased_relation>(scope->stmt_uid("target"), victim));
54}
55
56void target_table::out(std::ostream &out) {
57 out << victim_->ident() << " as " << refs[0]->ident();

Callers

nothing calls this directly

Calls 3

random_pickFunction · 0.85
stmt_uidMethod · 0.80
retryFunction · 0.70

Tested by

no test coverage detected