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

Method table_sample

grammar.cc:60–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60table_sample::table_sample(prod *p) : table_ref(p) {
61 match();
62 retry_limit = 1000; /* retries are cheap here */
63 do {
64 auto pick = random_pick(scope->schema->base_tables);
65 t = dynamic_cast<struct table*>(pick);
66 retry();
67 } while (!t || !t->is_base_table);
68
69 refs.push_back(make_shared<aliased_relation>(scope->stmt_uid("sample"), t));
70 percent = 0.1 * d100();
71 method = (d6() > 2) ? "system" : "bernoulli";
72}
73
74void table_sample::out(std::ostream &out) {
75 out << t->ident() <<

Callers

nothing calls this directly

Calls 5

random_pickFunction · 0.85
d100Function · 0.85
d6Function · 0.85
stmt_uidMethod · 0.80
retryFunction · 0.70

Tested by

no test coverage detected