HHH-20056 Cascade delete support detection in TiDB#11583
HHH-20056 Cascade delete support detection in TiDB#11583dveeden wants to merge 1 commit intohibernate:mainfrom
Conversation
|
Thanks for your pull request! This pull request appears to follow the contribution rules. › This message was automatically generated. |
fc41077 to
e9f9380
Compare
hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TiDBDialect.java
Outdated
Show resolved
Hide resolved
hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TiDBDialect.java
Outdated
Show resolved
Hide resolved
hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TiDBDialect.java
Outdated
Show resolved
Hide resolved
hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TiDBDialect.java
Outdated
Show resolved
Hide resolved
df7343c to
0dca6c0
Compare
hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TiDBDialect.java
Outdated
Show resolved
Hide resolved
|
|
||
| public TiDBDialect(DatabaseVersion version) { | ||
| super( version ); | ||
| this.mySQLVersion = DatabaseVersion.make( 8, 0, 11 ); |
There was a problem hiding this comment.
Does TiDB 5.4 advertise itself as MySQL 8.0.11? Maybe this should be a conditional assignment based on the actual behavior of the TiDB major/minor versions?
There was a problem hiding this comment.
The best would be to get this based on the version string, so 8.0.11-TiDB-v7.5.0 → 8.0.11.
Another option would be to use 5.7.25 for TiDB < 7.5.0 and 8.0.11 for TiDB >= 7.5.0.
There was a problem hiding this comment.
Yeah, you can use
| this.mySQLVersion = DatabaseVersion.make( 8, 0, 11 ); | |
| this.mySQLVersion = getVersion().isBefore( 7, 5 ) ? MINIMUM_MYSQL_VERSION : DatabaseVersion.make( 8, 0, 11 ); |
| super( createVersion( info, MINIMUM_VERSION ), MySQLServerConfiguration.fromDialectResolutionInfo( info ) ); | ||
| super( fetchDataBaseVersion( info ), MySQLServerConfiguration.fromDialectResolutionInfo( info ) ); | ||
| registerKeywords( info ); | ||
| this.mySQLVersion = createVersion( info, MINIMUM_VERSION ); |
There was a problem hiding this comment.
This should probably be
| this.mySQLVersion = createVersion( info, MINIMUM_VERSION ); | |
| this.mySQLVersion = createVersion( info, MINIMUM_MYSQL_VERSION ); |
i.e. the same MINIMUM_MYSQL_VERSION that you set in the other constructor, based on what TiDB 5.4 advertises itself as.
There was a problem hiding this comment.
Or even this, since createVersion actually uses info.getDatabaseVersion() as a first step.
| this.mySQLVersion = createVersion( info, MINIMUM_VERSION ); | |
| this.mySQLVersion = info.makeCopyOrDefault( MINIMUM_MYSQL_VERSION ); |
There was a problem hiding this comment.
- v5.4.3 identifies itself as:
5.7.25-TiDB-v5.4.3 - v6.1.0 identifies itself as:
5.7.25-TiDB-v6.1.0 - v7.1.0 identifies itself as:
5.7.25-TiDB-v7.1.0 - v7.5.0 identifies itself as:
8.0.11-TiDB-v7.5.0 - v8.1, v8.5 also identify as MySQL 8.0.11
Note that these are LTS versions.
See also:
There was a problem hiding this comment.
In that case, you should create private static final DatabaseVersion MINIMUM_MYSQL_VERSION = = DatabaseVersion.make( 5, 7, 25 );
supportsCascadeDelete()to detect support based on the TiDB versionNote that TiDB reports this as version string:
8.0.11-TiDB-v8.5.4. This is TiDB v8.5.4 claiming compatibility with MySQL 8.0.11.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.
https://hibernate.atlassian.net/browse/HHH-20056