Skip to content

Commit

Permalink
[CONJ-464] Using of "slowQueryThresholdNanos" option with value > Int…
Browse files Browse the repository at this point in the history
…eger.MAX_VALUE results in class cast exception
  • Loading branch information
rusher committed Apr 28, 2017
1 parent c25c3cf commit a5b8187
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ public enum DefaultOptions {

DefaultOptions(String name, Long defaultValue, Long minValue, Long maxValue, String implementationVersion) {
this.name = name;
this.objType = Integer.class;
this.objType = Long.class;
this.defaultValue = defaultValue;
this.minValue = minValue;
this.maxValue = maxValue;
Expand Down
12 changes: 12 additions & 0 deletions src/test/java/org/mariadb/jdbc/JdbcParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,4 +320,16 @@ public void checkDisable() throws SQLException {
}


/**
* CONJ-464 : Using of "slowQueryThresholdNanos" option results in class cast exception.
* @throws SQLException if any exception occur
*/
@Test
public void checkBigSlowQueryThresholdNanosValue() throws SQLException {
String url = "jdbc:mariadb://1.2.3.4/testj?user=john&slowQueryThresholdNanos=" + Long.MAX_VALUE;
UrlParser jdbc = UrlParser.parse(url);
assertEquals(Long.MAX_VALUE, jdbc.getOptions().slowQueryThresholdNanos.longValue());

}

}

0 comments on commit a5b8187

Please sign in to comment.