summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <serg@serg.mysql.com>2002-10-25 21:15:52 +0000
committerunknown <serg@serg.mysql.com>2002-10-25 21:15:52 +0000
commitf5563ddad40e8ab84d457b0e9960ddfdc7faec99 (patch)
tree30c13439b168df68d4884a7403a173a8970cc56e /sql/sql_table.cc
parent68a5932ab2b5e39858fa03934cbbe5c90042497e (diff)
parent43abd169b081479cb6ce1ad510a2620a2bb50db8 (diff)
downloadmariadb-git-f5563ddad40e8ab84d457b0e9960ddfdc7faec99.tar.gz
merged
BitKeeper/etc/gone: auto-union BitKeeper/etc/logging_ok: auto-union BitKeeper/deleted/.del-skipkeys~53ffbfa7d2fa9fb: Delete: BitKeeper/etc/skipkeys BitKeeper/etc/skipkeys: Rename: BitKeeper/deleted/.del-skipkeys~f623848ba4db5c3 -> BitKeeper/etc/skipkeys Build-tools/Do-compile: Auto merged Docs/manual.texi: Auto merged innobase/pars/lexyy.c: Auto merged innobase/pars/pars0grm.c: Auto merged mysys/my_init.c: Auto merged scripts/mysqlhotcopy.sh: Auto merged sql/nt_servc.cc: Auto merged sql/nt_servc.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_table.cc: Auto merged mysql-test/t/bdb-crash.test: Auto merged
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index bca7b79c132..865b30cdb39 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1910,16 +1910,24 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
#ifdef HAVE_BERKELEY_DB
if (old_db_type == DB_TYPE_BERKELEY_DB)
{
- (void) berkeley_flush_logs();
/*
For the alter table to be properly flushed to the logs, we
have to open the new table. If not, we get a problem on server
shutdown.
*/
- if (!open_tables(thd, table_list)) // Should always succeed
+ char path[FN_REFLEN];
+ (void) sprintf(path,"%s/%s/%s",mysql_data_home,new_db,table_name);
+ fn_format(path,path,"","",4);
+ table=open_temporary_table(thd, path, new_db, tmp_name,0);
+ if (table)
{
- close_thread_table(thd, &table_list->table);
+ intern_close_table(table);
+ my_free((char*) table, MYF(0));
}
+ else
+ sql_print_error("Warning: Could not open BDB table %s.%s after rename\n",
+ new_db,table_name);
+ (void) berkeley_flush_logs();
}
#endif
table_list->table=0; // For query cache