summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <gluh@gluh.mysql.r18.ru>2005-01-25 11:42:50 +0300
committerunknown <gluh@gluh.mysql.r18.ru>2005-01-25 11:42:50 +0300
commit37c4eadb46464a5e9c85a1349e85074cec9523cc (patch)
tree1bf92f11765e6868fed040ddfa7b581ba289fe55 /sql/sql_base.cc
parente9db02074f1a4c78c02eff7f5c8f02362d91ae05 (diff)
parentb796a7e4d01b740ac53913f6312445ee2619afc3 (diff)
downloadmariadb-git-37c4eadb46464a5e9c85a1349e85074cec9523cc.tar.gz
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0
into gluh.mysql.r18.ru:/home/gluh/MySQL/mysql-5.0 sql/sql_base.cc: Auto merged sql/sql_parse.cc: Auto merged
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 709083b3dec..0aa9f842691 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -261,13 +261,19 @@ void free_io_cache(TABLE *table)
DBUG_VOID_RETURN;
}
- /* Close all tables which aren't in use by any thread */
+/*
+ Close all tables which aren't in use by any thread
+
+ THD can be NULL, but then if_wait_for_refresh must be FALSE
+ and tables must be NULL.
+*/
bool close_cached_tables(THD *thd, bool if_wait_for_refresh,
TABLE_LIST *tables)
{
bool result=0;
DBUG_ENTER("close_cached_tables");
+ DBUG_ASSERT(thd || (!if_wait_for_refresh && !tables));
VOID(pthread_mutex_lock(&LOCK_open));
if (!tables)
@@ -343,7 +349,6 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh,
VOID(pthread_mutex_unlock(&LOCK_open));
if (if_wait_for_refresh)
{
- THD *thd=current_thd;
pthread_mutex_lock(&thd->mysys_var->mutex);
thd->mysys_var->current_mutex= 0;
thd->mysys_var->current_cond= 0;
@@ -2409,11 +2414,7 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
strxnmov(buff,sizeof(buff)-1,db,".",table_name,NullS);
table_name=buff;
}
- if (report_error == REPORT_ALL_ERRORS ||
- report_error == REPORT_EXCEPT_NON_UNIQUE)
- my_error(ER_UNKNOWN_TABLE, MYF(0), table_name, thd->where);
- else
- return (Field*) not_found_field;
+ my_error(ER_UNKNOWN_TABLE, MYF(0), table_name, thd->where);
}
else
if (report_error == REPORT_ALL_ERRORS ||