Details
-
Task
-
Status: In Progress (View Workflow)
-
Critical
-
Resolution: Unresolved
-
None
-
Q4/2025 Server Development
Description
Under terms of MDEV-10152 we'll need LEX::sp_add_instr_fetch_cursor() to get the target list as a parameter, to be able to rewrite it correctly (to the data type of the REF CURSOR .. RETURN clause, instead of setting it post-factum with help of the method sp_instr_fetch_cursor::set_fetch_target_list().
Proposal:
- Change the result type of sp_add_instr_fetch_cursor() from sp_instr_fetch_cursor to bool
- Rename sp_add_instr_fetch_cursor() to sp_add_fetch_cursor() to avoid problems during merge (the opposite return value in bool context)
- Add a new parameter to sp_add_fetch_cursor(), so it looks like this:
bool sp_add_fetch_cursor(THD *thd,
const Lex_ident_sys_st &name,
const List<sp_fetch_target> &list);
- Add a new target list parameter to constructors sp_instr_fetch_cursor, sp_instr_cfetch, sp_instr_cfetch_by_ref, remove the methods sp_instr_fetch_cursor::set_fetch_target_list(), sp_instr_fetch_cursor::add_to_fetch_target_list(), as they won't be needed any more.
- Remove from sql_yacc.yy the grammar rule sp_proc_stmt_fetch_head and add instead a new rule
fetch_statement_source:ident { $$= $1; }| FROM ident { $$= $2; }| NEXT_SYM FROM ident { $$= $3; }; - Change the grammar rule sp_proc_stmt_fetch to the following:
sp_proc_stmt_fetch:FETCH_SYM fetch_statement_source INTO sp_fetch_list{if (unlikely(Lex->sp_add_fetch_cursor(thd, $2, *$4)))
MYSQL_YYABORT;}
Attachments
Issue Links
- blocks
-
MDEV-10152 Add support for TYPE .. IS REF CURSOR
-
- In Progress
-