| 58 | } |
| 59 | |
| 60 | table_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 | |
| 74 | void table_sample::out(std::ostream &out) { |
| 75 | out << t->ident() << |
nothing calls this directly
no test coverage detected