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

mysql-connector-java error Variable 'character_set_results' can't be set to the value of 'NULL' #32987

Closed
shiyuhang0 opened this issue Mar 10, 2022 · 1 comment · Fixed by #32988
Assignees
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@shiyuhang0
Copy link
Member

shiyuhang0 commented Mar 10, 2022

Bug Report

when i use mysql-connector-java to connect to tidb.
it occurs java.sql.SQLSyntaxErrorException: Variable 'character_set_results' can't be set to the value of 'NULL'

  • tidb version: build after this commit 77730b6
  • mysql-connector-java: 5.1.44 or 8.0.26. I guess other version may has the same problem
public class DBHelper {

  public static final String url = "jdbc:mysql://address=(protocol=tcp)(host=$host)(port=4000)/?user=root&password=&useSSL=false";
  public static final String name = "com.mysql.jdbc.Driver";

  public Connection conn = null;

  public DBHelper() {
    try {
      Class.forName(name);
      conn = DriverManager.getConnection(url);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  public static void main(String[] args) {
    DBHelper helper = new DBHelper();
  }


pom:
  <dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.26</version>
  </dependency>
@shiyuhang0 shiyuhang0 added the type/bug The issue is confirmed as a bug. label Mar 10, 2022
@Defined2014
Copy link
Contributor

Defined2014 commented Mar 10, 2022

@morgo Seems jdbc depends on this feature, we should revert #32879

@Defined2014 Defined2014 self-assigned this Mar 10, 2022
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. labels Mar 10, 2022
@Defined2014 Defined2014 added sig/sql-infra SIG: SQL Infra and removed may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. labels Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants