| 2513 | // |
| 2514 | |
| 2515 | static gpre_nod* par_primitive_value(gpre_req* request, bool aster_ok, |
| 2516 | USHORT* paren_count, bool* bool_flag) |
| 2517 | { |
| 2518 | USHORT local_count; |
| 2519 | |
| 2520 | assert_IS_REQ(request); |
| 2521 | |
| 2522 | gpre_nod* node = 0; |
| 2523 | |
| 2524 | if (!paren_count) |
| 2525 | { |
| 2526 | local_count = 0; |
| 2527 | paren_count = &local_count; |
| 2528 | } |
| 2529 | |
| 2530 | if (MSC_match(KW_SELECT)) |
| 2531 | return par_stat(request); |
| 2532 | |
| 2533 | if (MSC_match(KW_MINUS)) |
| 2534 | return MSC_unary(nod_negate, par_primitive_value(request, false, paren_count, NULL)); |
| 2535 | |
| 2536 | MSC_match(KW_PLUS); |
| 2537 | |
| 2538 | if (MSC_match(KW_USER)) { |
| 2539 | return MSC_node(nod_user_name, 0); |
| 2540 | } |
| 2541 | |
| 2542 | if (MSC_match(KW_VALUE)) |
| 2543 | { |
| 2544 | // If request is NULL we must be processing a subquery - and |
| 2545 | // without the request to refer to we're kinda hosed |
| 2546 | |
| 2547 | if (!request) |
| 2548 | PAR_error("VALUE cannot be used in this context"); |
| 2549 | const act* action = request->req_actions; |
| 2550 | if (request->req_type != REQ_ddl || !action || |
| 2551 | !(action->act_type == ACT_create_domain || action->act_type == ACT_alter_domain)) |
| 2552 | { |
| 2553 | PAR_error("VALUE cannot be used in this context"); |
| 2554 | } |
| 2555 | |
| 2556 | return MSC_node(nod_dom_value, 0); |
| 2557 | } |
| 2558 | |
| 2559 | if (MSC_match(KW_LEFT_PAREN)) |
| 2560 | { |
| 2561 | (*paren_count)++; |
| 2562 | if (bool_flag && *bool_flag) |
| 2563 | node = SQE_boolean(request, paren_count); |
| 2564 | else |
| 2565 | node = SQE_value(request, false, paren_count, bool_flag); |
| 2566 | EXP_match_paren(); |
| 2567 | (*paren_count)--; |
| 2568 | return node; |
| 2569 | } |
| 2570 | |
| 2571 | // Check for an aggregate statistical expression. If we already have a |
| 2572 | // map defined for the request, we're part of either HAVING or a trailing |
no test coverage detected