summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authorunknown <mikef@nslinux.bedford.progress.com>2001-05-29 09:29:08 -0400
committerunknown <mikef@nslinux.bedford.progress.com>2001-05-29 09:29:08 -0400
commit9d52381348a5ff15e856d3efc2004bbe36bb39bd (patch)
tree4f346bd1140daed312c2399909b0061ca3c6155d /sql/lock.cc
parentf2c0436616634fc55613114a65e38eec1bfcc010 (diff)
downloadmariadb-git-9d52381348a5ff15e856d3efc2004bbe36bb39bd.tar.gz
Pushing all the Gemini changes above the table handler.
BUILD/FINISH.sh: Add Gemini to configure Docs/manual.texi: Added Gemini content to the manual. acinclude.m4: Add Gemini to configure configure.in: Add Gemini to configure include/my_base.h: transaction isolation level READ UNCOMMITTED does not allow updates include/mysqld_error.h: Added new messages for Lock related failures sql/field.cc: Gemini BLOB support - sql/field.h: Gemini BLOB Support sql/ha_gemini.cc: Gemini Table handler sql/ha_gemini.h: Gemini Table handler sql/handler.cc: Added new messages for Lock related failures Provide the ability to turn off recovery for operations like REPAIR TABLE ans ALTER TABLE sql/handler.h: Add a bit to have full text indexes as an option and define the prototype to optionally turn on and off logging sql/lock.cc: Added new messages for Lock related failures sql/share/czech/errmsg.txt: Added new messages for Lock related failures sql/share/danish/errmsg.txt: Added new messages for Lock related failures sql/share/dutch/errmsg.txt: Added new messages for Lock related failures sql/share/english/errmsg.txt: Added new messages for Lock related failures sql/share/estonian/errmsg.txt: Added new messages for Lock related failures sql/share/french/errmsg.txt: Added new messages for Lock related failures sql/share/german/errmsg.txt: Added new messages for Lock related failures sql/share/greek/errmsg.txt: Added new messages for Lock related failures sql/share/hungarian/errmsg.txt: Added new messages for Lock related failures sql/share/italian/errmsg.txt: Added new messages for Lock related failures sql/share/japanese/errmsg.txt: Added new messages for Lock related failures sql/share/korean/errmsg.txt: Added new messages for Lock related failures sql/share/norwegian-ny/errmsg.txt: Added new messages for Lock related failures sql/share/norwegian/errmsg.txt: Added new messages for Lock related failures sql/share/polish/errmsg.txt: Added new messages for Lock related failures sql/share/portuguese/errmsg.txt: Added new messages for Lock related failures sql/share/romanian/errmsg.txt: Added new messages for Lock related failures sql/share/russian/errmsg.txt: Added new messages for Lock related failures sql/share/slovak/errmsg.txt: Added new messages for Lock related failures sql/share/spanish/errmsg.txt: Added new messages for Lock related failures sql/share/swedish/errmsg.txt: Added new messages for Lock related failures sql/sql_base.cc: Avoidlock table overflow issues when doing an alter table on Windows. This is Gemini specific. sql/sql_table.cc: Add a bit to have full text indexes as an option and define the prototype to optionally turn on and off logging BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc26
1 files changed, 24 insertions, 2 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index 23f81c9c164..1d9aca66e74 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -35,6 +35,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table,uint count,
bool unlock, TABLE **write_locked);
static int lock_external(TABLE **table,uint count);
static int unlock_external(THD *thd, TABLE **table,uint count);
+static void print_lock_error(int error);
MYSQL_LOCK *mysql_lock_tables(THD *thd,TABLE **tables,uint count)
@@ -154,7 +155,7 @@ static int lock_external(TABLE **tables,uint count)
(*tables)->file->external_lock(thd, F_UNLCK);
(*tables)->current_lock=F_UNLCK;
}
- my_error(ER_CANT_LOCK,MYF(ME_BELL+ME_OLDWIN+ME_WAITTANG),error);
+ print_lock_error(error);
DBUG_RETURN(error);
}
else
@@ -325,7 +326,7 @@ static int unlock_external(THD *thd, TABLE **table,uint count)
}
}
if (error_code)
- my_error(ER_CANT_LOCK,MYF(ME_BELL+ME_OLDWIN+ME_WAITTANG),error_code);
+ print_lock_error(error_code);
DBUG_RETURN(error_code);
}
@@ -480,3 +481,24 @@ bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list)
}
DBUG_RETURN(result);
}
+
+static void print_lock_error(int error)
+{
+ 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;
+ default:
+ textno=ER_CANT_LOCK;
+ break;
+ }
+ my_error(textno,MYF(ME_BELL+ME_OLDWIN+ME_WAITTANG),error);
+ DBUG_VOID_RETURN;
+}
+