| 10557 | |
| 10558 | |
| 10559 | bool LEX::direct_call(THD *thd, const Qualified_ident *ident, |
| 10560 | List<Item> *args) |
| 10561 | { |
| 10562 | DBUG_ASSERT(ident); |
| 10563 | if (!ident->spvar()) |
| 10564 | return false; // A procedure call |
| 10565 | |
| 10566 | /* |
| 10567 | ident->part(0) is a known SP variable. |
| 10568 | Search for a procedure method of the variable, e.g.: |
| 10569 | assoc_array_var.delete('key'); |
| 10570 | */ |
| 10571 | Item *item; |
| 10572 | if (!ident->spvar()->type_handler()->has_methods() || |
| 10573 | ident->part(1).is_null() || |
| 10574 | !ident->part(2).is_null()) |
| 10575 | { |
| 10576 | /* |
| 10577 | E.g.: |
| 10578 | spvar_int.method(); -- The SP variable data type does not have methods |
| 10579 | spvar.step1.step2(); -- A 3-step method call of an SP variable |
| 10580 | (we don't have 3-step methods yet) |
| 10581 | */ |
| 10582 | thd->parse_error(ER_SYNTAX_ERROR, ident->pos().str); |
| 10583 | return true; |
| 10584 | } |
| 10585 | |
| 10586 | if (!(item= ident->spvar()->type_handler()-> |
| 10587 | create_item_method_or_error(thd, |
| 10588 | Type_handler::object_method_type_t::PROCEDURE, |
| 10589 | ident->part(0), ident->part(1), |
| 10590 | args, ident->pos()))) |
| 10591 | { |
| 10592 | DBUG_ASSERT(thd->is_error()); |
| 10593 | return true; |
| 10594 | } |
| 10595 | sql_command= SQLCOM_DO; |
| 10596 | DBUG_ASSERT(insert_list == nullptr); |
| 10597 | if (!(insert_list= List<Item>::make(thd->mem_root, item))) |
| 10598 | return true; |
| 10599 | |
| 10600 | return false; |
| 10601 | } |
| 10602 | |
| 10603 | |
| 10604 | bool LEX::assoc_assign_start(THD *thd, Qualified_ident *ident) |
nothing calls this directly
no test coverage detected