| 2343 | // |
| 2344 | |
| 2345 | static gpre_nod* par_plan( gpre_req* request) |
| 2346 | { |
| 2347 | assert_IS_REQ(request); |
| 2348 | |
| 2349 | // parse the join type |
| 2350 | |
| 2351 | nod_t nod_type; |
| 2352 | if (MSC_match(KW_JOIN)) |
| 2353 | nod_type = nod_join; |
| 2354 | else if (MSC_match(KW_MERGE)) |
| 2355 | nod_type = nod_merge; |
| 2356 | else if (MSC_match(KW_SORT) && MSC_match(KW_MERGE)) |
| 2357 | nod_type = nod_merge; |
| 2358 | else |
| 2359 | nod_type = nod_join; |
| 2360 | |
| 2361 | // make up the plan expression node |
| 2362 | |
| 2363 | gpre_nod* plan_expression = MSC_node(nod_plan_expr, 2); |
| 2364 | |
| 2365 | if (nod_type != nod_join) |
| 2366 | plan_expression->nod_arg[0] = MSC_node(nod_type, 0); |
| 2367 | |
| 2368 | // parse the plan items at this level |
| 2369 | |
| 2370 | EXP_left_paren(0); |
| 2371 | |
| 2372 | plan_expression->nod_arg[1] = SQE_list(par_plan_item, request, false); |
| 2373 | |
| 2374 | if (!EXP_match_paren()) |
| 2375 | return NULL; |
| 2376 | return plan_expression; |
| 2377 | } |
| 2378 | |
| 2379 | |
| 2380 | //____________________________________________________________ |
no test coverage detected