#include "options.h"#include <my_global.h>#include <my_sys.h>#include <my_getopt.h>#include <mysql_com.h>#include "exit_codes.h"#include "log.h"#include "portability.h"#include "priv.h"#include "user_management_commands.h"Include dependency graph for options.cc:

Go to the source code of this file.
Defines | |
| #define | QUOTE2(x) #x |
| #define | QUOTE(x) QUOTE2(x) |
Enumerations | |
| enum | options { OPT_USERNAME = 'u', OPT_PASSWORD = 'p', OPT_LOG = 256, OPT_PID_FILE, OPT_SOCKET, OPT_PASSWORD_FILE, OPT_MYSQLD_PATH, OPT_RUN_AS_SERVICE, OPT_USER, OPT_ANGEL_PID_FILE, OPT_MONITORING_INTERVAL, OPT_PORT, OPT_WAIT_TIMEOUT, OPT_BIND_ADDRESS, OPT_PRINT_PASSWORD_LINE, OPT_ADD_USER, OPT_DROP_USER, OPT_EDIT_USER, OPT_CLEAN_PASSWORD_FILE, OPT_CHECK_PASSWORD_FILE, OPT_LIST_USERS, OPT_MYSQLD_SAFE_COMPATIBLE } |
Functions | |
| static void | version () |
| static void | usage () |
| static C_MODE_START my_bool | get_one_option (int optid, const struct my_option *opt __attribute__((unused)), char *argument) |
Variables | |
| static const char *const | ANGEL_PID_FILE_SUFFIX = ".angel.pid" |
| static const int | ANGEL_PID_FILE_SUFFIX_LEN = strlen(ANGEL_PID_FILE_SUFFIX) |
| static struct my_option | my_long_options [] |
| static const char * | default_groups [] = { "manager", 0 } |
Definition at line 35 of file options.cc.
Definition at line 34 of file options.cc.
| enum options |
Definition at line 116 of file options.cc.
00116 { 00117 OPT_USERNAME= 'u', 00118 OPT_PASSWORD= 'p', 00119 OPT_LOG= 256, 00120 OPT_PID_FILE, 00121 OPT_SOCKET, 00122 OPT_PASSWORD_FILE, 00123 OPT_MYSQLD_PATH, 00124 #ifdef __WIN__ 00125 OPT_INSTALL_SERVICE, 00126 OPT_REMOVE_SERVICE, 00127 OPT_STAND_ALONE, 00128 #else 00129 OPT_RUN_AS_SERVICE, 00130 OPT_USER, 00131 OPT_ANGEL_PID_FILE, 00132 #endif 00133 OPT_MONITORING_INTERVAL, 00134 OPT_PORT, 00135 OPT_WAIT_TIMEOUT, 00136 OPT_BIND_ADDRESS, 00137 OPT_PRINT_PASSWORD_LINE, 00138 OPT_ADD_USER, 00139 OPT_DROP_USER, 00140 OPT_EDIT_USER, 00141 OPT_CLEAN_PASSWORD_FILE, 00142 OPT_CHECK_PASSWORD_FILE, 00143 OPT_LIST_USERS, 00144 OPT_MYSQLD_SAFE_COMPATIBLE 00145 };
| static C_MODE_START my_bool get_one_option | ( | int | optid, | |
| const struct my_option *opt | __attribute__((unused)), | |||
| char * | argument | |||
| ) | [static] |
Definition at line 334 of file options.cc.
References Options::User_management::cmd, Options::Debug::config_str, DBUG_SET, DBUG_SET_INITIAL, ERR_INVALID_USAGE, exit, OPT_ADD_USER, OPT_CHECK_PASSWORD_FILE, OPT_CLEAN_PASSWORD_FILE, OPT_DROP_USER, OPT_EDIT_USER, OPT_LIST_USERS, OPT_PRINT_PASSWORD_LINE, usage(), and version().
00337 { 00338 switch(optid) { 00339 case 'V': 00340 version(); 00341 exit(0); 00342 case OPT_PRINT_PASSWORD_LINE: 00343 case OPT_ADD_USER: 00344 case OPT_DROP_USER: 00345 case OPT_EDIT_USER: 00346 case OPT_CLEAN_PASSWORD_FILE: 00347 case OPT_CHECK_PASSWORD_FILE: 00348 case OPT_LIST_USERS: 00349 if (Options::User_management::cmd) 00350 { 00351 fprintf(stderr, "Error: only one password-management command " 00352 "can be specified at a time.\n"); 00353 exit(ERR_INVALID_USAGE); 00354 } 00355 00356 switch (optid) { 00357 case OPT_PRINT_PASSWORD_LINE: 00358 Options::User_management::cmd= new Print_password_line_cmd(); 00359 break; 00360 case OPT_ADD_USER: 00361 Options::User_management::cmd= new Add_user_cmd(); 00362 break; 00363 case OPT_DROP_USER: 00364 Options::User_management::cmd= new Drop_user_cmd(); 00365 break; 00366 case OPT_EDIT_USER: 00367 Options::User_management::cmd= new Edit_user_cmd(); 00368 break; 00369 case OPT_CLEAN_PASSWORD_FILE: 00370 Options::User_management::cmd= new Clean_db_cmd(); 00371 break; 00372 case OPT_CHECK_PASSWORD_FILE: 00373 Options::User_management::cmd= new Check_db_cmd(); 00374 break; 00375 case OPT_LIST_USERS: 00376 Options::User_management::cmd= new List_users_cmd(); 00377 break; 00378 } 00379 00380 break; 00381 case '?': 00382 usage(); 00383 exit(0); 00384 case '#': 00385 #ifndef DBUG_OFF 00386 DBUG_SET(argument ? argument : Options::Debug::config_str); 00387 DBUG_SET_INITIAL(argument ? argument : Options::Debug::config_str); 00388 #endif 00389 break; 00390 } 00391 return 0; 00392 }
Here is the call graph for this function:

| static void usage | ( | void | ) | [static] |
Definition at line 311 of file options.cc.
References my_long_options, my_print_help(), my_print_variables(), my_progname, and version().
00312 { 00313 version(); 00314 00315 printf("Copyright (C) 2003, 2004 MySQL AB\n" 00316 "This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n" 00317 "and you are welcome to modify and redistribute it under the GPL license\n"); 00318 printf("Usage: %s [OPTIONS] \n", my_progname); 00319 00320 my_print_help(my_long_options); 00321 printf("\nThe following options may be given as the first argument:\n" 00322 "--print-defaults Print the program argument list and exit\n" 00323 "--defaults-file=# Only read manager configuration and instance\n" 00324 " setings from the given file #. The same file\n" 00325 " will be used to modify configuration of instances\n" 00326 " with SET commands.\n"); 00327 my_print_variables(my_long_options); 00328 }
Here is the call graph for this function:

| static void version | ( | ) | [static] |
Definition at line 300 of file options.cc.
References MACHINE_TYPE, my_progname, mysqlmanager_version, LEX_STRING::str, and SYSTEM_TYPE.
Referenced by check_master_version(), Dbdict::check_ndb_versions(), Load_log_processor::create_unique_file(), Qmgr::execAPI_REGREQ(), Qmgr::execCM_NODEINFOCONF(), Dbdict::execDROP_FILE_REQ(), Dbdict::execDROP_FILEGROUP_REQ(), CommandInterpreter::executeStatus(), fil_space_get_version(), MgmApiSession::get_nodeid(), get_one_option(), get_options(), MgmApiSession::getConfig_common(), MgmApiSession::getConfig_old(), main(), mysql_get_server_version(), MYSQLlex(), NDB_COMMAND(), plugin_dl_add(), print_head(), MgmtSrvr::restartDB(), MgmtSrvr::restartNodes(), row_vers_build_for_consistent_read(), row_vers_build_for_semi_consistent_read(), row_vers_impl_x_locked_off_kernel(), row_vers_old_has_index_entry(), Dbtc::sendlqhkeyreq(), Filename::set(), SSLeay_version(), static_get_options(), update_frm_version(), usage(), Backup::verifyNodesAlive(), and Show_instance_status::write_header().
00301 { 00302 printf("%s Ver %s for %s on %s\n", my_progname, 00303 (const char *) mysqlmanager_version.str, 00304 SYSTEM_TYPE, MACHINE_TYPE); 00305 }
Here is the caller graph for this function:

const char* const ANGEL_PID_FILE_SUFFIX = ".angel.pid" [static] |
const int ANGEL_PID_FILE_SUFFIX_LEN = strlen(ANGEL_PID_FILE_SUFFIX) [static] |
const char* default_groups[] = { "manager", 0 } [static] |
Definition at line 308 of file options.cc.
struct my_option my_long_options[] [static] |
Definition at line 147 of file options.cc.
1.4.7

