summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-03-30 22:13:25 +0300
committerunknown <monty@mysql.com>2004-03-30 22:13:25 +0300
commit7131af822d7803c217b5d6130295b6c45d1ae9d2 (patch)
tree0b847162823e0120e6594218ea49b7cfff43a864 /sql
parent961767fad487e21f94b4a2f1ad81c86c44cbeb0d (diff)
downloadmariadb-git-7131af822d7803c217b5d6130295b6c45d1ae9d2.tar.gz
Force clients to recompile if client lib changes (Bug #3009)
sql/lock.cc: Added comments sql/set_var.h: Indentation fix
Diffstat (limited to 'sql')
-rw-r--r--sql/lock.cc52
-rw-r--r--sql/set_var.h2
2 files changed, 43 insertions, 11 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index 171c880db3e..923932a768a 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -445,14 +445,27 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count,
return sql_lock;
}
+
/*****************************************************************************
-** Lock table based on the name.
-** This is used when we need total access to a closed, not open table
+ Lock table based on the name.
+ This is used when we need total access to a closed, not open table
*****************************************************************************/
/*
Lock and wait for the named lock.
- Returns 0 on ok
+
+ SYNOPSIS
+ lock_and_wait_for_table_name()
+ thd Thread handler
+ table_list Lock first table in this list
+
+
+ NOTES
+ Works together with global read lock.
+
+ RETURN
+ 0 ok
+ 1 error
*/
int lock_and_wait_for_table_name(THD *thd, TABLE_LIST *table_list)
@@ -482,13 +495,28 @@ end:
/*
Put a not open table with an old refresh version in the table cache.
- This will force any other threads that uses the table to release it
- as soon as possible.
- One must have a lock on LOCK_open !
- Return values:
- < 0 error
- == 0 table locked
- > 0 table locked, but someone is using it
+
+ SYNPOSIS
+ lock_table_name()
+ thd Thread handler
+ table_list Lock first table in this list
+
+ WARNING
+ If you are going to update the table, you should use
+ lock_and_wait_for_table_name instead of this function as this works
+ together with 'FLUSH TABLES WITH READ LOCK'
+
+ NOTES
+ This will force any other threads that uses the table to release it
+ as soon as possible.
+
+ REQUIREMENTS
+ One must have a lock on LOCK_open !
+
+ RETURN:
+ < 0 error
+ == 0 table locked
+ > 0 table locked, but someone is using it
*/
int lock_table_name(THD *thd, TABLE_LIST *table_list)
@@ -588,6 +616,10 @@ bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list)
table_list Names of tables to lock
NOTES
+ If you are just locking one table, you should use
+ lock_and_wait_for_table_name().
+
+ REQUIREMENTS
One must have a lock on LOCK_open when calling this
RETURN
diff --git a/sql/set_var.h b/sql/set_var.h
index fbc03af714c..1cac2953a21 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -505,7 +505,7 @@ public:
sys_var_character_set(const char *name_arg) :sys_var_thd(name_arg)
{ nullable= 0; }
bool check(THD *thd, set_var *var);
-SHOW_TYPE type() { return SHOW_CHAR; }
+ SHOW_TYPE type() { return SHOW_CHAR; }
bool check_update_type(Item_result type)
{
return type != STRING_RESULT; /* Only accept strings */