Skip to content

Commit

Permalink
dbeaver#16847 remove data transfer fetch size hack for MariaDB (dbeav…
Browse files Browse the repository at this point in the history
  • Loading branch information
LonwoLonwo authored Sep 19, 2022
1 parent ab2b99c commit 556fc99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ public DBCQueryTransformer createQueryTransformer(@NotNull DBCQueryTransformType
if (type == DBCQueryTransformType.RESULT_SET_LIMIT) {
return new QueryTransformerLimit();
} else if (type == DBCQueryTransformType.FETCH_ALL_TABLE) {
return new QueryTransformerFetchAll();
return new QueryTransformerFetchAll(this);
}
return super.createQueryTransformer(type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
*/
class QueryTransformerFetchAll implements DBCQueryTransformer {

final MySQLDataSource dataSource;

QueryTransformerFetchAll(MySQLDataSource dataSource) {
this.dataSource = dataSource;
}

@Override
public void setParameters(Object... parameters)
{
Expand All @@ -43,7 +49,9 @@ public String transformQueryString(SQLQuery query) throws DBCException {
public void transformStatement(DBCStatement statement, int parameterIndex) throws DBCException {
// Set fetch size to Integer.MIN_VALUE to enable result set streaming
try {
((Statement)statement).setFetchSize(Integer.MIN_VALUE);
if (!dataSource.isMariaDB()) {
((Statement) statement).setFetchSize(Integer.MIN_VALUE);
}
} catch (SQLException e) {
throw new DBCException(e, statement.getSession().getExecutionContext());
}
Expand Down

0 comments on commit 556fc99

Please sign in to comment.