Treat MariaDB type as MySQL

resolved Merge issues on cherry-pick
This commit is contained in:
Glenn Renfro
2019-02-13 15:59:23 -05:00
parent 04fff1055c
commit 52e05f37bd
3 changed files with 20 additions and 9 deletions

View File

@@ -101,10 +101,13 @@ public enum DatabaseType {
* @return DatabaseType for given product name.
* @throws IllegalArgumentException if none is found.
*/
public static DatabaseType fromProductName(String productName){
if(!dbNameMap.containsKey(productName)){
throw new IllegalArgumentException("DatabaseType not found for product name: [" +
productName + "]");
public static DatabaseType fromProductName(String productName) {
if (productName.equals("MariaDB")) {
productName = "MySQL";
}
if (!dbNameMap.containsKey(productName)) {
throw new IllegalArgumentException(
"DatabaseType not found for product name: [" + productName + "]");
}
else{
return dbNameMap.get(productName);

View File

@@ -101,7 +101,7 @@ public class TaskExecutionDaoFactoryBean implements FactoryBean<TaskExecutionDao
this.dao = new JdbcTaskExecutionDao(dataSource, this.tablePrefix);
String databaseType;
try {
databaseType = org.springframework.batch.support.DatabaseType.fromMetaData(dataSource).name();
databaseType = DatabaseType.fromMetaData(dataSource).name();
}
catch (MetaDataAccessException e) {
throw new IllegalStateException(e);