summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <mikael@zim.(none)>2006-05-03 01:04:14 -0700
committerunknown <mikael@zim.(none)>2006-05-03 01:04:14 -0700
commit5aaba88e39c1c4874402d9684ee58d1a72e21f64 (patch)
tree46729fe336401503111d5d3c65817a04debd5aa8 /sql
parent90760a98907b668befa1c5af8547674f1ceaf609 (diff)
parente961e5591e201072501c725396839de176ecac0f (diff)
downloadmariadb-git-5aaba88e39c1c4874402d9684ee58d1a72e21f64.tar.gz
Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into zim.(none):/home/mikael/bug19313 sql/sql_table.cc: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_table.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 412682fc3b0..77e6d6dfd21 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -428,10 +428,6 @@ static uint read_ddl_log_header()
bool successful_open= FALSE;
DBUG_ENTER("read_ddl_log_header");
- bzero(file_entry_buf, sizeof(global_ddl_log.file_entry_buf));
- global_ddl_log.inited= FALSE;
- global_ddl_log.recovery_phase= TRUE;
- global_ddl_log.io_size= IO_SIZE;
create_ddl_log_file_name(file_name);
if ((global_ddl_log.file_id= my_open(file_name,
O_RDWR | O_BINARY, MYF(MY_WME))) >= 0)
@@ -1068,6 +1064,15 @@ void execute_ddl_log_recovery()
DBUG_ENTER("execute_ddl_log_recovery");
/*
+ Initialise global_ddl_log struct
+ */
+ bzero(global_ddl_log.file_entry_buf, sizeof(global_ddl_log.file_entry_buf));
+ global_ddl_log.inited= FALSE;
+ global_ddl_log.recovery_phase= TRUE;
+ global_ddl_log.io_size= IO_SIZE;
+ global_ddl_log.file_id=(File)-1;
+
+ /*
To be able to run this from boot, we allocate a temporary THD
*/
if (!(thd=new THD))
@@ -1130,7 +1135,8 @@ void release_ddl_log()
my_free((char*)free_list, MYF(0));
free_list= tmp;
}
- VOID(my_close(global_ddl_log.file_id, MYF(0)));
+ if (global_ddl_log.file_id != (File)-1)
+ VOID(my_close(global_ddl_log.file_id, MYF(0)));
pthread_mutex_unlock(&LOCK_gdl);
VOID(pthread_mutex_destroy(&LOCK_gdl));
DBUG_VOID_RETURN;