From 953f847aedcba6de1ca3a3693e798840bc461134 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 28 Oct 2024 10:29:27 +0100 Subject: [PATCH] Post-fix for MDEV-35236 when the option_list is initially empty, its value doesn't need to be restored, as it'll be shallow-copied every time. Furthermore, the CREATE_INFO is allocated on the stack, so it's even wrong to restore it after its frame was left. followup for 3cd706b107d --- sql/create_options.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/create_options.cc b/sql/create_options.cc index c4d320f7843..ba988456643 100644 --- a/sql/create_options.cc +++ b/sql/create_options.cc @@ -285,8 +285,8 @@ bool extend_option_list(THD* thd, handlerton *hton, bool create, { if (!extended) { - void *pos= *option_list ? &(last->next) : option_list; - thd->register_item_tree_change((Item**)pos); + if (*option_list) + thd->register_item_tree_change((Item**)&(last->next)); extended= true; } new (root) engine_option_value(name, value,