[MDEV-10541] Faking the version string only works with MariaDB-Clients Created: 2016-08-11  Updated: 2022-06-20  Resolved: 2017-05-06

Status: Closed
Project: MariaDB Server
Component/s: Protocol
Affects Version/s: 10.2.1
Fix Version/s: 10.2.6

Type: Bug Priority: Major
Reporter: Hartmut Holzgraefe Assignee: Vicențiu Ciorbaru
Resolution: Fixed Votes: 2
Labels: 10.2-ga
Environment:

Linux


Issue Links:
Duplicate
is duplicated by MDEV-28723 MySQL Connector fails to connect to M... Closed
Problem/Incident
is caused by MDEV-7780 Support for faking server version Closed

 Description   

Changing the server version string only works with MariaDB clients.

Problem is that only these know to remove the RPL_VERSION_HACK prefix ("5.5.5-") added by the server, and that the server even applies the RPL_VERSION_HACK prefix if the version string was explicitly set to a different value in my.cnf

How to reproduce:

  • change version to a different string in my.cnf, e.g.

    version=5.6.23-log"
    

  • connect to server with mysql client binary from MariaDB distribution:

    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MySQL connection id is 6
    Server version: 5.6.23-log Source distribution
    

  • connect to server with mysql client binary from MySQL distribution:

    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 7
    Server version: 5.5.5-5.6.23-log Source distribution
    

This leads to e.g. JDBC reporting a major and minor server version of 5 each, no matter what "version" is actually set to, so defeating the main purpose of version being fakable ...



 Comments   
Comment by Elena Stepanova [ 2016-08-16 ]

Easily reproducible with MySQL clients. I wouldn't be sure it's a bug, but serg said earlier on a mailing list that it is.

Comment by Sergey Vojtovich [ 2016-10-11 ]

serg, please review PR#242 by Hartmut.

Comment by Diego Dupin [ 2016-11-07 ]

for information, this is more important than MDEV-7780 indicate, mysql java driver test internally server version string.
The most important issue is related to timestamp : MySQL truncate timestamp's microsecond for 5.5 servers. So 10.1 servers sending 5.5.5-10.1 version won't have any microseconds.

Comment by Vicențiu Ciorbaru [ 2017-05-06 ]

Fixed with: https://github.com/MariaDB/server/commit/8f05c848c5d856f53fa907ae202deac465a17656

Generated at Thu Feb 08 07:43:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.