From: Jonas Oreland Date: October 3 2011 8:48am Subject: bzr push into mysql-5.1-telco-7.0 branch (jonas.oreland:4565 to 4566) List-Archive: http://lists.mysql.com/commits/141274 Message-Id: <20111003084816.E973D918F47@perch.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4566 Jonas Oreland 2011-10-03 ndb - 1) add search paths for atrt (since make install is different in 5.5) 2) ignore empty host names modified: storage/ndb/test/run-test/atrt.hpp storage/ndb/test/run-test/files.cpp storage/ndb/test/run-test/main.cpp storage/ndb/test/run-test/setup.cpp 4565 Jonas Oreland 2011-10-03 ndb - add missing Dbdict pool to list modified: storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp === modified file 'storage/ndb/test/run-test/atrt.hpp' --- a/storage/ndb/test/run-test/atrt.hpp 2011-06-30 15:59:25 +0000 +++ b/storage/ndb/test/run-test/atrt.hpp 2011-10-03 08:46:52 +0000 @@ -190,6 +190,19 @@ extern int g_default_ports; extern const char * g_clusters; +/** + * Since binaries move location between 5.1 and 5.5 + * we keep full path to them here + */ +char * find_bin_path(const char * basename); +extern const char * g_ndb_mgmd_bin_path; +extern const char * g_ndbd_bin_path; +extern const char * g_ndbmtd_bin_path; +extern const char * g_mysqld_bin_path; +extern const char * g_mysql_install_db_bin_path; + +extern const char * g_search_path[]; + #ifdef _WIN32 #include === modified file 'storage/ndb/test/run-test/files.cpp' --- a/storage/ndb/test/run-test/files.cpp 2011-06-30 15:59:25 +0000 +++ b/storage/ndb/test/run-test/files.cpp 2011-10-03 08:46:52 +0000 @@ -179,8 +179,8 @@ setup_files(atrt_config& config, int set const char * val; require(proc.m_options.m_loaded.get("--datadir=", &val)); BaseString tmp; - tmp.assfmt("%s/bin/mysql_install_db --defaults-file=%s/my.cnf --datadir=%s > %s/mysql_install_db.log 2>&1", - g_prefix, g_basedir, val, proc.m_proc.m_cwd.c_str()); + tmp.assfmt("%s --defaults-file=%s/my.cnf --datadir=%s > %s/mysql_install_db.log 2>&1", + g_mysql_install_db_bin_path, g_basedir, val, proc.m_proc.m_cwd.c_str()); to_fwd_slashes(tmp); if (sh(tmp.c_str()) != 0) @@ -305,8 +305,13 @@ setup_files(atrt_config& config, int set } fprintf(fenv, "\"\nexport CMD\n"); } - - fprintf(fenv, "PATH=%s/bin:%s/libexec:$PATH\n", g_prefix, g_prefix); + + fprintf(fenv, "PATH="); + for (int i = 0; g_search_path[i] != 0; i++) + { + fprintf(fenv, "%s/%s:", g_prefix, g_search_path[i]); + } + fprintf(fenv, "$PATH\n"); keys.push_back("PATH"); for (size_t k = 0; km_hostname.length() == 0) + continue; BaseString tmp = g_setup_progname; tmp.appfmt(" %s %s/ %s/", config.m_hosts[i]->m_hostname.c_str(), @@ -1509,6 +1552,35 @@ reset_config(atrt_config & config) return changed; } +static +bool +find_binaries() +{ + g_logger.info("Locating binaries..."); + bool ok = true; + for (int i = 0; g_binaries[i].exe != 0; i++) + { + const char * p = find_bin_path(g_binaries[i].exe); + if (p == 0) + { + if (g_binaries[i].is_required) + { + g_logger.critical("Failed to locate '%s'", g_binaries[i].exe); + ok = false; + } + else + { + g_logger.info("Failed to locate '%s'...ok", g_binaries[i].exe); + } + } + else + { + * g_binaries[i].var = p; + } + } + return ok; +} + template class Vector >; template class Vector; template class Vector; === modified file 'storage/ndb/test/run-test/setup.cpp' --- a/storage/ndb/test/run-test/setup.cpp 2011-06-30 15:59:25 +0000 +++ b/storage/ndb/test/run-test/setup.cpp 2011-10-03 08:46:52 +0000 @@ -20,6 +20,7 @@ #include #include #include +#include extern int g_mt; extern int g_mt_rr; @@ -321,7 +322,7 @@ load_process(atrt_config& config, atrt_c case atrt_process::AP_NDB_MGMD: { proc.m_proc.m_name.assfmt("%u-%s", proc_no, "ndb_mgmd"); - proc.m_proc.m_path.assign(g_prefix).append("/libexec/ndb_mgmd"); + proc.m_proc.m_path.assign(g_ndb_mgmd_bin_path); proc.m_proc.m_args.assfmt("--defaults-file=%s/my.cnf", proc.m_host->m_basedir.c_str()); proc.m_proc.m_args.appfmt(" --defaults-group-suffix=%s", @@ -336,13 +337,15 @@ load_process(atrt_config& config, atrt_c } case atrt_process::AP_NDBD: { - if (g_mt == 0 || (g_mt == 1 && ((g_mt_rr++) & 1) == 0)) + if (g_mt == 0 || + (g_mt == 1 && ((g_mt_rr++) & 1) == 0) || + g_ndbmtd_bin_path == 0) { - proc.m_proc.m_path.assign(g_prefix).append("/libexec/ndbd"); + proc.m_proc.m_path.assign(g_ndbd_bin_path); } else { - proc.m_proc.m_path.assign(g_prefix).append("/libexec/ndbmtd"); + proc.m_proc.m_path.assign(g_ndbmtd_bin_path); } proc.m_proc.m_name.assfmt("%u-%s", proc_no, "ndbd"); @@ -361,7 +364,7 @@ load_process(atrt_config& config, atrt_c case atrt_process::AP_MYSQLD: { proc.m_proc.m_name.assfmt("%u-%s", proc_no, "mysqld"); - proc.m_proc.m_path.assign(g_prefix).append("/libexec/mysqld"); + proc.m_proc.m_path.assign(g_mysqld_bin_path); proc.m_proc.m_args.assfmt("--defaults-file=%s/my.cnf", proc.m_host->m_basedir.c_str()); proc.m_proc.m_args.appfmt(" --defaults-group-suffix=.%d%s", @@ -1037,3 +1040,28 @@ operator<<(NdbOut& out, const atrt_proce return out; } +char * +find_bin_path(const char * exe) +{ + if (exe == 0) + return 0; + + if (exe[0] == '/') + { + /** + * Trust that path is correct... + */ + return strdup(exe); + } + + for (int i = 0; g_search_path[i] != 0; i++) + { + BaseString p; + p.assfmt("%s/%s/%s", g_prefix, g_search_path[i], exe); + if (File_class::exists(p.c_str())) + { + return strdup(p.c_str()); + } + } + return 0; +} No bundle (reason: useless for push emails).