@@ -102,8 +102,6 @@ public class UrlParser implements Cloneable {
102102 private static final String DISABLE_MYSQL_URL = "disableMariaDbDriver" ;
103103 private static final Pattern URL_PARAMETER =
104104 Pattern .compile ("(\\ /([^\\ ?]*))?(\\ ?(.+))*" , Pattern .DOTALL );
105- private static final Pattern AWS_PATTERN =
106- Pattern .compile ("(.+)\\ .([a-z0-9\\ -]+\\ .rds\\ .amazonaws\\ .com)" , Pattern .CASE_INSENSITIVE );
107105
108106 private String database ;
109107 private Options options = null ;
@@ -213,8 +211,7 @@ private static void parseInternal(UrlParser urlParser, String url, Properties pr
213211 if ((dbIndex < paramIndex && dbIndex < 0 ) || (dbIndex > paramIndex && paramIndex > -1 )) {
214212 hostAddressesString = urlSecondPart .substring (0 , paramIndex );
215213 additionalParameters = urlSecondPart .substring (paramIndex );
216- } else if ((dbIndex < paramIndex && dbIndex > -1 )
217- || (dbIndex > paramIndex && paramIndex < 0 )) {
214+ } else if (dbIndex < paramIndex || dbIndex > paramIndex ) {
218215 hostAddressesString = urlSecondPart .substring (0 , dbIndex );
219216 additionalParameters = urlSecondPart .substring (dbIndex );
220217 } else {
@@ -255,9 +252,8 @@ private static void defineUrlParserParameters(
255252 throws SQLException {
256253
257254 if (additionalParameters != null ) {
258- //noinspection Annotator
259255 Matcher matcher = URL_PARAMETER .matcher (additionalParameters );
260- matcher .find ();
256+ boolean unused = matcher .find ();
261257 urlParser .database = matcher .group (2 );
262258 urlParser .options =
263259 DefaultOptions .parse (urlParser .haMode , matcher .group (4 ), properties , urlParser .options );
@@ -351,7 +347,7 @@ private void setInitialUrl() {
351347 }
352348
353349 /**
354- * Permit to set parameters not forced. if options useBatchMultiSend and usePipelineAuth are not
350+ * Permit setting parameters not forced. if options useBatchMultiSend and usePipelineAuth are not
355351 * explicitly set in connection string, value will default to true or false according if aurora
356352 * detection.
357353 *
@@ -361,7 +357,7 @@ public UrlParser auroraPipelineQuirks() {
361357
362358 // Aurora has issue with pipelining, depending on network speed.
363359 // Driver must rely on information provided by user : hostname if dns, and HA mode.</p>
364- boolean disablePipeline = isAurora () ;
360+ boolean disablePipeline = haMode == HaMode . AURORA ;
365361
366362 if (options .useBatchMultiSend == null ) {
367363 options .useBatchMultiSend = disablePipeline ? Boolean .FALSE : Boolean .TRUE ;
@@ -373,30 +369,6 @@ public UrlParser auroraPipelineQuirks() {
373369 return this ;
374370 }
375371
376- /**
377- * Detection of Aurora.
378- *
379- * <p>Aurora rely on MySQL, then cannot be identified by protocol. But Aurora doesn't permit some
380- * behaviour normally working with MySQL : pipelining. So Driver must identified if server is
381- * Aurora to disable pipeline options that are enable by default.
382- *
383- * @return true if aurora.
384- */
385- public boolean isAurora () {
386- if (haMode == HaMode .AURORA ) {
387- return true ;
388- }
389- if (addresses != null ) {
390- for (HostAddress hostAddress : addresses ) {
391- Matcher matcher = AWS_PATTERN .matcher (hostAddress .host );
392- if (matcher .find ()) {
393- return true ;
394- }
395- }
396- }
397- return false ;
398- }
399-
400372 /**
401373 * Parse url connection string.
402374 *
0 commit comments