Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
4280b25e
Commit
4280b25e
authored
Jan 07, 2015
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--getopt-prefix-matching command-line option
parent
0ce8703e
Changes
39
Hide whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
88 additions
and
58 deletions
+88
-58
include/my_getopt.h
include/my_getopt.h
+1
-0
mysql-test/include/default_mysqld.cnf
mysql-test/include/default_mysqld.cnf
+2
-0
mysql-test/include/have_innodb.combinations
mysql-test/include/have_innodb.combinations
+9
-4
mysql-test/include/have_xtradb.combinations
mysql-test/include/have_xtradb.combinations
+2
-2
mysql-test/r/information_schema_all_engines.result
mysql-test/r/information_schema_all_engines.result
+1
-7
mysql-test/r/mysqld--help.result
mysql-test/r/mysqld--help.result
+5
-0
mysql-test/suite/engines/funcs/t/rpl_skip_error-slave.opt
mysql-test/suite/engines/funcs/t/rpl_skip_error-slave.opt
+1
-1
mysql-test/suite/maria/maria-recovery2-master.opt
mysql-test/suite/maria/maria-recovery2-master.opt
+1
-1
mysql-test/suite/parts/t/partition_debug_myisam-master.opt
mysql-test/suite/parts/t/partition_debug_myisam-master.opt
+1
-1
mysql-test/suite/parts/t/partition_recover_myisam-master.opt
mysql-test/suite/parts/t/partition_recover_myisam-master.opt
+1
-1
mysql-test/suite/parts/t/partition_repair_myisam-master.opt
mysql-test/suite/parts/t/partition_repair_myisam-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow-master.opt
...rfschema/t/hostcache_ipv6_addrinfo_again_allow-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny-master.opt
...erfschema/t/hostcache_ipv6_addrinfo_again_deny-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow-master.opt
...perfschema/t/hostcache_ipv6_addrinfo_bad_allow-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny-master.opt
.../perfschema/t/hostcache_ipv6_addrinfo_bad_deny-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow-master.opt
...erfschema/t/hostcache_ipv6_addrinfo_good_allow-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny-master.opt
...perfschema/t/hostcache_ipv6_addrinfo_good_deny-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow-master.opt
...fschema/t/hostcache_ipv6_addrinfo_noname_allow-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny-master.opt
...rfschema/t/hostcache_ipv6_addrinfo_noname_deny-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin-master.opt
.../suite/perfschema/t/hostcache_ipv6_auth_plugin-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_blocked-master.opt
...test/suite/perfschema/t/hostcache_ipv6_blocked-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_max_con-master.opt
...test/suite/perfschema/t/hostcache_ipv6_max_con-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow-master.opt
...rfschema/t/hostcache_ipv6_nameinfo_again_allow-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny-master.opt
...erfschema/t/hostcache_ipv6_nameinfo_again_deny-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow-master.opt
...fschema/t/hostcache_ipv6_nameinfo_noname_allow-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny-master.opt
...rfschema/t/hostcache_ipv6_nameinfo_noname_deny-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt
...-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt
+1
-1
mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt
mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt
+1
-1
mysql-test/suite/perfschema/t/short_option_1-master.opt
mysql-test/suite/perfschema/t/short_option_1-master.opt
+1
-1
mysql-test/suite/perfschema/t/start_server_nothing-master.opt
...l-test/suite/perfschema/t/start_server_nothing-master.opt
+1
-1
mysql-test/suite/rpl/t/rpl_skip_error-slave.opt
mysql-test/suite/rpl/t/rpl_skip_error-slave.opt
+1
-1
mysql-test/suite/rpl/t/rpl_skip_incident-slave.opt
mysql-test/suite/rpl/t/rpl_skip_incident-slave.opt
+1
-1
mysql-test/suite/sys_vars/r/sysvars_innodb.result
mysql-test/suite/sys_vars/r/sysvars_innodb.result
+2
-2
mysql-test/suite/sys_vars/t/delay_key_write_func-master.opt
mysql-test/suite/sys_vars/t/delay_key_write_func-master.opt
+1
-1
mysql-test/suite/sys_vars/t/ignore_db_dirs_basic-master.opt
mysql-test/suite/sys_vars/t/ignore_db_dirs_basic-master.opt
+11
-11
mysql-test/t/merge_recover-master.opt
mysql-test/t/merge_recover-master.opt
+1
-1
mysql-test/t/show_check-master.opt
mysql-test/t/show_check-master.opt
+1
-1
mysys/my_getopt.c
mysys/my_getopt.c
+21
-2
sql/mysqld.cc
sql/mysqld.cc
+5
-1
No files found.
include/my_getopt.h
View file @
4280b25e
...
...
@@ -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
,
...
...
mysql-test/include/default_mysqld.cnf
View file @
4280b25e
...
...
@@ -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
...
...
mysql-test/include/have_innodb.combinations
View file @
4280b25e
...
...
@@ -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-col
s
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-col
s
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-col
s
innodb-sys-tables
innodb-metrics
mysql-test/include/have_xtradb.combinations
View file @
4280b25e
...
...
@@ -4,10 +4,10 @@ plugin-load-add=$HA_XTRADB_SO
innodb
innodb-cmpmem
innodb-trx
innodb-sys-index
innodb-sys-index
es
[xtradb]
innodb
innodb-cmpmem
innodb-trx
innodb-sys-index
innodb-sys-index
es
mysql-test/r/information_schema_all_engines.result
View file @
4280b25e
...
...
@@ -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 5
7
information_schema 5
6
mysql 30
mysql-test/r/mysqld--help.result
View file @
4280b25e
...
...
@@ -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
...
...
mysql-test/suite/engines/funcs/t/rpl_skip_error-slave.opt
View file @
4280b25e
--slave-skip-error=1053,1062,1582
--slave-skip-error
s
=1053,1062,1582
mysql-test/suite/maria/maria-recovery2-master.opt
View file @
4280b25e
--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
=
mysql-test/suite/parts/t/partition_debug_myisam-master.opt
View file @
4280b25e
--skip-stack-trace --skip-core-file --myisam-recover-option=off
--skip-stack-trace --skip-core-file --myisam-recover-option
s
=off
mysql-test/suite/parts/t/partition_recover_myisam-master.opt
View file @
4280b25e
--myisam-recover
--myisam-recover
-options
mysql-test/suite/parts/t/partition_repair_myisam-master.opt
View file @
4280b25e
--myisam-recover=off
--myisam-recover
-options
=off
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/hostcache_ipv6_blocked-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/hostcache_ipv6_max_con-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
--max-user-connections=1024
mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt
View file @
4280b25e
--bind-addr=::
--bind-addr
ess
=::
mysql-test/suite/perfschema/t/short_option_1-master.opt
View file @
4280b25e
-a -Cutf8 --collation=utf8_bin -T12 -W3
-a -Cutf8 --collation
-server
=utf8_bin -T12 -W3
mysql-test/suite/perfschema/t/start_server_nothing-master.opt
View file @
4280b25e
...
...
@@ -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
mysql-test/suite/rpl/t/rpl_skip_error-slave.opt
View file @
4280b25e
--slave-skip-error=1062
--slave-skip-error
s
=1062
mysql-test/suite/rpl/t/rpl_skip_incident-slave.opt
View file @
4280b25e
--slave-skip-error=1590
--slave-skip-error
s
=1590
mysql-test/suite/sys_vars/r/sysvars_innodb.result
View file @
4280b25e
...
...
@@ -386,7 +386,7 @@ COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_CMP_PER_INDEX_ENABLED
SESSION_VALUE NULL
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN CO
NFIG
GLOBAL_VALUE_ORIGIN CO
MPILE-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 CO
NFIG
GLOBAL_VALUE_ORIGIN CO
MPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
...
...
mysql-test/suite/sys_vars/t/delay_key_write_func-master.opt
View file @
4280b25e
--myisam-recover=BACKUP,FORCE
--myisam-recover
-options
=BACKUP,FORCE
mysql-test/suite/sys_vars/t/ignore_db_dirs_basic-master.opt
View file @
4280b25e
--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-dir
s
=a
--ignore-db-dir
s
=b
--ignore-db-dir
s
=c
--ignore-db-dir
s
=
--ignore-db-dir
s
=d
--ignore-db-dir
s
x
--ignore-db-dir
s
=
--ignore-db-dir
s
=e
--ignore-db-dir
s
=lost+found
--ignore-db-dir
s
=.mysqlgui
--ignore-db-dir
s
=ignored_db
mysql-test/t/merge_recover-master.opt
View file @
4280b25e
--myisam-recover=force
--myisam-recover
-options
=force
mysql-test/t/show_check-master.opt
View file @
4280b25e
--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
=""
mysys/my_getopt.c
View file @
4280b25e
...
...
@@ -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
);
}
...
...
sql/mysqld.cc
View file @
4280b25e
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment