Skip to content

Commit 07a2746

Browse files
author
Darshan M N
committed
Bug#22016556 INNODB LOOKS FOR BUFFER POOL FILE NAME IN '/' IF
INNODB_DATA_HOME_DIR IS EMPTY Issue: ====== If the server is started with the following parameter set in cnf file - "innodb_data_home_dir =", to specify absolute paths for the data files listed in the innodb_data_file_path value, then the server looks for the buffer pool dump file in the root directory and throws an error. Fix: ==== The directory path of the buffer pool dump file is handled such that the server creates and looks for the buffer pool dump file at the right place. RB: 11081 Reviewed-by: Satya Bodapati <[email protected]> Reviewed-by: Jimmy Yang <[email protected]>
1 parent 4db17d5 commit 07a2746

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

storage/innobase/buf/buf0dump.cc

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 2011, 2012, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
the terms of the GNU General Public License as published by the Free Software
@@ -167,6 +167,25 @@ buf_load_status(
167167
va_end(ap);
168168
}
169169

170+
/** Returns the directory path where the buffer pool dump file will be created.
171+
@return directory path */
172+
static
173+
const char*
174+
get_buf_dump_dir()
175+
{
176+
const char* dump_dir;
177+
178+
/* The dump file should be created in the default data directory if
179+
innodb_data_home_dir is set as an empty string. */
180+
if (strcmp(srv_data_home, "") == 0) {
181+
dump_dir = fil_path_to_mysql_datadir;
182+
} else {
183+
dump_dir = srv_data_home;
184+
}
185+
186+
return(dump_dir);
187+
}
188+
170189
/*****************************************************************//**
171190
Perform a buffer pool dump into the file specified by
172191
innodb_buffer_pool_filename. If any errors occur then the value of
@@ -190,7 +209,7 @@ buf_dump(
190209
int ret;
191210

192211
ut_snprintf(full_filename, sizeof(full_filename),
193-
"%s%c%s", srv_data_home, SRV_PATH_SEPARATOR,
212+
"%s%c%s", get_buf_dump_dir(), SRV_PATH_SEPARATOR,
194213
srv_buf_dump_filename);
195214

196215
ut_snprintf(tmp_filename, sizeof(tmp_filename),
@@ -387,7 +406,7 @@ buf_load()
387406
buf_load_abort_flag = FALSE;
388407

389408
ut_snprintf(full_filename, sizeof(full_filename),
390-
"%s%c%s", srv_data_home, SRV_PATH_SEPARATOR,
409+
"%s%c%s", get_buf_dump_dir(), SRV_PATH_SEPARATOR,
391410
srv_buf_dump_filename);
392411

393412
buf_load_status(STATUS_NOTICE,

0 commit comments

Comments
 (0)