mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
--getopt-prefix-matching command-line option
This commit is contained in:
@ -102,6 +102,7 @@ typedef void *(*my_getopt_value)(const char *, uint, const struct my_option *,
|
||||
extern char *disabled_my_option;
|
||||
extern my_bool my_getopt_print_errors;
|
||||
extern my_bool my_getopt_skip_unknown;
|
||||
extern my_bool my_getopt_prefix_matching;
|
||||
extern my_error_reporter my_getopt_error_reporter;
|
||||
|
||||
extern int handle_options (int *argc, char ***argv,
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
# Default values that applies to all MySQL Servers
|
||||
[mysqld]
|
||||
disable-getopt-prefix-matching
|
||||
|
||||
open-files-limit= 1024
|
||||
local-infile
|
||||
character-set-server= latin1
|
||||
|
@ -3,12 +3,14 @@ ignore-builtin-innodb
|
||||
plugin-load-add=$HA_INNODB_SO
|
||||
innodb
|
||||
innodb-cmpmem
|
||||
innodb-cmp-per-index
|
||||
innodb-trx
|
||||
innodb-locks
|
||||
innodb-buffer-pool-stats
|
||||
innodb-buffer-page
|
||||
innodb-buffer-page-lru
|
||||
innodb-sys-foreign
|
||||
innodb-sys-foreign-col
|
||||
innodb-sys-foreign-cols
|
||||
innodb-sys-tables
|
||||
innodb-metrics
|
||||
|
||||
@ -17,24 +19,27 @@ ignore-builtin-innodb
|
||||
plugin-load-add=$HA_XTRADB_SO
|
||||
innodb
|
||||
innodb-cmpmem
|
||||
innodb-cmp-per-index
|
||||
innodb-trx
|
||||
innodb-locks
|
||||
innodb-buffer-pool-stats
|
||||
innodb-buffer-page
|
||||
innodb-buffer-page-lru
|
||||
innodb-sys-foreign
|
||||
innodb-sys-foreign-col
|
||||
innodb-sys-foreign-cols
|
||||
innodb-sys-tables
|
||||
innodb-metrics
|
||||
|
||||
[xtradb]
|
||||
innodb
|
||||
innodb-cmpmem
|
||||
innodb-cmp-per-index
|
||||
innodb-trx
|
||||
innodb-locks
|
||||
innodb-metrics
|
||||
innodb-buffer-pool-stats
|
||||
innodb-buffer-page
|
||||
innodb-buffer-page-lru
|
||||
innodb-sys-foreign
|
||||
innodb-sys-foreign-col
|
||||
innodb-sys-foreign-cols
|
||||
innodb-sys-tables
|
||||
innodb-metrics
|
||||
|
@ -4,10 +4,10 @@ plugin-load-add=$HA_XTRADB_SO
|
||||
innodb
|
||||
innodb-cmpmem
|
||||
innodb-trx
|
||||
innodb-sys-index
|
||||
innodb-sys-indexes
|
||||
|
||||
[xtradb]
|
||||
innodb
|
||||
innodb-cmpmem
|
||||
innodb-trx
|
||||
innodb-sys-index
|
||||
innodb-sys-indexes
|
||||
|
@ -23,7 +23,6 @@ INNODB_CMPMEM
|
||||
INNODB_CMPMEM_RESET
|
||||
INNODB_CMP_PER_INDEX
|
||||
INNODB_CMP_RESET
|
||||
INNODB_LOCKS
|
||||
INNODB_LOCK_WAITS
|
||||
INNODB_SYS_COLUMNS
|
||||
INNODB_SYS_FIELDS
|
||||
@ -95,7 +94,6 @@ INNODB_CMPMEM page_size
|
||||
INNODB_CMPMEM_RESET page_size
|
||||
INNODB_CMP_PER_INDEX database_name
|
||||
INNODB_CMP_RESET page_size
|
||||
INNODB_LOCKS lock_id
|
||||
INNODB_LOCK_WAITS requesting_trx_id
|
||||
INNODB_SYS_COLUMNS TABLE_ID
|
||||
INNODB_SYS_FIELDS INDEX_ID
|
||||
@ -167,7 +165,6 @@ INNODB_CMPMEM page_size
|
||||
INNODB_CMPMEM_RESET page_size
|
||||
INNODB_CMP_PER_INDEX database_name
|
||||
INNODB_CMP_RESET page_size
|
||||
INNODB_LOCKS lock_id
|
||||
INNODB_LOCK_WAITS requesting_trx_id
|
||||
INNODB_SYS_COLUMNS TABLE_ID
|
||||
INNODB_SYS_FIELDS INDEX_ID
|
||||
@ -244,7 +241,6 @@ INNODB_CMPMEM information_schema.INNODB_CMPMEM 1
|
||||
INNODB_CMPMEM_RESET information_schema.INNODB_CMPMEM_RESET 1
|
||||
INNODB_CMP_PER_INDEX information_schema.INNODB_CMP_PER_INDEX 1
|
||||
INNODB_CMP_RESET information_schema.INNODB_CMP_RESET 1
|
||||
INNODB_LOCKS information_schema.INNODB_LOCKS 1
|
||||
INNODB_LOCK_WAITS information_schema.INNODB_LOCK_WAITS 1
|
||||
INNODB_SYS_COLUMNS information_schema.INNODB_SYS_COLUMNS 1
|
||||
INNODB_SYS_FIELDS information_schema.INNODB_SYS_FIELDS 1
|
||||
@ -306,7 +302,6 @@ Database: information_schema
|
||||
| INNODB_CMPMEM_RESET |
|
||||
| INNODB_CMP_PER_INDEX |
|
||||
| INNODB_CMP_RESET |
|
||||
| INNODB_LOCKS |
|
||||
| INNODB_LOCK_WAITS |
|
||||
| INNODB_SYS_COLUMNS |
|
||||
| INNODB_SYS_FIELDS |
|
||||
@ -368,7 +363,6 @@ Database: INFORMATION_SCHEMA
|
||||
| INNODB_CMPMEM_RESET |
|
||||
| INNODB_CMP_PER_INDEX |
|
||||
| INNODB_CMP_RESET |
|
||||
| INNODB_LOCKS |
|
||||
| INNODB_LOCK_WAITS |
|
||||
| INNODB_SYS_COLUMNS |
|
||||
| INNODB_SYS_FIELDS |
|
||||
@ -411,5 +405,5 @@ Wildcard: inf_rmation_schema
|
||||
| information_schema |
|
||||
SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') GROUP BY TABLE_SCHEMA;
|
||||
table_schema count(*)
|
||||
information_schema 57
|
||||
information_schema 56
|
||||
mysql 30
|
||||
|
@ -205,6 +205,10 @@ The following options may be given as the first argument:
|
||||
mysql.general_logif --log-output=TABLE is used
|
||||
--general-log-file=name
|
||||
Log connections and queries to given file
|
||||
--getopt-prefix-matching
|
||||
Recognize command-line options by their unambiguos
|
||||
prefixes.
|
||||
(Defaults to on; use --skip-getopt-prefix-matching to disable.)
|
||||
--group-concat-max-len=#
|
||||
The maximum length of the result of function
|
||||
GROUP_CONCAT()
|
||||
@ -1152,6 +1156,7 @@ ft-query-expansion-limit 20
|
||||
ft-stopword-file (No default value)
|
||||
gdb FALSE
|
||||
general-log FALSE
|
||||
getopt-prefix-matching TRUE
|
||||
group-concat-max-len 1024
|
||||
gtid-domain-id 0
|
||||
gtid-ignore-duplicates FALSE
|
||||
|
@ -1 +1 @@
|
||||
--slave-skip-error=1053,1062,1582
|
||||
--slave-skip-errors=1053,1062,1582
|
||||
|
@ -1 +1 @@
|
||||
--skip-stack-trace --skip-core-file --loose-aria-log-dir-path=$MYSQLTEST_VARDIR/tmp --myisam-recover=
|
||||
--skip-stack-trace --skip-core-file --loose-aria-log-dir-path=$MYSQLTEST_VARDIR/tmp --myisam-recover-options=
|
||||
|
@ -1 +1 @@
|
||||
--skip-stack-trace --skip-core-file --myisam-recover-option=off
|
||||
--skip-stack-trace --skip-core-file --myisam-recover-options=off
|
||||
|
@ -1 +1 @@
|
||||
--myisam-recover
|
||||
--myisam-recover-options
|
||||
|
@ -1 +1 @@
|
||||
--myisam-recover=off
|
||||
--myisam-recover-options=off
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1,2 +1,2 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
--max-user-connections=1024
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1 +1 @@
|
||||
--bind-addr=::
|
||||
--bind-address=::
|
||||
|
@ -1 +1 @@
|
||||
-a -Cutf8 --collation=utf8_bin -T12 -W3
|
||||
-a -Cutf8 --collation-server=utf8_bin -T12 -W3
|
||||
|
@ -35,5 +35,5 @@
|
||||
--loose-performance_schema_events_statements_history_long_size=0
|
||||
--loose-performance_schema_events_statements_history_size=0
|
||||
|
||||
--loose-performance_schema_session_connect_attrs=0
|
||||
--loose-performance_schema_session_connect_attrs_size=0
|
||||
|
||||
|
@ -1 +1 @@
|
||||
--slave-skip-error=1062
|
||||
--slave-skip-errors=1062
|
||||
|
@ -1 +1 @@
|
||||
--slave-skip-error=1590
|
||||
--slave-skip-errors=1590
|
||||
|
@ -386,7 +386,7 @@ COMMAND_LINE_ARGUMENT REQUIRED
|
||||
VARIABLE_NAME INNODB_CMP_PER_INDEX_ENABLED
|
||||
SESSION_VALUE NULL
|
||||
GLOBAL_VALUE OFF
|
||||
GLOBAL_VALUE_ORIGIN CONFIG
|
||||
GLOBAL_VALUE_ORIGIN COMPILE-TIME
|
||||
DEFAULT_VALUE OFF
|
||||
VARIABLE_SCOPE GLOBAL
|
||||
VARIABLE_TYPE BOOLEAN
|
||||
@ -1114,7 +1114,7 @@ COMMAND_LINE_ARGUMENT REQUIRED
|
||||
VARIABLE_NAME INNODB_LOCKS_UNSAFE_FOR_BINLOG
|
||||
SESSION_VALUE NULL
|
||||
GLOBAL_VALUE OFF
|
||||
GLOBAL_VALUE_ORIGIN CONFIG
|
||||
GLOBAL_VALUE_ORIGIN COMPILE-TIME
|
||||
DEFAULT_VALUE OFF
|
||||
VARIABLE_SCOPE GLOBAL
|
||||
VARIABLE_TYPE BOOLEAN
|
||||
|
@ -1,2 +1,2 @@
|
||||
--myisam-recover=BACKUP,FORCE
|
||||
--myisam-recover-options=BACKUP,FORCE
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
--ignore-db-dir=a
|
||||
--ignore-db-dir=b
|
||||
--ignore-db-dir=c
|
||||
--ignore-db-dir=
|
||||
--ignore-db-dir=d
|
||||
--ignore-db-dir x
|
||||
--ignore-db-dir=
|
||||
--ignore-db-dir=e
|
||||
--ignore-db-dir=lost+found
|
||||
--ignore-db-dir=.mysqlgui
|
||||
--ignore-db-dir=ignored_db
|
||||
--ignore-db-dirs=a
|
||||
--ignore-db-dirs=b
|
||||
--ignore-db-dirs=c
|
||||
--ignore-db-dirs=
|
||||
--ignore-db-dirs=d
|
||||
--ignore-db-dirs x
|
||||
--ignore-db-dirs=
|
||||
--ignore-db-dirs=e
|
||||
--ignore-db-dirs=lost+found
|
||||
--ignore-db-dirs=.mysqlgui
|
||||
--ignore-db-dirs=ignored_db
|
||||
|
@ -1 +1 @@
|
||||
--myisam-recover=force
|
||||
--myisam-recover-options=force
|
||||
|
@ -1 +1 @@
|
||||
--log-output=table,file --slow-query-log --log-queries-not-using-indexes --myisam-recover=""
|
||||
--log-output=table,file --slow-query-log --log-queries-not-using-indexes --myisam-recover-options=""
|
||||
|
@ -56,7 +56,7 @@ enum enum_special_opt
|
||||
char *disabled_my_option= (char*) "0";
|
||||
char *enabled_my_option= (char*) "1";
|
||||
|
||||
/*
|
||||
/*
|
||||
This is a flag that can be set in client programs. 0 means that
|
||||
my_getopt will not print error messages, but the client should do
|
||||
it by itself
|
||||
@ -64,13 +64,21 @@ char *enabled_my_option= (char*) "1";
|
||||
|
||||
my_bool my_getopt_print_errors= 1;
|
||||
|
||||
/*
|
||||
/*
|
||||
This is a flag that can be set in client programs. 1 means that
|
||||
my_getopt will skip over options it does not know how to handle.
|
||||
*/
|
||||
|
||||
my_bool my_getopt_skip_unknown= 0;
|
||||
|
||||
|
||||
/*
|
||||
This is a flag that can be set in client programs. 1 means that
|
||||
my_getopt will reconize command line options by their unambiguous
|
||||
prefixes. 0 means an option must be always specified in full.
|
||||
*/
|
||||
my_bool my_getopt_prefix_matching= 1;
|
||||
|
||||
static void default_reporter(enum loglevel level,
|
||||
const char *format, ...)
|
||||
{
|
||||
@ -851,6 +859,9 @@ static int findopt(char *optpat, uint length,
|
||||
if (!opt->name[length]) /* Exact match */
|
||||
DBUG_RETURN(1);
|
||||
|
||||
if (!my_getopt_prefix_matching)
|
||||
continue;
|
||||
|
||||
if (!count)
|
||||
{
|
||||
/* We only need to know one prev */
|
||||
@ -867,6 +878,14 @@ static int findopt(char *optpat, uint length,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 1)
|
||||
my_getopt_error_reporter(INFORMATION_LEVEL,
|
||||
"Using unique option prefix '%.*s' is error-prone "
|
||||
"and can break in the future. "
|
||||
"Please use the full name '%s' instead.",
|
||||
length, optpat, *ffname);
|
||||
|
||||
DBUG_RETURN(count);
|
||||
}
|
||||
|
||||
|
@ -839,8 +839,12 @@ static struct my_option pfs_early_options[]=
|
||||
"Default startup value for the statements_digest consumer.",
|
||||
&pfs_param.m_consumer_statement_digest_enabled,
|
||||
&pfs_param.m_consumer_statement_digest_enabled, 0,
|
||||
GET_BOOL, OPT_ARG, TRUE, 0, 0, 0, 0, 0}
|
||||
GET_BOOL, OPT_ARG, TRUE, 0, 0, 0, 0, 0},
|
||||
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
|
||||
{"getopt-prefix-matching", 0,
|
||||
"Recognize command-line options by their unambiguos prefixes.",
|
||||
&my_getopt_prefix_matching, &my_getopt_prefix_matching, 0, GET_BOOL,
|
||||
NO_ARG, 1, 0, 1, 0, 0, 0}
|
||||
};
|
||||
|
||||
#ifdef HAVE_PSI_INTERFACE
|
||||
|
Reference in New Issue
Block a user