Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting the version for TiDB doesn't reflect on global vars #27210

Closed
dveeden opened this issue Aug 13, 2021 · 3 comments · Fixed by #27731
Closed

Setting the version for TiDB doesn't reflect on global vars #27210

dveeden opened this issue Aug 13, 2021 · 3 comments · Fixed by #27731
Assignees
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@dveeden
Copy link
Contributor

dveeden commented Aug 13, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Start TiDB with this config:

server-version = "8.0.26-tidb-5.2"

2. What did you expect to see? (Required)

SELECT VERSION(), The server greeting packet in the MySQL Protocol and SELECT @@version all report the same version, the one that was set in the config

3. What did you see instead (Required)

SELECT @@version not returning the version that I set but instead return the default version

mysql> SELECT @@version, VERSION();
+-----------------------------------------+-----------------+
| @@version                               | VERSION()       |
+-----------------------------------------+-----------------+
| 5.7.25-TiDB-v5.2.0-alpha-597-g26237b35f | 8.0.26-tidb-5.2 |
+-----------------------------------------+-----------------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

Release Version: v5.2.0-alpha-597-g26237b35f
Edition: Community
Git Commit Hash: 26237b35f857c2388eab46f9ee3b351687143681
Git Branch: master
UTC Build Time: 2021-08-12 04:28:47
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

This causes things like MySQL Workbench to not detect the version that I set:
image

This amongst possible other things causes MySQL Workbench to say that the WITH... syntax or CTE's is not valid for this version. This also makes it more difficult to test the level of our MySQL 8.0 compatibility, so this is somewhat related to #7968

@dveeden dveeden added the type/bug The issue is confirmed as a bug. label Aug 13, 2021
@Defined2014
Copy link
Contributor

/assign

@github-actions
Copy link

github-actions bot commented Sep 2, 2021

Please check whether the issue should be labeled with 'affects-x.y' or 'backport-x.y.z',
and then remove 'needs-more-info' label.

@dveeden
Copy link
Contributor Author

dveeden commented Sep 2, 2021

This indeed fixed the issue. MySQL Workbench now uses the MySQL 8 version of the syntax (with CTE support) if I set the version to 8.0.26-tidb-5.2.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
3 participants