[MDEV-4048] check that plugins_foreach isn't called under thd->LOCK_ha_data Created: 2013-01-15  Updated: 2013-03-23  Resolved: 2013-03-23

Status: Closed
Project: MariaDB Server
Component/s: None
Fix Version/s: 10.0.2

Type: Task Priority: Minor
Reporter: Sergei Golubchik Assignee: Sergei Golubchik
Resolution: Incomplete Votes: 0
Labels: None


 Description   

check that plugins_foreach isn't called under thd->LOCK_ha_data.

either with mysql_mutex_assert_not_owner()
or with mysql_mutex_record_order()

note this change:

=== modified file 'sql/sql_class.cc'
--- sql/sql_class.cc	2012-12-20 23:12:37 +0000
+++ sql/sql_class.cc	2013-01-10 22:22:14 +0000
@@ -736,8 +736,9 @@
     str.append(proc_info);
   }
 
-  mysql_mutex_lock(&thd->LOCK_thd_data);
-
+  /* Don't wait if LOCK_thd_data is used as this could cause a deadlock */
+  if (!mysql_mutex_trylock(&thd->LOCK_thd_data))
+  {
   if (thd->query())
   {
     if (max_query_len < 1)


Generated at Thu Feb 08 06:53:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.