在xtrabackup工具實現(xiàn)數(shù)據(jù)備份的過程中,有這樣的行為,工具通過handle_option函數(shù)處理傳入的參數(shù)并通過以下這段代碼處理mysql實例相關的參數(shù)
/* Reset u_max_value for all options, as we don't want the
--maximum-... modifier to set the actual option values */
for (my_option *optp = xb_server_options; optp->name; optp++) {
optp->u_max_value = (G_PTR *)&global_max_value;
}
其中xb_server_options,是保存待識別的mysql參數(shù)信息的列表,
struct my_option xb_server_options[]
共包含datadir,tmpdir等相關參數(shù),46項,其中最后一項為空值,為的是使for 循環(huán)結束.
如果傳給xtrabackup的參數(shù)有包含在這45項之中的,會打印在標準輸出上,以做提示,具體實現(xiàn)是以下代碼,
if (!param_str.str().empty()) {
msg("xtrabackup: recognized server arguments: %s\n",
param_str.str().c_str());
param_str.str("");
param_str.clear();
}