Skip to content

Commit

Permalink
fix: check MariaDB json in result set metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
yurem committed Jan 26, 2022
1 parent edf5a8d commit 96b6772
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,9 @@ public DatabaseMetaData getDatabaseMetaData() {
throw new ConnectionException("Failed to get database metadata", ex);
}
}


public boolean isMariaDb() {
return mariaDb;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public class SqlOperationServiceImpl implements SqlOperationService {

private boolean disableAttributeMapping = false;

private boolean mariaDb = false;

private PersistenceExtension persistenceExtension;

private SQLQueryFactory sqlQueryFactory;
Expand All @@ -104,6 +106,7 @@ public SqlOperationServiceImpl(Properties props, SqlConnectionProvider connectio
private void init() {
this.sqlQueryFactory = connectionProvider.getSqlQueryFactory();
this.schemaName = connectionProvider.getSchemaName();
this.mariaDb = connectionProvider.isMariaDb();
}

@Override
Expand Down Expand Up @@ -874,6 +877,10 @@ private boolean isJsonColumn(String tableName, String columnTypeName) {
return false;
}

if (mariaDb && "longtext".equals(columnTypeName)) {
return true;
}

// String engineType = connectionProvider.getEngineType(tableName);
// if ((engineType != null) && engineType.equalsIgnoreCase("mariadb")) {
// return "longtext".equals(columnTypeName);
Expand Down

0 comments on commit 96b6772

Please sign in to comment.