| 539 | } |
| 540 | |
| 541 | merge_stmt::merge_stmt(prod *p, struct scope *s, table *v) |
| 542 | : modifying_stmt(p,s,v) { |
| 543 | match(); |
| 544 | target_table_ = make_shared<target_table>(this, victim); |
| 545 | data_source = table_ref::factory(this); |
| 546 | // join_condition = join_cond::factory(this, *target_table_, *data_source); |
| 547 | join_condition = make_shared<simple_join_cond>(this, *target_table_, *data_source); |
| 548 | |
| 549 | |
| 550 | /* Put data_source into scope but not target_table. Visibility of |
| 551 | the latter varies depending on kind of when clause. */ |
| 552 | // for (auto r : data_source->refs) |
| 553 | // scope->refs.push_back(&*r); |
| 554 | |
| 555 | clauselist.push_back(when_clause::factory(this)); |
| 556 | while (d6()>4) |
| 557 | clauselist.push_back(when_clause::factory(this)); |
| 558 | } |
| 559 | |
| 560 | void merge_stmt::out(std::ostream &out) |
| 561 | { |