Hi, Nikita, On Sep 29, Nikita Malyavin wrote:
revision-id: ad6a305d84d (mariadb-11.2.1-9-gad6a305d84d) parent(s): 132c56f1325 author: Nikita Malyavin committer: Nikita Malyavin timestamp: 2023-09-23 11:46:36 +0400 message:
online alter: use thd->ha_data to store cache_list
nice
diff --git a/sql/online_alter.cc b/sql/online_alter.cc index 3255fc06c3e..5ad2156cd21 100644 --- a/sql/online_alter.cc +++ b/sql/online_alter.cc @@ -6,6 +6,7 @@
static handlerton *online_alter_hton;
+using Online_alter_cache_list= ilist<online_alter_cache_data>;
please, use typedef for that
class online_alter_cache_data: public Sql_alloc, public ilist_node<>, public binlog_cache_data @@ -246,7 +268,11 @@ int online_alter_savepoint_rollback(THD *thd, LEX_CSTRING name)
static int online_alter_close_connection(handlerton *hton, THD *thd) { - DBUG_ASSERT(thd->online_alter_cache_list.empty()); + Ha_data &ha= thd->ha_data[online_alter_hton->slot]; + auto *cache_list= (Online_alter_cache_list*)ha.ha_ptr;
why not thd_get_ha_data()? and don't forget thd_set_ha_data(thd, online_alter_hton, 0); THD can be reused, I suppose, so let's play safe.
+ + DBUG_ASSERT(!cache_list || cache_list->empty()); + delete cache_list; return 0; }
Regards, Sergei Chief Architect, MariaDB Server and security@mariadb.org