Skip to content

Commit

Permalink
[pinpoint-apm#9614] Add temporary getter + setter functions for Wrapp…
Browse files Browse the repository at this point in the history
…edPinotPreparedStatement maxRows
  • Loading branch information
ga-ram committed Jan 10, 2023
1 parent f2db9a3 commit 34966b0
Showing 1 changed file with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
*/
public class WrappedPinotPreparedStatement extends PinotPreparedStatement {
// Temporary variables for fillStatementWithParameters(). TODO: remove these when Pinot driver is fixed.
private String query;
private final String query;
private final String[] parameters;
private final int maxRows = Integer.MAX_VALUE;
private int maxRows = Integer.MAX_VALUE;

public WrappedPinotPreparedStatement(PinotConnection connection, String query) {
super(connection, query);
Expand Down Expand Up @@ -94,7 +94,8 @@ private String fillStatementWithParameters() throws SQLException {
return sb.toString();
}

/* temporary setter functions to redirect mybatis parameter setting to temporary variables this.query and this.parameters TODO: remove these when Pinot driver is fixed */
/* temporary setter + getter functions to redirect mybatis parameter setting to temporary variables this.query, this.parameters, and this.maxRows
TODO: remove these when Pinot driver is fixed */
public void setNull(int parameterIndex, int sqlType) throws SQLException {
this.validateState();
this.parameters[parameterIndex - 1] = "'NULL'";
Expand Down Expand Up @@ -165,4 +166,20 @@ public void clearParameters() throws SQLException {
this.parameters[i] = null;
}
}

public int getFetchSize() throws SQLException {
return this.maxRows;
}

public void setFetchSize(int rows) throws SQLException {
this.maxRows = rows;
}

public int getMaxRows() throws SQLException {
return this.maxRows;
}

public void setMaxRows(int max) throws SQLException {
this.maxRows = max;
}
}

0 comments on commit 34966b0

Please # to comment.