Skip to content

Commit 09cf0a6

Browse files
committed
MDEV-7780 - Support for faking server version
Embedded now supports "--version=<version>", while "--version" is still silently ignored. Also only run protocol check in non-embedded mode.
1 parent 39fb947 commit 09cf0a6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
SELECT @@version;
22
perl;
3-
$cnt= grep /my_favorite_version/, `$ENV{MYSQL} -e status`;
3+
$cnt= $ENV{MYSQL_TEST} =~ /mysqltest_embedded / ? 1 :
4+
grep /my_favorite_version/, `$ENV{MYSQL} -e status`;
45
print "$cnt\n";
56
EOF

sql/mysqld.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8946,20 +8946,20 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument)
89468946
binlog_format_used= true;
89478947
break;
89488948
#include <sslopt-case.h>
8949-
#ifndef EMBEDDED_LIBRARY
89508949
case 'V':
89518950
if (argument)
89528951
{
89538952
strmake(server_version, argument, sizeof(server_version) - 1);
89548953
set_sys_var_value_origin(&server_version_ptr, sys_var::CONFIG);
89558954
}
8955+
#ifndef EMBEDDED_LIBRARY
89568956
else
89578957
{
89588958
print_version();
89598959
opt_abort= 1; // Abort after parsing all options
89608960
}
8961-
break;
89628961
#endif /*EMBEDDED_LIBRARY*/
8962+
break;
89638963
case 'W':
89648964
if (!argument)
89658965
global_system_variables.log_warnings++;

0 commit comments

Comments
 (0)