MDEV-35236 Assertion `(mem_root->flags & 4) == 0' failed in safe_lexcstrdup_root

Post-fix for MDEV-35144.

Cannot allocate options values on the statement arena, because
HA_CREATE_INFO is shallow-copied for every execution, so if the
option_list was initially empty, it will be reset for every execution
and any values allocated on the  statement arena will be lost.

Cannot allocate option values on the execution arena, because
HA_CREATE_INFO is shallow-copied for every execution, so if the
option_list was  initially NOT empty, any values appended to the
end will be preserved and if they're on the execution arena their
content will be destroyed.

Let's use thd->change_item_tree() to save and restore necessary pointers
for every execution.

followup for 3da565c41d
This commit is contained in:
Sergei Golubchik 2024-10-23 14:43:32 +02:00
commit 3cd706b107
6 changed files with 46 additions and 12 deletions

View file

@ -89,7 +89,7 @@ bool parse_option_list(THD* thd, void *option_struct,
bool suppress_warning, MEM_ROOT *root);
bool extend_option_list(THD* thd, handlerton *hton, bool create,
engine_option_value **option_list,
ha_create_table_option *rules, MEM_ROOT *root);
ha_create_table_option *rules);
bool engine_table_options_frm_read(const uchar *buff, size_t length,
TABLE_SHARE *share);