summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2002-10-24 01:36:58 +0300
committermonty@hundin.mysql.fi <>2002-10-24 01:36:58 +0300
commit1cd37aad808314a8d1e6400c09ba179ac990f63e (patch)
tree2a02ab4a75472f0c5d85d3675d53854956ff33c5
parent5459505bba0bb30ca36ab427b40ad9236075f84d (diff)
parent36afa9a96e04e5621590ffa35a827ce9793d27d3 (diff)
downloadmariadb-git-1cd37aad808314a8d1e6400c09ba179ac990f63e.tar.gz
Merge work:/my/mysql-3.23 into hundin.mysql.fi:/my/mysql-3.23
-rw-r--r--Docs/manual.texi2
-rw-r--r--mysql-test/t/bdb-crash.test2
-rw-r--r--sql/sql_base.cc1
-rw-r--r--sql/sql_table.cc14
4 files changed, 16 insertions, 3 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi
index 158db75a407..cb0f2236bb9 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -46930,6 +46930,8 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.54
@itemize
@item
+Fixed a problem with BDB and @code{ALTER TABLE}.
+@item
Fixed reference to freed memory when doing complicated @code{GROUP BY
... ORDER BY} queries. Symptom was that @code{mysqld} died in function
@code{send_fields}.
diff --git a/mysql-test/t/bdb-crash.test b/mysql-test/t/bdb-crash.test
index 55e00ad2a5e..0005b631a46 100644
--- a/mysql-test/t/bdb-crash.test
+++ b/mysql-test/t/bdb-crash.test
@@ -1,3 +1,5 @@
+-- source include/have_bdb.inc
+
# test for bug reported by Mark Steele
drop table if exists t1;
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 6e0472cd149..6b445442058 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1530,6 +1530,7 @@ TABLE *open_temporary_table(THD *thd, const char *path, const char *db,
ha_open_options,
tmp_table))
{
+ my_free((char*) tmp_table,MYF(0));
DBUG_RETURN(0);
}
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index c22c6ae9266..0a09b6232e8 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1680,16 +1680,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