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 71174327
...@@ -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);
} }
...@@ -1155,11 +1159,11 @@ innobase_init(void) ...@@ -1155,11 +1159,11 @@ innobase_init(void)
srv_fast_shutdown = (ibool) innobase_fast_shutdown; srv_fast_shutdown = (ibool) innobase_fast_shutdown;
srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite; srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
srv_use_checksums = (ibool) innobase_use_checksums; srv_use_checksums = (ibool) innobase_use_checksums;
os_use_large_pages = (ibool) innobase_use_large_pages; os_use_large_pages = (ibool) innobase_use_large_pages;
os_large_page_size = (ulint) innobase_large_page_size; os_large_page_size = (ulint) innobase_large_page_size;
srv_file_per_table = (ibool) innobase_file_per_table; srv_file_per_table = (ibool) innobase_file_per_table;
srv_locks_unsafe_for_binlog = (ibool) innobase_locks_unsafe_for_binlog; srv_locks_unsafe_for_binlog = (ibool) innobase_locks_unsafe_for_binlog;
...@@ -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,23 +1246,23 @@ innobase_end(void) ...@@ -1241,23 +1246,23 @@ 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;
if (innobase_shutdown_for_mysql() != DB_SUCCESS) {
innodb_inited= 0; err = 1;
if (innobase_shutdown_for_mysql() != DB_SUCCESS) }
err= 1; hash_free(&innobase_open_tables);
hash_free(&innobase_open_tables); my_free(internal_innobase_data_file_path,
my_free(internal_innobase_data_file_path,MYF(MY_ALLOW_ZERO_PTR)); MYF(MY_ALLOW_ZERO_PTR));
pthread_mutex_destroy(&innobase_mutex); pthread_mutex_destroy(&innobase_mutex);
} }
DBUG_RETURN(err); DBUG_RETURN(err);
......
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