diff options
author | unknown <thek@adventure.(none)> | 2007-07-02 21:03:10 +0200 |
---|---|---|
committer | unknown <thek@adventure.(none)> | 2007-07-02 21:03:10 +0200 |
commit | be11de7a8ed93e5dd5d5abd1ca2e9ca5c3922db7 (patch) | |
tree | 22952496fda992e3bdada73b563098c2f9e3bbea /sql/sql_rename.cc | |
parent | 3fcaaceaa99050df9cd23a6e0480dc2b8b8c688b (diff) | |
parent | 289cc26c646f5a45e2c9fc6c0bb75f6f61d301a1 (diff) | |
download | mariadb-git-be11de7a8ed93e5dd5d5abd1ca2e9ca5c3922db7.tar.gz |
Merge adventure.(none):/home/thek/Development/cpp/bug21074/my51-bug21074
into adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime
sql/ha_ndbcluster.cc:
Auto merged
sql/lock.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_db.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_rename.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_trigger.cc:
Auto merged
sql/sql_cache.cc:
Manual merge.
Diffstat (limited to 'sql/sql_rename.cc')
-rw-r--r-- | sql/sql_rename.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index 866d82377c0..e68a360f2d4 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -144,10 +144,14 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent) } } - VOID(pthread_mutex_lock(&LOCK_open)); - if (lock_table_names(thd, table_list)) + pthread_mutex_lock(&LOCK_open); + if (lock_table_names_exclusively(thd, table_list)) + { + pthread_mutex_unlock(&LOCK_open); goto err; - + } + pthread_mutex_unlock(&LOCK_open); + error=0; if ((ren_table=rename_tables(thd,table_list,0))) { @@ -178,10 +182,14 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent) send_ok(thd); } + if (!error) + query_cache_invalidate3(thd, table_list, 0); + + pthread_mutex_lock(&LOCK_open); unlock_table_names(thd, table_list, (TABLE_LIST*) 0); + pthread_mutex_unlock(&LOCK_open); err: - pthread_mutex_unlock(&LOCK_open); /* enable logging back if needed */ if (disable_logs) { |