summaryrefslogtreecommitdiff
path: root/sql/sql_handler.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-10-16 03:08:40 +0300
committerunknown <monty@mashka.mysql.fi>2003-10-16 03:08:40 +0300
commitaff45e1b0733947abde48f712c1af64b4f2549a7 (patch)
treebd2eb4ac5dffdd3ac1af40b53a3680a0a9d78195 /sql/sql_handler.cc
parent893797be02d4dff2e1aafbdb98ac4e33b9726628 (diff)
parent0fc97bc9e5c6c0a4f380841b325f6f0647a90bb5 (diff)
downloadmariadb-git-aff45e1b0733947abde48f712c1af64b4f2549a7.tar.gz
merge with 4.0
BitKeeper/deleted/.del-MYSQL.ICO~d93519b5f0d6ee1: Auto merged client/client_priv.h: Auto merged extra/resolveip.c: Auto merged include/mysql.h: Auto merged include/thr_alarm.h: Auto merged myisam/myisamchk.c: Auto merged scripts/mysql_config.sh: Auto merged scripts/mysqld_safe.sh: Auto merged sql/slave.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_handler.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_test.cc: Auto merged
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r--sql/sql_handler.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 93ab332bcd5..bce1022d5c0 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -33,7 +33,7 @@
The second is to be freeed only on thread end. mysql_ha_open should
then do { handler_items=concat(handler_items, free_list); free_list=0; }
- But !!! do_cammand calls free_root at the end of every query and frees up
+ But !!! do_command calls free_root at the end of every query and frees up
all the sql_alloc'ed memory. It's harder to work around...
*/
@@ -72,7 +72,11 @@ int mysql_ha_close(THD *thd, TABLE_LIST *tables, bool dont_send_ok)
if (*ptr)
{
VOID(pthread_mutex_lock(&LOCK_open));
- close_thread_table(thd, ptr);
+ if (close_thread_table(thd, ptr))
+ {
+ /* Tell threads waiting for refresh that something has happened */
+ VOID(pthread_cond_broadcast(&COND_refresh));
+ }
VOID(pthread_mutex_unlock(&LOCK_open));
}
else
@@ -89,8 +93,11 @@ int mysql_ha_close(THD *thd, TABLE_LIST *tables, bool dont_send_ok)
int mysql_ha_closeall(THD *thd, TABLE_LIST *tables)
{
TABLE **ptr=find_table_ptr_by_name(thd, tables->db, tables->real_name, 0);
- if (*ptr)
- close_thread_table(thd, ptr);
+ if (*ptr && close_thread_table(thd, ptr))
+ {
+ /* Tell threads waiting for refresh that something has happened */
+ VOID(pthread_cond_broadcast(&COND_refresh));
+ }
return 0;
}