| 151 | } |
| 152 | |
| 153 | joined_table::joined_table(prod *p) : table_ref(p) { |
| 154 | lhs = table_ref::factory(this); |
| 155 | rhs = table_ref::factory(this); |
| 156 | |
| 157 | condition = join_cond::factory(this, *lhs, *rhs); |
| 158 | |
| 159 | if (d6()<4) { |
| 160 | type = "inner"; |
| 161 | } else if (d6()<4) { |
| 162 | type = "left"; |
| 163 | } else { |
| 164 | type = "right"; |
| 165 | } |
| 166 | |
| 167 | for (auto ref: lhs->refs) |
| 168 | refs.push_back(ref); |
| 169 | for (auto ref: rhs->refs) |
| 170 | refs.push_back(ref); |
| 171 | } |
| 172 | |
| 173 | void joined_table::out(std::ostream &out) { |
| 174 | out << *lhs; |