summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/sql_base.cc45
-rw-r--r--sql/sql_base.h2
-rw-r--r--sql/sql_db.cc4
3 files changed, 1 insertions, 50 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 426c9db2717..ea688ad6e0f 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2412,51 +2412,6 @@ void drop_open_table(THD *thd, TABLE *table, const char *db_name,
}
-/*
- Wait for condition but allow the user to send a kill to mysqld
-
- SYNOPSIS
- wait_for_condition()
- thd Thread handler
- mutex mutex that is currently hold that is associated with condition
- Will be unlocked on return
- cond Condition to wait for
-*/
-
-void wait_for_condition(THD *thd, mysql_mutex_t *mutex, mysql_cond_t *cond)
-{
- /* Wait until the current table is up to date */
- const char *proc_info;
- thd->mysys_var->current_mutex= mutex;
- thd->mysys_var->current_cond= cond;
- proc_info=thd->proc_info;
- thd_proc_info(thd, "Waiting for table");
- DBUG_ENTER("wait_for_condition");
- DEBUG_SYNC(thd, "waiting_for_table");
- if (!thd->killed)
- mysql_cond_wait(cond, mutex);
-
- /*
- We must unlock mutex first to avoid deadlock becasue conditions are
- sent to this thread by doing locks in the following order:
- lock(mysys_var->mutex)
- lock(mysys_var->current_mutex)
-
- One by effect of this that one can only use wait_for_condition with
- condition variables that are guranteed to not disapper (freed) even if this
- mutex is unlocked
- */
-
- mysql_mutex_unlock(mutex);
- mysql_mutex_lock(&thd->mysys_var->mutex);
- thd->mysys_var->current_mutex= 0;
- thd->mysys_var->current_cond= 0;
- thd_proc_info(thd, proc_info);
- mysql_mutex_unlock(&thd->mysys_var->mutex);
- DBUG_VOID_RETURN;
-}
-
-
/**
Check that table exists in table definition cache, on disk
or in some storage engine.
diff --git a/sql/sql_base.h b/sql/sql_base.h
index 67e5601663a..24669bd2597 100644
--- a/sql/sql_base.h
+++ b/sql/sql_base.h
@@ -203,8 +203,6 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
COND **conds);
int setup_ftfuncs(SELECT_LEX* select);
int init_ftfuncs(THD *thd, SELECT_LEX* select, bool no_order);
-void wait_for_condition(THD *thd, mysql_mutex_t *mutex,
- mysql_cond_t *cond);
bool lock_table_names(THD *thd, TABLE_LIST *table_list,
TABLE_LIST *table_list_end, ulong lock_wait_timeout,
uint flags);
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index c4a7dc53972..fe4b112196c 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -21,14 +21,12 @@
#include "unireg.h"
#include "sql_db.h"
#include "sql_cache.h" // query_cache_*
-#include "lock.h" // wait_if_global_read_lock,
- // start_waiting_global_read_lock
+#include "lock.h" // lock_schema_name
#include "sql_table.h" // build_table_filename,
// filename_to_tablename
#include "sql_rename.h" // mysql_rename_tables
#include "sql_acl.h" // SELECT_ACL, DB_ACLS,
// acl_get, check_grant_db
-#include "sql_base.h" // wait_for_condition
#include "log_event.h" // Query_log_event
#include <mysys_err.h>
#include "sp.h"