diff options
author | unknown <monty@mashka.mysql.fi> | 2002-09-03 15:53:07 +0300 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-09-03 15:53:07 +0300 |
commit | 35115d9a509933f141ec835d5da7930233e9e3a3 (patch) | |
tree | 86282cab0897280d73f2d591496d1ebd35ab09fd /sql/sql_table.cc | |
parent | c8f6ea2c7c0ae7521025a7ed25d5ee40bd1f9b69 (diff) | |
download | mariadb-git-35115d9a509933f141ec835d5da7930233e9e3a3.tar.gz |
Check if AND/OR expression can be NULL
Better fix for ALTER TABLE on BDB tables
(Both of the above fixes are already in 4.0)
Docs/manual.texi:
Changelog
sql/item_cmpfunc.cc:
Check if AND/OR expression can be NULL
sql/sql_table.cc:
Better fix for ALTER TABLE on BDB tables
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 534b267403c..2bb46b5c47d 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -19,6 +19,9 @@ #include "mysql_priv.h" #include <hash.h> +#ifdef HAVE_BERKELEY_DB +#include <ha_berkeley.h> +#endif #include <myisam.h> #ifdef __WIN__ @@ -1675,11 +1678,18 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, VOID(pthread_cond_broadcast(&COND_refresh)); VOID(pthread_mutex_unlock(&LOCK_open)); #ifdef HAVE_BERKELEY_DB - extern bool berkeley_flush_logs(void); if (old_db_type == DB_TYPE_BERKELEY_DB) { - (void)berkeley_flush_logs(); - table=open_ltable(thd,table_list,TL_READ); + (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 + { + close_thread_table(thd, &table_list->table); + } } #endif |