Why can a user modify server version in config file?

It affects the result of SELECT VERSION(); while I do believe the version info should be immutable of a released binary.

Wow, this is mind blowing…

Some audit software uses the version to determine which critical bugs contained in the release (treat TiDB as MySQL). Users use this feature to avoid some audit software misinformation.
@tison @dragonly

dirty but seems necessary

Thanks for your information @lonng!

I’d like to investigate a bit on this issue. Then when do we want to use the version as a MySQL compatible version? Does MySQL define a version string spec?

Generally speaking TiDB is not fully 5.7 compatible. If the version string is for display only and we actually don’t depend on it, why not define a TiDB version string that avoid this misinformation?

UPDATED: Well, since there is audit tools validate the version, there must be some of them validate whether the version string is a valid MySQL version…

In current situation the function is necessary, but we may think of a pluggable function replacement instead of in-place hacking…I’m not quite sure whether or not it is deserved, though.

And as far as we support such approach now, we may live with it at least for a long time…

Yes, we are not fully compatible with MySQL at the code level. But some ORM/drivers will detect the server version to tweak some internal variables. We are compatible with the MySQL version to avoid some ORM or driver issues.