summaryrefslogtreecommitdiff
path: root/sql/vers_utils.h
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-10-09 19:08:16 +0300
committerMonty <monty@mariadb.org>2018-12-09 20:49:05 +0200
commitae58cd6b87bf1f872093816691ebdd46bef50c7f (patch)
tree02fc330a4d1296fce819b7345eb5ef6cbc3061dd /sql/vers_utils.h
parent9207a838ededa0d5f40129848de20a2075ab0e44 (diff)
downloadmariadb-git-ae58cd6b87bf1f872093816691ebdd46bef50c7f.tar.gz
Simple cleanups (no logic changes)
Diffstat (limited to 'sql/vers_utils.h')
-rw-r--r--sql/vers_utils.h39
1 files changed, 0 insertions, 39 deletions
diff --git a/sql/vers_utils.h b/sql/vers_utils.h
index e896f84135e..2bea191da9e 100644
--- a/sql/vers_utils.h
+++ b/sql/vers_utils.h
@@ -5,43 +5,4 @@
#include "sql_class.h"
#include "vers_string.h"
-class MDL_auto_lock
-{
- THD *thd;
- TABLE_LIST &table;
- bool error;
-
-public:
- MDL_auto_lock(THD *_thd, TABLE_LIST &_table) :
- thd(_thd), table(_table)
- {
- DBUG_ASSERT(thd);
- MDL_request protection_request;
- if (thd->global_read_lock.can_acquire_protection())
- {
- error= true;
- return;
- }
- protection_request.init(MDL_key::GLOBAL, "", "", MDL_INTENTION_EXCLUSIVE,
- MDL_EXPLICIT);
- error= thd->mdl_context.acquire_lock(&protection_request, thd->variables.lock_wait_timeout);
- if (error)
- return;
-
- table.mdl_request.init(MDL_key::TABLE, table.db.str, table.table_name.str, MDL_EXCLUSIVE, MDL_EXPLICIT);
- error= thd->mdl_context.acquire_lock(&table.mdl_request, thd->variables.lock_wait_timeout);
- thd->mdl_context.release_lock(protection_request.ticket);
- }
- ~MDL_auto_lock()
- {
- if (!error)
- {
- DBUG_ASSERT(table.mdl_request.ticket);
- thd->mdl_context.release_lock(table.mdl_request.ticket);
- table.mdl_request.ticket= NULL;
- }
- }
- bool acquire_error() const { return error; }
-};
-
#endif // VERS_UTILS_INCLUDED