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

Function statement_factory

grammar.cc:466–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464}
465
466shared_ptr<prod> statement_factory(struct scope *s)
467{
468 try {
469 s->new_stmt();
470 if (d42() == 1)
471 return make_shared<merge_stmt>((struct prod *)0, s);
472 if (d42() == 1)
473 return make_shared<insert_stmt>((struct prod *)0, s);
474 else if (d42() == 1)
475 return make_shared<delete_returning>((struct prod *)0, s);
476 else if (d42() == 1) {
477 return make_shared<upsert_stmt>((struct prod *)0, s);
478 } else if (d42() == 1)
479 return make_shared<update_returning>((struct prod *)0, s);
480 else if (d6() > 4)
481 return make_shared<select_for_update>((struct prod *)0, s);
482 else if (d6() > 5)
483 return make_shared<common_table_expression>((struct prod *)0, s);
484 return make_shared<query_spec>((struct prod *)0, s);
485 } catch (runtime_error &e) {
486 return statement_factory(s);
487 }
488}
489
490void common_table_expression::accept(prod_visitor *v)
491{

Callers 1

mainFunction · 0.85

Calls 3

d42Function · 0.85
d6Function · 0.85
new_stmtMethod · 0.80

Tested by

no test coverage detected