Skip to content

Commit

Permalink
[misc] code style correction
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Dec 13, 2023
1 parent 2b2d7cd commit f8b835c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: java
jdk: openjdk17
version: ~> 1.0

before_install:
- |-
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/mariadb/jdbc/DatabaseMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.mariadb.jdbc.client.DataType;
import org.mariadb.jdbc.client.ServerVersion;
import org.mariadb.jdbc.client.result.CompleteResult;
import org.mariadb.jdbc.client.result.Result;
import org.mariadb.jdbc.util.VersionFactory;
import org.mariadb.jdbc.util.constants.CatalogTerm;
import org.mariadb.jdbc.util.constants.ColumnFlags;
Expand Down
12 changes: 1 addition & 11 deletions src/main/java/org/mariadb/jdbc/client/result/Result.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,38 +59,28 @@ public abstract class Result implements ResultSet, Completion {

protected final boolean traceEnable;
private final int maxIndex;
private boolean closeOnCompletion;
private final MutableInt fieldLength = new MutableInt(0);
private final boolean forceAlias;
private final byte[] nullBitmap;

/** data size */
protected int dataSize = 0;

/** rows */
protected byte[][] data;

/** mutable field index */
protected MutableInt fieldIndex = new MutableInt();

/** is fully loaded */
protected boolean loaded;

/** is an output parameter result-set */
protected boolean outputParameter;

/** current row pointer */
protected int rowPointer = -1;

/** is result-set closed */
protected boolean closed;

/** statement that initiate this result */
protected Statement statement;

/** row number limit */
protected long maxRows;

private boolean closeOnCompletion;
private Map<String, Integer> mapper = null;
private int fetchSize;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1713,9 +1713,9 @@ public void getPrimaryKeysBasic() throws SQLException {
public void getImportedKeysBasic() throws SQLException {
Assumptions.assumeFalse(isXpand());
assertThrowsContains(
SQLException.class,
() -> sharedConn.getMetaData().getImportedKeys(null, null, ""),
"'table' parameter in getImportedKeys cannot be null");
SQLException.class,
() -> sharedConn.getMetaData().getImportedKeys(null, null, ""),
"'table' parameter in getImportedKeys cannot be null");
testResultSetColumns(
sharedConn.getMetaData().getImportedKeys(null, null, "cross1"),
"PKTABLE_CAT String,PKTABLE_SCHEM String,PKTABLE_NAME String, PKCOLUMN_NAME"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,7 @@ public void closeOnCompletionClose() throws Exception {
closeOnCompletionClose(sharedConn);
closeOnCompletionClose(sharedConnBinary);
}

@Test
public void closeOnCompletionStreamingClose() throws Exception {
try (Connection conn = createCon("&allowMultiQueries")) {
Expand All @@ -1308,7 +1309,8 @@ public void closeOnCompletionStreamingClose() throws Exception {
assertThrows(SQLException.class, () -> pstmt.execute());
}

try (PreparedStatement pstmt = conn.prepareStatement("SELECT * from sequence_1_to_10;SELECT * from sequence_1_to_10")) {
try (PreparedStatement pstmt =
conn.prepareStatement("SELECT * from sequence_1_to_10;SELECT * from sequence_1_to_10")) {
pstmt.execute();
pstmt.closeOnCompletion();
assertTrue(pstmt.getMoreResults(org.mariadb.jdbc.Statement.CLOSE_CURRENT_RESULT));
Expand Down

0 comments on commit f8b835c

Please sign in to comment.