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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
9d5c9379
Commit
9d5c9379
authored
Nov 24, 2015
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-7780 - Support for faking server version
Added --version=str (optional argument sets server version string).
parent
cc8e8633
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
7 deletions
+28
-7
mysql-test/r/mysqld--help.result
mysql-test/r/mysqld--help.result
+2
-1
mysql-test/suite/sys_vars/r/version.result
mysql-test/suite/sys_vars/r/version.result
+4
-0
mysql-test/suite/sys_vars/t/version.opt
mysql-test/suite/sys_vars/t/version.opt
+1
-0
mysql-test/suite/sys_vars/t/version.test
mysql-test/suite/sys_vars/t/version.test
+5
-0
sql/mysqld.cc
sql/mysqld.cc
+15
-5
sql/mysqld.h
sql/mysqld.h
+1
-0
sql/sys_vars.cc
sql/sys_vars.cc
+0
-1
No files found.
mysql-test/r/mysqld--help.result
View file @
9d5c9379
...
...
@@ -1124,7 +1124,8 @@ The following options may be given as the first argument:
CLIENT_STATISTICS, INDEX_STATISTICS and TABLE_STATISTICS
tables in the INFORMATION_SCHEMA
-v, --verbose Used with --help option for detailed help.
-V, --version Output version information and exit.
-V, --version[=name]
Output version information and exit.
--wait-timeout=# The number of seconds the server waits for activity on a
connection before closing it
...
...
mysql-test/suite/sys_vars/r/version.result
0 → 100644
View file @
9d5c9379
SELECT @@version;
@@version
my_favorite_version
1
mysql-test/suite/sys_vars/t/version.opt
0 → 100644
View file @
9d5c9379
--version="my_favorite_version"
mysql-test/suite/sys_vars/t/version.test
0 → 100644
View file @
9d5c9379
SELECT
@@
version
;
perl
;
$cnt
=
grep
/
my_favorite_version
/
,
`$ENV{MYSQL} -e status`
;
print
"
$cnt
\n
"
;
EOF
sql/mysqld.cc
View file @
9d5c9379
...
...
@@ -631,7 +631,7 @@ DATE_TIME_FORMAT global_date_format, global_datetime_format, global_time_format;
Time_zone
*
default_tz
;
const
char
*
mysql_real_data_home_ptr
=
mysql_real_data_home
;
char
server_version
[
SERVER_VERSION_LENGTH
];
char
server_version
[
SERVER_VERSION_LENGTH
]
,
*
server_version_ptr
;
char
*
mysqld_unix_port
,
*
opt_mysql_tmpdir
;
ulong
thread_handling
;
...
...
@@ -7604,8 +7604,8 @@ struct my_option my_long_options[]=
0
,
0
,
0
,
0
,
0
,
0
},
{
"verbose"
,
'v'
,
"Used with --help option for detailed help."
,
&
opt_verbose
,
&
opt_verbose
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"version"
,
'V'
,
"Output version information and exit."
,
0
,
0
,
0
,
GET_
NO_ARG
,
NO
_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"version"
,
'V'
,
"Output version information and exit."
,
0
,
0
,
0
,
GET_
STR
,
OPT
_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"plugin-load"
,
OPT_PLUGIN_LOAD
,
"Semicolon-separated list of plugins to load, where each plugin is "
"specified as ether a plugin_name=library_file pair or only a library_file. "
...
...
@@ -8947,8 +8947,16 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument)
#include <sslopt-case.h>
#ifndef EMBEDDED_LIBRARY
case
'V'
:
if
(
argument
)
{
strmake
(
server_version
,
argument
,
sizeof
(
server_version
)
-
1
);
set_sys_var_value_origin
(
&
server_version_ptr
,
sys_var
::
CONFIG
);
}
else
{
print_version
();
opt_abort
=
1
;
// Abort after parsing all options
}
break
;
#endif
/*EMBEDDED_LIBRARY*/
case
'W'
:
...
...
@@ -9641,6 +9649,8 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
void
set_server_version
(
void
)
{
if
(
!
IS_SYSVAR_AUTOSIZE
(
&
server_version_ptr
))
return
;
char
*
end
=
strxmov
(
server_version
,
MYSQL_SERVER_VERSION
,
MYSQL_SERVER_SUFFIX_STR
,
NullS
);
#ifdef EMBEDDED_LIBRARY
...
...
sql/mysqld.h
View file @
9d5c9379
...
...
@@ -534,6 +534,7 @@ extern uint mysql_real_data_home_len;
extern
const
char
*
mysql_real_data_home_ptr
;
extern
ulong
thread_handling
;
extern
"C"
MYSQL_PLUGIN_IMPORT
char
server_version
[
SERVER_VERSION_LENGTH
];
extern
char
*
server_version_ptr
;
extern
MYSQL_PLUGIN_IMPORT
char
mysql_real_data_home
[];
extern
char
mysql_unpacked_real_data_home
[];
extern
MYSQL_PLUGIN_IMPORT
struct
system_variables
global_system_variables
;
...
...
sql/sys_vars.cc
View file @
9d5c9379
...
...
@@ -3368,7 +3368,6 @@ static Sys_var_mybool Sys_timed_mutexes(
NO_MUTEX_GUARD
,
NOT_IN_BINLOG
,
ON_CHECK
(
NULL
),
ON_UPDATE
(
NULL
),
DEPRECATED
(
""
));
static
char
*
server_version_ptr
;
static
Sys_var_charptr
Sys_version
(
"version"
,
"Server version"
,
READ_ONLY
GLOBAL_VAR
(
server_version_ptr
),
...
...
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