summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-02-07 21:53:09 +0200
committerunknown <monty@hundin.mysql.fi>2002-02-07 21:53:09 +0200
commitbac8e19eb572fe2d7f5a4ad922da98705b9ceab8 (patch)
tree708ef39599ea53d1527917fbaba2da01449cf30d /sql
parentda7a480126e86e6ca5048e69ce7e9442e6476d0e (diff)
parenta816b25a1910eb51df01abe9e4ed2bc251042a93 (diff)
downloadmariadb-git-bac8e19eb572fe2d7f5a4ad922da98705b9ceab8.tar.gz
Merge work:/home/bk/mysql into hundin.mysql.fi:/my/bk/mysql
sql/ha_innobase.cc: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innobase.cc2
-rw-r--r--sql/ha_innobase.h5
-rw-r--r--sql/sql_table.cc33
3 files changed, 25 insertions, 15 deletions
diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc
index d9fb7d3eb2e..9a4dc070978 100644
--- a/sql/ha_innobase.cc
+++ b/sql/ha_innobase.cc
@@ -85,7 +85,7 @@ long innobase_mirrored_log_groups, innobase_log_files_in_group,
char *innobase_data_home_dir, *innobase_data_file_path;
char *innobase_log_group_home_dir, *innobase_log_arch_dir;
char *innobase_unix_file_flush_method;
-bool innobase_flush_log_at_trx_commit, innobase_log_archive,
+my_bool innobase_flush_log_at_trx_commit, innobase_log_archive,
innobase_use_native_aio, innobase_fast_shutdown;
/* innobase_data_file_path=ibdata:15,idata2:1,... */
diff --git a/sql/ha_innobase.h b/sql/ha_innobase.h
index 54449a1ef2b..ec77cd1a70f 100644
--- a/sql/ha_innobase.h
+++ b/sql/ha_innobase.h
@@ -174,8 +174,9 @@ extern long innobase_force_recovery, innobase_thread_concurrency;
extern char *innobase_data_home_dir, *innobase_data_file_path;
extern char *innobase_log_group_home_dir, *innobase_log_arch_dir;
extern char *innobase_unix_file_flush_method;
-extern bool innobase_flush_log_at_trx_commit, innobase_log_archive,
- innobase_use_native_aio, innobase_fast_shutdown;
+/* The following variables have to be my_bool for SHOW VARIABLES to work */
+extern my_bool innobase_flush_log_at_trx_commit, innobase_log_archive,
+ innobase_use_native_aio, innobase_fast_shutdown;
extern TYPELIB innobase_lock_typelib;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index aa54f325ebb..62ebf04a9f3 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -771,7 +771,7 @@ bool close_cached_table(THD *thd,TABLE *table)
/* Mark all tables that are in use as 'old' */
mysql_lock_abort(thd,table); // end threads waiting on lock
-#ifdef REMOVE_LOCKS
+#if defined(USING_TRANSACTIONS) || defined( __WIN__) || defined( __EMX__) || !defined(OS2)
/* Wait until all there are no other threads that has this table open */
while (remove_table_from_cache(thd,table->table_cache_key,
table->table_name))
@@ -1569,20 +1569,29 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
}
-#if defined( __WIN__) || defined( __EMX__) || defined( OS2)
- // Win32 can't rename an open table, so we must close the org table!
- table_name=thd->strdup(table_name); // must be saved
- if (close_cached_table(thd,table))
- { // Aborted
- VOID(quick_rm_table(new_db_type,new_db,tmp_name));
- VOID(pthread_mutex_unlock(&LOCK_open));
- goto err;
+#if (!defined( __WIN__) && !defined( __EMX__) && !defined( OS2))
+ if (table->file->has_transactions())
+#endif
+ {
+ /*
+ Win32 and InnoDB can't rename an open table, so we must close
+ the original table at before doing the rename
+ */
+ table_name=thd->strdup(table_name); // must be saved
+ if (close_cached_table(thd,table))
+ { // Aborted
+ VOID(quick_rm_table(new_db_type,new_db,tmp_name));
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ goto err;
+ }
+ table=0; // Marker that table is closed
}
- table=0; // Marker for win32 version
-#else
- table->file->extra(HA_EXTRA_FORCE_REOPEN); // Don't use this file anymore
+#if (!defined( __WIN__) && !defined( __EMX__) && !defined( OS2))
+ else
+ table->file->extra(HA_EXTRA_FORCE_REOPEN); // Don't use this file anymore
#endif
+
error=0;
if (mysql_rename_table(old_db_type,db,table_name,db,old_name))
{