mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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
This commit is contained in:
11
sql/lock.cc
11
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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user