summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2017-08-09 08:56:11 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2017-08-09 08:56:11 +0300
commit56b03e308fb4c0feee166ddf6a707d855affa3c3 (patch)
treefc4e16093800cf4cbf1cc54fceb0b7280c4212ba /sql/lock.cc
parent4f40f87c48a9ee252f797b5d760a6b6f07cc3815 (diff)
parenta346a5613ee7c0b17b0b4ce377659c996ef6bb75 (diff)
downloadmariadb-git-56b03e308fb4c0feee166ddf6a707d855affa3c3.tar.gz
Merge tag 'mariadb-10.0.32' into 10.0-galera
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc37
1 files changed, 3 insertions, 34 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index f7b9980ef05..965f7dcab99 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -96,7 +96,6 @@ extern HASH open_cache;
static int lock_external(THD *thd, TABLE **table,uint count);
static int unlock_external(THD *thd, TABLE **table,uint count);
-static void print_lock_error(int error, TABLE *);
/* Map the return value of thr_lock to an error from errmsg.txt */
static int thr_lock_errno_to_mysql[]=
@@ -374,7 +373,7 @@ static int lock_external(THD *thd, TABLE **tables, uint count)
if ((error=(*tables)->file->ha_external_lock(thd,lock_type)))
{
- print_lock_error(error, *tables);
+ (*tables)->file->print_error(error, MYF(0));
while (--i)
{
tables--;
@@ -691,8 +690,8 @@ static int unlock_external(THD *thd, TABLE **table,uint count)
(*table)->current_lock = F_UNLCK;
if ((error=(*table)->file->ha_external_lock(thd, F_UNLCK)))
{
- error_code=error;
- print_lock_error(error_code, *table);
+ error_code= error;
+ (*table)->file->print_error(error, MYF(0));
}
}
table++;
@@ -914,36 +913,6 @@ bool lock_object_name(THD *thd, MDL_key::enum_mdl_namespace mdl_type,
}
-static void print_lock_error(int error, TABLE *table)
-{
- int textno;
- DBUG_ENTER("print_lock_error");
-
- switch (error) {
- case HA_ERR_LOCK_WAIT_TIMEOUT:
- textno=ER_LOCK_WAIT_TIMEOUT;
- break;
- case HA_ERR_READ_ONLY_TRANSACTION:
- textno=ER_READ_ONLY_TRANSACTION;
- break;
- case HA_ERR_LOCK_DEADLOCK:
- textno=ER_LOCK_DEADLOCK;
- break;
- case HA_ERR_WRONG_COMMAND:
- my_error(ER_ILLEGAL_HA, MYF(0), table->file->table_type(),
- table->s->db.str, table->s->table_name.str);
- DBUG_VOID_RETURN;
- default:
- textno=ER_CANT_LOCK;
- break;
- }
-
- my_error(textno, MYF(0), error);
-
- DBUG_VOID_RETURN;
-}
-
-
/****************************************************************************
Handling of global read locks