| 312 | } |
| 313 | |
| 314 | query_spec::query_spec(prod *p, struct scope *s, bool lateral) : |
| 315 | prod(p), myscope(s) |
| 316 | { |
| 317 | scope = &myscope; |
| 318 | scope->tables = s->tables; |
| 319 | |
| 320 | if (lateral) |
| 321 | scope->refs = s->refs; |
| 322 | |
| 323 | from_clause = make_shared<struct from_clause>(this); |
| 324 | select_list = make_shared<struct select_list>(this); |
| 325 | |
| 326 | set_quantifier = (d100() == 1) ? "distinct" : ""; |
| 327 | |
| 328 | search = bool_expr::factory(this); |
| 329 | |
| 330 | if (d6() > 2) { |
| 331 | ostringstream cons; |
| 332 | cons << "limit " << d100() + d100(); |
| 333 | limit_clause = cons.str(); |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | long prepare_stmt::seq; |
| 338 | |