Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
Description
PS related C++ code blocks diverged in the two *.yy files.
Under terms of this task we'll synchronize the code.
Let's move these LEX members:
LEX_CSTRING prepared_stmt_name;
|
Item *prepared_stmt_code;
|
List<Item> prepared_stmt_params;
|
into a separate new class Lex_prepared_stmt, move the C++ code blocks to LEX and to the new class as methods and reuse these methods in *.yy files.
In the new reduction the grammar will look as simple as follows:
prepare:
|
PREPARE_SYM ident FROM prepare_src
|
{
|
if (Lex->stmt_prepare($2, $4)) |
MYSQL_YYABORT;
|
}
|
;
|
 |
execute:
|
EXECUTE_SYM ident execute_using
|
{
|
if (Lex->stmt_execute($2, $3)) |
MYSQL_YYABORT;
|
}
|
| EXECUTE_SYM IMMEDIATE_SYM prepare_src execute_using
|
{
|
if (Lex->stmt_execute_immediate($3, $4)) |
MYSQL_YYABORT;
|
}
|
;
|
|
i.e. one method call per statement.
Note, a separate class Lex_prepared_stmt will help to move PS related data structures from LEX to new new classes for all PS based statements:
- Sql_cmd_prepare
- Sql_cmd_deallocate
- Sql_cmd_execute
- Sql_cmd_execute_immediate
This will be done separately, eventually.
Attachments
Issue Links
- blocks
-
MDEV-12518 Unify sql_yacc.yy and sql_yacc_ora.yy
- Closed
- is blocked by
-
MDEV-18806 Synchronize ALTER TABLE EXCHANGE PARTITION and PURGE grammar in sql_yacc.yy and sql_yacc_ora.yy
- Closed