diff options
author | unknown <monty@hundin.mysql.fi> | 2002-02-07 21:34:35 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-02-07 21:34:35 +0200 |
commit | 3942e44524777ead3d8c5dd314fd0b7bc3e13f32 (patch) | |
tree | 67009f11ad55cd9073d02909883f5369a74f101f /sql/sql_table.cc | |
parent | 8a56717c4ce14aa7e36e04a8dc880dcc1311ea28 (diff) | |
download | mariadb-git-3942e44524777ead3d8c5dd314fd0b7bc3e13f32.tar.gz |
Update to autoconf 2.52
Fix of InnoDB variables in SHOW VARIABLES
Fix for ALTER TABLE and InnoDB
BUILD/FINISH.sh:
Update to autoconf 2.52
BUILD/SETUP.sh:
Update to autoconf 2.52
BUILD/compile-alpha:
Update to autoconf 2.52
BUILD/compile-pentium-gcov:
Update to autoconf 2.52
BUILD/compile-pentium-gprof:
Update to autoconf 2.52
BUILD/compile-pentium:
Update to autoconf 2.52
Docs/manual.texi:
Changelog
acconfig.h:
Update to autoconf 2.52
acinclude.m4:
Update to autoconf 2.52
bdb/dist/configure.in:
Update to autoconf 2.52
client/Makefile.am:
Update to autoconf 2.52
configure.in:
Update to autoconf 2.52
mysql-test/r/innodb.result:
Update of InnoDB Cardinality values
mysys/Makefile.am:
Update to autoconf 2.52
scripts/Makefile.am:
Update to autoconf 2.52
sql/ha_innobase.cc:
Fix of InnoDB variables in SHOW VARIABLES
sql/ha_innobase.h:
Fix of InnoDB variables in SHOW VARIABLES
sql/sql_table.cc:
Fix for ALTER TABLE and InnoDB
support-files/my-huge.cnf.sh:
Fixed typo
support-files/my-large.cnf.sh:
Fixed typo
support-files/my-medium.cnf.sh:
Fixed typo
support-files/my-small.cnf.sh:
Fixed typo
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 33 |
1 files changed, 21 insertions, 12 deletions
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)) { |