Commit c1085da6 authored by unknown's avatar unknown

ha_innodb.cc:

  Fix a glitch reported by Guilhem: release the memory allocated for innodb_internal_... if innobase_init() fails; cleanups: in ha_innodb, you should use the InnoDB formatting style for the source code


sql/ha_innodb.cc:
  Fix a glitch reported by Guilhem: release the memory allocated for innodb_internal_... if innobase_init() fails; cleanups: in ha_innodb, you should use the InnoDB formatting style for the source code
parent 602d9a03
...@@ -1079,6 +1079,8 @@ innobase_init(void) ...@@ -1079,6 +1079,8 @@ innobase_init(void)
if (ret == FALSE) { if (ret == FALSE) {
sql_print_error( sql_print_error(
"InnoDB: syntax error in innodb_data_file_path"); "InnoDB: syntax error in innodb_data_file_path");
my_free(internal_innobase_data_file_path,
MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
...@@ -1109,6 +1111,8 @@ innobase_init(void) ...@@ -1109,6 +1111,8 @@ innobase_init(void)
"InnoDB: syntax error in innodb_log_group_home_dir\n" "InnoDB: syntax error in innodb_log_group_home_dir\n"
"InnoDB: or a wrong number of mirrored log groups\n"); "InnoDB: or a wrong number of mirrored log groups\n");
my_free(internal_innobase_data_file_path,
MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
...@@ -1197,7 +1201,8 @@ innobase_init(void) ...@@ -1197,7 +1201,8 @@ innobase_init(void)
err = innobase_start_or_create_for_mysql(); err = innobase_start_or_create_for_mysql();
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
my_free(internal_innobase_data_file_path,
MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN(1); DBUG_RETURN(1);
} }
...@@ -1241,22 +1246,22 @@ innobase_end(void) ...@@ -1241,22 +1246,22 @@ innobase_end(void)
set_panic_flag_for_netware(); set_panic_flag_for_netware();
} }
#endif #endif
if (innodb_inited) if (innodb_inited) {
{
if (innobase_very_fast_shutdown) { if (innobase_very_fast_shutdown) {
srv_very_fast_shutdown = TRUE; srv_very_fast_shutdown = TRUE;
fprintf(stderr, fprintf(stderr,
"InnoDB: MySQL has requested a very fast shutdown without flushing\n" "InnoDB: MySQL has requested a very fast shutdown without flushing\n"
"InnoDB: the InnoDB buffer pool to data files. At the next mysqld startup\n" "InnoDB: the InnoDB buffer pool to data files. At the next mysqld startup\n"
"InnoDB: InnoDB will do a crash recovery!\n"); "InnoDB: InnoDB will do a crash recovery!\n");
} }
innodb_inited= 0; innodb_inited = 0;
if (innobase_shutdown_for_mysql() != DB_SUCCESS) if (innobase_shutdown_for_mysql() != DB_SUCCESS) {
err= 1; err = 1;
}
hash_free(&innobase_open_tables); hash_free(&innobase_open_tables);
my_free(internal_innobase_data_file_path,MYF(MY_ALLOW_ZERO_PTR)); my_free(internal_innobase_data_file_path,
MYF(MY_ALLOW_ZERO_PTR));
pthread_mutex_destroy(&innobase_mutex); pthread_mutex_destroy(&innobase_mutex);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment