summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-09-03 05:16:15 +0300
committerunknown <monty@hundin.mysql.fi>2001-09-03 05:16:15 +0300
commit5160501770aafc0b2b9ee287e5a8b7627b1b51bb (patch)
treee5faac23f2977c577bc7fac42a2b90e5f53f2855 /sql/lock.cc
parentb4a417109c16fcb15c2ad050ba156f1bdf099e5e (diff)
downloadmariadb-git-5160501770aafc0b2b9ee287e5a8b7627b1b51bb.tar.gz
Update of manual with 4.0 changes
Create innodb table space if configuring with InnoDB and not using --skip-innodb Fixes for TRUNCATE TABLE and DROP DATABASE. Docs/manual.texi: Update of manual with 4.0 changes. mysql-test/mysql-test-run.sh: Fixed option --mysqld mysql-test/r/innodb.result: More test cases mysql-test/r/truncate.result: More test cases mysql-test/t/drop.test: More test cases mysql-test/t/innodb.test: More test cases mysql-test/t/truncate.test: More test cases sql/gen_lex_hash.cc: Smaller array sql/ha_innobase.cc: Create innodb table space if not using --skip-innodb sql/lock.cc: Fixed wrong mutex handling in global read lock. sql/md5.c: Fixed bug from merge sql/sql_base.cc: cleanup sql/sql_db.cc: Use new global lock functions. Fixed new bug that database wasn't always dropped. sql/sql_delete.cc: Fixed problem with mysql_truncate() when called from restore_table sql/sql_parse.cc: Fixed error message handling. sql/sql_table.cc: cleanup
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index f523f10b3a7..9ce4137e380 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -394,8 +394,8 @@ int lock_and_wait_for_table_name(THD *thd, TABLE_LIST *table_list)
error=0;
end:
- start_waiting_global_read_lock(thd);
pthread_mutex_unlock(&LOCK_open);
+ start_waiting_global_read_lock(thd);
DBUG_RETURN(error);
}
@@ -532,6 +532,10 @@ bool lock_global_read_lock(THD *thd)
(void) pthread_mutex_lock(&LOCK_open);
const char *old_message=thd->enter_cond(&COND_refresh, &LOCK_open,
"Waiting to get readlock");
+ DBUG_PRINT("info",
+ ("waiting_for: %d protect_against: %d",
+ waiting_for_read_lock, protect_against_global_read_lock));
+
waiting_for_read_lock++;
while (protect_against_global_read_lock && !thd->killed)
pthread_cond_wait(&COND_refresh, &LOCK_open);
@@ -573,8 +577,9 @@ bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh)
if (thd->global_read_lock) // This thread had the read locks
{
my_error(ER_CANT_UPDATE_WITH_READLOCK,MYF(0));
+ (void) pthread_mutex_unlock(&LOCK_open);
DBUG_RETURN(1);
- }
+ }
old_message=thd->enter_cond(&COND_refresh, &LOCK_open,
"Waiting for release of readlock");
while (global_read_lock && ! thd->killed &&
@@ -594,9 +599,11 @@ bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh)
void start_waiting_global_read_lock(THD *thd)
{
bool tmp;
+ DBUG_ENTER("start_waiting_global_read_lock");
(void) pthread_mutex_lock(&LOCK_open);
tmp= (!--protect_against_global_read_lock && waiting_for_read_lock);
(void) pthread_mutex_unlock(&LOCK_open);
if (tmp)
pthread_cond_broadcast(&COND_refresh);
+ DBUG_VOID_RETURN;
}