MDEV-17588, we need to postpone resolving of the storage engine to the handlerton pointer, from `mysql_parse()` time to `mysql_execute_command()` time.
So we need to pass the storage engine name, scanned in the ENGINE=XXX clause, through LEX.
Adding the storage engine name as a member to LEX (directly, or through its parts like HA_CREATE_INFO) is not nice:
- LEX is already huge enough.
- The logic of LEX initialization and updating is already too complex.
The easiest way to solve this would be moving the create table related code to a new class Sql_cmd_create_table, with a member:
and adding the same member to Sql_cmd_alter_table.
The `case SQLCMD_CREATE_TABLE` part of `mysql_execute_command()` will go to `Sql_cmd_create_table::execute()`.
This code in sql_yacc.yy:
will change to:
The code in the rule storage_engines: will go to a new method in THD:
so it can be reused by:
- The `storage_engines` rule
This change should fix