{"record":{"id":"cec988a60fb0fca0","repo":"apache/seatunnel","slug":"unsupported-mysql-version","errorCode":null,"errorMessage":"Unsupported MySQL version: ","messagePattern":"Unsupported MySQL version: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/mysql/MySqlVersion.java","lineNumber":44,"sourceCode":"    V_8_2(\"8.2\"),\n    V_8_3(\"8.3\"),\n    V_8_4(\"8.4\");\n\n    private final String versionPrefix;\n\n    MySqlVersion(String versionPrefix) {\n        this.versionPrefix = versionPrefix;\n    }\n\n    public static MySqlVersion parse(String version) {\n        if (version != null) {\n            for (MySqlVersion mySqlVersion : values()) {\n                if (version.startsWith(mySqlVersion.versionPrefix)) {\n                    return mySqlVersion;\n                }\n            }\n        }\n        throw new UnsupportedOperationException(\"Unsupported MySQL version: \" + version);\n    }\n\n    public boolean isBefore(MySqlVersion version) {\n        return this.compareTo(version) < 0;\n    }\n\n    public boolean isAtOrBefore(MySqlVersion version) {\n        return this.compareTo(version) <= 0;\n    }\n\n    public boolean isAfter(MySqlVersion version) {\n        return this.compareTo(version) > 0;\n    }\n\n    public boolean isAtOrAfter(MySqlVersion version) {\n        return this.compareTo(version) >= 0;\n    }\n}","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/mysql/MySqlVersion.java#L26-L62","documentation":"MySqlVersion.parse cannot recognize the version string returned by the MySQL server: it matches the string against known version prefixes (5.x/8.x prefixes enumerated in MySqlVersion) and throws UnsupportedOperationException when none match. The connector needs the version to gate SQL feature usage (e.g. metadata-based split vs INFORMATION_SCHEMA).","triggerScenarios":"Connecting to a MySQL-compatible server whose version string does not start with any known prefix — e.g. MariaDB, TiDB, Aurora variant strings, or very new/unusual version numbers.","commonSituations":"Pointing the MySQL connector at MariaDB (version string '5.5.5-10.x...'); using TiDB or ShardingSphere proxy whose version banner differs; testing against MySQL forks.","solutions":["Use a genuine MySQL server (5.x or 8.x) or one whose version string matches a known prefix.","For MariaDB, use the connector-dm/connector compatible with mariadb or connect via a dialect that accepts its version.","Add the missing versionPrefix to the MySqlVersion enum and rebuild if you must support this fork."],"exampleFix":"// before\nurl = \"jdbc:mysql://host:4000/db\"  // TiDB, version not recognized\n// after\nurl = \"jdbc:mysql://mysql-host:3306/db\"  // genuine MySQL 8.x","handlingStrategy":"validation","validationCode":"// Before submitting the job, check the server banner\nString version = connection.getMetaData().getDatabaseProductVersion();\nif (!(version.startsWith(\"5.\") || version.startsWith(\"8.\"))) {\n  throw new IllegalArgumentException(\"MySQL connector expects MySQL 5.x/8.x, got: \" + version);\n}","typeGuard":null,"tryCatchPattern":"try {\n  dialect.connect(conn);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().startsWith(\"Unsupported MySQL version\")) {\n    // switch dialect/connector to one matching the actual server (MariaDB/TiDB)\n  }\n}","preventionTips":["Run SELECT VERSION() against the server before configuring the job.","Do not use the MySQL dialect for MariaDB or TiDB; pick the appropriate dialect/connector.","Pin to genuine MySQL 5.x or 8.x servers in test and production environments."],"tags":["jdbc","mysql","version-parsing","compatibility"],"backgroundTag":"unsupported-enum-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}