diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2017-05-05 13:32:01 +0300 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2017-05-06 22:06:25 +0300 |
commit | 8f05c848c5d856f53fa907ae202deac465a17656 (patch) | |
tree | 917a7a50c27647b6a4443c53ff3ac1291f467475 /sql/sql_acl.cc | |
parent | c22ef4df26b47c55ade612788d0c63137889c71f (diff) | |
download | mariadb-git-8f05c848c5d856f53fa907ae202deac465a17656.tar.gz |
MDEV-10541: Faking the version string only works with MariaDB-Clients
Our RPL_VERSION_HACK prefix caused MySQL clients to always report 5.5
major and minor versions, even if a specific fake version is passed via
my.cnf or command line parameters. When a specific version is requested,
don't employ the RPL_VERSION_HACK prefix within the server handshake
packet.
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 5e3311d502a..8c48d0aa2db 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -12062,7 +12062,13 @@ static bool send_server_handshake_packet(MPVIO_EXT *mpvio, data_len= SCRAMBLE_LENGTH; } - end= strxnmov(end, SERVER_VERSION_LENGTH, RPL_VERSION_HACK, server_version, NullS) + 1; + /* When server version is specified in config file, don't include + the replication hack prefix. */ + if (using_custom_server_version) + end= strnmov(end, server_version, SERVER_VERSION_LENGTH) + 1; + else + end= strxnmov(end, SERVER_VERSION_LENGTH, RPL_VERSION_HACK, server_version, NullS) + 1; + int4store((uchar*) end, mpvio->auth_info.thd->thread_id); end+= 4; |