diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2022-10-29 19:22:04 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2022-10-29 19:22:04 +0200 |
commit | 1ebfa2af62246b98e17cd255a9ccd858151b355a (patch) | |
tree | f9cf4670ebe96b46f8e0107acc31f7235ec4c554 /sql/sql_class.cc | |
parent | dd9da61dcfd7f5e675ed876cf38886b29d0ddc57 (diff) | |
parent | 64143741789a3e1c2bb8c6bf627eaec3751af0c6 (diff) | |
download | mariadb-git-1ebfa2af62246b98e17cd255a9ccd858151b355a.tar.gz |
Merge branch '10.6' into 10.7
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 173a0197bb6..ad983ab35d6 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -5111,12 +5111,22 @@ void reset_thd(MYSQL_THD thd) before writing response to client, to provide durability guarantees, in other words, server can't send OK packet before modified data is durable in redo log. -*/ -extern "C" void thd_increment_pending_ops(MYSQL_THD thd) + + NOTE: system THD (those that are not associated with client + connection) do not allows async operations yet. + + @param thd a THD + @return thd + @retval nullptr if this is system THD */ +extern "C" MYSQL_THD thd_increment_pending_ops(MYSQL_THD thd) { + if (!thd || thd->system_thread != NON_SYSTEM_THREAD) + return nullptr; thd->async_state.inc_pending_ops(); + return thd; } + /** This function can be used by plugin/engine to indicate end of async operation (such as end of group commit @@ -5127,6 +5137,8 @@ extern "C" void thd_increment_pending_ops(MYSQL_THD thd) extern "C" void thd_decrement_pending_ops(MYSQL_THD thd) { DBUG_ASSERT(thd); + DBUG_ASSERT(thd->system_thread == NON_SYSTEM_THREAD); + thd_async_state::enum_async_state state; if (thd->async_state.dec_pending_ops(&state) == 0) { |