1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Merge to get fix for LOCK TABLES + DROP TABLE in another thread

BitKeeper/etc/ignore:
  auto-union
BitKeeper/deleted/.del-delete.result:
  Delete: mysql-test/r/delete.result
client/mysqlbinlog.cc:
  Auto merged
libmysql/libmysql.c:
  Auto merged
mysql-test/t/delete.test:
  Auto merged
mysql-test/t/type_datetime.test:
  Auto merged
sql/field.h:
  Auto merged
sql/lock.cc:
  Auto merged
sql/share/polish/errmsg.txt:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/type_datetime.result:
  Update results after merge
sql/log_event.h:
  Use local version
sql/mysql_priv.h:
  Use local version
sql/mysqld.cc:
  Use local version
sql/sql_repl.h:
  Use local version
This commit is contained in:
unknown
2003-03-07 01:20:56 +02:00
13 changed files with 160 additions and 40 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -80,7 +80,6 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists)
{
my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE,MYF(0),
tables->real_name);
error = 1;
goto err;
}
while (global_read_lock && ! thd->killed)
@@ -93,7 +92,6 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists)
err:
pthread_mutex_unlock(&LOCK_open);
VOID(pthread_cond_broadcast(&COND_refresh)); // Signal to refresh
pthread_mutex_lock(&thd->mysys_var->mutex);
thd->mysys_var->current_mutex= 0;
@@ -138,7 +136,6 @@ int mysql_rm_table_part2_with_lock(THD *thd,
error=mysql_rm_table_part2(thd,tables, if_exists, dont_log_query);
pthread_mutex_unlock(&LOCK_open);
VOID(pthread_cond_broadcast(&COND_refresh)); // Signal to refresh
pthread_mutex_lock(&thd->mysys_var->mutex);
thd->mysys_var->current_mutex= 0;
@@ -171,6 +168,9 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
bool some_tables_deleted=0, tmp_table_deleted=0;
DBUG_ENTER("mysql_rm_table_part2");
if (lock_table_names(thd, tables))
DBUG_RETURN(1);
for (table=tables ; table ; table=table->next)
{
char *db=table->db ? table->db : thd->db;
@@ -242,11 +242,12 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
}
}
error = 0;
unlock_table_names(thd, tables);
error= 0;
if (wrong_tables.length())
{
my_error(ER_BAD_TABLE_ERROR,MYF(0),wrong_tables.c_ptr());
error=1;
error= 1;
}
DBUG_RETURN(error);
}